Crate telemetry_subscribers
source · [−]Expand description
This is a library for common Tokio Tracing subscribers, such as for Jaeger.
The subscribers are configured using TelemetryConfig passed into the init()
method.
A panic hook is also installed so that panics/expects result in scoped error logging.
Getting started is easy:
let config = telemetry_subscribers::TelemetryConfig {
service_name: "my_app".into(),
..Default::default()
};
// Important! Need to keep the guard and not drop until program terminates
let guard = telemetry_subscribers::init(config);
Features
jaeger
- this feature is enabled by default as it enables jaeger tracingjson
- Bunyan formatter - JSON log output, optionaltokio-console
- Tokio-console subscriber, optional
Structs
Configuration for different logging/tracing options
Functions
Initialize telemetry subscribers based on TelemetryConfig NOTE: You must keep the returned guard and not drop it until the end of the program, otherwise logs will not appear!!