| Crates.io | influxive-writer |
| lib.rs | influxive-writer |
| version | 0.0.5 |
| created_at | 2023-07-21 21:48:56.624864+00 |
| updated_at | 2025-08-12 12:49:14.39608+00 |
| description | Rust utility for efficiently writing metrics to a running InfluxDB instance |
| homepage | |
| repository | https://github.com/holochain/influxive |
| max_upload_size | |
| id | 922693 |
| size | 77,928 |
Rust utility for efficiently writing metrics to InfluxDB. Metrics can be written directly to a running InfluxDB instance or written to a Line Protocol file on disk that can be pushed to InfluxDB using Telegraf.
use influxive_core::Metric;
use influxive_writer::*;
let writer = InfluxiveWriter::with_token_auth(
InfluxiveWriterConfig::default(),
"http://127.0.0.1:8086",
"my.bucket",
"my.token",
);
writer.write_metric(
Metric::new(
std::time::SystemTime::now(),
"my.metric",
)
.with_field("value", 3.14)
.with_tag("tag", "test-tag")
);
use influxive_core::Metric;
use influxive_writer::*;
let path = std::path::PathBuf::from("my-metrics.influx");
let config = InfluxiveWriterConfig::create_with_influx_file(path.clone());
// The file backend ignores host/bucket/token
let writer = InfluxiveWriter::with_token_auth(config, "", "", "");
writer.write_metric(
Metric::new(
std::time::SystemTime::now(),
"my.metric",
)
.with_field("value", 3.14)
.with_tag("tag", "test-tag")
);
// Now you can read and use the metrics file `my-metrics.influx`