fix: skip cold start spans for provisioned concurrency#734
Open
litianningdatadog wants to merge 1 commit intomainfrom
Open
fix: skip cold start spans for provisioned concurrency#734litianningdatadog wants to merge 1 commit intomainfrom
litianningdatadog wants to merge 1 commit intomainfrom
Conversation
With provisioned concurrency, containers are pre-warmed before invocations, causing module load timestamps to be captured minutes (or hours) before the first invocation. This inflates aws.lambda.load span durations to the full pre-warm gap rather than the actual load time. Skip cold start span creation for provisioned-concurrency, consistent with the existing fix for lambda-managed-instances (PR #717). Fixes #723.
c810e8c to
f171b1c
Compare
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?
Skip creating cold start tracing spans when running with provisioned concurrency (
AWS_LAMBDA_INITIALIZATION_TYPE === "provisioned-concurrency") per AWShttps://datadoghq.atlassian.net/browse/SVLS-8541
Motivation
With provisioned concurrency, containers are pre-warmed before invocations are assigned. Module loading timestamps (
rootNodes[].startTime) are captured during the pre-warm phase — potentially minutes or hours before the first invocation. Whenaws.lambda.loadspans are created at invocation time using these stale timestamps, the span duration inflates to the full pre-warm gap rather than the actual module load time.This is the same problem fixed for
lambda-managed-instancesin #717. The fix applies the same pattern: skip cold start spans when the init→invocation gap makes them misleading.Testing Guidelines
Unit tests added for
isProvisionedConcurrency()and the listener guard.Types of Changes
Check all that apply