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() {
    tracing_axiom::init();
    say_hello();
    tracing_axiom::shutdown();
}

#[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.

Enums

The error type for this crate.

Functions

Create a new Builder.

Initialize a global subscriber which sends traces to Axiom.

Shutdown the tracer prodiver, flushing all spans. Run this before exit.

Initialize a global subscriber which sends traces to Axiom.