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, Instrumentation.AspNetCore] Always set server.port attribute for spans #5419

Merged
merged 7 commits into from
Mar 12, 2024

Conversation

Kielek
Copy link
Contributor

@Kielek Kielek commented Mar 6, 2024

Fixes N/A
Design discussion issue N/A

I do not see any conditions related to the default port numbers in https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md

Changes

[Instrumentation.Http, Instrumentation.AspNetCore] Always set server.port attribute

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)

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.86%. Comparing base (6250307) to head (3da6a7f).
Report is 128 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5419      +/-   ##
==========================================
+ Coverage   83.38%   84.86%   +1.48%     
==========================================
  Files         297      284      -13     
  Lines       12531    12204     -327     
==========================================
- Hits        10449    10357      -92     
+ Misses       2082     1847     -235     
Flag Coverage Δ
unittests ?
unittests-Instrumentation-Experimental 24.29% <100.00%> (?)
unittests-Instrumentation-Stable 24.34% <100.00%> (?)
unittests-Solution-Experimental 84.79% <100.00%> (?)
unittests-Solution-Stable 84.82% <100.00%> (?)

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

Files Coverage Δ
...tation.AspNetCore/Implementation/HttpInListener.cs 90.06% <100.00%> (+0.48%) ⬆️
...tp/Implementation/HttpHandlerDiagnosticListener.cs 70.63% <100.00%> (-0.24%) ⬇️
...plementation/HttpWebRequestActivitySource.netfx.cs 80.73% <100.00%> (-0.04%) ⬇️

... and 61 files with indirect coverage changes

@Kielek Kielek marked this pull request as ready for review March 6, 2024 16:49
@Kielek Kielek requested a review from a team as a code owner March 6, 2024 16:49
@Kielek
Copy link
Contributor Author

Kielek commented Mar 6, 2024

@vishweshbankwar, could you please review?

@vishweshbankwar
Copy link
Member

@vishweshbankwar, could you please review?

@Kielek - Thanks, looks like this spec change was a miss on our side.

@vishweshbankwar
Copy link
Member

Copy link
Member

@vishweshbankwar vishweshbankwar left a comment

Choose a reason for hiding this comment

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

LGTM - But we should wait to hear from .NET about #5419 (comment) before we make a change on HttpClient metrics side.

@Kielek Kielek changed the title [Instrumentation.Http, Instrumentation.AspNetCore] Always set server.… [Instrumentation.Http, Instrumentation.AspNetCore] Always set server.port attribute for spans Mar 7, 2024
@Kielek
Copy link
Contributor Author

Kielek commented Mar 7, 2024

@vishweshbankwar, I have double checked the metrics part and the current implementation seems to be in sync with .NET specific semantic conventions. The semantic convention is different for part of the attributes, if compare it with https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/http/http-metrics.md

Before I will create the runtime issue I would like to check with @lmolkova what is the plan for this. Is there any chance, that the common metrics will be handled in the same way for .NET9+?

For this PR - if we agree to keep current metrics behavior, I can drop changes related to metrics. I do not see any conflicts for spans.

@lmolkova
Copy link

lmolkova commented Mar 7, 2024

I think this is tracked on the .NET side via dotnet/runtime#94829 and is considered for the .NET 9. I don't know however if plans have been solidified. Maybe @antonfirsov can comment?

@vishweshbankwar
Copy link
Member

vishweshbankwar commented Mar 7, 2024

I think this is tracked on the .NET side via dotnet/runtime#94829 and is considered for the .NET 9. I don't know however if plans have been solidified. Maybe @antonfirsov can comment?

I think we should not make the change then in instrumentation library. Users moving from .NET6.0/.NET7.0 to .NET8.0 will see a breaking change and they will see another breaking change when moving to .NET9.0 (if it gets changed there).

@antonfirsov - Any chance the change can be backported to 8.0?

@antonfirsov
Copy link

Any chance the change can be backported to 8.0?

No, we consider those breaking.

@Kielek
Copy link
Contributor Author

Kielek commented Mar 8, 2024

@vishweshbankwar, reverted changes related to metrics in 446a701

We should consider fixing behavior for .NET Framework metrics. I think that spans related changes should be merged.

@cijothomas
Copy link
Member

Fixing adding the port attribute to Metrics - is this considered a breaking change?

@Kielek
Copy link
Contributor Author

Kielek commented Mar 11, 2024

Fixing adding the port attribute to Metrics - is this considered a breaking change?

In scope of the OpenTelemetry packages, I would consider it as a bugfixing. I am not sure what is the perspective on this by .NET team.

If possible, please merge this one, then we can address .NET Framework scenario in separate PR (probably not changing anything for .NET6 and 7 as both will be EoS this year.

@antonfirsov
Copy link

Fixing adding the port attribute to Metrics - is this considered a breaking change?

Addition, removal or renaming of attributes may break existing queries therefore it's considered to be a behavioral breaking change. We kept merging last minute changes to maximize compatibility and minimize the changes needed between .NET 8 -> .NET 9, but unfortunately open-telemetry/semantic-conventions#459 landed after the .NET 8 GA snap date.

For Metrics, we are more willing to take these kind of changes between major version than in general in .NET so dotnet/runtime#94829 will be most likely implemented for .NET 9.

@utpilla utpilla merged commit 4cccb09 into open-telemetry:main Mar 12, 2024
44 checks passed
@Kielek Kielek deleted the server.port-always branch March 12, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants