feat(parametric/java): enable FFE span-enrichment scenario for Java#7150
Draft
leoromanovsky wants to merge 1 commit into
Draft
feat(parametric/java): enable FFE span-enrichment scenario for Java#7150leoromanovsky wants to merge 1 commit into
leoromanovsky wants to merge 1 commit into
Conversation
Enable tests/parametric/test_ffe/test_span_enrichment.py for the Java tracer (DataDog/dd-trace-java#11658), which adds FFE APM feature-flag span enrichment behind DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED. - FeatureFlagEvaluatorController: re-activate the caller-supplied root span (span_id) around the OpenFeature evaluation so the ffe_* tags land on the test's root span. span_id arrives as a decimal string and is resolved via the OpenTracing registry (DDSpanId.from); unknown/unparsable ids skip activation and never throw. - manifests/java.yml: declare the enrichment suite at v1.64.0 (the release that ships the feature).
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
DataDog/dd-trace-java#11658 adds
FFE APM feature-flag span enrichment to the Java tracer (experimental, gated behind
DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED): the root APM span carriesffe_flags_enc/ffe_subjects_enc/ffe_runtime_defaultstags, encoded against theFROZEN contract (
dd-trace-js#8343). The parametric suitetests/parametric/test_ffe/test_span_enrichment.pyalready exists and is frozen; Java iscurrently marked
missing_feature. This PR enables it for Java.Changes
manifests/java.yml— declaretests/parametric/test_ffe/test_span_enrichment.pyat
v1.64.0(the release that ships the feature), replacingmissing_feature.FeatureFlagEvaluatorController.java(parametric test client) — re-activate thecaller-supplied root span around the OpenFeature evaluation so the
ffe_*tags land onthe test's root span. The client sends
span_idas a decimal string; it is resolved viathe OpenTracing registry (
OpenTracingController.getSpan(DDSpanId.from(...))). Anunknown / missing / unparsable
span_idleaves the target null → activation is skippedand never throws. The eval switch is extracted into an
evaluate(...)helper so it canrun inside or outside the re-activated scope.
The frozen test, fixture (
span-enrichment-flags.json), and the Python client-sideffe_evaluate(..., span_id=...)plumbing already exist onmain, so the diff is limitedto the manifest line and the Java parametric controller.
Decisions
v1.64.0(release) vs. a SNAPSHOT declaration — the manifest declares the releaseversion the feature ships in, matching the existing FFE convention
(
test_dynamic_evaluation.py: v1.56.0). Validated locally against a1.64.0-SNAPSHOTbuild of the SDK branch.ffe_*tags are attached to the rootspan of the active trace at flag-evaluation time. The parametric test starts a span and
passes its
span_idto/ffe/evaluate; without re-activating that span around the eval,the evaluation runs outside the test's trace and the tags have no root span to attach to.
Validation
The frozen suite (18 cases) was run locally against a
dd-java-agent 1.64.0-SNAPSHOT(+ custom
dd-trace-api/dd-openfeature) built from dd-trace-java#11658(HEAD
8491123c5d):All 18 cases execute and pass — delta-varint codec,
ffe_flags_encserial-ID combinationffe_subjects_encSHA256-hashed targeting keyswith doLog gating + 10-subject / 20-experiments-per-subject caps, and
ffe_runtime_defaultsfallback + 64-char truncation + 5-key cap.