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

Add support for .NET8.0 HttpClient metrics #4931

Merged

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Oct 7, 2023

Towards open-telemetry/opentelemetry-dotnet-contrib#1753

Details: open-telemetry/opentelemetry-dotnet-contrib#1753
open-telemetry/opentelemetry-dotnet-contrib#1753

Changes

This PR adds support for metrics enablement that are part of .NET8.0. For HttpClient the following meters will be added to the MeterProviderBuilder when application targets .NET8.0 framework:

  • Meter : System.Net.Http

    • http.client.request.duration
    • http.client.active_requests
    • http.client.open_connections
    • http.client.connection.duration
    • http.client.request.time_in_queue
  • Meter : System.Net.NameResolution

    • dns.lookups.duration

Users may selectively opt-out with the help of views.

TODO: Update Readme

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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)

@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #4931 (f48e3e4) into main (38e21a9) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    open-telemetry/opentelemetry-dotnet#4931      +/-   ##
==========================================
+ Coverage   83.26%   83.29%   +0.02%     
==========================================
  Files         295      295              
  Lines       12375    12378       +3     
==========================================
+ Hits        10304    10310       +6     
+ Misses       2071     2068       -3     
Flag Coverage Δ
unittests 83.29% <100.00%> (+0.02%) ⬆️

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

Files Coverage Δ
...rumentation.Http/MeterProviderBuilderExtensions.cs 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

@vishweshbankwar vishweshbankwar marked this pull request as ready for review October 7, 2023 01:19
@vishweshbankwar vishweshbankwar requested a review from a team as a code owner October 7, 2023 01:19
@samsp-msft
Copy link

@JamesNK please review

Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Looks good.
Some comments from #4934 (review) are applicable here as well.

.Replace("{flavor}", "1.1");
#else
.Replace("{flavor}", "2.0");
Copy link
Member

Choose a reason for hiding this comment

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

This is kind of interesting. How is it we don't report 2.0 now?

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Some non-blocking feedback, LGTM

@utpilla utpilla merged commit d07d030 into open-telemetry:main Oct 20, 2023
68 checks passed
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

8 participants