Skip to content

Conversation

@Kielek
Copy link
Member

@Kielek Kielek commented Sep 26, 2025

Towards #2909

Changes

Goal - make following attributes available on startup:

  • http.request.method,
  • server.address,
  • server.port,
  • url.scheme,
  • url.path,
  • user_agent.original,
  • url.query.

Side effect: breaking changes in IIS module.
It is not responsible for creating activity. It delegates it to the instrumentation package.
2 reasons for this design:

  • keep separation of managing activity context in IIS module and OpenTelemetry deatails in instrumentation package
  • Instrumentation package allows to configure DisableRedactionUrlQuery through IConfiguration. I do not found good way to set it on the IIS module side.

While reviewing you can check commit-by-commit towards this implementation. The last one is the big commit only.

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)

@github-actions github-actions bot added comp:instrumentation.aspnet.telemetryhttpmodule Things related to OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient labels Sep 26, 2025
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 82.66667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.83%. Comparing base (9998490) to head (f1be3a0).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Shared/RequestDataHelper.cs 0.00% 8 Missing ⚠️
...umentation.AspNet/Implementation/HttpInListener.cs 89.28% 3 Missing ⚠️
...ation.AspNet.TelemetryHttpModule/ActivityHelper.cs 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3151      +/-   ##
==========================================
- Coverage   69.95%   69.83%   -0.13%     
==========================================
  Files         439      439              
  Lines       16895    16919      +24     
==========================================
- Hits        11819    11815       -4     
- Misses       5076     5104      +28     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 82.73% <0.00%> (-1.00%) ⬇️
unittests-Exporter.Geneva 53.33% <ø> (-0.12%) ⬇️
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.61% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 94.11% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 83.80% <ø> (ø)
unittests-Instrumentation.AspNet 75.00% <86.11%> (+0.06%) ⬆️
unittests-Instrumentation.AspNetCore 70.76% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (ø)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 76.36% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 84.61% <ø> (ø)
unittests-Instrumentation.Http 74.18% <ø> (ø)
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 87.29% <100.00%> (ø)
unittests-Instrumentation.StackExchangeRedis 71.80% <ø> (ø)
unittests-Instrumentation.Wcf 79.54% <100.00%> (+0.59%) ⬆️
unittests-OpAmp.Client 72.14% <ø> (+0.58%) ⬆️
unittests-PersistentStorage 65.88% <ø> (ø)
unittests-Resources.AWS 74.42% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 55.65% <ø> (-18.27%) ⬇️
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 88.25% <ø> (ø)

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

Files with missing lines Coverage Δ
....TelemetryHttpModule/TelemetryHttpModuleOptions.cs 90.00% <100.00%> (ø)
...ry.Instrumentation.AspNet/AspNetInstrumentation.cs 90.00% <100.00%> (+1.11%) ⬆️
...tInstrumentationTracerProviderBuilderExtensions.cs 100.00% <100.00%> (ø)
...qlClient/Implementation/SqlActivitySourceHelper.cs 91.30% <100.00%> (ø)
...on.Wcf/Implementation/AspNetParentSpanCorrector.cs 94.93% <100.00%> (+1.83%) ⬆️
...ation.AspNet.TelemetryHttpModule/ActivityHelper.cs 85.00% <50.00%> (-0.72%) ⬇️
...umentation.AspNet/Implementation/HttpInListener.cs 81.08% <89.28%> (+0.66%) ⬆️
src/Shared/RequestDataHelper.cs 72.22% <0.00%> (-9.03%) ⬇️

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

@Kielek
Copy link
Member Author

Kielek commented Sep 26, 2025

@open-telemetry/dotnet-contrib-approvers, AspNet part is ready to review. I need to fix AspNetParentSpanCorrector in WCF instrumentation.

@Kielek Kielek force-pushed the aspnet-startactivityattributes branch from 4c8d942 to 50a5dd8 Compare September 29, 2025 11:28
@github-actions github-actions bot added the comp:instrumentation.wcf Things related to OpenTelemetry.Instrumentation.Wcf label Sep 29, 2025
@Kielek Kielek marked this pull request as ready for review September 29, 2025 11:46
@Kielek Kielek requested a review from a team as a code owner September 29, 2025 11:46
@Kielek
Copy link
Member Author

Kielek commented Sep 29, 2025

@repl-chris, it will be great if you can review at least WCF changes, as you have developed initial version.

@Kielek Kielek merged commit 1b1f8b3 into open-telemetry:main Oct 1, 2025
231 of 234 checks passed
@Kielek Kielek deleted the aspnet-startactivityattributes branch October 1, 2025 16:00
@Kielek Kielek mentioned this pull request Oct 6, 2025
2 tasks
Kielek added a commit to ysolomchenko/opentelemetry-dotnet-instrumentation that referenced this pull request Oct 16, 2025
System.Web.Http nor System.Web.Mvc are not loaded on OWIN.
System.Web seems the most suitable alternative.

Previously Activity was created by the TelemetryModule. Now it was pushed to
the Instrumentation library. Handles changes from:
open-telemetry/opentelemetry-dotnet-contrib#3151
Kielek added a commit to ysolomchenko/opentelemetry-dotnet-instrumentation that referenced this pull request Oct 20, 2025
System.Web.Http nor System.Web.Mvc are not loaded on OWIN.
System.Web seems the most suitable alternative.

Previously Activity was created by the TelemetryModule. Now it was pushed to
the Instrumentation library. Handles changes from:
open-telemetry/opentelemetry-dotnet-contrib#3151
Kielek added a commit to open-telemetry/opentelemetry-dotnet-instrumentation that referenced this pull request Oct 22, 2025
…beta.1/beta.2 (#4524)

Bump OpenTelemetry.Instrumentation.AspNet/Wcf 1.13.0-beta.1/beta.2 (#4524)

* Fix AspNet on OWIN instrumentation

System.Web.Http nor System.Web.Mvc are not loaded on OWIN.
System.Web seems the most suitable alternative.

Previously Activity was created by the TelemetryModule. Now it was pushed to
the Instrumentation library. Handles changes from:
open-telemetry/opentelemetry-dotnet-contrib#3151

* Owin tests - ensure that client spanId is propagated to AspNet instrumentation


Co-authored-by: Piotr Kiełkowicz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.aspnet.telemetryhttpmodule Things related to OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient comp:instrumentation.wcf Things related to OpenTelemetry.Instrumentation.Wcf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants