Crates.io | opinionated_metrics |
lib.rs | opinionated_metrics |
version | 0.2.0 |
source | src |
created_at | 2022-02-16 20:18:24.062818 |
updated_at | 2022-10-26 13:45:50.922827 |
description | Automatic configuration of exporters for `metrics` |
homepage | https://github.com/faradayio/geocode-csv/tree/main/crates/opinionated_metrics |
repository | https://github.com/faradayio/geocode-csv |
max_upload_size | |
id | 533526 |
size | 9,838 |
opinionated_metrics
: Automatically configure metrics
exportersThe goal: This library should provide reasonable defaults for collecting and exporting data from the Rust metrics
facade.
// Set up metrics reporting for a CLI tool, using environment variables.
let metrics_handle = opinionated_metrics::initialize_cli()?;
// Do stuff.
// Send a metrics report when the CLI tool has finished running.
metrics_handle.report().await?;
The reality: Right now, this works for CLI programs and it exports metrics to NewRelic and/or the logs. And we would honestly recommend against reporting to NewRelic unless you're already invested in it. (Hey, nobody ever promised this libraries opinions were good.) We do want to add Prometheus support, and better support for servers (and not just CLI programs that run and exit).
Current users: This library is intended for immediate production use at Faraday.
For more details, see the API documentation.