Skip to content

chore(layer): drop integrations for runtimes that can't run in Lambda - #903

Merged
purple4reina merged 1 commit into
mainfrom
dilly/layer-drop-non-lambda-integrations
Dec 4, 2026
Merged

purple4reina merged 1 commit into
mainfrom
dilly/layer-drop-non-lambda-integrations

Conversation

@astuyve

@astuyve astuyve commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes these ddtrace integrations from the layer:

  • Azure Functions and Azure Durable Functions
  • Ray and Ray Serve
  • vLLM, plus LLM Observability's vLLM integration

Motivation

None of these can run inside AWS Lambda. Azure Functions is another cloud's function host, Ray is a cluster runtime, and vLLM is a GPU inference server. This is part of keeping the layer under the size check without raising the budget (see #901 and #902).

Ray's __init__ and constants stay: ddtrace/_trace/trace_handlers.py imports ddtrace.contrib.internal.ray.constants at tracer startup. If a user imports one of the removed packages anyway, automatic patching logs that the integration couldn't be enabled and carries on (raise_errors=False).

Results (Python 3.15, amd64, dd-trace-py main pipeline 157654945)

unzipped zipped
main 25,466 kB 10,113 kB
this PR 25,226 kB (−240 kB) 10,021 kB

Testing Guidelines

  • Built the layer with UPSTREAM_PIPELINE_ID=157654945 PYTHON_VERSION=3.15 ARCH=amd64 ./scripts/build_layers.sh and ran check_layer_size.sh (numbers above).
  • In public.ecr.aws/sam/build-python3.15:1, with DD_LLMOBS_ENABLED, DD_APPSEC_ENABLED, DD_PROFILING_ENABLED and DD_EXCEPTION_REPLAY_ENABLED all on, datadog_lambda.handler emitted the same spans as main (aws.lambda, aws.lambda.load, aws.lambda.import, sqlite.query). It logged nothing new.
  • Imported every ddtrace.* module in the layer and compared failures against main. The only differences are the removed modules themselves, so nothing left in the layer imports what this PR removes.

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)

🤖 Generated with Claude Code

Remove ddtrace's Azure Functions, Azure Durable Functions, Ray, Ray Serve and
vLLM integrations (and the LLM Observability vLLM pieces) from the layer.
None of these runtimes run inside AWS Lambda. Ray's __init__ and constants
stay because the tracer imports them at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Static import checks support the integration removals while preserving Ray’s tracer-startup modules. A full Lambda layer build was not independently validated.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 3494d98

@purple4reina purple4reina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has minimal impact on package size, but still worth it.

@purple4reina
purple4reina merged commit 5180c45 into main Dec 4, 2026
120 checks passed
@purple4reina
purple4reina deleted the dilly/layer-drop-non-lambda-integrations branch December 4, 2026 20:03
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.

2 participants