Help Docs

Integration with Lambda Execution Logs and Metrics

Achieve real-time observability into your Lambda environments with the Lambda Extensions integration with Site24x7. The extensions run as a companion processes outside the Lambda function runtime process so you can configure the execution environment.

Site24x7’s integration with Lambda Extensions helps you plug into the execution cycle before, during, and after an invocation. The logs are obtained from Lambda functions rather than CloudWatch logs and are pushed into Site24x7 AppLogs to diagnose them further.

Site 24x7 also supports the Lambda Telemetry API that creates extensions that can access telemetry streams directly from the Lambda execution environment. You can get telemetry streams from the Lambda service, including function and extension logs, as well as events, traces, and metrics coming from the Lambda platform itself with the Telemetry API.

When the JSON access policy has the permission lambda:UpdateFunctionConfiguration added, the integration is done automatically.

Contents

Prerequisites

For the AWS console, you need:

  • An AWS account ID.
  • A Lambda function monitored by Site24x7.

For the Site24x7 console, you need to:

  • Have a valid and active AWS account.
  • Integrate your AWS account with Site24x7. Learn more.
  • Grant the permission lambda:UpdateFunctionConfiguration that enables us to integrate your account with Lambda Extensions automatically.
  • If not, you can set up the integration manually by following the steps below:
    The Lambda Extension Logs and Lambda Extension Metrics tabs will be displayed only after Site24x7-Lambda Extension integration for both logs and metrics. If the logs and metrics are not integrated then, only the Lambda Extension tab will be shown.

Integrate with Lambda Extensions using Extension ARN for Lambda Execution Logs

To manually integrate Site24x7 with Lambda Extensions using Extension ARN for Lambda Execution Logs, you need to:

  1. Log in to your Site24x7 account.
  2. Navigate to Cloud > AWS > All Accounts Summary > Lambda monitor.
  3. Select the name of the monitor (a Lambda function) that you'd like to integrate with a Lambda Extension.
  4. Navigate to the Lambda Extension or Lambda Execution Logs tab, where you’ll see the text fields Log Config Key, Environment Key (SITE24X7_LAMBDA_LOGS_EXTENSION), and Lambda Extension ARN with values.
  5. Log in to the AWS management console and enter AWS Lambda into the search bar at the top of the page.
  6. Navigate to Functions and search for the Lambda function that is monitored by Site24x7.

    AWS Lambda functions to configure.

  7. After selecting that function, select Layers and then Add a layer.
  8. Under Choose a layer, select Specify an ARN. Paste the Lambda extension ARN provided in the Site24x7 console into the Specify an ARN text field. Click Add.

    AWS Lambda functions to add layers.

  9. On getting the success message, navigate to the Configuration tab of your monitored function, and select Environment variables from the left navigation bar.
  10. Select Add environment variable.
  11. By default, the Key to be entered is logTypeConfig, and the Value is the encoded string provided in the Log Config Key field in the Site24x7 console. 
  12. Enter the Environment Key as SITE24X7_LAMBDA_LOGS_EXTENSION and the Value can be any value. 
  13. Click Save. You'll receive a success message.

    lambda environment variable

  14. Reload the Lambda Execution Logs tab in the Site24x7 console to view the successful integration.

Integrate Site24x7 with Lambda Extensions using .ZIP archives for Lambda Execution Logs

SITE24X7_LAMBDA_LOG_EXTENSION and logTypeConfig must always be added as keys when you're integrating using a .ZIP file. To deploy a function using a container image, download the .ZIP file and include the extension file inside your /opt/extensions folder in the container image. Read more.

To integrate Site24x7 with Lambda Extensions using .ZIP archives, you need to:

  1. Log in to your Site24x7 account.
  2. Navigate to Cloud > AWS > All Accounts Summary > Lambda monitor.
  3. Select the name of the monitor (a Lambda function) that you'd like to integrate with a Lambda Extension.
  4. Navigate to the Lambda Extension or the Lambda Execution Logs tab, where you’ll see the Integrate using a ZIP file tab with text fields Log Config KeyEnvironment Key (SITE24X7_LAMBDA_LOG_EXTENSION), and S3 URL along with a drop-down to select the region.
  5. Copy and paste the S3 URL shared (based on chosen Region) in your browser, and download the ZIP file. The downloaded ZIP file contains the extension.
  6. Log in to the AWS management console and enter AWS Lambda in the search bar at the top of the page.
  7. Navigate to Layers and click Create layer
  8. Fill in the Name field, and upload the ZIP file that you downloaded in step 5. You can also paste the S3 URL provided in the Site24x7 console. Click Create.You'll receive a success message.

    Create AWS Lambda layers to integrate lambda extensions.

  9. Once the layer is created, you can add a Lambda extension by including the layer in the Function monitored in Site24x7. Copy the Version ARN that you obtained after layer creation, and paste it in the Specify an ARN text field in the Add layer screen of your monitored Lambda function. Click Add.
  10. Under the Configuration tab of your monitored function, select Environment variables from the left navigation bar. Click Edit.
  11. In the Edit environment variables page, click Add environment variable.
  12. By default, the Key to be entered is logTypeConfig, and the Value is the encoded string provided in the Log Config Key field in the Site24x7 console.
  13. Enter the Environment Key as SITE24X7_LAMBDA_LOG_EXTENSION and the Value can be any value. Click Save. You'll receive a success message.
  14. Reload the Lambda Execution Logs tab in the Site24x7 console to view the successful integration.

Integrate with Lambda Extensions using Extension ARN for Lambda Execution Metrics

To manually integrate Site24x7 with Lambda Extensions using Extension ARN for Lambda Execution Metrics, you need to:

  1. Log in to your Site24x7 account.
  2. Navigate to Cloud > AWS > All Accounts Summary > Lambda monitor.
  3. Select the name of the monitor (a Lambda function) that you'd like to integrate with a Lambda Extension.
  4. Navigate to the Lambda Extension tab or the Lambda Execution Metrics tab, where you’ll see the text fields Log Config Key, Environment Key (SITE24X7_LAMBDA_METRICS_EXTENSION), and Lambda Extension ARN with values.
  5. Log in to the AWS management console and enter AWS Lambda into the search bar at the top of the page.
  6. Navigate to Functions, and search for the Lambda function that is monitored by Site24x7.
  7. After selecting that function, select Layers and then Add a layer.
  8. Under Choose a layer, select Specify an ARN. Paste the Lambda extension ARN provided in the Site24x7 console into the Specify an ARN text field. Click Add.
  9. On getting the success message, navigate to the Configuration tab of your monitored function, and select Environment variables from the left navigation bar.
  10. Select Add environment variable.
  11. By default, the Key to be entered is logTypeConfig, and the Value is the encoded string provided in the Log Config Key field in the Site24x7 console.
  12. Enter the Environment Key as SITE24X7_LAMBDA_METRIC_EXTENSION and the Value can be any value. 
  13. Click Save. You'll receive a success message.
  14. Reload the Lambda Execution Metrics tab in the Site24x7 console to view the successful integration

Integrate with Lambda Extensions using .ZIP archives for Lambda Execution Metrics

To deploy a function using a container image, download the .ZIP file and include the extension file inside your /opt/extensions folder in the container image.

To integrate Site24x7 with Lambda Extensions using .ZIP archives for Lambda Execution Metrics, you need to:

  1. Log in to your Site24x7 account.
  2. Navigate to Cloud > AWS > All Accounts Summary > Lambda monitor.
  3. Select the name of the monitor (a Lambda function) that you'd like to integrate with a Lambda Extension.
  4. Navigate to the Lambda Extension tab or the Lambda Execution Metrics tab, where you’ll see the Integrate using a ZIP file tab with text fields Log Config Key, Environment Key (SITE24X7_LAMBDA_METRICS_EXTENSION) and S3 URL along with a drop-down to select the region.
  5. Copy and paste the S3 URL shared (based on chosen Region) in your browser, and download the ZIP file. The downloaded ZIP file contains the extension.
  6. Log in to the AWS management console and enter AWS Lambda in the search bar at the top of the page.
  7. Navigate to Layers and click Create layer.
  8. Fill in the Name field, and upload the ZIP file that you downloaded in step 5. You can also paste the S3 URL provided in the Site24x7 console. Click Create.You'll receive a success message.
  9. Once the layer is created, you can add a Lambda extension by including the layer in the Function monitored in Site24x7. Copy the Version ARN that you obtained after layer creation, and paste it in the Specify an ARN text field in the Add layer screen of your monitored Lambda function. Click Add.
  10. Under the Configuration tab of your monitored function, select Environment variables from the left navigation bar. Click Edit.
  11. In the Edit environment variables page, click Add environment variable.
  12. By default, the Key to be entered is logTypeConfig, and the Value is the encoded string provided in the Log Config Key field in the Site24x7 console.
  13. Enter the Environment Key as SITE24X7_LAMBDA_METRIC_EXTENSION and the Value can be any value. Click Save. You'll receive a success message.
  14. Reload the Lambda Execution Metrics tab in the Site24x7 console to view the successful integration.

Upgrade the version of Lambda Extension

(i) ARN Method

To upgrade the version of the Lambda Extensions integrated using an ARN method, you need to:

  1. Follow the steps 1 to 3 in integrating Site24x7 with Lambda Extensions using ARN method.
  2. Navigate to the Lambda Execution Logs tab, where you'll see a yellow box at the top. On clicking Upgrade Lambda Log Extension, a pop-up will appear. Select Upgrade using Extension ARN, where two text fields, Log Config Key and Lambda Extension ARN will be available.
  3. Using the new values of Log Config Key and Lambda Extension ARN, follow the steps 5 to 11 to create a layer, and add environment variables.
  4. Reload the Lambda Execution Logs tab in Site24x7 console to view the successful integration.

(ii) .ZIP archive

To upgrade the version of the Lambda Extensions integrated using the .ZIP archive method, you need to:

  1. Follow the steps 1 to 3 in integrating Site24x7 with Lambda Extensions using .ZIP archives.
  2. Navigate to the Lambda Execution Logs tab, where you'll see a yellow box at the top. On clicking Upgrade Lambda Log Extension, a pop-up will appear. Select Upgrade using a ZIP file, where a text field, S3 URL will be available.
  3. Using this new S3 URL, follow the steps 5 to 11 to create a layer, and add environment variables.
  4. Reload the Lambda Execution Logs tab in the Site24x7 console to view the successful integration.
  • Site24x7-Lambda Extension integrated monitor supports Lambda execution metrics for Version 3 and above. The existing customers using Version 2 can upgrade to Version 3 to get the metrics data.
  • If you wish to monitor both logs and metrics for your Lambda Extensions, you will have to select both the Logs and Metrics checkboxes in the Lambda Extension tab before integrating. You can also select either Logs or Metrics based on your requirement and integrate as well.
  • To receive logs, add the Environment Key as SITE24X7_LAMBDA_LOG_EXTENSION.
  • To receive metrics, add the Environment Key as SITE24X7_LAMBDA_METRIC_EXTENSION.

Performance Impacts

Lambda Extensions can impact the performance of your Lambda function since they share the same resources as your code. These shared resources include the CPU, memory, network bandwidth, and storage. To monitor the performance overhead of the lambda extensions, we consider the metric PostRuntimeExtensionsDuration which estimates the extra time (after your code has finished running) while using an extension.

Additional charges will be incurred for your Lambda function from AWS due to the rise in function execution duration and memory usage of Lambda Extensions.

Example:

To understand the performance impacts of Lambda Extensions on the function's code size, execution time, and latency, consider these two scenarios:

Case 1: Function execution results without Lambda Extensions.

Lambda function performance without Lambda Extensions.

Case 2: Function execution results with Lambda Extensions.

Lambda function performance with Lambda Extensions.

Was this document helpful?

Shortlink has been copied!