| Crates.io | komoju-datadog |
| lib.rs | komoju-datadog |
| version | 0.1.1 |
| created_at | 2025-09-16 07:12:50.572946+00 |
| updated_at | 2025-09-16 07:48:14.439338+00 |
| description | Opinionated DataDog instrumentation toolkit |
| homepage | |
| repository | https://github.com/komoju/komoju-datadog |
| max_upload_size | |
| id | 1841055 |
| size | 77,942 |
This is our in-house DataDog integration for Rust. It is similar to DataDog's own integrations for other languages, providing support for metrics, traces, and logs. All data is automatically tagged to correlate logs and traces.
Add this to your Cargo.toml:
[dependencies]
komoju-datadog = "0.1"
This library is configured through the Config struct, which automatically
picks up DD_ environment variables.
use komoju_datadog::{Config, tracing::Tracer, statsd::StatsD};
fn main() {
let o11y_config = Config::builder().service("my-service").build();
StatsD::init_global(&o11y_config);
let _tracer_guard = Tracer::new(&o11y_config);
// Start the service here, e.g. via tokio::runtime::Runtime::block_on.
}
This crate has several optional features which can be enabled:
| feature | provides |
|---|---|
aws_ecs |
correlation of traces to ECS containers, enables system metrics |
axum |
AxumTraceLayer for automatic spans for each request |
sqlx |
instrument_query macro for tracing SQLx queries |
See the documentation for more details and usage examples.