Skip to content

[Instrumentation.AWS{Lambda}] Add schema URL#4063

Open
martincostello wants to merge 8 commits intoopen-telemetry:mainfrom
martincostello:add-aws-schema-url-version
Open

[Instrumentation.AWS{Lambda}] Add schema URL#4063
martincostello wants to merge 8 commits intoopen-telemetry:mainfrom
martincostello:add-aws-schema-url-version

Conversation

@martincostello
Copy link
Copy Markdown
Member

@martincostello martincostello commented Apr 5, 2026

Changes

  • Add schema URL and version to AWS metrics and traces.
  • Add schema URL and version to AWS Lambda traces.
  • Add AWS attributes to meters as tags.
  • Add test to validate new version additions.

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 and version to AWS traces.
- Add test to validate new version additions.
Add missing exception message.
@github-actions github-actions bot added the comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS label Apr 5, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.73%. Comparing base (d1717a8) to head (55915ea).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4063      +/-   ##
==========================================
- Coverage   72.75%   72.73%   -0.02%     
==========================================
  Files         458      458              
  Lines       17876    17905      +29     
==========================================
+ Hits        13006    13024      +18     
- Misses       4870     4881      +11     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 89.76% <ø> (ø)
unittests-Exporter.Geneva 54.82% <ø> (ø)
unittests-Exporter.InfluxDB 95.81% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (-0.19%) ⬇️
unittests-Exporter.OneCollector 94.61% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 86.27% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 83.92% <100.00%> (+0.38%) ⬆️
unittests-Instrumentation.AspNet 77.37% <ø> (ø)
unittests-Instrumentation.AspNetCore 70.44% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (ø)
unittests-Instrumentation.ConfluentKafka 39.83% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.60% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 77.27% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 73.78% <ø> (ø)
unittests-Instrumentation.Hangfire 86.05% <ø> (ø)
unittests-Instrumentation.Http 74.62% <ø> (ø)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.68% <ø> (ø)
unittests-Instrumentation.SqlClient 85.74% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 71.98% <ø> (ø)
unittests-Instrumentation.Wcf 79.68% <ø> (ø)
unittests-OpAmp.Client 78.99% <ø> (-0.51%) ⬇️
unittests-PersistentStorage 68.19% <ø> (-1.64%) ⬇️
unittests-Resources.AWS 74.34% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 72.26% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 94.28% <ø> (ø)

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

Files with missing lines Coverage Δ
...ion.AWS/Implementation/Metrics/AWSMeterProvider.cs 100.00% <100.00%> (ø)
...on.AWS/Implementation/Tracing/AWSTracerProvider.cs 100.00% <100.00%> (ø)
...trumentation.AWS/MeterProviderBuilderExtensions.cs 100.00% <100.00%> (ø)
...rumentation.AWS/TracerProviderBuilderExtensions.cs 87.50% <100.00%> (ø)
...etry.Instrumentation.AWSLambda/AWSLambdaWrapper.cs 95.52% <100.00%> (+0.60%) ⬆️

... and 5 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.

@martincostello martincostello marked this pull request as ready for review April 5, 2026 16:33
@martincostello martincostello requested a review from a team as a code owner April 5, 2026 16:33
Copilot AI review requested due to automatic review settings April 5, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds OpenTelemetry schema URL and instrumentation scope version metadata to AWS client tracing, aligned to the configured AWS semantic convention version, and extends tests to guard against future enum/version additions causing runtime failures.

Changes:

  • Pass SemanticConventionVersion into the AWS tracer provider registration.
  • Create ActivitySource instances with TelemetrySchemaUrl and package Version.
  • Add a theory test that exercises all SemanticConventionVersion enum values; update AWS instrumentation changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/OpenTelemetry.Instrumentation.AWS.Tests/AWSClientInstrumentationOptionsTests.cs Adds a theory test enumerating all semantic convention versions to ensure no exceptions when versions are added.
src/OpenTelemetry.Instrumentation.AWS/TracerProviderBuilderExtensions.cs Registers AWSTracerProvider with the configured semantic convention version.
src/OpenTelemetry.Instrumentation.AWS/Implementation/Tracing/AWSTracerProvider.cs Sets ActivitySource version and schema URL (based on semantic convention version) when creating tracers.
src/OpenTelemetry.Instrumentation.AWS/CHANGELOG.md Documents the addition of instrumentation scope version and schema URL to traces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Make dictionary non-static.
- Use `InvalidEnumArgumentException` for consistency.
- Assert spans have version and schema URL.
- Also add the version and schema URL to metrics.
- Refactor to support using for AWS Lambda too.
Add schema URL and version to traces.
@github-actions github-actions bot requested review from Oberon00 and rypdal April 5, 2026 17:57
@github-actions github-actions bot added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Apr 5, 2026
@martincostello martincostello changed the title [Instrumentation.AWS] Add schema URL [Instrumentation.AWS{Lambda}] Add schema URL Apr 5, 2026
Pass attributes through to meters to use as tags.

Resolves open-telemetry#4065.
Use `TryAdd()` overload that avoids allocating closures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Instrumentation.AWS] Add tags to meters

7 participants