Track basic runtime metrics
Is your feature request related to a problem? Please describe.
We want to track and expose several metrics. The simplest ones to start with would be basic runtime/process information, such as:
- Current memory usage
- Current thread/ task count
- Current journal size/ max journal size
Describe the solution you'd like
The defacto standard way to expose metrics is via Prometheus, by simply serving an HTTP endpoint that (often lazily) gathers metrics when it's hit and prints them in the standard OpenMetrics format. For the dashboard, we should expose the same data, but wrapped in JSON for ease of use.
Various Prometheus client libraries also offer good tooling for tracking custom metrics, which we will need when we start tracking more domain-specific metrics.
Describe alternatives you've considered
We don't strictly speaking need Prometheus compatibility right now; however, the data structures it uses and the tooling around it are quite good, to the point where there just isn't a very good reason (or way) to track metrics and not expose them to Prometheus.
Additional context
This is a part of ratman-dashboard
(#50 (closed)), and the metrics are quoted from the design doc.