Skip to content

Commit 06223eb

Browse files
committed
fix(tracer): remove debug logs
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
1 parent 37ec8f2 commit 06223eb

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

ext/sidecar.c

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ ddog_SidecarTransport *ddtrace_sidecar_connect(bool is_fork) {
268268
switch (mode) {
269269
case DD_TRACE_SIDECAR_CONNECTION_MODE_SUBPROCESS:
270270
// Force subprocess only
271-
LOG(DEBUG, "Sidecar connection mode: subprocess (forced)");
272271
transport = ddtrace_sidecar_connect_subprocess();
273272
if (!transport) {
274273
LOG(ERROR, "Subprocess connection failed (mode=subprocess, no fallback)");
@@ -277,7 +276,6 @@ ddog_SidecarTransport *ddtrace_sidecar_connect(bool is_fork) {
277276

278277
case DD_TRACE_SIDECAR_CONNECTION_MODE_THREAD:
279278
// Force thread only
280-
LOG(DEBUG, "Sidecar connection mode: thread (forced)");
281279
transport = ddtrace_sidecar_connect_thread();
282280
if (!transport) {
283281
LOG(ERROR, "Thread connection failed (mode=thread, no fallback)");
@@ -287,23 +285,22 @@ ddog_SidecarTransport *ddtrace_sidecar_connect(bool is_fork) {
287285
case DD_TRACE_SIDECAR_CONNECTION_MODE_AUTO:
288286
default:
289287
// Try subprocess first, fallback to thread if needed
290-
LOG(DEBUG, "Sidecar connection mode: auto (trying subprocess first)");
291288
transport = ddtrace_sidecar_connect_subprocess();
292289

293-
if (transport) {
294-
LOG(DEBUG, "Connected to sidecar via subprocess");
295-
} else if (!ddtrace_endpoint) {
296-
// Don't try fallback if endpoint is invalid - both modes need a valid endpoint
297-
// The "Invalid DD_TRACE_AGENT_URL" error was already logged during endpoint creation
298-
} else {
299-
// Subprocess failed but endpoint is valid - try thread mode fallback
300-
LOG(WARN, "Subprocess connection failed, falling back to thread mode");
301-
transport = ddtrace_sidecar_connect_thread();
302-
303-
if (transport) {
304-
LOG(INFO, "Connected to sidecar via thread (fallback)");
290+
if (!transport) {
291+
if (!ddtrace_endpoint) {
292+
// Don't try fallback if endpoint is invalid - both modes need a valid endpoint
293+
// The "Invalid DD_TRACE_AGENT_URL" error was already logged during endpoint creation
305294
} else {
306-
LOG(ERROR, "Both subprocess and thread connections failed, sidecar unavailable");
295+
// Subprocess failed but endpoint is valid - try thread mode fallback
296+
LOG(WARN, "Subprocess connection failed, falling back to thread mode");
297+
transport = ddtrace_sidecar_connect_thread();
298+
299+
if (transport) {
300+
LOG(INFO, "Connected to sidecar via thread (fallback)");
301+
} else {
302+
LOG(ERROR, "Both subprocess and thread connections failed, sidecar unavailable");
303+
}
307304
}
308305
}
309306
break;

tests/ext/sandbox/die_in_sandbox.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ x();
1717

1818
?>
1919
--EXPECTF--
20-
[ddtrace] [debug] Sidecar connection mode: auto (trying subprocess first)
21-
[ddtrace] [debug] Connected to sidecar via subprocess
2220
[ddtrace] [warning] UnwindExit thrown in ddtrace's closure defined at %s:%d for x(): <exit> in Unknown on line 0
2321
[ddtrace] [span] Encoding span: Span { service: die_in_sandbox.php, name: die_in_sandbox.php, resource: die_in_sandbox.php, type: cli, trace_id: %d, span_id: %d, parent_id: %d, start: %d, duration: %d, error: %d, meta: %s, metrics: %s, meta_struct: %s, span_links: %s, span_events: %s }
2422
[ddtrace] [span] Encoding span: Span { service: die_in_sandbox.php, name: x, resource: x, type: cli, trace_id: %d, span_id: %d, parent_id: %d, start: %d, duration: %d, error: %d, meta: %s, metrics: %s, meta_struct: %s, span_links: %s, span_events: %s }

tests/ext/span_on_close.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ $span->onClose = [
2424

2525
?>
2626
--EXPECTF--
27-
[ddtrace] [debug] Sidecar connection mode: auto (trying subprocess first)
28-
[ddtrace] [debug] Connected to sidecar via subprocess
2927
Second
3028
First
3129
[ddtrace] [span] Encoding span: Span { service: %s, name: root span, resource: root span, type: cli, trace_id: %d, span_id: %d, parent_id: %d, start: %d, duration: %d, error: %d, meta: %s, metrics: %s, meta_struct: %s, span_links: %s, span_events: %s }

tests/ext/startup_logging_json_config.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ dd_dump_startup_logs($logs, [
5252
]);
5353
?>
5454
--EXPECT--
55-
[ddtrace] [debug] Sidecar connection mode: auto (trying subprocess first)
56-
[ddtrace] [debug] Connected to sidecar via subprocess
5755
Sanity check
5856
env: "my-env"
5957
service: "my-service"

0 commit comments

Comments
 (0)