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
SpanExporterthat writes toStdoutor other configuredWrite. - Pipeline
Builder - Pipeline builder
Functions§
- new_
pipeline - Create a new stdout exporter pipeline builder.