[][src]Crate opentelemetry

The Rust OpenTelemetry implementation.

OpenTelemetry provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. You can analyze them using Prometheus, Jaeger, and other observability tools.

Getting Started

use opentelemetry::{api::trace::Tracer, exporter::trace::stdout};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a new instrumentation pipeline
    let (tracer, _uninstall) = stdout::new_pipeline().install();

    tracer.in_span("doing_work", |cx| {
        // Traced app logic here...
    });

    Ok(())
}

See the examples directory for different integration patterns.

Modules

api

OpenTelemetry API: What applications use and SDKs implement.

experimental

OpenTelemetry Experimental Features

exporter

OpenTelemetry data exporters

global

OpenTelemetry Global API

sdk

OpenTelemetry SDK