AlexanderThaller / prometheus_exporter

Helper libary to export prometheus metrics using tiny_http and rust-prometheus.
MIT License
28 stars 10 forks source link

Make endpoint configurable. #16

Closed jward-bw closed 3 years ago

jward-bw commented 3 years ago

Hi, hope you accept external PRs. I'd like to use this crate, but our monitoring stack is configured to have very particular endpoints to serve metrics on. Let me know if you want anything changed.

AlexanderThaller commented 3 years ago

Sorry for some reason my github notifications are broken. I would be open to make the endpoint configurable. I will review the code and let you know. Thank you for the pr!

AlexanderThaller commented 3 years ago

Can you run cargo +nightly fmt --all on your changes? Otherwise it looks good to me.

AlexanderThaller commented 3 years ago

I'm not entirely sure about the ASCII requirement. I would expect to be able to use äöü in my endpoints. Probably its good to have some sanitation and only allow correct paths instead. Probably we could use https://github.com/servo/rust-url for that.

That being said I think currently having the requirement to only allow ASCII is fine. We can always change it in the future if the need for non ASCII paths arises.

AlexanderThaller commented 3 years ago

@jward-bw can you run cargo fmt (using nightly)? Can merge after that

jward-bw commented 3 years ago

Hey Alexander, thanks for getting back to me. Just got round to checking your comments. I've ran the nightly format and rebased to master. I might look at making non-ASCII usable separately if I find time for it.

AlexanderThaller commented 3 years ago

Thank you for the contribution probably gonna release it to 0.8.2 soon.