Skip to content

Add instructions for building the Lambda layer #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,56 @@ This table represents the components that the ADOT Lambda Layer will support and
| | otlpexporter | |
| | otlphttpexporter | |

## Building the Lambda Layer

The ADOT Lambda layer is not available in all AWS regions and partitions today. In order to use the layer in these cases, you can build and pulbish the layer from source. In order to build the layer from source, perform the following steps.

1. Clone the repository locally

```
git clone --recurse-submodules https://github.com/aws-observability/aws-otel-lambda.git
```

2. Run the `patch-upstream.sh` script to patch upstream OpenTelemetry submodules with layer configurations:

```sh
./patch-upstream.sh
```

3. Go to the language folder, such as `python`, `java`:

```sh
cd python/
```

4. Run the `build.sh` script with your desired architecture (`amd64` or `arm64`):

```sh
GOARCH=amd64 ./build.sh amd64
```

5. Publish the output zipfile as a Lambda layer. The output zipfile name, runtime, and architecture will change depending on your language and use case.

```sh
aws lambda publish-layer-version \
--layer-name opentelemetry-javaagent-layer-amd64-java17 \
--description "AWS Distro for Open Telemetry Lambda Layer for Java including auto-instrumentation agent" \
--zip-file "fileb://opentelemetry-lambda/java/layer-javaagent/build/distributions/opentelemetry-javaagent-layer.zip" \
--compatible-runtimes java17 \
--compatible-architectures "x86_64"
```

| Language | Use Case | File name |
|------------------|----------------------------------------------|---------------------------------------------------------------------------------------------------|
| `java` | Auto instrumentation agent + SDK + collector | `opentelemetry-lambda/java/layer-javaagent/build/distributions/opentelemetry-javaagent-layer.zip` |
| `java` | SDK + collector | `opentelemetry-lambda/java/layer-wrapper/build/distributions/opentelemetry-javawrapper-layer.zip` |
| `nodejs` | SDK + collector | `opentelemetry-lambda/nodejs/packages/layer/build/layer.zip` |
| `python` | SDK + collector | `opentelemetry-lambda/python/src/build/layer.zip` |
| `collector` | ADOT collector only | `opentelemetry-lambda/collector/build/opentelemetry-collector-layer-{architecture}.zip` |




## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
Expand Down