Repository navigation
feat(ffe): evaluate dependent flags with prerequisite telemetry #2748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hhan2024
wants to merge
7
commits into
main
Choose a base branch
from
helen/ffe-dependent-flags-evaluator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
deca0cc
feat(remote-config): register dependent flag variant-key capability
hhan2024 adec0d1
feat(ffe): evaluate dependent flags with prerequisite telemetry
hhan2024 aec2115
perf(ffe): keep independent flag evaluation free of dependency tracking
hhan2024 b54827e
chore(ffe): align benchmark lint configuration with main
hhan2024 9c6d085
chore(ffe): separate benchmark registration from removed lint section
hhan2024 1cf7834
Merge branch 'main' into helen/ffe-dependent-flags-evaluator
hhan2024 983b4b0
fix(ffe): defer dependency validation and align JS behavior
hhan2024 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use criterion::{Criterion, criterion_group, criterion_main}; | ||
| use libdd_ffe::rules_based::{ | ||
| Configuration, EvaluationContext, ExpectedFlagType, UniversalFlagConfig, | ||
| }; | ||
| use serde_json::json; | ||
| use std::hint::black_box; | ||
|
|
||
| fn bench_dependencies(c: &mut Criterion) { | ||
| let parent = json!({"key":"parent","enabled":true,"variationType":"BOOLEAN", | ||
| "variations":{"on":{"key":"on","value":true}}, | ||
| "allocations":[{"key":"default","splits":[{"shards":[],"variationKey":"on"}]}]}); | ||
| for (name, repeated) in [ | ||
| ("legacy", 0), | ||
| ("one_prerequisite", 1), | ||
| ("memoized_16_references", 16), | ||
| ] { | ||
| let mut root = parent.clone(); | ||
| root["key"] = json!("root"); | ||
| if repeated > 0 { | ||
| root["allocations"][0]["rules"] = json!([{"conditions": (0..repeated).map(|_| | ||
| json!({"flagEvaluation":{"key":"parent"},"operator":"ONE_OF","value":["on"]}) | ||
| ).collect::<Vec<_>>()}]); | ||
| } | ||
| let config = Configuration::from_server_response( | ||
| UniversalFlagConfig::from_json( | ||
| serde_json::to_vec( | ||
| &json!({"createdAt":"2026-10-28T00:00:00Z","environment":{"name":"test"}, | ||
| "flags":{"root":root,"parent":parent}}), | ||
| ) | ||
| .unwrap(), | ||
| ) | ||
| .unwrap(), | ||
| ); | ||
| let context = EvaluationContext::new(Some("subject".into()), Default::default()); | ||
| let now = chrono::Utc::now(); | ||
| c.bench_function(&format!("dependent_flags/{name}"), |b| { | ||
| b.iter(|| { | ||
| black_box(config.eval_flag( | ||
| black_box("root"), | ||
| black_box(&context), | ||
| ExpectedFlagType::Boolean, | ||
| now, | ||
| )) | ||
| .unwrap() | ||
| }) | ||
| }); | ||
| } | ||
| } | ||
| criterion_group!(benches, bench_dependencies); | ||
| criterion_main!(benches); |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Comment from Claude working with Aaron Silverman:
Reminder: release order for the dependent-flags stack.
main, merge, and release libdatadog.dependent-flag-variant-key-v1.