From 28794e138aab63def2e812a2d904f47582ae1cce Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 12:28:57 +0200 Subject: [PATCH 1/7] docs: clarify that layer version may not be 1 Suggest to always check the ARNs listed in the release notes instead of assuming that the layer version will always be 1. --- docs/reference/lambda-support.md | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index ada302cd6..c29d07791 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -8,8 +8,8 @@ applies_to: product: apm_agent_python: ga sub: - apm-lambda-ext-v: ver-1-5-7 - apm-python-v: ver-6-23-0 + apm-lambda-ext-v: ver-1-6-0 + apm-python-v: ver-6-24-0 --- # Monitoring AWS Lambda Python Functions [lambda-support] @@ -46,9 +46,11 @@ To add the layers to your Lambda function through the AWS Management Console: * APM agent layer: ``` - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:1 <1> + arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <1> ``` - 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. + 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is + usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get + the exact one. ![image of choosing a layer in AWS Console](images/choose-a-layer.png "") 5. Click the *Add* button @@ -60,10 +62,12 @@ To add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent through the AW ```bash aws lambda update-function-configuration --function-name yourLambdaFunctionName \ --layers arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 \ <1> -arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:1 <2> +arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is + usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get + the exact one. :::::: ::::::{tab-item} SAM @@ -78,11 +82,13 @@ Resources: ... Layers: - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> - - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:1 <2> + - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> ... ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is + usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get + the exact one. :::::: ::::::{tab-item} Serverless @@ -95,11 +101,13 @@ functions: handler: ... layers: - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> - - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:1 <2> + - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> ... ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is + usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get + the exact one. :::::: ::::::{tab-item} Terraform @@ -109,11 +117,13 @@ To add the{{apm-lambda-ext}} and the APM agent to your function add the ARNs to ... resource "aws_lambda_function" "your_lambda_function" { ... - layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:1"] <1> + layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION}"] <1> } ... ``` -1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. +1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is + usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get + the exact one. :::::: ::::::{tab-item} Container Image From 5adecd0e4917d920ec5faa79a91fce8e3e6ca77e Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:05:35 +0200 Subject: [PATCH 2/7] Use subsitution for lambda layer version Also fix it for code blocks --- docs/reference/lambda-support.md | 43 +++++++++++++------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index c29d07791..248ae63bd 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -10,6 +10,7 @@ applies_to: sub: apm-lambda-ext-v: ver-1-6-0 apm-python-v: ver-6-24-0 + apm-python-layer-v: 3 --- # Monitoring AWS Lambda Python Functions [lambda-support] @@ -39,18 +40,16 @@ To add the layers to your Lambda function through the AWS Management Console: 3. Choose the *Specify an ARN* radio button 4. Copy and paste the following ARNs of the {{apm-lambda-ext}} layer and the APM agent layer in the *Specify an ARN* text input: * APM Extension layer: - ``` + ```subs=true arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. * APM agent layer: + ```subs=true + arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <1> ``` - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <1> - ``` - 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is - usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get - the exact one. + 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. ![image of choosing a layer in AWS Console](images/choose-a-layer.png "") 5. Click the *Add* button @@ -59,21 +58,19 @@ To add the layers to your Lambda function through the AWS Management Console: ::::::{tab-item} AWS CLI To add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent through the AWS command line interface execute the following command: -```bash +```bash subs=true aws lambda update-function-configuration --function-name yourLambdaFunctionName \ --layers arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 \ <1> -arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> +arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <2> ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is - usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get - the exact one. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. :::::: ::::::{tab-item} SAM In your SAM `template.yml` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent as follows: -```yaml +```yaml subs=true ... Resources: yourLambdaFunction: @@ -82,48 +79,42 @@ Resources: ... Layers: - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> - - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> + - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <2> ... ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is - usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get - the exact one. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. :::::: ::::::{tab-item} Serverless In your `serverless.yml` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent to your function as follows: -```yaml +```yaml subs=true ... functions: yourLambdaFunction: handler: ... layers: - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> - - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <2> + - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <2> ... ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. -2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is - usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get - the exact one. +2. Replace `{AWS_REGION}` with the AWS region of your Lambda function. :::::: ::::::{tab-item} Terraform To add the{{apm-lambda-ext}} and the APM agent to your function add the ARNs to the `layers` property in your Terraform file: -```yaml +```yaml subs=true ... resource "aws_lambda_function" "your_lambda_function" { ... - layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION}"] <1> + layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}}"] <1> } ... ``` -1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is - usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get - the exact one. +1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. :::::: ::::::{tab-item} Container Image From 12d4cab992ce8e1a6c15a13cdb13825bb3f0abcf Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:12:24 +0200 Subject: [PATCH 3/7] Fix warnings --- docs/reference/lambda-support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index 248ae63bd..f5489a3ff 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -40,13 +40,13 @@ To add the layers to your Lambda function through the AWS Management Console: 3. Choose the *Specify an ARN* radio button 4. Copy and paste the following ARNs of the {{apm-lambda-ext}} layer and the APM agent layer in the *Specify an ARN* text input: * APM Extension layer: - ```subs=true + ``` subs=true arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. * APM agent layer: - ```subs=true + ``` subs=true arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <1> ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. From 90ee58a74d0daa90685f7f349ff58035d1b38a8b Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:27:57 +0200 Subject: [PATCH 4/7] Try inline blocks --- docs/reference/lambda-support.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index f5489a3ff..3121878a2 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -40,15 +40,11 @@ To add the layers to your Lambda function through the AWS Management Console: 3. Choose the *Specify an ARN* radio button 4. Copy and paste the following ARNs of the {{apm-lambda-ext}} layer and the APM agent layer in the *Specify an ARN* text input: * APM Extension layer: - ``` subs=true - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> - ``` + {subs}`arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1` <1> 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. * APM agent layer: - ``` subs=true - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <1> - ``` + {subs}`arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}}` <1> 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. ![image of choosing a layer in AWS Console](images/choose-a-layer.png "") From 5b8cbcbfa64be25592ed3d56e3f3b073d2b5367a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:34:53 +0200 Subject: [PATCH 5/7] Try with bash code block --- docs/reference/lambda-support.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index 3121878a2..354556870 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -40,11 +40,15 @@ To add the layers to your Lambda function through the AWS Management Console: 3. Choose the *Specify an ARN* radio button 4. Copy and paste the following ARNs of the {{apm-lambda-ext}} layer and the APM agent layer in the *Specify an ARN* text input: * APM Extension layer: - {subs}`arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1` <1> + ```bash subs=true + arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1> + ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture. * APM agent layer: - {subs}`arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}}` <1> + ```bash subs=true + arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <1> + ``` 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. ![image of choosing a layer in AWS Console](images/choose-a-layer.png "") From 4d5245d55cd3ea3556b1051ad47397e7d09b140d Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:41:31 +0200 Subject: [PATCH 6/7] Looks like it's subs and not sub --- docs/reference/lambda-support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index 354556870..5b05c7cd1 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -7,7 +7,7 @@ applies_to: observability: product: apm_agent_python: ga -sub: +subs: apm-lambda-ext-v: ver-1-6-0 apm-python-v: ver-6-24-0 apm-python-layer-v: 3 From 247f521af0aa53ccc7eaef2116e3c83d5d270f05 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 19 Sep 2025 17:46:43 +0200 Subject: [PATCH 7/7] Not it's sub --- docs/reference/lambda-support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/lambda-support.md b/docs/reference/lambda-support.md index 5b05c7cd1..354556870 100644 --- a/docs/reference/lambda-support.md +++ b/docs/reference/lambda-support.md @@ -7,7 +7,7 @@ applies_to: observability: product: apm_agent_python: ga -subs: +sub: apm-lambda-ext-v: ver-1-6-0 apm-python-v: ver-6-24-0 apm-python-layer-v: 3