From 86210bb4e8131acb27244c2090789e4804857ae7 Mon Sep 17 00:00:00 2001 From: bardabun Date: Mon, 9 Dec 2024 17:00:45 +0200 Subject: [PATCH] Update Node.js layer docs to link to latest ARN --- .../shipping/AWS/aws-lambda-extension-node.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/docs/shipping/AWS/aws-lambda-extension-node.md b/docs/shipping/AWS/aws-lambda-extension-node.md index 939ce998..b72f9888 100644 --- a/docs/shipping/AWS/aws-lambda-extension-node.md +++ b/docs/shipping/AWS/aws-lambda-extension-node.md @@ -2,9 +2,9 @@ id: Lambda-extension-node title: Traces from Node.js on AWS Lambda using OpenTelemetry overview: This integration to auto-instrument your Node.js application running on AWS Lambda and send the traces to your Logz.io account. -product: ['tracing'] -os: ['windows', 'linux'] -filters: ['AWS', 'Compute'] +product: ["tracing"] +os: ["windows", "linux"] +filters: ["AWS", "Compute"] logo: https://logzbucket.s3.eu-west-1.amazonaws.com/logz-docs/shipper-logos/AWS-Lambda.svg logs_dashboards: [] logs_alerts: [] @@ -18,17 +18,17 @@ Deploy this integration to auto-instrument your Node.js application running on A :::note This integration only works for the following AWS regions: `us-east-1`, `us-east-2`, `us-west-1`, `us-west-2`, - `ap-south-1`, `ap-northeast-3`, `ap-northeast-2`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1`, - `eu-central-1`, `eu-west-1`, `eu-west-2`, `eu-west-3`, `eu-north-1`, - `sa-east-1`, - `ca-central-1`. +`ap-south-1`, `ap-northeast-3`, `ap-northeast-2`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1`, +`eu-central-1`, `eu-west-1`, `eu-west-2`, `eu-west-3`, `eu-north-1`, +`sa-east-1`, +`ca-central-1`. ::: **Before you begin, you'll need**: - -* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -* Configured [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) -* A Lambda function with a Node.js application that is not yet instrumented. + +- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) +- Configured [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) +- A Lambda function with a Node.js application that is not yet instrumented. :::note Using `aws lambda update-function-configuration` with `--layers` replaces all existing layers with the specified ARN(s). To add a new layer without removing existing ones, include all desired layer ARNs in the command, both new and previously attached. @@ -42,13 +42,12 @@ Adding environmental variables using the AWS CLI commands below, will overwrite This integration uses OpenTelemetry Collector Contrib, not the OpenTelemetry Collector Core. ::: - -#### Add the OpenTelemetry collector layer to your Lambda function +#### Add the OpenTelemetry collector layer to your Lambda function This layer contains the OpenTelemetry collector that will capture data from your application. ```shell -aws lambda update-function-configuration --function-name <> --layers arn:aws:lambda:<>:486140753397:layer:logzio-opentelemetry-collector-<>-0_1_0:1 +aws lambda update-function-configuration --function-name <> --layers arn:aws:lambda:<>:486140753397:layer:logzio-opentelemetry-collector-<>:<> ``` Replace `<>` with the name of your Lambda function running the Node.js application. @@ -57,14 +56,14 @@ Replace `<>` with the code of your AWS regions, e.g. `us-east-1 Replace `<>` with the target architecture for your Lambda function, either `arm64` for ARM-based applications or `amd64` (also known as x86_64) for traditional 64-bit Intel/AMD applications. +Replace `<>` with the latest version of the layer. You can find the latest version number by visiting the [Logz.io OpenTelemetry Lambda Releases page.](https://github.com/logzio/opentelemetry-lambda/releases) #### Create a configuration file for the OpenTelemetry collector - -By default, the OpenTelemetry collector layer exports data to the Lambda console. To customize the collector configuration, you need to add a `collector.yaml` to your function and specifiy its location via the `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` environment variable. +By default, the OpenTelemetry collector layer exports data to the Lambda console. To customize the collector configuration, you need to add a `collector.yaml` to your function and specifiy its location via the `OPENTELEMETRY_COLLECTOR_CONFIG_URI` environment variable. The `collector.yaml` file will have the following configuration: - + ```yaml receivers: otlp: @@ -86,18 +85,15 @@ service: exporters: [logzio/traces] ``` - -{@include: ../../_include/tracing-shipping/replace-tracing-token.html} -{@include: ../../_include/tracing-shipping/tail-sampling.md} - +{@include: ../../\_include/tracing-shipping/replace-tracing-token.html} +{@include: ../../\_include/tracing-shipping/tail-sampling.md} #### Direct the OpenTelemetry collector to the configuration file - -Add `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` variable to direct the OpenTelemetry collector to the configuration file: +Add `OPENTELEMETRY_COLLECTOR_CONFIG_URI` variable to direct the OpenTelemetry collector to the configuration file: ``` -aws lambda update-function-configuration --function-name <> --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=<>} +aws lambda update-function-configuration --function-name <> --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_URI=<>} ``` Replace `<>` with the name of your Lambda function running the Node.js application. @@ -105,7 +101,6 @@ Replace `<>` with the name of your Lambda function ru Replace `<>` with the actual path to your `collector.yaml` file. (If `collector.yaml` is located in the root directory of your application, use the path `/var/task/collector.yaml`.) - #### Activate tracing for your Lambda function ```shell @@ -118,17 +113,21 @@ Replace `<>` with the name of your Lambda function ru The OpenTelemetry Node.js wrapper layer automatically instruments the Node.js application in your Lambda function. +Find the latest ARN for the OpenTelemetry Node.js wrapper layer on the [OpenTelemetry Lambda GitHub Releases page](https://github.com/open-telemetry/opentelemetry-lambda/releases) under `layer-nodejs`. + ```shell -aws lambda update-function-configuration --function-name <> --layers arn:aws:lambda:<>:486140753397:layer:opentelemetry-nodejs-0_1_0:1 +aws lambda update-function-configuration --function-name <> --layers + ``` Replace `<>` with the name of your Lambda function running the Node.js application. +`<>` with the latest ARN from the GitHub releases page. + Replace `<>` with the code of your AWS regions, e.g. `us-east-1`. - #### Add environment variable for the wrapper - + Add the `AWS_LAMBDA_EXEC_WRAPPER` environment variable to point to the `otel-handler` executable: ```shell