Conversation
724d7a3 to
df232b1
Compare
talex5
left a comment
There was a problem hiding this comment.
Looks reasonable. I'm not keen on the name prometheus-app-pure though (especially as it has the side-effect of registering collectors!). Maybe prometheus-reporter?
df232b1 to
5acd350
Compare
|
Sorry for the super late update here @talex5. I have now rebased, changed the name to |
|
|
||
| The `prometheus-reporter.unix` ocamlfind library provides the `Prometheus_reporter_unix` module, | ||
| which includes a cmdliner option. | ||
| See the `examples/example.ml` program for an example, which can be run as: |
| @@ -0,0 +1,18 @@ | |||
| (** Report metrics for Prometheus. | |||
| See: https://prometheus.io/ | |||
There was a problem hiding this comment.
This was See: {{:https://prometheus.io/}https://prometheus.io/} previously.
| @@ -0,0 +1,55 @@ | |||
| (** Report metrics for Prometheus. | |||
| See: https://prometheus.io/ | |||
| - This extends [Prometheus_reporter] with support for cmdliner option parsing, a server pre-configured | ||
| for Unix, and a start-time metric that uses [Unix.gettimeofday]. | ||
| *) | ||
|
|
||
| type config = int option | ||
|
|
||
| val opts : config Cmdliner.Term.t | ||
| (** [opts] is the extra command-line options to offer Prometheus | ||
| monitoring. *) |
There was a problem hiding this comment.
It might make more sense to keep the cmdliner stuff for cohttp in app. That would also avoid exposing the type (which is likely to change - see #51).
| process_cpu_seconds_total; | ||
| ] | ||
| end | ||
| include Prometheus_reporter |
There was a problem hiding this comment.
We should also be able to include it in the mli, to avoid duplication.
|
I would love to see a combination of Prometheus and Dream! |
This is a pretty early PR that just moves the code around a bit to not depend on cohttp.
Tests seems to pass on my machine at least.
Closes #39