11 releases

0.0.5 Aug 12, 2025
0.0.4-alpha.1 Feb 19, 2025
0.0.3-alpha.1 Jun 5, 2024
0.0.2-alpha.1 Oct 16, 2023
0.0.1-alpha.9 Jul 31, 2023

#1158 in Debugging

Download history 416/week @ 2025-10-13 442/week @ 2025-10-20 632/week @ 2025-10-27 579/week @ 2025-11-03 355/week @ 2025-11-10 1067/week @ 2025-11-17 359/week @ 2025-11-24 320/week @ 2025-12-01 405/week @ 2025-12-08 208/week @ 2025-12-15 256/week @ 2025-12-22 457/week @ 2025-12-29 784/week @ 2026-01-05 543/week @ 2026-01-12 529/week @ 2026-01-19 221/week @ 2026-01-26

2,101 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

37KB
712 lines

Project Forum Chat

License: MIT License: Apache-2.0

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.

Example

Writing to a running InfluxDB instance

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")
);

Writing to a file on disk

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`

Dependencies

~5.5–8.5MB
~137K SLoC