Crates.io | influxive-otel |
lib.rs | influxive-otel |
version | 0.0.3-alpha.1 |
source | src |
created_at | 2023-07-14 23:02:54.170429 |
updated_at | 2024-06-05 16:34:01.836963 |
description | Opentelemetry metrics bindings for influxive-child-svc |
homepage | |
repository | https://github.com/holochain/influxive |
max_upload_size | |
id | 916837 |
size | 31,393 |
Opentelemetry metrics bindings for influxive-child-svc.
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, &[]);