metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.06k stars 145 forks source link

feat: get_recent_metrics as method from PrometheusHandle #466

Closed lpj145 closed 3 months ago

lpj145 commented 3 months ago

If we choose to only uses the Recorder, I think with that implementation we could achieve a lot of implementations, like translate to otlp, request a rest api, print to stdout and some other things.

tobz commented 3 months ago

Hey, sorry for the delay in getting around to this PR.

I'm going to close this, as this feature is not something I'm looking to currently add. Many people have asked for this before, but the truth is that installing a "Prometheus" exporter and not even using any Prometheus-specific features, just grabbing the metrics, is a weird usage of the crate that I don't want to encourage.

I'm happy to accept a PR for a generic recorder that only supports getting manual snapshots of the registry, though.