nlopes / actix-web-prom

Actix-web middleware to expose Prometheus metrics
MIT License
89 stars 56 forks source link

Add PrometheusMetrics::new_with_registry_and_buckets #52

Closed arthurlm closed 3 years ago

arthurlm commented 3 years ago

This help to configure prometheus histogram buckets in case query duration differ from default prometheus behaviour.

See issue: https://github.com/nlopes/actix-web-prom/issues/26

I have made minimal changes here to keep PR readable as possible and compatible with previous code. It would be nice to have something like a builder instead of having multiple new_ methods.

arthurlm commented 3 years ago

For builder pattern you can have a look here to see how it might look: https://github.com/arthurlm/actix-web-prom/compare/master...arthurlm:builder

nlopes commented 3 years ago

I definitely regret not making this one a builder pattern from the beginning. I'm catching up on a lot of these issues/PRs and will definitely look at your branch.

arthurlm commented 3 years ago

Thanks, I would also be happy to create a PR for this but my builder branch depends of this PR.

I can rebase my branches in the opposite order. So you would first have to merge builder branch, then the changes related to buckets configuration. It is up to your preferences and your interest.

nlopes commented 3 years ago

I'll merge this one then and you can create a PR with the builder pattern. Thank you.