Skip to content

[AspNetCore] Update gRPC Semantic Conventions#4370

Draft
martincostello wants to merge 5 commits intoopen-telemetry:mainfrom
martincostello:update-aspnetcore-grpc-semantic-conventions
Draft

[AspNetCore] Update gRPC Semantic Conventions#4370
martincostello wants to merge 5 commits intoopen-telemetry:mainfrom
martincostello:update-aspnetcore-grpc-semantic-conventions

Conversation

@martincostello
Copy link
Copy Markdown
Member

Builds on top of #4090.

Changes

Update the Semantic Conventions version for gRPC Server spans to v1.41.0.

One thing I'm unsure of is whether or not we need to implement OTEL_SEMCONV_STABILITY_OPT_IN or not given that the support is already experimental.

Once that question is answered I'll add/update the tests as appropriate.

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 optimizations, recommended by Copilot, to reduce allocations in `HttpInListener.OnStopActivity()`:

- Cache activity display names.
- Uses slices instead of `Regex`.
- Avoid enum reflection.
- Null check delegates to avoid try-catch blocks.
- Use SetCustomProperty to check for who made the instrumentation.
- Avoid running gRPC-related code for HTTP 1.1.
- Avoid additional check for the normalized HTTP method.
- Use pattern matching on nullable.
Update the Semantic Conventions version for RPC Server spans to v1.41.0.
@github-actions github-actions Bot added the comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore label May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 84.25197% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.73%. Comparing base (886d9a7) to head (c31fe87).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...tation.AspNetCore/Implementation/HttpInListener.cs 80.00% 20 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4370      +/-   ##
==========================================
+ Coverage   75.62%   75.73%   +0.11%     
==========================================
  Files         455      456       +1     
  Lines       18238    18313      +75     
==========================================
+ Hits        13793    13870      +77     
+ Misses       4445     4443       -2     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 89.92% <100.00%> (+0.40%) ⬆️
unittests-Exporter.Geneva 54.82% <ø> (-0.16%) ⬇️
unittests-Exporter.InfluxDB 95.81% <ø> (ø)
unittests-Exporter.OneCollector 94.63% <ø> (ø)
unittests-Extensions 90.78% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 86.27% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 85.22% <ø> (ø)
unittests-Instrumentation.AspNet 78.04% <ø> (ø)
unittests-Instrumentation.AspNetCore 78.10% <80.95%> (+5.98%) ⬆️
unittests-Instrumentation.Cassandra 92.85% <ø> (ø)
unittests-Instrumentation.ConfluentKafka 78.52% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.60% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 81.39% <ø> (ø)
unittests-Instrumentation.EventCounters 77.67% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.34% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.09% <ø> (ø)
unittests-Instrumentation.Hangfire 88.91% <ø> (ø)
unittests-Instrumentation.Http 75.24% <ø> (+0.62%) ⬆️
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Remoting 66.06% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 40.83% <ø> (ø)
unittests-Instrumentation.SqlClient 84.36% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 93.78% <ø> (ø)
unittests-Instrumentation.Wcf 81.94% <ø> (ø)
unittests-OpAmp.Client 83.74% <ø> (-0.52%) ⬇️
unittests-PersistentStorage 69.29% <ø> (ø)
unittests-Resources.AWS 74.49% <ø> (ø)
unittests-Resources.Azure 88.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 72.26% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 90.47% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 96.39% <ø> (ø)

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

Files with missing lines Coverage Δ
...spNetCore/AspNetCoreTraceInstrumentationOptions.cs 96.42% <100.00%> (+0.77%) ⬆️
src/Shared/GrpcTagHelper.cs 98.07% <100.00%> (+0.03%) ⬆️
src/Shared/RequestDataHelper.cs 83.33% <100.00%> (+8.33%) ⬆️
...tation.AspNetCore/Implementation/HttpInListener.cs 85.36% <80.00%> (+10.69%) ⬆️

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

Also remove `grpc.status` and `grpc.target`.
@martincostello martincostello added the keep-open Prevents issues and pull requests being closed as stale label May 8, 2026
Move RpcSemanticConventionHelper to shared code for re-use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore keep-open Prevents issues and pull requests being closed as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant