| Crates.io | agntcy-slim-tracing |
| lib.rs | agntcy-slim-tracing |
| version | 0.2.7 |
| created_at | 2025-06-03 13:55:32.156107+00 |
| updated_at | 2025-11-21 19:52:58.692868+00 |
| description | Observability for SLIM data plane: logs, traces and metrics infrastructure. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1699072 |
| size | 125,548 |
The agntcy-slim-tracing module provides comprehensive observability for the
Agntcy SLIM data plane through structured logging, distributed tracing, and metrics. It
offers a flexible configuration system for controlling logging levels and
enabling OpenTelemetry integration.
This module serves as the observability foundation for all SLIM components, enabling:
The tracing module uses tracing and OpenTelemetry for a unified approach to observability, allowing developers to diagnose issues across the SLIM ecosystem.
Logging behavior is controlled by three sources, in order of precedence (highest first):
TracingConfiguration { log_level, filters, ... }log_level = "info" and default module filters listlog_level (string): The default verbosity applied to all modules (unless overridden).filters (Vec<String>): A list of module directives. Each entry may be either:
slim_service)slim_service=debug)filters contains only module names (no =level). They all inherit log_level.RUST_LOG is set it fully overrides the configuration.
module=level directives (e.g. slim=debug,slim_auth=trace) and no global (bare) level, an implicit ,off is appended internally so that all unspecified modules are silenced.info or info,slim=debug) it is used as-is.RUST_LOG is NOT set:
filters equals the default list, every module in that list is assigned the configured log_level.filters differs from the default:
=level keep their specified level.=level inherit the configured log_level.log_level so that unmentioned modules do not become overly verbose.| Input Source | Value | Effective Behavior |
|---|---|---|
| (no env), defaults | log_level=info | All default slim* modules log at info |
| (no env), config.filters = ["slim_service", "slim_auth=trace"] and log_level=warn | slim_service=warn, slim_auth=trace |
|
| RUST_LOG=slim=debug | Augmented to slim=debug,off — only slim module at debug |
|
| RUST_LOG=slim=debug,slim_auth=trace | Augmented to slim=debug,slim_auth=trace,off |
|
| RUST_LOG=debug | Global debug level for all modules | |
| RUST_LOG=info,slim=debug | All modules info, slim debug |
|
| RUST_LOG=slim=debug,other=info,slim_mls=trace | Only those three modules active; others off (implicit) |
,offWhen users specify only targeted module=level directives, they usually intend to restrict output. Appending off prevents unrelated third-party crates from emitting logs unexpectedly.
export RUST_LOG=traceexport RUST_LOG=slim_session=debugexport RUST_LOG=warn,slim_auth=debugLog filtering affects only emitted spans' events & formatted logs; OpenTelemetry spans are still created based on the sampler configuration. Adjust sampling separately if you need to reduce trace volume.
slim_*=debug)SLIM_LOG_LEVEL)!module syntax)This behavior is implemented inside TracingConfiguration::setup_tracing_subscriber.