Expand description

Trace Semantic Conventions

The trace semantic conventions define a set of standardized attributes to be used in Spans.

Usage

use opentelemetry::{global, trace::Tracer as _};
use opentelemetry_semantic_conventions as semcov;

let tracer = global::tracer("my-component");
let _span = tracer
    .span_builder("span-name")
    .with_attributes(vec![
        semcov::trace::NET_PEER_NAME.string("example.org"),
        semcov::trace::NET_PEER_PORT.i64(80),
    ])
    .start(&tracer);

Constants