envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.91k stars 4.79k forks source link

Prometheus: add native histogram support #32686

Open howardjohn opened 7 months ago

howardjohn commented 7 months ago

Title: Prometheus: add native histogram support

Description: https://prometheus.io/docs/concepts/metric_types/#histogram

Prometheus has a new native histogram mode which (claims to) make a much better tradeoff between metrics cost and usefulness by having dynamic bucket sizing. It would be great to have support for this in Envoy

KBaichoo commented 7 months ago

cc @jmarantz @ggreenway

ggreenway commented 7 months ago

This sounds interesting. But I couldn't find any documentation on exactly what the format it is, or how it is represented in the exposition format. Can you point me to docs on the format?

howardjohn commented 7 months ago

@ggreenway I was surprised by the lack of clear specification. https://github.com/prometheus/client_golang/pull/1150/files is an example of the Go implementation, but it doesn't link to any specification either and has a lot of seemingly magic stuff.

My understanding is this also depends on protobuf encoded Prometheus encoding, which might be a large pre-req before even getting to the histogram support itself.

Its quite plausible its a bit too early to adopt this in Envoy (or at least not at a 'stable' level)

ggreenway commented 7 months ago

I had thought that prometheus stopped using the protobuf exposition format, which used to be true but is now not true. Found a bit of the backstory here: https://github.com/prometheus/client_model/blob/master/README.md

euroelessar commented 7 months ago

OpenTelemetry has a good documentation for exponential histograms: https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram As well as a comparison with Prometheus' native histograms: https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#exponential-histograms (spoiler: they are compatible and can be converted to each other)

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] commented 6 months ago

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

howardjohn commented 4 months ago

/reopen /help-wanted

ggreenway commented 4 months ago

@howardjohn have there been any updates on the stability of the format, docs, etc?

beorn7 commented 4 months ago

I'm currently writing the spec (which hopefully will get marked as final in September). Currently, native histograms can only be exposed via protobuf, so the protobuf spec will already help a lot.

If you are wondering what things mean, you could look at the code of prometheus/client_golang or prometheus/client_java or just ask me. :o)

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 months ago

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

adams-shaun commented 3 weeks ago

+1 libcircllhist is great at what it does, but seems to run with high overhead over extended periods of time and large sample counts / numbers of histograms to accumulate.