Skip to content

Commit 87175b5

Browse files
authored
chore(agent-data-plane): only emit OTLP config-related logs if OTLP pipeline is enabled (#1100)
1 parent 2acf436 commit 87175b5

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

bin/agent-data-plane/src/cli/run.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,21 @@ fn add_otlp_pipeline_to_blueprint(
408408
if dp_config.otlp().proxy().enabled() {
409409
let core_agent_otlp_grpc_endpoint = dp_config.otlp().proxy().core_agent_otlp_grpc_endpoint().to_string();
410410
let core_agent_otlp_http_endpoint = dp_config.otlp().proxy().core_agent_otlp_http_endpoint().to_string();
411-
let api_key = config.get_typed::<String>("api_key").expect("API key is required");
411+
let proxy_metrics = dp_config.otlp().proxy().proxy_metrics();
412+
let proxy_logs = dp_config.otlp().proxy().proxy_logs();
413+
let proxy_traces = dp_config.otlp().proxy().proxy_traces();
414+
let api_key = config
415+
.get_typed::<String>("api_key")
416+
.error_context("API key must be set.")?;
417+
418+
info!(
419+
proxy_grpc_endpoint = %core_agent_otlp_grpc_endpoint,
420+
proxy_http_endpoint = %core_agent_otlp_http_endpoint,
421+
proxy_metrics,
422+
proxy_logs,
423+
proxy_traces,
424+
"OTLP proxy mode enabled. Select OTLP payloads will be proxied to the Core Agent."
425+
);
412426

413427
let otlp_relay_config = OtlpRelayConfiguration::from_configuration(config)?;
414428
let otlp_decoder_config = OtlpDecoderConfiguration::from_configuration(config)?;
@@ -434,13 +448,15 @@ fn add_otlp_pipeline_to_blueprint(
434448
.connect_component("dd_traces_encode", ["otlp_traces_decode"])?;
435449
}
436450
} else {
451+
info!("OTLP proxy mode disabled. OTLP signals will be handled natively.");
452+
437453
let otlp_config =
438454
OtlpConfiguration::from_configuration(config)?.with_workload_provider(env_provider.workload().clone());
439455

440456
blueprint
441457
// Components.
442458
.add_source("otlp_in", otlp_config)?
443-
// Metrics and logs.
459+
// Metrics, logs, and traces.
444460
//
445461
// We send OTLP metrics directly to the enrichment stage of the metrics pipeline, skipping aggregation,
446462
// to avoid transforming counters into rates.

bin/agent-data-plane/src/config.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use saluki_config::GenericConfiguration;
22
use saluki_error::GenericError;
33
use saluki_io::net::ListenAddress;
4-
use tracing::info;
54

65
/// General data plane configuration.
76
#[derive(Clone, Debug)]
@@ -258,20 +257,6 @@ impl DataPlaneOtlpProxyConfiguration {
258257
.try_get_typed("data_plane.otlp.proxy.logs.enabled")?
259258
.unwrap_or(true);
260259

261-
if enabled {
262-
info!(
263-
proxy_enabled = enabled,
264-
core_agent_otlp_grpc_endpoint = %core_agent_otlp_grpc_endpoint,
265-
core_agent_otlp_http_endpoint = %core_agent_otlp_http_endpoint,
266-
proxy_traces = proxy_traces,
267-
proxy_metrics = proxy_metrics,
268-
proxy_logs = proxy_logs,
269-
"OTLP proxy mode enabled. Select OTLP payloads will be proxied to the Core Agent."
270-
);
271-
} else {
272-
info!("OTLP proxy mode disabled. OTLP signals will be handled natively.");
273-
}
274-
275260
Ok(Self {
276261
enabled,
277262
core_agent_otlp_grpc_endpoint,

0 commit comments

Comments
 (0)