Skip to content

[AspNetCore] Fix server.address#4337

Merged
martincostello merged 4 commits intoopen-telemetry:mainfrom
martincostello:aspnetcore-fix-server.address
May 7, 2026
Merged

[AspNetCore] Fix server.address#4337
martincostello merged 4 commits intoopen-telemetry:mainfrom
martincostello:aspnetcore-fix-server.address

Conversation

@martincostello
Copy link
Copy Markdown
Member

martincostello#2 (review)

Changes

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)

- Fix mistake from open-telemetry#3993 and set the right `server.address` value.
- Apply some Copilot refactoring suggestions for feature switch handling.
Remove pre-processor directive.
@github-actions github-actions Bot added the comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore label May 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.08%. Comparing base (26a1dc7) to head (97ffdac).
⚠️ Report is 14 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4337      +/-   ##
==========================================
+ Coverage   76.04%   76.08%   +0.04%     
==========================================
  Files         466      465       -1     
  Lines       18695    18580     -115     
==========================================
- Hits        14217    14137      -80     
+ Misses       4478     4443      -35     
Flag Coverage Δ
unittests-Instrumentation.AspNet 78.04% <ø> (ø)
unittests-Instrumentation.AspNetCore 70.88% <100.00%> (+0.25%) ⬆️

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

Files with missing lines Coverage Δ
...tation.AspNetCore/Implementation/HttpInListener.cs 74.67% <100.00%> (+0.50%) ⬆️

... and 19 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 May 1, 2026 09:13
@martincostello martincostello requested a review from a team as a code owner May 1, 2026 09:13
Copilot AI review requested due to automatic review settings May 1, 2026 09:13
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

Fixes ASP.NET Core span server.address tagging to align with semantic conventions and adjusts feature-switch handling/tests accordingly.

Changes:

  • Set server.address to the host name only (without port) and ensure server.port is tagged separately.
  • Refactor feature-switch detection for ASP.NET Core native OpenTelemetry tags to use runtime version + switch configuration.
  • Update end-to-end test client base address and assertions to validate server.address/server.port.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/OpenTelemetry.Instrumentation.AspNetCore.Tests/EndToEndTests.cs Sets a deterministic client BaseAddress to assert server.address + server.port, and refactors feature switch setup/reset.
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs Fixes server.address to use host only, adjusts URL path tagging placement, and refactors native-tag detection logic for ASP.NET Core 10/11+.

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

Comment thread src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs Outdated
Move and reword comment to make the purpose clearer.
@martincostello martincostello added this pull request to the merge queue May 7, 2026
Merged via the queue into open-telemetry:main with commit 54ef378 May 7, 2026
70 checks passed
@martincostello martincostello deleted the aspnetcore-fix-server.address branch May 7, 2026 06:49
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants