5 releases

0.2.2 Jan 22, 2024
0.2.1 Dec 25, 2023
0.2.0 Dec 28, 2022
0.1.1 Nov 18, 2022
0.1.0 Nov 17, 2022

#803 in Debugging

32 downloads per month

MIT license

9KB
146 lines

Usage

Pepe Telemetry can be initialized using envorment variables only or using RUST_LOG environment variable with provided config.

RUST_LOG is common environment variable to set log level. See docs here

Initialization from environment variables

Variable name Required Note
RUST_LOG_FORMAT No Log format. Options: plain, json. Default: plain
RUST_LOG_JAEGER_ENDPOINT No Jaeger endpoint for logs exporting
pepe_telemetry::init_subscriber_from_env();

tracing::info!("hello, pepe!");

Initialization from config

let config = Config {
  svc_name: "pepe_telemetry_example".to_string(),
  format: Format::Plain,
  jaeger_endpoint: None
};

let subscriber = pepe_telemetry::get_subscriber(&config);
pepe_telemetry::init_subscriber(subscriber);

tracing::info!("hello, pepe!");

Dependencies

~13–23MB
~302K SLoC