open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.23k stars 765 forks source link

[sdk-metrics] Add support for .NET 9 Advice API #5854

Closed rajkumar-rangaraj closed 1 month ago

rajkumar-rangaraj commented 1 month ago

Fixes #5487 Design discussion issue #

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.29%. Comparing base (6250307) to head (0dec04c). Report is 324 commits behind head on main.

Files with missing lines Patch % Lines
src/OpenTelemetry/Metrics/MetricStreamIdentity.cs 95.65% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/graphs/tree.svg?width=650&height=150&src=pr&token=vscyfvPfy5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #5854 +/- ## ========================================== + Coverage 83.38% 86.29% +2.91% ========================================== Files 297 257 -40 Lines 12531 11194 -1337 ========================================== - Hits 10449 9660 -789 + Misses 2082 1534 -548 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `?` | | | [unittests-Project-Experimental](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.27% <95.65%> (?)` | | | [unittests-Project-Stable](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.24% <95.65%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [src/OpenTelemetry/Metrics/MetricStreamIdentity.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854?src=pr&el=tree&filepath=src%2FOpenTelemetry%2FMetrics%2FMetricStreamIdentity.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkvTWV0cmljcy9NZXRyaWNTdHJlYW1JZGVudGl0eS5jcw==) | `88.98% <95.65%> (+2.31%)` | :arrow_up: | ... and [225 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5854/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)
cijothomas commented 1 month ago

@rajkumar-rangaraj Do you know if httpclient, aspnetcore started leveraging the advice for providing custom buckets ?

rajkumar-rangaraj commented 1 month ago

@rajkumar-rangaraj Do you know if httpclient, aspnetcore started leveraging the advice for providing custom buckets ?

I haven't checked this part yet.

CodeBlanch commented 1 month ago

Definitely need a CHANGELOG for this one 😄

cijothomas commented 1 month ago

@rajkumar-rangaraj Do you know if httpclient, aspnetcore started leveraging the advice for providing custom buckets ?

I haven't checked this part yet.

np! We just need to make sure we don't remove the hardcoded buckets that exist today in sdk, until that happens and old versions are out of support.

cijothomas commented 1 month ago

Definitely need a CHANGELOG for this one 😄

I also suggest to document this near https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics/customizing-the-sdk#explicit-bucket-histogram-aggregation and recommend users to leverage Advice, wherever feasible

rajkumar-rangaraj commented 1 month ago

@rajkumar-rangaraj Do you know if httpclient, aspnetcore started leveraging the advice for providing custom buckets ?

I haven't checked this part yet.

np! We just need to make sure we don't remove the hardcoded buckets that exist today in sdk, until that happens and old versions are out of support.

Created an issue to track doc changes separately - https://github.com/open-telemetry/opentelemetry-dotnet/issues/5855