Description
What is the problem you are solving?
Currently, enabling tracing and application signals in AWS SAM for Lambda functions requires developers to manually add the AWS Distro for OpenTelemetry (ADOT) Lambda layers in their SAM templates. This process is cumbersome and error-prone because the Layer ARNs are tightly coupled to the AWS region, account ID, and version. Whenever any of these parameters change (for example, when deploying to a new region or updating the layer version), every affected template must be manually updated. This increases maintenance overhead and risk of misconfiguration, impacting the ability to consistently capture tracing and application signals.
How do developers work around this problem today?
Today, developers must:
Manually look up the correct ADOT Lambda layer ARN for each region and runtime.
Add these ARNs to the Layers
property of each relevant AWS::Serverless::Function resource in their SAM templates.
Update all templates when a new layer version is released or when deploying to a new region.
This process is usually done by referring to documentation or scripts, and is repeated by every developer or team enabling tracing.
Proposed solution
I propose adding a new attribute (for example,
Tracing: ActiveWithADOT
) or an option under the existing
Tracing property for AWS::Serverless::Function. When this attribute is set, SAM will automatically attach the appropriate ADOT Lambda layer for the function’s runtime and deployment region, without requiring manual ARN specification.
Example Usage:
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
Tracing: ActiveWithADOT
With this, SAM will:
Resolve and attach the correct ADOT layer for the function’s runtime and deployment region.
Handle updates to layer versions automatically as new releases are adopted by SAM.
Ensure application signals are enabled without manual layer management.