fix(sidecar): include initial data in app-started#2271
Draft
bm1549 wants to merge 1 commit into
Draft
Conversation
Contributor
📚 Documentation Check Results📦
|
Contributor
🔒 Cargo Deny Results📦
|
BenchmarksComparisonCandidateCandidate benchmark detailsBaselineBaseline benchmark details |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c2c3557 | Docs | Datadog PR Page | Give us feedback! |
Contributor
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
bm1549
force-pushed
the
brian.marks/debug-telemetry-start-race
branch
from
July 25, 2026 02:13
e31c2ab to
c2c3557
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This seeds the PHP tracer's buffered startup configurations, dependencies, and integrations into the application telemetry worker before
Startis queued. The firstapp-startedrequest includes the initial batch instead of racing with it.Stats and internal log/metric traffic now use a
MetricsLogsworker, so that traffic cannot create the application worker before the PHP startup batch arrives. Cache creation for a service and environment is serialized to avoid duplicate workers.Motivation
dd-trace-php 1.22 updated libdatadog from
b10b1d46tocd90e50a. The sidecar change in that range was the oneshot flusher rewrite in03357ee1(#2143). Its shorter flush path exposed an existing race: worker creation queuedStartin a detached task while buffered startup actions were queued by another task. Stats or internal telemetry could also create the shared worker first.The result was an
app-startedpayload without the PHP tracer's initial configuration.Additional Notes
This PR is limited to the buffered startup path used by dd-trace-php. Lifecycle handoff, runtime cleanup, registration replay, and other telemetry hardening remain in the follow-up stacked PR.
The public field shape of
TelemetryCachedClientis unchanged.How to test the change?
cargo +nightly-2026-02-08 fmt --all -- --checkcargo clippy -p datadog-sidecar --all-targets -- -D warningscargo test -p datadog-sidecar -- --test-threads=1(41 unit tests and 5 doc tests passed)Focused coverage checks the buffered startup payload, same-key concurrent creation, and
Start/Stopordering.