Crate tracing_axiom
source · [−]Expand description
Send traces to Axiom with a single line.
Example
In a project that uses Tokio and
tracing run cargo add tracing-axiom
and
configure it like this:
#[tokio::main]
async fn main() {
let _guard = tracing_axiom::init();
say_hello();
}
#[tracing::instrument]
pub fn say_hello() {
tracing::info!("Hello, world!");
}
The example above gets the Axiom API token from the AXIOM_TOKEN
env and
panics if setup fails. If you want to handle the error, use try_init
.
For more advanced configuration, see builder()
.
Structs
Builder for creating a tracer, a layer or a subscriber that sends traces to
Axiom.
The token and the url are derived from the AXIOM_TOKEN
and AXIOM_URL
environment variables.
The guard will shutdown the OTEL tracer provider on drop.
Enums
The error type for this crate.