feat(dotnet): enable FFE span-enrichment parametric tests#7152
Draft
leoromanovsky wants to merge 2 commits into
Draft
feat(dotnet): enable FFE span-enrichment parametric tests#7152leoromanovsky wants to merge 2 commits into
leoromanovsky wants to merge 2 commits into
Conversation
Enable tests/parametric/test_ffe/test_span_enrichment.py for .NET (flip manifest from missing_feature to >=3.36.0) and wire the parametric app to the Datadog OpenFeature provider: - ApmTestApi.cs: add /ffe/start + /ffe/evaluate; /ffe/evaluate re-activates the caller-supplied root span (Parent = stored span context) so multiple evaluations aggregate ffe_* tags onto the test's real root span and child spans propagate to it. - ApmTestApi.csproj: reference OpenFeature 2.3.0 + Datadog.FeatureFlags.OpenFeature 2.3.0. - Ship the enrichment-aware Datadog.FeatureFlags.OpenFeature 2.3.0 nupkg in the build context and order the local nuget source first; the nuget.org 2.3.0 predates span enrichment and would attach no ffe_* tags. Validated locally: TEST_LIBRARY=dotnet ./run.sh PARAMETRIC -k span_enrichment => 18 passed (dotnet@3.46.0).
Contributor
|
|
|
POST /ffe/evaluate re-activates the caller's root span by starting a transient "ffe.evaluate" child scope. It was created with FinishOnClose=false, so disposing the scope never finished that child; the trace kept a pending open span, the tracer never flushed it, and the test agent received zero traces (all 13 span-enrichment cases failed with "Number (1) of traces not available"). Finish the transient child on dispose — the stored root is unaffected and is still closed later by /trace/span/finish. Also refresh the staged Datadog.FeatureFlags.OpenFeature 2.3.0 nupkg to the build carrying the object/structure runtime-default fix (dd-trace-dotnet#8795) so the parametric client matches the SDK under test.
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
Fan out the FFE APM feature-flag span-enrichment contract (shipped in Node.js via
dd-trace-js#8343, frozen) to the .NET server SDK by enabling the existing frozenparametric suite
tests/parametric/test_ffe/test_span_enrichment.pyfordotnet. With theDD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLEDgate on, each root APM span carriesffe_flags_enc/ffe_subjects_enc/ffe_runtime_defaults, encoded identically across SDKs sobackend/Trino decode and these shared assertions stay in parity.
SDK PR: DataDog/dd-trace-dotnet#8795.
Changes
.NET-scoped only:
manifests/dotnet.yml: fliptests/parametric/test_ffe/test_span_enrichment.pyfrommissing_featureto'>=3.36.0'so the suite runs and must pass.utils/build/docker/dotnet/parametric/Endpoints/ApmTestApi.cs: add/ffe/startand/ffe/evaluate./ffe/evaluatere-activates the caller-supplied root span(
StartActive("ffe.evaluate", { Parent = storedSpan.Context, FinishOnClose = true })) so theOpenFeature
Finallyhook accumulates onto the test's real root span — multiple evaluationsaggregate serial IDs onto one root, and child-span evaluations propagate to the root
(chunk-level tagging). The transient eval span finishes on scope dispose so the trace flushes.
utils/build/docker/dotnet/parametric/ApmTestApi.csproj: referenceOpenFeature 2.3.0+Datadog.FeatureFlags.OpenFeature 2.3.0.utils/build/docker/dotnet/parametric/Dockerfile+nuget.config: ship the enrichment-awareDatadog.FeatureFlags.OpenFeature 2.3.0nupkg in the build context and order the local nugetsource first.
Decisions
Datadog.FeatureFlags.OpenFeature 2.3.0predates span enrichment — it has neither
SpanEnrichmentHooknor theFeatureFlagsSdk.AccumulateSpanEnrichmentCallTarget stub — so restoring it builds a parametricapp that attaches no
ffe_*tags (every assertion fails with zero tags). The enrichment-awarebuild is the same
2.3.0version, so the local nuget source is ordered first to win theversion-tie. Once an enrichment-bearing
Datadog.FeatureFlags.OpenFeatureis published tonuget.org, the shipped nupkg + local-source ordering can be dropped.
landing enrichment on a throwaway root;
Parent = storedSpan.Contextensures aggregation onto thetest-created root.
ffe_*write happens in the auto-instrumentation tracer(
datadog-dotnet-apm-3.46.0) via CallTarget, so the compile-timeDatadog.Tracereference staysthe published
*.Results
Validated locally on
datadog-dotnet-apm-3.46.0(arm64):