Repository navigation
Conversation
The provider now deduplicates exposures itself and sends them from a finally-stage hook instead of at resolution. Resolution only checks the new provider cache and stamps __dd_exposure_cache_hit in the flag metadata. The hook records the exposure and sends it when the allocation logs exposures, the subject is not already exposed, and the evaluation has no error, so an evaluation that an application hook fails no longer sends an exposure or marks the subject as exposed. The agent's writer keeps its own cache for now, because an older provider still sends every evaluation.
Test each condition under which the exposure hook sends nothing, and list the exposure cache's key and value classes as POJOs excluded from coverage verification, as the writer's cache classes are.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
This branch has not been deployed
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.
Warning
NOT READY FOR REVIEW YET
What Does This Do
ExposureLoggingHook, that runs at the OpenFeature finally stage.ExposureDeduplicationCache, keyed on (flag, subject). Resolution only checks it, and stamps__dd_exposure_cache_hitin the flag metadata.__dd_do_logand__dd_split_serial_id, not only when span enrichment is on.Motivation
Today the provider sends the exposure while it resolves the flag, before any hook runs. OpenFeature runs provider hooks first, so an application
afterhook can still throw and give the application the default value. The exposure was already sent in that case. At the finally stage the result is final, so a failed evaluation sends nothing and the next evaluation sends the exposure.The provider cache is also the base for a customer exposure hook in a later change, so that Datadog and the customer use the same exposure decision.
Additional Notes
dd-openfeature) and the agent (dd-java-agent) ship separately, and an older provider still sends every evaluation. The provider cache has the same size as the writer's cache (65,536 entries), so both drop the same repeats. The writer's cache will be removed after the feature-flagging code moves out ofdd-java-agent.Providerevaluation methods directly runs no hooks, so it sends no exposures.Jira ticket: EX-3800