Use AWS Lambda to collect Elasticache Redis slowlog entries and submit to Datadog
This AWS Lambda function connects to an AWS Elasticache instance running in redis mode,
and submits slowlog entry metrics to a Datadog account.
This lambda function was built and tested with the ruby-3.3
runtime.
Deploy the “Full zip distribution” from the releases pages to AWS lambda
The following parameters need to be supplied to the lambda function.
Environment Variable | Type | Description | Required | Default |
---|---|---|---|---|
REDIS_HOST | string | FQDN or URI of the elasticache redis endpoint | yes | - |
DATADOG_API_KEY | string | Datadog API Key | no | - |
DATADOG_APP_KEY | string | Datadog API Key | no | - |
NAMESPACE | string | “namespace” tag to apply to Datadog metric | yes | - |
ENV | string | “env” tag to apply to the Datadog metric | yes | - |
METRICNAME | string | Metric name to use | no | ‘elasticache.slowlog’ |
SSM_PATH | string | SSM Path where Datadog API Key and Datadog App key are stored | no | - |
note: either DATADOG_API_KEY and DATADOG_APP_KEY must be set environment variables or passed in from SSM.
See https://github.com/scribd/terraform-elasticache-slowlog-to-datadog/blob/master/main.tf for a reference
implementation in Terraform.
This script is used to inject arbitrary slow queries into a target redis instance.
DO NOT use this script in production environments, as it will CPU thrash the target instance.
Environment Variable | Type | Description | Required | Default |
---|---|---|---|---|
REDIS_HOST | string | FQDN or URI of the elasticache redis endpoint | yes | - |
To use elasticache-slowlog-to-datadog you need:
redis5.0+
engine.Releases are cut using semantic-release.
Please write commit messages following Angular commit guidelines