Coralogix can now use AWS Lambda extensions to read Lambda functions’ logs and metrics directly without having to use Cloudwatch, thereby reducing latency and cost while gaining observability into your serverless infrastructure.
Go to AWS Serverless Repository and Search for Coralogix. Select Coralogix-Lambda-Extension. Make sure you perform the installation in the same region as the Lambda’s you want to add the extension layer to. If they are spread over more than one region, install the extension in each of these regions.
List the appropriate runtime environments for your lambdas and click ‘Deploy’. Make sure to add your runtime environment to the list, keeping the same format (separated by ‘, ‘).
Validate that the extension is available as a Lambda layer in your account
Go to the Lambda functions from which you want to send logs to Coralogix, choose the ‘Layers’ component, and click ‘Add Layer’
Select Custom Layers, choose the coralogix-extension layer that matches your lambda architecture, select the latest version and click ‘Add’
Go to the environment variables section in your Lambda function and add the below 3 parameters.
This document includes cluster-dependent URL’s. Each URL has a variable part (in Italic). Please match this part with a row entry within the following table. Copy the table row entry located under the column that matches the top-level domain of your Coralogix account (.com, .in, etc.). Replace the variable part of the URL with this entry.
Finally, click ‘Add’.
In case you need to deploy your lambda as a container image, to inject extension as part of your function just copy below to your image Dockerfile (read more about it here):
FROM coralogixrepo/coralogix-lambda-extension:latest AS coralogix-extension FROM public.ecr.aws/lambda/python:3.8 # Layer code WORKDIR /opt COPY --from=coralogix-extension /opt/ . # Function code WORKDIR /var/task COPY app.py . CMD ["app.lambda_handler"]
You can include SAM (Serverless Application Model) in your automation frameworks. If you need access to the latest Lambda code go to https://github.com/coralogix/coralogix-aws-serverless/tree/master/src.
You’re all set! Data will begin streaming to Coralogix.
Need any help with your integration? ping us on our in-app chat or at [email protected]