Add feature flag span enrichment system tests#6828
Draft
Conversation
Contributor
|
|
dfe6168 to
537d098
Compare
sameerank
commented
Apr 29, 2026
Contributor
Author
There was a problem hiding this comment.
File name enforced by CI rule
Comment on lines
+6
to
+7
| 3. Max serial ID limit (128) | ||
| 4. Max subjects limit (25) |
Contributor
Author
There was a problem hiding this comment.
I just picked these numbers randomly, provisionally so I could write tests. What limits should we actually use?
537d098 to
7370a3b
Compare
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 2fa1e11 | Docs | Datadog PR Page | Give us feedback! |
e63833a to
12da3a9
Compare
Add parametric tests for feature flag APM span enrichment: - Test_Span_Enrichment_Serial_IDs: verify multiple flag evaluations combine serial IDs correctly in feature_flags_encoded using delta varint encoding - Test_Span_Enrichment_Child_Span_Propagation: verify flag evaluations in child spans propagate to root span - Test_Span_Enrichment_Max_Serial_IDs: verify 128 serial ID limit enforcement - Test_Span_Enrichment_Max_Subjects: verify 25 subject limit enforcement - Test_Span_Enrichment_Default_Fallback: verify feature_flags tag with coded-default prefix when flag not found in UFC, including 64 char truncation - Test_Span_Enrichment_Subjects: verify feature_flag_subjects_encoded behavior based on doLog flag, including SHA256 hashing of targeting keys - Test_Span_Enrichment_Delta_Varint: unit tests for encoding utilities Add utilities for delta varint encoding/decoding and SHA256 targeting key hashing. Mark tests as missing_feature in all library manifests.
12da3a9 to
2fa1e11
Compare
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
Add system tests for feature flag event enrichment (Feature ID 551) that validates APM span chunk tags:
ffe_flags_enc: base64(delta varint encoded serial IDs) for all evaluated flagsffe_subjects_enc: subject hash → serial IDs mapping (when doLog=true)ffe_defaults: flag name → "coded-default: " mapping (when flag not found in UFC)Example span tags:
{ "ffe_defaults": { "flag-not-found": "coded-default: my-default-value" }, "ffe_flags_enc": "ZAgUAg==", "ffe_subjects_enc": { "4208f8d8017ce252df51f51e8c5b558a": "ZA==", "8e526f09f0531278f8bd60f224adf60a": "bAg=" } }In this example:
"ZAgUAg=="decodes to serial IDs [100, 108, 128, 130]JIRA: https://datadoghq.atlassian.net/browse/FFL-2201
Changes
New test files (consolidated in parametric):
tests/parametric/test_ffe/test_span_enrichment.py- All span enrichment teststests/parametric/test_ffe/span-enrichment-flags.json- UFC fixture with serialId in splitstests/parametric/test_ffe/utils.py- Delta varint encoding/decoding utilities + SHA256 hashingTest coverage:
Test_Span_Enrichment_Serial_IDstest_multiple_flags_serial_ids_combinedTest_Span_Enrichment_Child_Span_Propagationtest_child_span_flag_evaluation_propagates_to_rootTest_Span_Enrichment_Max_Serial_IDstest_max_128_serial_ids_enforcedTest_Span_Enrichment_Default_Fallbacktest_flag_not_found_adds_ffe_defaults_tagTest_Span_Enrichment_Default_Fallbacktest_ffe_defaults_value_truncated_at_64_charsTest_Span_Enrichment_Default_Fallbacktest_max_5_flag_keys_in_ffe_defaultsTest_Span_Enrichment_Max_Subjectstest_max_25_subjects_enforcedTest_Span_Enrichment_Subjectstest_do_log_true_adds_subjects_encodedTest_Span_Enrichment_Subjectstest_do_log_false_no_subjects_encodedTest_Span_Enrichment_Subjectstest_subjects_encoded_uses_sha256_hashed_targeting_keyTest_Span_Enrichment_Delta_VarintManifest updates:
missing_featureentries to language manifests (tests written before tracer implementation)Why parametric only (no E2E)?
test_exposures.pyandtest_dynamic_evaluation.pyWorkflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present