[SVLS-8582] feat(logs): change default of durable log buffer size from 0 to 5 - #1324
Open
lym953 wants to merge 1 commit into
Open
[SVLS-8582] feat(logs): change default of durable log buffer size from 0 to 5#1324lym953 wants to merge 1 commit into
lym953 wants to merge 1 commit into
Conversation
Durable functions no longer need this env var set to get logs enriched with durable execution context. Non-durable functions are unaffected once the extension learns the function is not durable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
lym953
marked this pull request as ready for review
August 14, 2026 01:28
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Bottlecap’s Lambda configuration to restore the non-zero default for durable-function log buffering (DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZE), so logs can be held briefly to await durable execution context and be enriched when tracer metadata arrives.
Changes:
- Change
LambdaConfigdefaultlambda_durable_function_log_buffer_sizefrom0to5. - Update inline documentation for the config field and the env-var-backed source field to reflect the new default and behavior.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
78
to
+81
| /// Maximum number of request IDs whose logs are held in `held_logs` waiting for durable | ||
| /// execution context. Set to 0 to disable log holding; logs will be flushed immediately | ||
| /// without durable execution context enrichment. Defaults to 0 until the tracer-side | ||
| /// durable execution support is released; set to 50 to re-enable enrichment. | ||
| /// without durable execution context enrichment. Only affects durable functions: once the | ||
| /// extension learns the function is not durable, logs bypass holding regardless of this value. |
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.
Background
DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZEmeans how many logs (in terms of number of invocations) the extension buffers to wait for enrichment. If it's N (which is 5 right now), then the extension holds all logs for up to N invocations, waits for traces for these invocations to be sent from the tracer, then uses the metadata from the traces to enrich the logs.If the function is not a durable function, then the extension holds all logs (for up to N invocations) at cold start. Then, as soon as it receives the
platform.InitStartevent and learns that the function is not a durable function, it releases all held logs and no longer holds logs.Ideally, its default value should be a non-zero value, so the behavior is correct for both durable functions and non-durable functions, i.e.:
Actually, the default was 5 at the beginning. However, when the log holding logic was released, tracer-side changes that adds the necessary metadata to traces had not been released. As a result, the extension never gets the metadata it's waiting for, and some logs are somehow dropped. Therefore, #1239 changes the default back to 0 as a temporary mitigation of this issue.
Now, all the tracer-side changes (
datadog-lambda-js,datadog-lambda-python) have been released, so we can change the default back to 5. The dropped-logs problem won't happen as long as the user uses the latest version for the tracer.Overview
Changes the default of
lambda_durable_function_log_buffer_size(
DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZE) from0to5, so instrumenting a durablefunction no longer requires setting this env var to get logs enriched with durable execution
context.
Testing
cargo test --lib— 541 passed, 0 failedcargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleanNo manual test on a live durable function yet.
Existing integration tests
Non-durable functions — covered. These suites ensures logs for non-durable functions are flushed correctly:
integration-tests/tests/on-demand.test.ts— node/python/java/dotnet, 2 invocations each;asserts the
Hello world!log is retrievable by request ID for both the cold and warminvocation.
integration-tests/tests/lmi.test.ts— Managed Instance mode; asserts logs exist and thatthe
Hello world!log is present.integration-tests/tests/auth.test.ts— assertslogs.length > 0under delegated auth.Durable functions — not covered. However, we have done lots of manual tests using
DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZE == 5and ensured this works well for durable functions.Next steps:
Update onboarding doc saying if extension v100+ is used, then the user doesn't need to set
DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZEto 5 since it's 5 by default.🤖 Partially generated with Claude Code