client_rust icon indicating copy to clipboard operation
client_rust copied to clipboard

feat: add range based exponential buckets in histogram

Open kohlisid opened this issue 1 year ago • 1 comments

The current implementation does not have a range based exponential bucket function.

This can be useful in scenarios where the end user doesn't want to perform manual calculations for extracting the required buckets, especially when multiple different ranges are to be used for different histograms.

Similar implementation is provided in the golang client as well. https://github.com/prometheus/client_golang/blob/5d584e2717ef525673736d72cd1d12e304f243d7/prometheus/histogram.go#L125

kohlisid avatar Oct 11 '24 22:10 kohlisid

@mxinden please check! Thank you

kohlisid avatar Oct 15 '24 05:10 kohlisid

@mxinden Thanks for the review! Have addressed them with some small follow ups, please take a look whenever you get a chance.

kohlisid avatar Oct 29 '24 14:10 kohlisid

@mxinden Just following up on this? Let me know if any other changes are required

kohlisid avatar Nov 06 '24 22:11 kohlisid

Hey @mxinden Thanks for getting back on this I can remove the log here for sure! Returning the result might be cleaner but then it would diverge from the fixed buckets functions present currently, if you're okay with that we can go that route

Otherwise I'm good with having the empty iterator as return

Let me know what works best and I can make those changes quickly and we can get this merged :)

kohlisid avatar Jan 06 '25 17:01 kohlisid

@mxinden Based on your latest addition to the change log file, could you please tell me what would be the conflict resolution here intended.

kohlisid avatar Jan 06 '25 17:01 kohlisid

@kohlisid I resolved the merge conflicts. Sorry for the trouble.

Please remove the log dependency. You can keep the log lines as code comments. I am in favor of using an empty iterator.

mxinden avatar Jan 06 '25 20:01 mxinden

@mxinden Updated! Please check Thanks

kohlisid avatar Jan 06 '25 21:01 kohlisid