Skip to content

Commit 44d6e0d

Browse files
committed
avoid unnecessary wrapping
1 parent 2577db7 commit 44d6e0d

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

bottlecap/src/lifecycle/invocation/processor.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,8 @@ impl Processor {
12511251
}
12521252

12531253
// Extract _dd.p.* propagation tags from x-datadog-tags header
1254-
tags = extract_propagation_tags(&headers);
1254+
let carrier_tags = headers.get(DATADOG_TAGS_KEY).map_or("", String::as_str);
1255+
tags = crate::traces::propagation::extract_propagation_tags(carrier_tags);
12551256
}
12561257

12571258
// We should always use the generated span id from the tracer
@@ -1359,11 +1360,6 @@ impl Processor {
13591360
}
13601361
}
13611362

1362-
fn extract_propagation_tags(carrier: &HashMap<String, String>) -> HashMap<String, String> {
1363-
let carrier_tags = carrier.get(DATADOG_TAGS_KEY).map_or("", String::as_str);
1364-
crate::traces::propagation::extract_propagation_tags(carrier_tags)
1365-
}
1366-
13671363
#[cfg(test)]
13681364
#[allow(clippy::unwrap_used)]
13691365
mod tests {

bottlecap/src/lifecycle/invocation/triggers/step_function_event.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl StepFunctionEvent {
151151
.parse()
152152
.unwrap_or(Self::generate_trace_id(self.execution.id.clone()).0);
153153

154-
let tags = extract_propagation_tags(trace_tags);
154+
let tags = crate::traces::propagation::extract_propagation_tags(trace_tags);
155155

156156
(lo_tid, tags)
157157
} else {
@@ -239,10 +239,6 @@ impl StepFunctionEvent {
239239
}
240240
}
241241

242-
fn extract_propagation_tags(tags_str: &str) -> HashMap<String, String> {
243-
crate::traces::propagation::extract_propagation_tags(tags_str)
244-
}
245-
246242
impl ServiceNameResolver for StepFunctionEvent {
247243
fn get_specific_identifier(&self) -> String {
248244
String::new()

0 commit comments

Comments
 (0)