Setting Up AWS Distro for OpenTelemetry with Container-Based Lambda Functions and New Relic
Blog post from New Relic
AWS Distro for OpenTelemetry (ADOT) addresses the challenges of observability in serverless environments by offering a vendor-neutral method to collect and export telemetry data, while overcoming the limitations of containerized AWS Lambda functions that cannot utilize standard Lambda Layers. A practical solution involves embedding ADOT directly into a container image using a multi-stage Docker build, allowing telemetry data to be exported seamlessly to platforms like New Relic. Container images provide benefits such as larger deployment packages, consistent CI/CD tooling, and control over runtime dependencies, although they cannot natively integrate Lambda Layers. The article outlines steps to build and deploy ADOT-instrumented Lambda functions, including configuring the Serverless Application Model (SAM) template and adding custom instrumentation for enhanced observability. Despite some operational overhead during cold starts, this approach offers flexible deployment and comprehensive telemetry through New Relic's OTLP endpoint, making it a powerful combination for achieving serverless observability.