-
Notifications
You must be signed in to change notification settings - Fork 28
Split implementation to a pure app #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Split implementation to a pure app #46
Conversation
724d7a3
to
df232b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing text here?
@@ -0,0 +1,18 @@ | |||
(** Report metrics for Prometheus. | |||
See: https://prometheus.io/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was See: {{:https://prometheus.io/}https://prometheus.io/}
previously.
@@ -0,0 +1,55 @@ | |||
(** Report metrics for Prometheus. | |||
See: https://prometheus.io/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be a link.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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