metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.11k stars 153 forks source link

metrics-exporter-prometheus: exemplar support #175

Open clux opened 3 years ago

clux commented 3 years ago

A way to attach traceids to histograms as per the OpenMetics specifictaion

Use case is grafana tempo

tobz commented 3 years ago

Taking a cursory glance, this is definitely more work than I'd be comfortable taking on personally. I'd accept a PR adding this functionality and can try and offer some guidance on working through it if need be.

I'll leave the issue open for anyone else looking for the same thing.

clux commented 3 years ago

Completely understand. Mostly wanted to see if there was interest around for it as it looked cool. Thanks for keeping a tracking issue.

gsserge commented 3 years ago

If nobody is working on this then I'd like to give it a try.

After a quick look into the spec and the Go client, it seems that the first step is to implement Open Metrics negotiation and encoding: https://github.com/prometheus/client_golang/blob/master/prometheus/promhttp/http.go#L356. Please correct me if I'm wrong, but it looks like metrics-exporter-prometheus does not support Open Metrics yet. Then we can extend Histogram with Exemplar, implement recording and emission.

tobz commented 3 years ago

Nobody is working on this as far as I know, so it's all yours. :)

wperron commented 3 years ago

@gsserge any progress so far? I'm interested in this feature, I'd be glad to help get it through

fredr commented 2 years ago

@gsserge @wperron did you start working on this? I'm thinking of looking into this in the upcoming weeks, so if you have made any progress or figured something out while looking into or have any other info regarding this it would be appreciated

wperron commented 2 years ago

@gsserge @wperron did you start working on this? I'm thinking of looking into this in the upcoming weeks, so if you have made any progress or figured something out while looking into or have any other info regarding this it would be appreciated

Hey 👋 I have not worked on this no, changing priorities and all, feel free to take it

campbellC commented 1 year ago

@fredr looks like you made significant progress on this. Do you plan on continuing the effort in that PR? I'm also keen for this and may (hopefully) have some capacity to take a look soon.

fredr commented 1 year ago

hey @campbellC, I'm happy to continue with it, but waiting for some feedback on how it should be implemented.

The PR so far is just a proof of concept and a base for discussion, and I've dropped the momentum a bit since the summer, but I will try to get it rolling again.

If you have any feedback on the PR or ideas how it could be implemented differently, let me know!

fredr commented 1 year ago

I've dropped this for now, as I don't have time to put into it. Feel free to pick it up