opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

Adding MinMax to Histograms

Open mic-max opened this issue 3 years ago • 19 comments

Fixes #2560

Changes

Histograms will now record the minimum and maximum measurement values.

For significant contributions please make sure you have completed the following items:

  • [x] Appropriate CHANGELOG.md updated for non-trivial changes
  • [ ] Design discussion issue #
  • [x] Changes in public API reviewed

mic-max avatar Dec 08 '21 20:12 mic-max

Codecov Report

Merging #2735 (a282844) into main (af7ab89) will decrease coverage by 0.42%. The diff coverage is 76.59%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
- Coverage   87.35%   86.92%   -0.43%     
==========================================
  Files         277      278       +1     
  Lines       10068    10151      +83     
==========================================
+ Hits         8795     8824      +29     
- Misses       1273     1327      +54     
Impacted Files Coverage Δ
...ry/Metrics/ExplicitBucketHistogramConfiguration.cs 83.33% <ø> (+22.22%) :arrow_up:
src/OpenTelemetry/Metrics/MetricPoint.cs 75.00% <71.79%> (-8.00%) :arrow_down:
...tryProtocol/Implementation/MetricItemExtensions.cs 93.95% <100.00%> (+0.12%) :arrow_up:
src/OpenTelemetry/Metrics/HistogramBuckets.cs 100.00% <100.00%> (ø)
...rc/OpenTelemetry/Metrics/HistogramConfiguration.cs 100.00% <100.00%> (ø)
src/OpenTelemetry/Metrics/Metric.cs 95.50% <100.00%> (+1.12%) :arrow_up:
src/OpenTelemetry/Metrics/MetricReaderExt.cs 86.36% <100.00%> (+1.81%) :arrow_up:
src/OpenTelemetry/Metrics/MetricStreamIdentity.cs 90.62% <100.00%> (+0.62%) :arrow_up:
...entation/ExportClient/OtlpGrpcTraceExportClient.cs 35.71% <0.00%> (-42.86%) :arrow_down:
...xporter.OpenTelemetryProtocol/OtlpTraceExporter.cs 36.36% <0.00%> (-40.91%) :arrow_down:
... and 14 more

codecov[bot] avatar Dec 08 '21 21:12 codecov[bot]

https://github.com/open-telemetry/opentelemetry-dotnet/pull/2718 changes the layout, so this will be affected.

cijothomas avatar Dec 08 '21 22:12 cijothomas

https://github.com/open-telemetry/opentelemetry-dotnet/pull/2705/files - need to bring this back as well. (it was reverted)

cijothomas avatar Dec 08 '21 22:12 cijothomas

https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/Metrics/MetricType.cs also see this class.

cijothomas avatar Dec 08 '21 22:12 cijothomas

This PR was marked stale due to lack of activity. It will be closed in 7 days.

github-actions[bot] avatar Jan 27 '22 03:01 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar Feb 10 '22 03:02 github-actions[bot]

Could this be reopened please :)

mic-max avatar Jun 29 '22 18:06 mic-max

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Jul 07 '22 03:07 github-actions[bot]

Comment to keep this open. I'm excited and eager to see this changed merged and released.

jdaigle avatar Jul 09 '22 14:07 jdaigle

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Jul 23 '22 03:07 github-actions[bot]

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Aug 01 '22 03:08 github-actions[bot]

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Aug 13 '22 03:08 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar Aug 20 '22 03:08 github-actions[bot]

Can this be reopened? Is it being worked on?

arianmotamedi avatar Aug 23 '22 20:08 arianmotamedi

@mic-max Please resolve the merge conflicts for getting this PR ready for review.

utpilla avatar Aug 23 '22 20:08 utpilla

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Aug 31 '22 04:08 github-actions[bot]

Would love to have this. For me, I'm recording queue processing times and having the average is alright, but what I really want to know is what the max time is.

ejsmith avatar Sep 13 '22 20:09 ejsmith

I guess there wouldn't be any way to get something like the 99th percentile from a histogram even with this change. I was reading docs on OpenTelemetry specs and it seems like doing percentiles isn't really going to be supported.

ejsmith avatar Sep 13 '22 21:09 ejsmith

I guess there wouldn't be any way to get something like the 99th percentile from a histogram even with this change. I was reading docs on OpenTelemetry specs and it seems like doing percentiles isn't really going to be supported.

Histogram exports buckets, allowing backends to calculate percentiles.

cijothomas avatar Sep 13 '22 21:09 cijothomas

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Sep 22 '22 04:09 github-actions[bot]

Do we need help getting this completed and merged? It seems like an important feature for otel metrics.

ejsmith avatar Sep 26 '22 19:09 ejsmith

Let me know when you want to merge this and I will resolve the conflicts, not going to waste my time fixing preemptively just for new conflicts to come up

mic-max avatar Oct 03 '22 17:10 mic-max

The PR looks good except for 2 things:

  1. MinMwx should be part of Identity. Must be fixed in this PR.
  2. Other exporters will break with this change. The fix is in other exporters, but blocking PR to prevent accidental merge until exporters are hotfixed. See https://github.com/open-telemetry/opentelemetry-dotnet/pull/2735/files#r989476122

if we keep the metric type same, then it wont break existing exporters. and can use Nan/Infinity to indicate lack of min/max

cijothomas avatar Oct 07 '22 02:10 cijothomas

Merging. @alanwest please take a final look and share any issues you see!

cijothomas avatar Oct 14 '22 21:10 cijothomas