Repository navigation
Buffer telemetry for 25 ms, Lambda's minimum - #8
Merged
Merged
Conversation
The extension waits for Lambda's telemetry hand-off at the end of every invocation, and Lambda hands the last batch over only when TIMEOUT_MS expires, so the window is added to every invocation. 25 ms keeps that wait short; Better Stack still gets one request per invocation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Lowers the default
TIMEOUT_MSfrom 1000 to 25, Lambda's minimum. Proposed on top of #5 as its own change, so its cost and benefit can be judged separately.TIMEOUT_MSis how long Lambda buffers telemetry before it hands it to the extension over the sandbox's loopback. It is not how often the extension sends to Better Stack: that stays one request per invocation, at its end. Since #5 the extension waits for that hand-off at the end of every invocation, and Lambda only hands over the last batch, withplatform.runtimeDone, when the buffering window closes. So the window is added to every invocation's duration, whatever the function logged. Measured in the E2E, nodejs22.x x86_64, a handler that logs two lines:TIMEOUT_MS1000TIMEOUT_MS25The cost of 25 ms: a function that logs faster than 40 lines per second gets a hand-off every 25 ms instead of every second, at most 40 per second, each a small request on the loopback. Functions that log less often see no difference, since a batch with a single line waits for the window either way. Anyone who prefers fewer hand-offs in long, chatty invocations sets
TIMEOUT_MShigher, at that much more time per invocation.🤖 Generated with Claude Code