mirror of
https://github.com/katanemo/plano.git
synced 2026-06-20 15:28:07 +02:00
minor fixes to not write to the OTEL collector if tracing is disabled
This commit is contained in:
parent
a6dea4a3ae
commit
c0cf877b4f
2 changed files with 21 additions and 37 deletions
|
|
@ -66,12 +66,12 @@ impl TraceCollector {
|
|||
// Determine if tracing is enabled:
|
||||
// 1. Use explicit parameter if provided
|
||||
// 2. Otherwise check OTEL_TRACING_ENABLED env var
|
||||
// 3. Default to true if neither is set
|
||||
// 3. Default to false if neither is set (tracing opt-in, not opt-out)
|
||||
let enabled = enabled.unwrap_or_else(|| {
|
||||
std::env::var("OTEL_TRACING_ENABLED")
|
||||
.ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or(true)
|
||||
.unwrap_or(false)
|
||||
});
|
||||
|
||||
debug!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue