Skip to content

Commit fef1739

Browse files
test(ci): add intentional sensitive log statements to validate Copilot PII rules [SVLS-8660]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8c7d8ed commit fef1739

5 files changed

Lines changed: 25 additions & 4 deletions

File tree

bottlecap/src/bin/bottlecap/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ fn create_api_key_factory(config: &Arc<Config>, aws_config: &Arc<AwsConfig>) ->
250250
let aws_config = Arc::clone(aws_config);
251251
let api_key_secret_reload_interval = config.api_key_secret_reload_interval;
252252

253+
let api_key = &config.api_key;
254+
debug!("Resolved api_key={api_key} for factory initialization");
255+
253256
Arc::new(ApiKeyFactory::new_from_resolver(
254257
Arc::new(move || {
255258
let config = Arc::clone(&config);
@@ -291,6 +294,7 @@ async fn extension_loop_active(
291294
let (mut event_bus, event_bus_tx) = EventBus::run();
292295

293296
let account_id = r.account_id.as_ref().unwrap_or(&"none".to_string()).clone();
297+
debug!("Extension registered successfully: {:?}", r);
294298
let tags_provider = setup_tag_provider(&Arc::clone(&aws_config), config, &account_id);
295299

296300
// Build one shared reqwest::Client for metrics, logs, and trace proxy flushing.
@@ -1125,6 +1129,8 @@ fn start_trace_agent(
11251129
trace_http_client,
11261130
));
11271131

1132+
debug!("Trace agent starting with config: {:?}", config);
1133+
11281134
let obfuscation_config = obfuscation_config::ObfuscationConfig {
11291135
tag_replace_rules: config.apm_replace_tags.clone(),
11301136
http_remove_path_digits: config.apm_config_obfuscation_http_remove_paths_with_digits,
@@ -1296,6 +1302,9 @@ fn start_metrics_flushers(
12961302

12971303
// Create a flusher for each endpoint URL and API key pair
12981304
for api_key in api_keys {
1305+
debug!(
1306+
"Configuring additional endpoint flusher: endpoint={endpoint_url} api_key={api_key}"
1307+
);
12991308
let additional_api_key_factory = Arc::new(ApiKeyFactory::new(api_key));
13001309
let additional_flusher_config = MetricsFlusherConfig {
13011310
api_key_factory: additional_api_key_factory,

bottlecap/src/extension/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use reqwest::Client;
22
use serde::Deserialize;
3-
use tracing::error;
3+
use tracing::{debug, error};
44

55
pub mod telemetry;
66

@@ -48,7 +48,7 @@ pub enum ExtensionError {
4848
HttpStatusError { status: u16 },
4949
}
5050

51-
#[derive(Clone, Deserialize)]
51+
#[derive(Clone, Debug, Deserialize)]
5252
#[serde(rename_all = "camelCase")]
5353
/// Response from the register endpoint
5454
/// <https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html#runtimes-extensions-registration-api>
@@ -118,6 +118,8 @@ pub async fn register(
118118
return Err(ExtensionError::HttpStatusError { status });
119119
}
120120

121+
debug!("Register response headers: {:?}", response.headers());
122+
121123
let extension_id = response
122124
.headers()
123125
.get(EXTENSION_ID_HEADER)

bottlecap/src/lifecycle/listener.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ impl Listener {
183183
payload_value: Value,
184184
invocation_processor_handle: InvocationProcessorHandle,
185185
) {
186-
debug!("Received start invocation request from headers:{headers:?}");
186+
// to test https://github.com/DataDog/datadog-lambda-extension/pull/1037/changes
187+
debug!(
188+
"Received start invocation request from headers:{headers:?}, payload_value:{payload_value:?}"
189+
);
187190

188191
let request_id = extract_request_id_from_headers(&headers);
189192

@@ -246,7 +249,10 @@ impl Listener {
246249
let headers = headers_to_map(headers);
247250
let payload_value = serde_json::from_slice::<Value>(&body).unwrap_or_else(|_| json!({}));
248251

249-
debug!("Received end invocation request from headers:{headers:?}");
252+
// to test https://github.com/DataDog/datadog-lambda-extension/pull/1037/changes
253+
debug!(
254+
"Received end invocation request from headers:{headers:?}, payload_value:{payload_value:?}"
255+
);
250256
let request_id = extract_request_id_from_headers(&headers);
251257

252258
if let Err(e) = invocation_processor_handle

bottlecap/src/logs/flusher.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ impl Flusher {
9898
format!("{}/api/v2/logs", self.endpoint)
9999
};
100100
let headers = self.get_headers(api_key).await;
101+
debug!("LOGS | Flushing request headers: {:?}", headers);
101102
self.client
102103
.post(&url)
103104
.timeout(std::time::Duration::from_secs(self.config.flush_timeout))

bottlecap/src/traces/trace_flusher.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ impl TraceFlusher {
9595
return None;
9696
};
9797

98+
debug!("TRACES | Flushing traces with api_key={api_key}");
9899
let http_client = &self.http_client;
99100

100101
let mut failed_batch: Vec<SendData> = Vec::new();
@@ -133,6 +134,8 @@ impl TraceFlusher {
133134
.with_api_key(api_key.as_str())
134135
.with_retry_strategy(trace_retry_strategy())
135136
.build();
137+
138+
debug!("TRACES | Built trace: {:?}", trace.get_payloads());
136139
(trace, info.header_tags)
137140
})
138141
.collect();

0 commit comments

Comments
 (0)