Skip to content

[DNM] Performance improvements#4096

Closed
martincostello wants to merge 34 commits intoopen-telemetry:mainfrom
martincostello:performance-improvements
Closed

[DNM] Performance improvements#4096
martincostello wants to merge 34 commits intoopen-telemetry:mainfrom
martincostello:performance-improvements

Conversation

@martincostello
Copy link
Copy Markdown
Member

Changes

Combines the changes from the following PRs so I can get a single set of NuGet packages from CI to test:

Not intended for review or to be merged.

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)

Avoid adding tags for ASP.NET Core activities where ASP.NET Core has native support to add them itself.
Add CHANGELOG entry.
Fix markdown lint warnings.
Fix CHANGELOG and comment.
Fix incorrect pattern matching on non-nullable `PathString`.
Add schema URL to the `ActivitySource`.

Contributes to open-telemetry#4064.
Remove redundant test code for .NET Framework.
- Make CHANGELOG more specific.
- Remove unused using statement.
Use `ActivitySourceFactory` to create the `Activity`.
Revert `sealed`.
Remove trailing space.
Still needs a line between entries.
Add optimizations, recommended by Copilot, to reduce allocations in `HttpInListener.OnStopActivity()`:

- Cache activity display names.
- Uses slices instead of `Regex`.
- Avoid enum reflection.
Add new tests to extend patch coverage.
Also check if `statusCode` is negative.
Have a single benchmark that uses the test host and remove various cruft.
Add a benchmark for a gRPC service.
Fix missing configuration to enable it.
Null check delegates to avoid try-catch blocks.
Add simpler benchmarks for HTTP and gRPC using the ASP.NET Core test server.
- 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.
Ensure the metrics pipeline is active.
Ensure the metrics pipeline is active.
Use existing constant instead of literal.
Use pattern matching on nullable.
Update the README and fix the formatting.
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore perf Performance related labels Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 90.83333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.86%. Comparing base (df6d38d) to head (8eb13b0).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...tation.AspNetCore/Implementation/HttpInListener.cs 89.36% 10 Missing ⚠️
...eInstrumentationTracerProviderBuilderExtensions.cs 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4096      +/-   ##
==========================================
- Coverage   72.93%   72.86%   -0.07%     
==========================================
  Files         452      460       +8     
  Lines       17844    17927      +83     
==========================================
+ Hits        13014    13063      +49     
- Misses       4830     4864      +34     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 90.19% <100.00%> (+0.44%) ⬆️
unittests-Exporter.Geneva 54.82% <ø> (-0.33%) ⬇️
unittests-Exporter.InfluxDB 95.81% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
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.54% <ø> (ø)
unittests-Instrumentation.AspNet 76.61% <ø> (ø)
unittests-Instrumentation.AspNetCore 77.80% <88.77%> (+7.36%) ⬆️
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.21% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 71.98% <ø> (ø)
unittests-Instrumentation.Wcf 79.54% <ø> (-0.14%) ⬇️
unittests-OpAmp.Client 78.16% <ø> (-0.13%) ⬇️
unittests-PersistentStorage 69.83% <ø> (-0.33%) ⬇️
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 Δ
...umentation.AspNetCore/AspNetCoreInstrumentation.cs 100.00% <100.00%> (ø)
src/Shared/GrpcTagHelper.cs 98.03% <100.00%> (+0.03%) ⬆️
src/Shared/RequestDataHelper.cs 83.33% <100.00%> (+8.33%) ⬆️
...eInstrumentationTracerProviderBuilderExtensions.cs 95.55% <50.00%> (-0.19%) ⬇️
...tation.AspNetCore/Implementation/HttpInListener.cs 88.26% <89.36%> (+14.98%) ⬆️

... and 12 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
Copy link
Copy Markdown
Member Author

@martincostello martincostello deleted the performance-improvements branch April 12, 2026 17:48
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 dependencies Pull requests that update a dependency file infra Infra work - CI/CD, code coverage, linters perf Performance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant