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

Prometheus Histogram and Summary types? #2834

Closed
Rast1234 opened this issue Jan 31, 2022 · 2 comments
Closed

Prometheus Histogram and Summary types? #2834

Rast1234 opened this issue Jan 31, 2022 · 2 comments
Labels
question Further information is requested

Comments

@Rast1234
Copy link

Question

What are you trying to achieve?

Currently i use AppMetrics. I'm trying to switch to opentelemetry metrics. Have a couple of questions regarding metric types and how to configure them.

Histogram

Prometheus has Histogram metric type which places reported values in buckets.

OpenTelemetry defines Histogram with buckets.

AppMetrics calls this BucketHistogram and allows configuring buckets on each metric created:

var metric = new App.Metrics.BucketHistogram.BucketHistogramOptions { Buckets = new double[] { 1, 10, 100 } };
App.Metrics.Metrics.Instance.Measure.BucketHistogram.Update(metric, 42);

So how do i specify buckets for a histogram with opentelemetry-dotnet?

var metric = new Meter("name").CreateHistogram<int>("metric", ???);

I've tried looking in sources and found DefaultHistogramBounds but have no idea how to pass them from user code.

Summary

Prometheus has Summary metric type which calculates quantiles.

OpenTelemetry defines Summary as legacy for some reason.

AppMetrics calls this Histogram (yeah, confusing, i know). While it doesn't allow to configure quantiles/percentiles, user can specify sampling algorithm: uniform, exponentially decaying and sliding window.

var metric = new App.Metrics.Histogram.HistogramOptions() { Reservoir = () => new App.Metrics.ReservoirSampling.ExponentialDecay.DefaultForwardDecayingReservoir(1024, 0.015) };

I've seen mentions of Summary type in prometheus serializer but can't find any metric that uses it. Is it unsupported? Are there any plans on this?

Gauge

Currently existing ObservableGauge requires boilerplate code to maintain a counter and increase/decrease it. Are there any plans to make convenient extensions/wrappers/helpers to simplify its usage? Like a Counter but with .Increase/.Decrease methods maybe?

@Rast1234 Rast1234 added the question Further information is requested label Jan 31, 2022
@cijothomas
Copy link
Member

Histogram custom bounds: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics/customizing-the-sdk#specify-custom-boundaries-for-histogram

Summary : Not supported in SDK/no plans unless spec requires this. (It currently only exist in OTLP protos i think to support metrics from external sources.)

Gauge - Not a wrapper, but there'll be dedicated UpDownCounter and its observable counterpart. #2362 This won't be part of 1st stable release, but would come in the next version.

@Rast1234
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants