#metrics-exporter #open-telemetry #recorder

metrics-exporter-opentelemetry

🐻‍❄️🎈 A metrics exporter over OpenTelemetry

2 releases

0.1.1 Mar 24, 2025
0.1.0 Mar 7, 2025

#326 in Debugging

Download history 200/week @ 2025-03-07 37/week @ 2025-03-14 145/week @ 2025-03-21 47/week @ 2025-03-28 13/week @ 2025-04-04 31/week @ 2025-04-11 10/week @ 2025-04-18

108 downloads per month

MIT license

19KB
163 lines

🐻‍❄️🎈 metrics-exporter-opentelemetry

A metrics exporter over OpenTelemetry

The metrics-exporter-opentelemetry crate is a metrics exporter over OpenTelemetry's metrics API.

Warnings

  • The crate doesn't support the following methods from metrics:

  • The crate provide no-op implementations of the metrics::Recorder::describe_* as we can't modify a constructed counter/gauge/histogram from metrics::Recorder::register_*. The SDK keeps track of it but is internal and isn't able to be accessed.

Usage

// Cargo.toml:
//
// [dependencies]
// metrics = "^0"
// metrics-exporter-opentelemetry = "^0"

use metrics_exporter_opentelemetry::Recorder;

fn main() {
    // Install a global `metrics` recorder
    let _ = Recorder::builder("my-app")
        .install_global()
        .unwrap();

    let counter = metrics::counter!("hello.world");
    counter.increment(1);
}

License

metrics-exporter-opentelemetry is released under the MIT License with love, care, and Dr. Pepper. This is a call of help, I am too addicted to Dr. Pepper at this rate.

Dependencies

~3.5–4.5MB
~77K SLoC