Skip to content

fix: skip cold start spans for provisioned concurrency#734

Open
litianningdatadog wants to merge 1 commit intomainfrom
tianning.li/SVLS-8541-inflated-aws.lambda.load
Open

fix: skip cold start spans for provisioned concurrency#734
litianningdatadog wants to merge 1 commit intomainfrom
tianning.li/SVLS-8541-inflated-aws.lambda.load

Conversation

@litianningdatadog
Copy link

@litianningdatadog litianningdatadog commented Feb 25, 2026

What does this PR do?

Skip creating cold start tracing spans when running with provisioned concurrency (AWS_LAMBDA_INITIALIZATION_TYPE === "provisioned-concurrency") per AWS

https://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. When aws.lambda.load spans 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-instances in #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

  • 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)

@litianningdatadog litianningdatadog requested review from a team as code owners February 25, 2026 16:48
@litianningdatadog litianningdatadog marked this pull request as draft February 25, 2026 16:54
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.
@litianningdatadog litianningdatadog force-pushed the tianning.li/SVLS-8541-inflated-aws.lambda.load branch from c810e8c to f171b1c Compare February 25, 2026 17:00
@litianningdatadog litianningdatadog marked this pull request as ready for review February 25, 2026 18:37
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