Publish process context during MINIT - #4213
Conversation
Publish in the parent so the agent can reuse inferred TLS offsets in worker forks. Preserve first-request and post-fork republication. If the MINIT process also serves requests, the first request updates the existing header mapping and replaces its payload, adding process tags when enabled. The publication timestamp advances while the runtime ID stays unchanged. Later requests do not repeat this initialization. Add a regression test that checks an idle PHP server before its first request.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 21 Pipeline jobs failed
|
There was a problem hiding this comment.
Looks fine to me, but I don't understand the full implications. Could you explain a bit more?
And obviously we need to get the tests working:
========DIFF========
001+ Server failed to start: Invalid address: 127.0.0.1:0
001- One Process Context mapping before any request: bool(true)
========DONE========
FAIL Linux OTel Process Context is published during MINIT [tmp/build_extension/tests/ext/otel_process_context_minit.phpt]
@morrisonlevi For this to work, the parent needs to already have published the process context. So I'm doing that on MINIT, which is what is run pre-fork on fpm. It also has the advantage that it reduces the window where we're already processing requests but the agent has not yet resolved the offsets. This is currently a problem in the system-tests, where we ahave to introduce a delay in the beginning of the request to give time to the user-space part of the resolution to take place. |
Benchmarks [ tracer ]Benchmark execution time: 2026-09-18 12:09:06 Comparing candidate commit 55972a0 in PR branch Found 2 performance improvements and 4 performance regressions! Performance is the same for 187 metrics, 1 unstable metrics.
|
Publish in the parent so the agent can reuse inferred TLS offsets in worker forks. See https://github.com/DataDog/datadog-agent/blob/main/pkg/security/ebpf/c/include/helpers/span.h#L57-L64
Description
Reviewer checklist