open-telemetry / opentelemetry-dotnet

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

[sdk-metrics] Add support .NET 9 Synchronous Gauge #5867

Open rajkumar-rangaraj opened 1 day ago

rajkumar-rangaraj commented 1 day ago

Fixes #4805 Design discussion issue #

Changes

Please provide a brief description of the changes here.

Updated the Metric class to add support for synchronous gauge.

Follow up: Update document - #5868

Merge requirement checklist

codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.29%. Comparing base (6250307) to head (457173d). Report is 332 commits behind head on main.

Files with missing lines Patch % Lines
src/OpenTelemetry/Metrics/Metric.cs 80.00% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867/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/5867?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 #5867 +/- ## ========================================== + Coverage 83.38% 86.29% +2.90% ========================================== Files 297 257 -40 Lines 12531 11214 -1317 ========================================== - Hits 10449 9677 -772 + Misses 2082 1537 -545 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867/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/5867/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/5867/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.23% <81.81%> (?)` | | | [unittests-Project-Stable](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.14% <81.81%> (?)` | | 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/5867?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/Reader/MetricReader.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867?src=pr&el=tree&filepath=src%2FOpenTelemetry%2FMetrics%2FReader%2FMetricReader.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkvTWV0cmljcy9SZWFkZXIvTWV0cmljUmVhZGVyLmNz) | `87.82% <100.00%> (ø)` | | | [src/OpenTelemetry/Metrics/Metric.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867?src=pr&el=tree&filepath=src%2FOpenTelemetry%2FMetrics%2FMetric.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkvTWV0cmljcy9NZXRyaWMuY3M=) | `96.89% <80.00%> (+0.37%)` | :arrow_up: | ... and [233 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5867/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)
rajkumar-rangaraj commented 19 hours ago

Q: Do you know if it should trigger any changes on instrumentation (packages) side? Contrib repository/natively instrumented packages?

Not yet, need to investigate it.