• Observability in serverless environments can be challenging, but AWS Distro for OpenTelemetry (ADOT) simplifies this by providing a standardized, vendor-neutral way to collect and export telemetry. • ADOT allows you to leverage industry-standard OpenTelemetry APIs to instrument your applications without being locked into a single observability backend. • The challenge with containerized Lambdas is that they do not support standard Lambda Layers. • Since ADOT is typically deployed as a layer for Lambda functions, we need an alternative way to get the telemetry agent into our execution environment. • This post walks through a practical workaround by embedding ADOT directly into your container image using a multi-stage Docker build, followed by exporting that telemetry to New Relic. • Why Container Images?
Article Summaries:
- AWS Distro for OpenTelemetry (ADOT) enables vendor‑neutral telemetry collection for serverless workloads. Because container‑based Lambda functions cannot use traditional Lambda Layers, the article shows how to embed ADOT directly into a container image via a multi‑stage Docker build. In the first stage, the ADOT layer ZIP is downloaded and extracted to
/opt, mimicking the layer extraction that occurs with ZIP deployments. The second stage copies these files into a standard Lambda runtime image, installs the function’s dependencies, and sets the wrapper script as executable. The SAM template then configures environment variables to route telemetry from the instrumented Lambda to New Relic instead of the default X‑Ray backend.
Sources: