Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Instrumentation.Http] Skip tagging traces when running on .NET 9+ #2314

Merged

Conversation

TimothyMothra
Copy link
Contributor

Fixes #2029

Net9 added support for Http semantic convention attributes here: dotnet/runtime#104251

Changes

  • update Instrumentation.Http to not override tags set by NET9.
  • update unit tests

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)

@TimothyMothra TimothyMothra requested a review from a team as a code owner November 12, 2024 01:18
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters comp:instrumentation.http Things related to OpenTelemetry.Instrumentation.Http labels Nov 12, 2024
global.json Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.96%. Comparing base (71655ce) to head (d65b138).
Report is 616 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2314      +/-   ##
==========================================
- Coverage   73.91%   67.96%   -5.95%     
==========================================
  Files         267      363      +96     
  Lines        9615    13512    +3897     
==========================================
+ Hits         7107     9184    +2077     
- Misses       2508     4328    +1820     
Flag Coverage Δ
unittests-Instrumentation.Http 74.33% <100.00%> (?)

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

Files with missing lines Coverage Δ
...tp/Implementation/HttpHandlerDiagnosticListener.cs 72.95% <100.00%> (ø)

... and 386 files with indirect coverage changes

@github-actions github-actions bot removed the infra Infra work - CI/CD, code coverage, linters label Nov 13, 2024
@TimothyMothra TimothyMothra marked this pull request as ready for review November 13, 2024 18:27
@github-actions github-actions bot added the infra Infra work - CI/CD, code coverage, linters label Nov 13, 2024
Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks pretty good, but looks like there's some build issues.

@TimothyMothra
Copy link
Contributor Author

PR looks pretty good

Thanks!

but looks like there's some build issues.

Sigh. Visual Studio keeps saving files with Windows line endings (CR LF), but this repo expects Unix line endings (LF).
I haven't found a way to force Visual Studio to stop changing things. 🤦‍♂️

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CodeBlanch CodeBlanch changed the title [Instrumentation.Http] fall back in case of NET9. update unit tests [Instrumentation.Http] Skip tagging traces when running on .NET 9+ Nov 27, 2024
@CodeBlanch CodeBlanch merged commit f6c4195 into open-telemetry:main Nov 27, 2024
60 checks passed
@TimothyMothra TimothyMothra deleted the 2029_httpinstrumentation_net9 branch November 27, 2024 20:31
@@ -199,16 +203,19 @@ public void OnStopActivity(Activity activity, object? payload)

if (TryFetchResponse(payload, out var response))
{
if (currentStatusCode == ActivityStatusCode.Unset)
if (!IsNet9OrGreater)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activity status, error.type are still set above in .NET9. is that intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.http Things related to OpenTelemetry.Instrumentation.Http
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[http] Update Trace Instrumentation to align with changes in .NET 9.0
7 participants