tracing-elastic-apm

Crates.iotracing-elastic-apm
lib.rstracing-elastic-apm
version3.4.0
sourcesrc
created_at2020-12-21 17:26:24.912664
updated_at2024-06-03 06:00:47.795207
descriptionElastic APM intake API tracing layer.
homepagehttps://github.com/krojew/tracing-elastic-apm
repositoryhttps://github.com/krojew/tracing-elastic-apm
max_upload_size
id325326
size57,447
Kamil Rojewski (krojew)

documentation

https://docs.rs/tracing-elastic-apm

README

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.

Commit count: 80

cargo fmt