AWS Lambda functions
editAWS Lambda functions
edit[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
Elastic APM lets you monitor your AWS Lambda functions. The natural integration of distributed tracing into your AWS Lambda functions provides insights into each function’s execution and runtime behavior as well as its relationships and dependencies to other services.
AWS Lambda architecture
editAWS Lambda uses a special execution model to provide a scalable, on-demand compute service for code execution. In particular, AWS freezes the execution environment of a lambda function when no active requests are being processed. This execution model poses additional requirements on APM in the context of AWS Lambda functions:
- To avoid data loss, APM data collected by APM agents needs to be flushed before the execution environment of a lambda function is frozen.
- Flushing APM data must be fast so as not to impact the response times of lambda function requests.
To accomplish the above, Elastic APM agents instrument AWS Lambda functions and dispatch APM data via an AWS Lambda extension.
Normally, during the execution of a Lambda function, there’s only a single language process running in the AWS Lambda execution environment. With an AWS Lambda extension, Lambda users run a second process alongside their main service/application process.
By using an AWS Lambda extension, Elastic APM agents can send data to a local Lambda extension process, and that process will forward data on to the managed intake service asynchronously. The Lambda extension ensures that any potential latency between the Lambda function and the managed intake service instance will not cause latency in the request flow of the Lambda function itself.
Setup
editTo get started with monitoring AWS Lambda functions, refer to the APM agent documentation:
The APM agent documentation states that you can use either an APM secret token or API key to authorize requests to the managed intake service. However, when sending data to a project, you must use an API key.
Read more about API keys in Keep APM data secure.