Skip to content

fix: flush feature flag telemetry at invocation end - #872

Draft
vjfridge wants to merge 1 commit into
DataDog:mainfrom
vjfridge:vickie/FFL-3412/lambda-telemetry-flush
Draft

vjfridge wants to merge 1 commit into
DataDog:mainfrom
vjfridge:vickie/FFL-3412/lambda-telemetry-flush

Conversation

@vjfridge

@vjfridge vjfridge commented Oct 20, 2026 •

Copy link
Copy Markdown

What does this PR do?

Flush pending feature flag evaluation and exposure EVP telemetry through the tracer's versioned internal contract after every invocation, including handler errors and failures in unrelated cleanup. Keep providers and their workers available for warm invocations.

DD_FEATURE_FLAG_FLUSH_TIMEOUT_MS defaults to 500 ms. The wait is capped at remaining invocation time minus a 100 ms safety margin. Older tracers or unused OpenFeature safely skip the capability. Incomplete flushes produce debug diagnostics without replacing the handler's response or original exception.

Motivation

Short invocations can finish before background telemetry flush intervals. Part 2 of FFL-3412, depending on dd-trace-py #21135.

Testing Guidelines

  • 45 wrapper and combined tracer/Lambda tests plus 8 subtests passed on Python 3.11 against the candidate tracer.
  • 44 tests plus 8 subtests passed against the existing published tracer before adding the optional cross-repository test.
  • Black and Flake8 passed for changed Python files.
  • Added a short-invocation smoke handler and deployment/ingestion runbook under tests/integration/FEATURE_FLAG_FLUSH.md.

Additional Notes

Draft pending tracer release coordination and a deployed ingestion test. AWS sandbox credential acquisition returned SSO 403; no deployed smoke test has been completed. Record the first supported published tracer, Lambda library and layer versions together before announcing support. The default layer build must include the tracer capability; this PR intentionally does not invent an unreleased dependency version.

Timeout stops waiting, not the underlying send; delivery remains best effort. This PR is submitted from a personal fork because upstream push access was denied.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

Use the tracer flush contract within the remaining Lambda budget while preserving handler outcomes and warm providers.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-6 <noreply@localhost>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant