#datadog #logger #tracer #logging

datadoghq

Datadog APM-compatible tracer and logger

2 releases

0.2.2 Jun 30, 2022
0.2.1 May 27, 2022
0.2.0 May 27, 2022

#8 in #tracer

MIT license

46KB
1K SLoC

Datadog APM for Rust (original fork from datadog-apm)

Credits

Forked from https://github.com/pipefy/datadog-apm-rust.

Usage

Config

{
    let enabled = true;
    let config = Config::new(
        "service_name".to_string(),
        Some("staging".to_string()),
        "localhost:8196".to_string(),
        LoggingConfig {
            level: Level::Debug,
            ..LoggingConfig::default()
        },
        ApmConfig::default(),
        enabled,
    );
    let _client = DatadogTracing::new(config);

Instrumentation

#[tracing::instrument]
pub fn foo(name: &str) {
    debug!("Hello, {}!", name);
}

Span

{
    let span = span!(Level::INFO, "foo");
    let _enter = span.enter();
    info!("greeting");
}

More

See also tracing

Dependencies

~5–7MB
~120K SLoC