Skip to content

[OpenTelemetry] Add schema URL to resources - #7726

Merged
martincostello merged 2 commits into
open-telemetry:mainfrom
martincostello:add-schema-url-to-resource-providers
Sep 9, 2026
Merged

martincostello merged 2 commits into
open-telemetry:mainfrom
martincostello:add-schema-url-to-resource-providers

Conversation

@martincostello

Copy link
Copy Markdown
Member

#7723 (comment)

Changes

Add schema URL to internally created resources, where relevant, that were missed when implementing #7472.

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)

Add schema URL to internally created resources, where relevant.
@github-actions github-actions Bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Sep 7, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 7, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-10 16:41 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Comment thread src/OpenTelemetry/CHANGELOG.md Outdated
Comment thread src/Shared/SchemaUrls.cs

@martincostello martincostello Sep 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copied from here.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.63%. Comparing base (823da27) to head (59ef7d6).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7726      +/-   ##
==========================================
- Coverage   91.64%   91.63%   -0.02%     
==========================================
  Files         325      326       +1     
  Lines       18168    18165       -3     
==========================================
- Hits        16650    16645       -5     
- Misses       1518     1520       +2     
Flag Coverage Δ
unittests-Project-Experimental 91.67% <100.00%> (-0.09%) ⬇️
unittests-Project-Stable 91.68% <100.00%> (-0.09%) ⬇️
unittests-Solution 91.75% <100.00%> (+0.03%) ⬆️
unittests-UnstableCoreLibraries-Experimental 51.07% <85.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
...lemetry/Resources/OtelServiceNameEnvVarDetector.cs 100.00% <100.00%> (ø)
src/OpenTelemetry/Resources/ResourceBuilder.cs 91.52% <100.00%> (-0.28%) ⬇️
...enTelemetry/Resources/ResourceBuilderExtensions.cs 100.00% <100.00%> (ø)
src/OpenTelemetry/SemanticConventionsVersion.cs 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

It unintentionally changes empty service-instance handling, and the tests do not verify the exact schema version.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds semantic-convention schema URLs to resources created internally by the OpenTelemetry SDK.

Changes:

  • Introduces centralized schema URL/version helpers.
  • Applies schema URLs to default, telemetry SDK, service, and environment resources.
  • Expands resource schema URL tests.
File summaries
File Description
OpenTelemetry.slnx Includes the shared schema helper.
OpenTelemetry.Extended.slnx Includes the shared schema helper.
src/Shared/SchemaUrls.cs Builds versioned schema URLs.
src/OpenTelemetry/SemanticConventionsVersion.cs Defines semantic conventions version 1.44.0.
src/OpenTelemetry/OpenTelemetry.csproj Links the shared helper.
src/OpenTelemetry/Resources/ResourceBuilder.cs Adds schema URL to default resources.
src/OpenTelemetry/Resources/ResourceBuilderExtensions.cs Adds schema URLs to SDK and service resources.
src/OpenTelemetry/Resources/OtelServiceNameEnvVarDetector.cs Adds schema URL to detected service resources.
src/OpenTelemetry/CHANGELOG.md Documents the behavioral change.
test/OpenTelemetry.Tests/Resources/ResourceTests.cs Tests default resource schema propagation.
test/OpenTelemetry.Tests/Resources/ResourceBuilderTests.cs Tests service resource schema URLs.
test/OpenTelemetry.Tests/Resources/OtelServiceNameEnvVarDetectorTests.cs Tests detector schema URLs.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/OpenTelemetry/Resources/ResourceBuilderExtensions.cs
Comment thread test/OpenTelemetry.Tests/Resources/ResourceTests.cs
@martincostello
martincostello marked this pull request as ready for review September 7, 2026 12:43
@martincostello
martincostello requested a review from a team as a code owner September 7, 2026 12:43
Comment thread src/OpenTelemetry/Resources/ResourceBuilderExtensions.cs
This was referenced Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants