Enable PHP FFE span-enrichment parametric tests#7153
Draft
leoromanovsky wants to merge 1 commit into
Draft
Conversation
Activate tests/parametric/test_ffe/test_span_enrichment.py for PHP (v1.21.0-dev)
and adapt the PHP parametric server so the FROZEN suite passes in the
long-running CLI app:
- /ffe/evaluate: re-activate the caller-supplied span (span_id) around the
evaluation via switch_stack, so the ffe_* enrichment tags land on the test's
span (multi-eval aggregation onto one root; child-span propagation to root).
- /ffe/start: when the test pushes a UFC via Remote Config (no inline config),
call dd_trace_internal_fn('await_ffe_config') to actively pump Remote Config.
The CLI server's SIGVTALRM-driven RC refresh is starved by IO-blocking, so
without this the worker never applies the pushed UFC and evaluation returns
defaults.
- /trace/span/finish: synchronously flush on ROOT-span close so the finished
trace (carrying the enrichment tags written on root finish) deterministically
reaches the agent before wait_for_num_traces reads it, instead of racing the
async send-queue drain.
Validated locally: TEST_LIBRARY=php ./run.sh PARAMETRIC -k span_enrichment
=> 18 passed.
Contributor
|
|
|
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.
Motivation
The FFE APM feature-flag span-enrichment contract (frozen against
dd-trace-js#8343) is beingfanned out to the remaining server SDKs. The parametric suite
tests/parametric/test_ffe/test_span_enrichment.pyalready exists and is frozen; this PR enablesit for PHP (the last of the 5 server SDKs), against the tracer changes in
DataDog/dd-trace-php#3996.Changes
tests/parametric/test_ffe/test_span_enrichment.pyfor PHP atv1.21.0-dev.utils/build/docker/php/parametric/server.php) — adapt thelong-running CLI app so the frozen suite passes:
/ffe/evaluate: re-activate the caller-supplied span (span_id) around the evaluation viaswitch_stack, so theffe_*enrichment tags land on the test's span. This makes multi-evalaggregation onto a single root work and lets a child-span evaluation propagate to the root.
/ffe/start: when the test pushes a UFC config via Remote Config (no inlineconfiguration),call
dd_trace_internal_fn('await_ffe_config')to actively pump Remote Config. In thelong-running CLI server the SIGVTALRM-driven RC refresh is starved (the amphp event loop is
mostly blocked in IO, not burning CPU time), so without this the worker never applies the
pushed UFC and evaluation returns default values.
/trace/span/finish: synchronously flush on root-span close so the finished trace(carrying the enrichment tags written on root finish) deterministically reaches the agent
before
wait_for_num_tracesreads it, instead of racing the async send-queue drain.The diff is language-scoped: only the PHP parametric server and the PHP manifest line are touched.
No unrelated cross-language drift,
_test_agent.py, or local-only Docker/platform changes areincluded.
Decisions
dd-trace-php#3996); this PR ispurely the system-tests enablement + parametric-app adaptation.
await_ffe_configis a tracertesting internal fn added in that PR.
/trace/span/flushendpoint'sdd_trace_synchronous_flushusage, to keep child-span semanticsunchanged.
Validation
Run locally against the
dd-trace-php#3996build (dd-library-php-1.21.0, C extension built fromsource for
aarch64-linux-gnu, PHP 8.2 NTS):All 18 cases pass — serial-ID aggregation/child-span propagation (e.g.
ZAgUAg==→[100,108,128,130]), SHA256-hashed subjects gated ondoLog, runtime-defaults with 64-chartruncation, and all frozen limits (200/10/20/5).