Repository navigation
fix: flush feature flag telemetry at the end of each invocation - #878
Open
purple4reina wants to merge 2 commits into
Open
purple4reina wants to merge 2 commits into
purple4reina wants to merge 2 commits into
Conversation
dd-trace sends feature flag evaluations and exposures on a 10 second unref'd timer, which never fires before Lambda freezes the sandbox. Publish dd-trace's ffe:writers:flush channel when the invocation completes, before the awaited metric flushes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
purple4reina
marked this pull request as ready for review
December 4, 2026 22:27
There was a problem hiding this comment.
More details
The feature-flag flush starts before the awaited metric and extension flushes. Delivery remains best-effort because dd-trace provides no awaitable flush; deployed Lambda delivery remains unverified.
🤖 Bits Code Review · Commit 06d0439
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.
What does this PR do?
Publishes dd-trace's
ffe:writers:flushdiagnostics channel at the end of each invocation, right after the existingflushMetrics()call. dd-trace's exposure and flag-evaluation writers subscribe to this channel and send their buffers when it publishes.Motivation
dd-trace sends feature flag telemetry on a 10 second
unref()'d timer. Lambda freezes the sandbox as soon as the handler returns, so the timer never fires andfeature_flag.evaluationsstays at zero. A customer confirmed this with Extension v104 and layer 144.Jira: https://datadoghq.atlassian.net/browse/APMSVLS-730
Additional Notes
try/catch:diagnostics_channelnever throws subscriber errors to the publisher. With an older tracer, or with feature flags off, nothing subscribes and the publish does nothing.Types of Changes
Check all that apply
🤖 Generated with Claude Code