Skip to content

Commit a2ffde0

Browse files
authored
fix: lowercase DD_SERVICE on processors (#1013)
## What? Lowercases `DD_SERVICE` for products using it to send telemetry ## Why? Previous agent did this specifically on Serverless workloads, we should be consistent – and also #1009
1 parent 4ca997c commit a2ffde0

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

bottlecap/src/lifecycle/invocation/processor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ impl Processor {
107107
&config.service.clone().unwrap_or(resource.clone()),
108108
"aws.lambda",
109109
config.trace_aws_service_representation_enabled,
110-
);
110+
)
111+
.to_lowercase();
111112

112113
let enhanced_metrics = EnhancedMetrics::new(metrics_aggregator, Arc::clone(&config));
113114
enhanced_metrics.start_usage_metrics_task(); // starts the long-running task that monitors usage metrics (fd_use, threads_use, tmp_used)

bottlecap/src/logs/lambda/processor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ impl LambdaProcessor {
6464
event_bus: Sender<Event>,
6565
is_managed_instance_mode: bool,
6666
) -> Self {
67-
let service = datadog_config.service.clone().unwrap_or_default();
67+
let service = datadog_config
68+
.service
69+
.clone()
70+
.unwrap_or_default()
71+
.to_lowercase();
6872
let tags = tags_provider.get_tags_string();
6973
let function_arn = tags_provider.get_canonical_id().unwrap_or_default();
7074

bottlecap/src/tags/lambda/tags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn tags_from_env(
100100
tags_map.insert(ENV_KEY.to_string(), env.to_string());
101101
}
102102
if let Some(service) = &config.service {
103-
tags_map.insert(SERVICE_KEY.to_string(), service.to_string());
103+
tags_map.insert(SERVICE_KEY.to_string(), service.to_lowercase());
104104
}
105105
if let Ok(init_type) = std::env::var(INIT_TYPE) {
106106
tags_map.insert(INIT_TYPE_KEY.to_string(), init_type);

bottlecap/src/traces/stats_concentrator_service.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ impl StatsConcentratorService {
166166
sequence: 0,
167167
// Not supported yet
168168
agent_aggregation: String::new(),
169-
service: self.config.service.clone().unwrap_or_default(),
169+
service: self
170+
.config
171+
.service
172+
.clone()
173+
.unwrap_or_default()
174+
.to_lowercase(),
170175
container_id: self.tracer_metadata.container_id.clone(),
171176
// Not supported yet
172177
tags: vec![],

0 commit comments

Comments
 (0)