#open-telemetry

influxive-otel

Opentelemetry metrics bindings for influxive-child-svc

14 releases

0.0.3-alpha.1 Jun 5, 2024
0.0.2-alpha.1 Oct 16, 2023
0.0.1-alpha.11 Aug 4, 2023
0.0.1-alpha.9 Jul 31, 2023

#373 in Development tools

Download history 473/week @ 2024-07-02 548/week @ 2024-07-09 671/week @ 2024-07-16 450/week @ 2024-07-23 709/week @ 2024-07-30 414/week @ 2024-08-06 374/week @ 2024-08-13 361/week @ 2024-08-20 566/week @ 2024-08-27 483/week @ 2024-09-03 572/week @ 2024-09-10 763/week @ 2024-09-17 701/week @ 2024-09-24 388/week @ 2024-10-01 368/week @ 2024-10-08 416/week @ 2024-10-15

2,022 downloads per month
Used in 4 crates (via influxive)

MIT/Apache

39KB
866 lines

Project Forum Chat

License: MIT License: Apache-2.0

Opentelemetry metrics bindings for influxive-child-svc.

Example

use influxive_writer::*;

// create an influxive writer
let writer = InfluxiveWriter::with_token_auth(
    InfluxiveWriterConfig::default(),
    "http://127.0.0.1:8086",
    "my.bucket",
    "my.token",
);

// register the meter provider
opentelemetry_api::global::set_meter_provider(
    influxive_otel::InfluxiveMeterProvider::new(
        Default::default(),
        Arc::new(writer),
    )
);

// create a metric
let m = opentelemetry_api::global::meter("my.meter")
    .f64_histogram("my.metric")
    .init();

// make a recording
m.record(3.14, &[]);

Dependencies

~4–11MB
~112K SLoC