1

AWS Lambda suggests using ADOT(AWS Distro for OpenTelemetry) over the AWS x-ray SDK to instrument python code in AWS Lambda. The documentation that suggests this can be found here:

https://docs.aws.amazon.com/lambda/latest/dg/python-tracing.html

However, the issue is the ADOT documentation does not speak about how to properly instrument container image based lambda functions.

How can this be achieved using Lambda container images?

ADOT is provides this solution as a Lambda Layer. Since Lambda functions packaged as container images do not support adding Lambda layers, us developers take on the responsibility for packaging the preferred runtimes and dependencies as a part of the container image during the build process.

My understanding is that in order for ADOT to instrument the code, ADOT needs to be invoked to wrap the subsequent network calls to ensure they are traced. My understanding is that the lambda python base container image uses a shell script as its entrypoint. How will copying the layer data to /opt ensure that the ADOT wrappers get called when the lambda gets invoked?

PeeKay
  • 59
  • 1
  • 4
  • 1
    Hey! ADOT PM here. Thanks for the question and I'm wondering if you've seen https://aws.amazon.com/blogs/opensource/auto-instrumenting-a-python-application-with-an-aws-distro-for-opentelemetry-lambda-layer/ already? – Michael Hausenblas Nov 22 '22 at 17:18
  • 1
    Hey @MichaelHausenblas, at least I didn't see anything about container based lambdas in that blog post? Problem is that ADOT is available as layer but you can't use layers with container based lambdas. I am currently investigating exactly that case. We need to use Python 3.11 so have to use container based setup. Trying to figure how to include ADOT into that – Jari Kujansuu Apr 25 '23 at 11:13

0 Answers0