Skip to content

Commit 485598e

Browse files
authored
fix: use datadog as default propagation style if supplied version is malformed (#891)
Fixes an issue where config parsing fails if this is invalid
1 parent f12e410 commit 485598e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bottlecap/src/config/trace_propagation_style.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{fmt::Display, str::FromStr};
22

33
use serde::{Deserialize, Deserializer};
4+
use tracing::error;
45

56
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
67
pub enum TracePropagationStyle {
@@ -21,7 +22,10 @@ impl FromStr for TracePropagationStyle {
2122
"b3" => Ok(TracePropagationStyle::B3),
2223
"tracecontext" => Ok(TracePropagationStyle::TraceContext),
2324
"none" => Ok(TracePropagationStyle::None),
24-
_ => Err(format!("Unknown trace propagation style: {s}")),
25+
_ => {
26+
error!("Trace propagation style is invalid: {:?}, using Datadog", s);
27+
Ok(TracePropagationStyle::Datadog)
28+
}
2529
}
2630
}
2731
}

0 commit comments

Comments
 (0)