#tracing #elastic #apm #telemetry

tracing-elastic-apm

Elastic APM intake API tracing layer

12 stable releases

new 3.2.3 Aug 12, 2022
3.2.2 Jul 15, 2022
3.2.1 Jun 30, 2022
3.2.0 Oct 27, 2021
1.0.1 Dec 22, 2020

#120 in Database interfaces

Download history 58/week @ 2022-04-24 100/week @ 2022-05-01 106/week @ 2022-05-08 317/week @ 2022-05-15 99/week @ 2022-05-22 88/week @ 2022-05-29 165/week @ 2022-06-05 138/week @ 2022-06-12 277/week @ 2022-06-19 178/week @ 2022-06-26 126/week @ 2022-07-03 308/week @ 2022-07-10 202/week @ 2022-07-17 164/week @ 2022-07-24 162/week @ 2022-07-31 122/week @ 2022-08-07

656 downloads per month

MIT license

32KB
824 lines

tracing-elastic-apm

crates.io version Documentation (latest release)

Elastic APM tracing layer. Uses the native ingest API.

Usage

Create a new tracing Layer:

let layer = tracing_elastic_apm::new_layer(
    "ServiceName".to_string(),
    // remember to use desired protocol below, e.g. http://
    tracing_elastic_apm::Config::new("APM address".to_string())
)?;

Register the layer:

tracing_subscriber::registry()
    .with(layer)
    .init();

Take a look at Config for more configuration options.

Supported feature flags

  • default-tls (enabled by default) - use default TLS backend.
  • rustls-tls - use Rustls TLS backend.

Please see corresponding flags in the reqwest library for more information: https://docs.rs/reqwest/0.11.2/reqwest/#optional-features

Async and time measurements

APM doesn't support the notion of idle time and only tracks actual span durations. Async code naturally interleaves spans at await points, which means span start time + duration might be lower than actual span end time as measured by a wall clock. That in turn means child spans in APM might sometimes start after the parent span start time + duration.

Dependencies

~6–15MB
~306K SLoC