[AspNetCore] Fix server.address#4337
Merged
martincostello merged 4 commits intoopen-telemetry:mainfrom May 7, 2026
Merged
Conversation
- 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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4 tasks
Contributor
There was a problem hiding this comment.
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.addressto the host name only (without port) and ensureserver.portis 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.
Move and reword comment to make the purpose clearer.
4 tasks
Kielek
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
martincostello#2 (review)
Changes
server.addressvalue.Merge requirement checklist
AppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)