Module stdout

Source
Available on crate feature trace only.
Expand description

§Stdout Span Exporter

The stdout SpanExporter writes debug printed Spans to its configured Write instance. By default it will write to Stdout.

§Examples

use opentelemetry::trace::Tracer;
use opentelemetry::sdk::export::trace::stdout;
use opentelemetry::global::shutdown_tracer_provider;

fn main() {
    let tracer = stdout::new_pipeline()
        .with_pretty_print(true)
        .install_simple();

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

    shutdown_tracer_provider(); // sending remaining spans
}

Structs§

Exporter
A SpanExporter that writes to Stdout or other configured Write.
PipelineBuilder
Pipeline builder

Functions§

new_pipeline
Create a new stdout exporter pipeline builder.