Skip to content

Use source generators for semantic conventions #2869

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thompson-tomo
Copy link
Contributor

@thompson-tomo thompson-tomo commented Jun 30, 2025

Fixes #2856
Design discussion issue #

Changes

This PR introduces a new client package OpenTelemetry.SemanticConventions.Abstractions which is designed to ease the implementation of otel by reducing the need for implementors to be defining their own keys.

The approach here overcomes the limitation of the current approach by Scoping the generated code to the users namespace and the accessibility modifier being internal. At the same time it is only generating the necessary namespace.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@thompson-tomo thompson-tomo requested a review from a team as a code owner June 30, 2025 04:28
@thompson-tomo thompson-tomo marked this pull request as draft June 30, 2025 04:28
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters documentation Improvements or additions to documentation comp:semanticconventions Things related to OpenTelemetry.SemanticConventions labels Jun 30, 2025
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.76%. Comparing base (71655ce) to head (2c96664).
Report is 916 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2869      +/-   ##
==========================================
- Coverage   73.91%   69.76%   -4.15%     
==========================================
  Files         267      394     +127     
  Lines        9615    15980    +6365     
==========================================
+ Hits         7107    11149    +4042     
- Misses       2508     4831    +2323     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 86.25% <ø> (?)
unittests-Exporter.Geneva 53.45% <ø> (?)
unittests-Exporter.InfluxDB 95.14% <ø> (?)
unittests-Exporter.Instana 74.86% <ø> (?)
unittests-Exporter.OneCollector 94.61% <ø> (?)
unittests-Exporter.Stackdriver 79.26% <ø> (?)
unittests-Extensions 90.65% <ø> (?)
unittests-Extensions.Enrichment 100.00% <ø> (?)
unittests-Instrumentation.AWS 83.69% <ø> (?)
unittests-Instrumentation.AspNet 76.79% <ø> (?)
unittests-Instrumentation.AspNetCore 70.32% <ø> (?)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (?)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (?)
unittests-Instrumentation.EntityFrameworkCore 62.05% <ø> (?)
unittests-Instrumentation.EventCounters 76.36% <ø> (?)
unittests-Instrumentation.GrpcCore 91.42% <ø> (?)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (?)
unittests-Instrumentation.Hangfire 93.58% <ø> (?)
unittests-Instrumentation.Http 74.09% <ø> (?)
unittests-Instrumentation.Owin 88.62% <ø> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.Quartz 78.76% <ø> (?)
unittests-Instrumentation.Runtime 100.00% <ø> (?)
unittests-Instrumentation.ServiceFabricRemoting 34.54% <ø> (?)
unittests-Instrumentation.SqlClient 88.26% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 70.92% <ø> (?)
unittests-Instrumentation.Wcf 78.75% <ø> (?)
unittests-PersistentStorage 65.88% <ø> (?)
unittests-Resources.AWS 75.00% <ø> (?)
unittests-Resources.Azure 84.56% <ø> (?)
unittests-Resources.Container 67.34% <ø> (?)
unittests-Resources.Gcp 71.42% <ø> (?)
unittests-Resources.Host 73.91% <ø> (?)
unittests-Resources.OperatingSystem 76.98% <ø> (?)
unittests-Resources.Process 100.00% <ø> (?)
unittests-Resources.ProcessRuntime 78.26% <ø> (?)
unittests-Sampler.AWS 88.79% <ø> (?)

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

see 416 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thompson-tomo thompson-tomo force-pushed the feature/#2856_SourceGenerator branch from 36ccb43 to fa3632f Compare June 30, 2025 05:07
@thompson-tomo thompson-tomo force-pushed the feature/#2856_SourceGenerator branch from fa3632f to b481fee Compare June 30, 2025 05:09
@thompson-tomo thompson-tomo changed the title Feature/#2856 source generator Use source generators for semantic conventions Jun 30, 2025
@thompson-tomo thompson-tomo force-pushed the feature/#2856_SourceGenerator branch 3 times, most recently from 2705087 to 5bc6f77 Compare July 1, 2025 05:04
@thompson-tomo thompson-tomo force-pushed the feature/#2856_SourceGenerator branch 4 times, most recently from b5a6bb4 to 3ed9eb5 Compare July 6, 2025 05:09
Signed-off-by: James Thompson <thompson.tomo@outlook.com>
@thompson-tomo thompson-tomo force-pushed the feature/#2856_SourceGenerator branch from 3ed9eb5 to 2c96664 Compare July 8, 2025 01:25
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 15, 2025
@thompson-tomo
Copy link
Contributor Author

Keep open

@github-actions github-actions bot removed the Stale label Jul 16, 2025
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 documentation Improvements or additions to documentation infra Infra work - CI/CD, code coverage, linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] source generator using semantic conventions
1 participant