Function tracing_axiom::default
source · pub fn default<S>(
service_name: &str
) -> Result<OpenTelemetryLayer<S, Tracer>, Error>where
S: Subscriber + for<'span> LookupSpan<'span>,
Expand description
Creates a default OpenTelemetryLayer
with a Tracer
that sends traces to Axiom.
It uses the environment variables AXIOM_TOKEN
and optionally AXIOM_URL
and AXIOM_DATASET
to configure the endpoint.
If you want to manually set these or other attributres, use builder()
or builder_with_env()
.
§Errors
Errors if the initialization was unsuccessful, likely because a global
subscriber was already installed or AXIOM_TOKEN
and/or AXIOM_DATASET
is not set or invalid.