Repository navigation
Add debug diagnostics to the dd-openfeature SDK - #13092
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@AlexeyKuznetsov-DD thanks for the review on #12897. I closed that PR because #12844 moved the provider code it logged from into the
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60e55aee92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🟢 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c9001a7aa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
A throwing DEBUG logging backend can interrupt shutdown before workers and configuration delivery are stopped. Shutdown flags are already set, preventing subsequent attempts from completing cleanup.
🤖 Bits Code Review · Commit 5c9001a
There was a problem hiding this comment.
A throwing DEBUG logging backend can interrupt runtime shutdown cleanup and permanently stop exposure delivery. Moving shutdown logs after each component’s signal still leaves the remaining runtime cleanup vulnerable.
🤖 Bits Code Review · Commit 3bd2246
Help onboarding by logging what the dd-openfeature SDK does, at DEBUG. Provider: log the lifecycle (initializing, ready, timed out, recovered, configuration changed or unavailable, shutting down) and why an exposure is suppressed (at TRACE). Log only the type of an initialization failure, since its message can echo the endpoint URL. Evaluations: log the raw outcome of every evaluation, including the evaluation context and any personal data in it, only when DD_TRACE_DEBUG is on and the application logger allows DEBUG. Each value is rendered within 1024 characters and a depth limit, with cycle detection, so that a cyclic or very deep value cannot overflow the stack of the evaluating thread. Say so at INFO, through the logger of the hook, when the hook is registered. When only DD_TRACE_DEBUG is on, warn which logger category to enable. Configuration delivery: log the runtime start-up (source, transport, enabled pipelines) and every configuration applied or removed. For agentless delivery, log the endpoint without its query, applied and unchanged responses, retries with their delay, and that a malformed or empty payload retains the current configuration. For Remote Configuration, log the subscription and malformed documents. Event pipelines: log the exposure flush lifecycle (with the failure reason and the number of dropped exposures), the exposures dropped by a full queue (counted on the application thread and reported once per flush, so the producer never logs), the shutdown requests, and delivered flag evaluation flushes. The module has no SLF4J 2 compatible logging backend in tests, so add a test-only SLF4J provider that captures events. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Address the review of the SDK diagnostics. Log only the scheme, host and port of the agentless endpoint when the configuration source starts. The path of a custom base URL can carry a credential, as its userinfo and query can. Log that the provider shut down after its cleanup, so that a failing logging backend cannot keep the metrics and the evaluator from being shut down. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A debug log that ran after a state flag was set but before the work it describes could, with a failing logging backend, skip that work, and the flag then kept it from being retried. Log after the work instead: - apply a configuration, or its removal, and notify the listeners before logging it; - signal the exposure and flag evaluation workers before logging the shutdown request; - cancel the polling and shut the executor down before logging that the agentless source stopped; - log that the agentless source started after its first poll and the scheduling of the next ones. The provider lifecycle logs cannot be moved after their work without restructuring the initialization, so they are contained instead: a log that fails no longer turns a successful initialization into an error or skips an event. Each path has a test that makes the logging backend throw and checks the work still happened. Add a test accessor to the flag evaluation pipeline, like the exposure pipeline has. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The debug renderer read a Structure through keySet() and getValue(). For an immutable structure these copy every key and deep-clone the value, so the whole context was copied before the budget applied. Walk asUnmodifiableMap() instead, and cover immutable contexts. Environment: Datadog workspace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3bd2246 to
a244377
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Build pipeline has failing jobs for b060e05: What to do next?
DetailsSince those jobs are not marked as being allowed to fail, the pipeline will most likely fail. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|

What Does This Do
Adds DEBUG diagnostics to the
dd-openfeatureSDK. Stacked on #13091, which adds the agent-side logs.Provider. Logs the lifecycle (initializing, ready, timed out, recovered, configuration changed or unavailable, shutting down). A failed initialization logs only the exception type, because the message of a configuration error can echo the endpoint URL.
Evaluations.
DebugLoggingHooklogs the raw outcome of every evaluation: flag, context, default and resolved values, variant, reason, error and metadata. It is registered only when bothDD_TRACE_DEBUGand the application's logger allow DEBUG, and the raw context can carry personal data, so:DD_TRACE_DEBUGis on, one WARN names the logger category to enable;The reasons an exposure is not sent are logged at TRACE.
Configuration delivery. Logs the runtime start-up (source, event transport, which pipelines are enabled) and every configuration applied or removed. For agentless delivery: the endpoint without its userinfo or query, applied and unchanged (HTTP 304) responses, each retry with its delay, and that a malformed or empty payload retains the current configuration. For Remote Configuration: the subscription and malformed documents.
Event pipelines. Logs the exposure flush (starting, delivered, or failed with the reason and the batch size), the shutdown requests, and delivered flag evaluation flushes. On master a full exposure queue dropped exposures without a log. The producer, an application thread, still does not log: it counts the drops and the serializer reports them once per flush.
Tests. The module has no SLF4J 2 compatible logging backend in its tests, so its loggers were no-ops. A small test-only SLF4J provider (
testlog/CapturingServiceProvider) captures events so the new tests can assert the logs.Motivation
Onboarding diagnostics for feature flags (FFL-3401), following the SDK logging checklist.
Additional Notes
This also addresses the review of #12897, which targeted the provider code that #12844 moved into this module:
catch (Throwable): the hook catchesRuntimeException | LinkageErroronly.logback-classictest dependency: none is added.Validation:
dd-openfeaturetests, Spotless, forbidden-APIs, SpotBugs and Javadoc pass, as do thefeature-flagging-libandfeature-flagging-agenttests.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: FFL-3401
🤖 Generated with Claude Code