test(parametric): enable Python FFE span-enrichment suite#7149
Draft
leoromanovsky wants to merge 1 commit into
Draft
test(parametric): enable Python FFE span-enrichment suite#7149leoromanovsky wants to merge 1 commit into
leoromanovsky wants to merge 1 commit into
Conversation
Honor span_id in the Python parametric /ffe/evaluate handler so ffe_* tags land on the test's root span, and flip the six class-level missing_feature entries in manifests/python.yml so the frozen test_span_enrichment.py classes run and assert for Python (>=4.9.0; validated against ddtrace 4.12.0rc1). Validated locally: TEST_LIBRARY=python ./run.sh PARAMETRIC -k span_enrichment -> 18 passed (8 enrichment classes), 0 skipped.
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 feature (frozen against
dd-trace-js#8343)is being fanned out to the remaining Datadog server SDKs. The Python tracer
(
dd-trace-py) now implements it (gated behindDD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED), attachingffe_flags_enc,ffe_subjects_enc, andffe_runtime_defaultsto the root APM span.This PR enables the existing, frozen parametric enrichment suite
(
tests/parametric/test_ffe/test_span_enrichment.py) to actually run and assert forPython, so the contract is enforced in CI rather than skipped via
missing_feature.Changes
utils/build/docker/python/parametric/apm_test_client/server.py-- the/ffe/evaluatehandler now honors the optionalspan_idfield sent by the testclient (
_test_client_parametric.py). It looks up the caller-supplied root span inthe existing
spansregistry and re-activates it viaddtrace.tracer.context_provider.activate(...)around the OpenFeature evaluation,so the
ffe_*tags land on the test's intended root span. An unknown / missing /unparsable id simply skips activation and never throws. This reuses the same
context-activation primitive that
/trace/span/start'sstart_span(activate=True)relies on; the base
/ffe/start+/ffe/evaluatehandlers already exist onmain.manifests/python.yml-- removed the six class-levelmissing_featureentries fortest_span_enrichment.pyso those classes inherit the file-level>=4.9.0gate andmust pass. The validated artifact reports version
4.12.0rc1, which satisfies the gate.No change to the frozen test file, encoding, or limits.
Decisions
and the Python manifest are touched. The shared HTTP test-client (
ffe_start/ffe_evaluatewithspan_id) already exists onmainand needed no change. No_test_agent.pychange is required -- the enrichment tests only useset_remote_config/wait_for_rc_apply_state/wait_for_num_traces.missing_featurelets the classes inherit the existing>=4.9.0file gate rather thanintroducing a new hard-coded version, keeping the manifest forward-compatible.
tests/parametric/test_ffe/test_span_enrichment.pyandthe codec/limits are unchanged; product behavior lives in
dd-trace-py(
DataDog/dd-trace-py#18640).Local validation
Built a
cp311wheel fromdd-trace-pybranchleo.romanovsky/ffe-apm-span-enrichment(
ddtrace-4.12.0rc1-cp311-cp311-linux_aarch64.whl), placed it inbinaries/, and ranthe suite on this PR branch:
Result -- all 8 enrichment classes, 18/18 tests passed, 0 skipped:
Classes exercised (all passing):
Test_Span_Enrichment_Serial_IDs,Test_Span_Enrichment_Child_Span_Propagation,Test_Span_Enrichment_Max_Serial_IDs,Test_Span_Enrichment_Default_Fallback,Test_Span_Enrichment_Max_Subjects,Test_Span_Enrichment_Max_Experiments_Per_Subject,Test_Span_Enrichment_Subjects,Test_Span_Enrichment_Delta_Varint.