influxive-otel

Crates.ioinfluxive-otel
lib.rsinfluxive-otel
version0.0.3-alpha.1
sourcesrc
created_at2023-07-14 23:02:54.170429
updated_at2024-06-05 16:34:01.836963
descriptionOpentelemetry metrics bindings for influxive-child-svc
homepage
repositoryhttps://github.com/holochain/influxive
max_upload_size
id916837
size31,393
Core Dev (github:holochain:core-dev)

documentation

https://docs.rs/influxive-otel

README

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, &[]);
Commit count: 37

cargo fmt