mirage / prometheus

OCaml library for reporting metrics to a Prometheus server
Apache License 2.0
49 stars 27 forks source link

Add config constructor in Prometheus_unix #52

Open abbysmal opened 2 years ago

abbysmal commented 2 years ago

This PR is a follow-up to our previous conversation offline.

This PR aims to add a simple constructor for the config type in Prometheus_unix, so that we do not have to solely rely on the Cmdliner based facility.

This is probably not quite nice enough, let me know if I can adjust it in any way. :)

rbjorklin commented 2 years ago

This looks related to my suggested change in #51, no?

abbysmal commented 2 years ago

If I understand correctly, it is not quite the same: The goal here is to produce an alternative constructor to the type config, in order to be able to bypass the usage of Cmdliner (not convenient for me at the moment). From what I see, your PR extends the Cmdliner constructor with a new arbitrary bind address parameter.

I am however fine with waiting on your PR to be merged to include your changes to this PR, since our changes clashes nonetheless. :-)

Edit: my bad, I misread your sentence: it is not the same, but our changes are related indeed! If you feel like incorporating the config constructor outside of Cmdliner from my changes into your branch, feel free to do it! Or I will wait for your work to be merged and fix this branch myself. :)