| Crates.io | statshouse |
| lib.rs | statshouse |
| version | 0.1.1 |
| created_at | 2026-01-15 21:55:01.090636+00 |
| updated_at | 2026-01-15 22:01:37.214928+00 |
| description | StatsHouse client library for Rust |
| homepage | https://github.com/razmser/statshouse-rs |
| repository | https://github.com/razmser/statshouse-rs |
| max_upload_size | |
| id | 2047180 |
| size | 32,779 |
Rust client library for StatsHouse.
This repository is a Cargo workspace with:
statshouse/: the client library cratextask/: developer tooling (cargo x)Add the dependency:
[dependencies]
statshouse = "0.1.0"
Send a counter metric (UDP by default):
use statshouse::{MetricBuilder, Transport};
fn main() {
let mut transport = Transport::default();
MetricBuilder::new(b"requests_total")
.tag(b"env", b"staging")
.tag(b"service", b"api")
.write_count(&mut transport, 1.0, 0);
}
Send value metric over TCP:
use statshouse::{MetricBuilder, Transport};
fn main() {
let mut transport = Transport::tcp("127.0.0.1:13337");
MetricBuilder::new(b"latency_ms")
.tag(b"env", b"staging")
.write_values(&mut transport, &[12.3, 18.9, 7.4], 0.0, 0);
}
Use UDP explicitly:
use statshouse::{MetricBuilder, Transport};
fn main() {
let mut transport = Transport::udp("127.0.0.1:13337");
MetricBuilder::new(b"requests_total")
.tag(b"env", b"staging")
.write_count(&mut transport, 1.0, 0);
}
Single command to run all checks: cargo x ci
MPL-2.0
__src_client_write_err tags with Go (env/app tags).