Our next-gen architecture is built to help you make sense of your ever-growing data Watch a 4-min demo video!

Back to All Integrations

Coralogix Extensions for Amazon Web Services (AWS) Lambda Coralogix Extensions for Amazon Web Services (AWS) Lambda

Last Updated: Feb. 01, 2023

Coralogix provides an easy way to collect your Cloud watch metrics.
The preferred and easiest integration method will be to use our AWS Serverless Application Repository.
Our code is open source and you can see it on Github

Requirements

  • Your AWS user should have permissions to create lambdas and IAM roles.

Installation – Lambda layer

  • Navigate to the Application Page.
  • Based on your lambda write the runtime in ‘CompatibleRuntimes’
  • Based on your lambda architecture put ‘true’ in either ‘AMD64SupportEnabled’ or ‘ARM64SupportEnabled’ and ‘false’ in the other
  • Click Deploy.

Installation – Container image lambda

In case you deploy your lambda as container image, to inject extension as part of your function just copy it to your image:

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"]

Note: in this example, python3.8 is being used as the runtime but all runtimes are supported with our lambda extension.

Usage

Once the deployment is done the Layer is ready and you can add it to any Lambda you wish to collect logs from.
This is how:

  1. Go to the Lambda functions from which you want to send logs to Coralogix, choose the ‘Layers’ component, and click ‘Add Layer’
  2. Select Custom Layers, choose the coralogix-extension layer that matches your lambda architecture, select the latest version and click ‘Add’
  3. Go to the environment variables section in your Lambda function and add the following ENV variables:
    1. CORALOGIX_PRIVATE_KEY – A unique ID that represents your company.
    2. CORALOGIX_APP_NAME – A mandatory metadata field that is sent with the logs. Helps identify the logs sent by this Lambda function.
    3. CORALOGIX_SUB_SYSTEM – A mandatory metadata field sent with the logs. Helps identify the logs sent by this Lambda function.
    4. CORALOGIX_LOG_URL (Optional) – use https://<cluster_url>/api/v1/logs
      Using the table below find the appropriate ‘Cluster URL’ .

Coralogix Endpoints <cluster_url>

RegionLogs Endpoint
EUapi.coralogix.com
EU2api.eu2.coralogix.com
USapi.coralogix.us
SGapi.coralogixsg.com
INapi.app.coralogix.in

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]

On this page