Crates.io | metrics-exporter-influx |
lib.rs | metrics-exporter-influx |
version | 0.1.3 |
source | src |
created_at | 2023-07-05 20:50:37.542004 |
updated_at | 2023-10-24 19:48:59.865245 |
description | A metrics-compatible exporter for sending metrics to Influx/Grafana Cloud |
homepage | https://github.com/sevco/metrics-exporter-influx |
repository | https://github.com/sevco/metrics-exporter-influx |
max_upload_size | |
id | 909354 |
size | 61,235 |
use std::time::Duration;
#[tokio::main]
async fn main() {
InfluxBuilder::new().with_duration(Duration::from_secs(60)).install()?;
}
use std::fs::File;
#[tokio::main]
async fn main() {
InfluxBuilder::new()
.with_writer(File::create("/tmp/out.metrics")?)
.install()?;
}
#[tokio::main]
async fn main() {
InfluxBuilder::new()
.with_influx_api(
"http://localhost:8086",
"db/rp",
None,
None,
None,
Some("ns".to_string())
)
.install()?;
}
Grafana Cloud supports the Influx Line Protocol exported by this exporter.
#[tokio::main]
async fn main() {
InfluxBuilder::new()
.with_grafna_cloud_api(
"https://https://influx-prod-03-prod-us-central-0.grafana.net/api/v1/push/influx/write",
Some("username".to_string()),
Some("key")
)
.install()?;
}