Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repo] Move OpenTelemetry.SemanticConventions project from main repo #1672

Merged
merged 30 commits into from
Apr 24, 2024

Conversation

joegoldman2
Copy link
Contributor

@joegoldman2 joegoldman2 commented Apr 21, 2024

Fixes #1657.

Changes

Reintroduce OpenTelemetry.SemanticConventions project that has been removed with open-telemetry/opentelemetry-dotnet#5539.
PR created as draft just to see if I'm going in the right direction and because the generation script is throwing an exception at the moment.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

Copy link

codecov bot commented Apr 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.55%. Comparing base (71655ce) to head (22f9809).
Report is 216 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1672      +/-   ##
==========================================
- Coverage   73.91%   72.55%   -1.37%     
==========================================
  Files         267      240      -27     
  Lines        9615     9261     -354     
==========================================
- Hits         7107     6719     -388     
- Misses       2508     2542      +34     
Flag Coverage Δ
unittests-Solution 79.97% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 227 files with indirect coverage changes

@joegoldman2 joegoldman2 marked this pull request as ready for review April 23, 2024 17:04
@joegoldman2 joegoldman2 requested a review from a team April 23, 2024 17:04
@joegoldman2 joegoldman2 marked this pull request as draft April 23, 2024 17:05
@joegoldman2 joegoldman2 marked this pull request as ready for review April 23, 2024 17:53
@CodeBlanch
Copy link
Member

@joegoldman2

Would you mind adding a CHANGELOG.md file into the project? Let's seed it with something like...

# Changelog

## Unreleased

* Updated to `1.25.0` release of OpenTelemetry Semantic Conventions.
  ([#1672](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1672))

* Moved from `https://github.com/open-telemetry/opentelemetry-dotnet/` to
  `https://github.com/open-telemetry/opentelemetry-dotnet-contrib/`.

Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding CI/infrqastructure code similar to 9fbfdf2

Also it will be great to have component owner under .github repository for this project.

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having all attributes in one place would be problematic in the long term: different stability, huge file, hard to use

I suggest to reuse new approach we've implemented in Java and Python - group attributes by the root namespace following the discussion in open-telemetry/semantic-conventions#551

It's being documented here https://github.com/open-telemetry/semantic-conventions/blob/18325605937cb0a15fde89faabf48c857eab0ca5/supplementary-guidelines/semantic_conventions_code_generation.md.

Here's how Java does it https://github.com/open-telemetry/semantic-conventions-java.

This is not a requirement, and from semconv perspective we want to give language SIGs a freedom to decide how they want to do it.

Happy to help with Jinja if needed.

/// Constants for semantic attribute names outlined by the OpenTelemetry specifications.
/// </summary>
/// <remarks>
/// Schema and specification version: {{schemaUrl}}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once .NET allows to set schema URL, having a single one would be problematic - different instrumentations can produce different schema versions.

public static class SemanticConventionsAttributes
{
{% for attribute in attributes if attribute.is_local and not attribute.ref %}
{% if not loop.first %}{{"\n"}}{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want different template attributes (like http.request.header.<key>) to appear differently than regular ones

@CodeBlanch
Copy link
Member

CodeBlanch commented Apr 24, 2024

@Kielek I pushed changes here to tweak Component.BuildTest.yml so that it skips code coverage upload if there isn't any data available.

Also there was a typo in codecov.yml which is actually breaking all code coverage upload currently 😬 Opened: #1688

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

/// <summary>
/// {{format_xml_doc(member.brief | render_markdown(code="<c>{0}</c>", paragraph="{0}"))}}
/// </summary>
public const {{ type }} {{ member.member_id | to_camelcase(True) }} = {{ print_value(type, member.value) }};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it should be possible to get rid of print_value macro and use print_member_value filter provided by the otel/semconvgen

Suggested change
public const {{ type }} {{ member.member_id | to_camelcase(True) }} = {{ print_value(type, member.value) }};
public const {{ type }} {{ member.member_id | to_camelcase(True) }} = {{ print_member_value(member) }};

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Kielek Kielek merged commit 4e68225 into open-telemetry:main Apr 24, 2024
126 of 127 checks passed
@joegoldman2 joegoldman2 deleted the fix/1657 branch April 24, 2024 19:45
@joaopgrassi
Copy link
Member

joaopgrassi commented Jul 25, 2024

Hi all, and @joegoldman2

I'm following up on this as a semconv maintainer and helping migrate to the new tooling (Weaver). I notice that
the script says semconv 1.25, but I see attributes that are waaaaay old, like the ones in AndroidAttributes and I'm a bit confused.

Was this PR really updated with semconv version 1.25? Or was it just migrated as is from the main repo? (with spec version 1.13)

@ben-wilson-mews
Copy link

ben-wilson-mews commented Aug 15, 2024

@joegoldman2 I notice that this package isn't published to nuget, any timeline on it being published? The instructions I followed in the readme for the package.

For anyone wondering, the team are working on a polygot generator here. The aim being to republish this soon but with best practices of versioning them to provide a stable interface

@joaopgrassi
Copy link
Member

@ben-wilson-mews so you are already working on migrating this to weaver? I also started working on it #1944. How far long are you? I can maybe give what I have and you can continue if you want. Let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:semanticconventions Things related to OpenTelemetry.SemanticConventions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Reintroduce OpenTelemetry.SemanticConventions
6 participants