Skip to content

Commit 8713027

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 ecec868 commit 8713027

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

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/traces/trace_flusher.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ impl TraceFlusher {
133133
.with_api_key(api_key.as_str())
134134
.with_retry_strategy(trace_retry_strategy())
135135
.build();
136+
137+
debug!("TRACES | Built trace: {:?}", trace.get_payloads());
136138
(trace, info.header_tags)
137139
})
138140
.collect();

0 commit comments

Comments
 (0)