feat(tracer): add configuration for connection mode#3573
feat(tracer): add configuration for connection mode#3573
Conversation
|
✨ Fix all issues with BitsAI or with Cursor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3573 +/- ##
==========================================
- Coverage 62.22% 62.08% -0.14%
==========================================
Files 141 141
Lines 13352 13352
Branches 1746 1746
==========================================
- Hits 8308 8290 -18
- Misses 4253 4269 +16
- Partials 791 793 +2 see 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ tracer ]Benchmark execution time: 2026-03-05 16:01:30 Comparing candidate commit 8b7a5b3 in PR branch Found 0 performance improvements and 3 performance regressions! Performance is the same for 188 metrics, 3 unstable metrics. scenario:ComposerTelemetryBench/benchTelemetryParsing-opcache
scenario:PHPRedisBench/benchRedisBaseline-opcache
scenario:SamplingRuleMatchingBench/benchRegexMatching4-opcache
|
ce20a9e to
2eb0609
Compare
Benchmarks [ profiler ]Benchmark execution time: 2026-01-14 16:24:26 Comparing candidate commit 05ebcae in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 28 metrics, 6 unstable metrics. scenario:php-profiler-timeline-memory-with-profiler-and-timeline
|
06223eb to
cda73e8
Compare
211d162 to
0b1eb24
Compare
58e8671 to
e4a603a
Compare
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
e4a603a to
a2f512c
Compare
- crashtracker_segfault: filter crash pings by absence of os_info instead of kind == "Crash ping" (libdatadog 27de9f37d changed crash ping kind from "Crash ping" to "UnixSignal") - debugger_span_decoration_probe: update expected URL from /debugger/v1/input to /debugger/v2/input (libdatadog 29e00628b routed logs to snapshots endpoint)
…lter With newer libdatadog (29e00628b), debugger logs are routed to /debugger/v2/input instead of /debugger/v1/diagnostics. The filter in replayDebuggerData() still included /debugger/v1/diagnostics with body (added in c3be656 for older routing), which caused it to return a diagnostics response before the actual /debugger/v2/input snapshot, breaking debugger_span_decoration_probe.phpt. Remove the diagnostics clause — only /debugger/v1/input and /debugger/v2/input are snapshot/log endpoints.
…back routing libdatadog 29e00628b routes logs to /debugger/v2/input but falls back to /debugger/v1/diagnostics when the agent doesn't support v2 (as is the case with the request replayer in tests). Update the expected URI in debugger_span_decoration_probe.phpt accordingly. Also restore the /debugger/v1/diagnostics filter in replayDebuggerData() which was incorrectly removed in the previous commit.
…ailable In ddtrace_sidecar_setup_thread_mode, a forked child detecting is_child_process=true would try to connect to the parent's thread listener. If the parent used subprocess mode (no thread listener), the connect would fail and the child returned with no sidecar and no fallback. Mirror the existing fallback logic from ddtrace_sidecar_handle_fork: when the parent's listener is unavailable, reset ddtrace_sidecar_master_pid to the current process and fall through to start a new master listener in this process.
…ct path When a parent process initializes the sidecar in thread mode, forks, and then exits, the child inherits a broken transport (parent's listener thread is dead). In dd_sidecar_connect(), if ddog_sidecar_connect_worker() fails and current_pid != master_pid, promote the child to master so it can still submit traces. The existing fallback in ddtrace_sidecar_setup_thread_mode covers the initial-setup path, but the reconnect path (ddtrace_sidecar_connect_callback -> dd_sidecar_connect) had no equivalent fallback, causing a silent failure for orphaned children that already had an inherited transport. Add a .phpt test that verifies the orphaned child can create and submit spans after the parent exits.
… compatibility Thread-mode sockets now include the master's effective uid in the filename (libdd.<ver>@<uid>-<pid>.sock in /tmp/libdatadog/). A worker process that later drops privileges via setuid() (e.g. www-data under PHP-FPM) still computes the same socket path as the master listener, and ensure_dir_exists now best-effort chmods the directory world-writable to allow socket creation by any user. Also fixes a double-dot bug in socket/lock path construction (Rust >=1.87 no longer strips leading dots from with_extension arguments). Adds test: sidecar_thread_mode_permissions.phpt verifies the socket is created with the correct uid-pid encoding.
04d237e to
0d0c164
Compare
Update libdatadog submodule: thread mode sidecar now uses abstract Unix sockets on Linux (no filesystem permissions needed, any user can connect) and a single-threaded Tokio runtime (no extra OS threads, fixes LSan "Running thread was not suspended" ASAN warnings at process exit). Update sidecar_thread_mode_permissions.phpt to verify abstract socket usage (no filesystem socket created) instead of checking file permissions.
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
fd58c34 to
31e8976
Compare
After fork, the child inherits the parent's heap including the Tokio current_thread runtime allocations and Rust stdlib once-cell inits from the sidecar thread. Since threads don't survive fork, these are orphaned allocations that LSan incorrectly reports as leaks. This is the same reason daemonize() already sets LSAN_OPTIONS=detect_leaks=0 for the subprocess sidecar.
When the PHP-FPM master process runs as root, the sidecar thread (thread mode) creates named SHM objects with 0600 by default, making them inaccessible to worker processes running as www-data. Call ddog_sidecar_set_shm_open_mode(0644) before starting the master sidecar listener when geteuid()==0, so workers can open the SHM regions read-only. The mode is set in both ddtrace_sidecar_setup_thread_mode() and ddtrace_sidecar_minit() to cover all code paths.
Description
Reviewer checklist