vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
18.16k stars 1.6k forks source link

Support Prometheus native histograms #16333

Open runiq opened 1 year ago

runiq commented 1 year ago

A note for the community

Use Cases

Compared to Prometheus' current histogram implementation, native histograms:

Attempted Solutions

No response

Proposal

No response

References

https://www.youtube.com/watch?v=AcmABV6NCYk&list=PLoz-W_CUquUmVOjYTqWHX4CJ0jP61vif8&index=2

Version

vector 0.27.0 (x86_64-unknown-linux-gnu 5623d1e 2023-01-18)

jszwedko commented 1 year ago

Note that we'll probably want to wait for this feature to stabilize in Prometheus before adding to Vector. It currently appears to be undocumented.

jacobstr commented 7 months ago

To follow up @jszwedko's comment, indeed this un/under-documentation still appears to be the case in April 2024. It looks like the functionality is making it's way into mainline prom in fits and starts but:

Much (all?) of this development appears to mostly center around the golang prometheus community.

Reimirno commented 2 weeks ago

Follow up: @jszwedko @jacobstr

Native histogram does still seem to be experimental and under-documented as of Nov 2024. There seems to be no ongoing work regarding this issue.

I wonder if makes sense to contribute now, because we do have a use case relying Vector being able to ingest and output Prom native histogram, at least through remote write route. My reasoning:

While NHCB is a uncertainty, I want to make a case that we can go ahead and implement support for native histogram in Vector already without supporting NHCB. This is effectively the approach taken by most of the instrumentation library that already supports native histogram anyways (prom java sdk, prom golang sdk etc).

I scoped out some changes to be made:

Happy to iterate/discuss this further.

jszwedko commented 4 days ago

Thanks for following up on this @runiq . I agree with your assessment. This feature seems relatively stable, at this point, even if it not well-documented. The risk of it changing drastically seems minimal. I think we'd support a PR implementing this if you want to give it a shot.

If it is possible to map to the the existing sketch or histogram types in Vector without being lossy, that would definitely be preferable. Otherwise we'll need to add an additional type and do the mapping in the sinks where needed. However, if we do need to do that, the fact that OTLP has the same model will mean we'll be able to take advantage of that when we expand Vector to support receiving and sending metrics in OTLP.

runiq commented 3 days ago

Thanks for following up on this @runiq .

That wasn't me, it was @Reimirno .

I think we'd support a PR implementing this if you want to give it a shot.

I'm afraid I won't be able to implement this, it'd probably be way above my capabilities if I'm being honest with myself.

Reimirno commented 3 days ago

@jszwedko Yes, that was me following up. Thanks for your reply and thoughts.

I might take a stab at this once I have some bandwidth. I don't think existing histogram/sketches types can be lossless conversion for prometheus native histogram OR OTLP exponential histogram. Most likely we do need an additional type.