tracing-kickstart
Rust module used to bootstrap tracing and reduce code duplication across projects.
Intended for personal use only.
Example
This example loads the TracingConfig from a .env file by deserializing through a nested config struct.
Example .env file:
APP__TRACE__LOG_FILE_PATH="/tmp/tracing-kickstart-example.log"
APP__TRACE__COLLECTOR_URL="https://otel.example.com:4318"
APP__TRACE__COLLECTOR_AUTH_HEADER="Basic aHVudGVyMg=="
APP__TRACE__ANSI_OUTPUT=true
Implementation example
use ;
use dotenv;
use Deserialize;
use TracingConfig;
async
Feature flags
Default: none
tokio_console - Enables tokio's console feature
- Pulls
console-subscriberinto dependency tree and handles required env filter updates
detector_hostresource - enables the HostResourceDetector
- Added attributes:
host.id,host.arch
detector_os - enables the OsResourceDetector
- Added attributes:
os_type
detector_process
- Enables the
ProcessResourceDetector - Added attributes:
process.command_args,process.pid,process.runtime.version,process.runtime.name,process.runtime.description
detector_telemetry - enables the TelemetryResourceDetector
- Added attributes:
telemetry.sdk.name,telemetry.sdk.language,telemetry.sdk.version
attrs_crate_name
- Adds an additional attribute (
service.crate_name) for the crate name. - This will only differ from
service_namefor crates/packages which contain hyphen's in their package name. - E.g. for this library:
service.name:tracing-kickstartservice.crate_name:tracing_kickstart
attrs_origin
- Adds attributes for info regarding the
tracing-kickstartpackage, e.g. the version, crate name, etc