Deploying Failure Flags on AWS Lambda
This document will walk you through setting up Failure Flags for AWS Lambda Functions. On Lambda, Failure Flags is deployed as a Lambda Extension called Gremlin-Lambda. This extension creates a sidecar container that runs alongside your function. Gremlin-Lambda supports both AMD64/x86_64 and ARM64 architectures. You can learn more about the AWS Lambda Extensions API in the AWS documentation.
Configuring Failure Flags for AWS Lambda
The Gremlin-Lambda Extension accepts the following environment variables in addition to those defined in Configuring Failure Flags. When referencing files, the filename must be a fully qualified path from the root of the resulting Lambda Function file system (typically /var/task):
AWS Lambda metadata discovered by Gremlin
Gremlin automatically detects the following environment variables for Lambda functions:
Adding the Gremlin-Lambda Extension to your Lambda Function
Gremlin releases a new version of the Failure Flags Lambda layer with each sidecar release. This means the Lambda layer version (indicated by the number at the end of the ARN) will change with each release. We’ll include the corresponding Lambda layer number for each sidecar release in the Failure Flags sidecar release notes.
Once you have the correct ARN, add the extension to your Lambda Function by following the instructions in the AWS Lambda Developer Guide.
Building your own Lambda Layer
You may want to build your own Lambda Layer or incorporate the gremlin-lambda binary in a Lambda container image. Maybe you're at risk of using too many layers, or maybe your organization has a package caching policy. Either way you'll want to build your own asset. You can access all of the gremlin-lambda and failure-flags-sidecar builds via our website.
Files provided via assets.gremlin.com have the following format: https://assets.gremlin.com/packages/gremlin-lambda/{VERSION}/{ARCH}/{FILE}
You can reference the LATEST release at: https://assets.gremlin.com/packages/gremlin-lambda/latest/{ARCH}/{FILE}
ARCH is one of the following:
- x86_64
- arm64
Different releases may include different files, but the current FILE set includes:
- gremlin-lambda-linux.tar.gz (x86_64)
- layer-gremlin-lambda.zip
- LICENSE
You can find a list of releases in our release notes, or in our VERSIONS file.
Verifying your Failure Flags Lambda deployment
After deploying the extension, confirm that Gremlin can see your function before you try to run an experiment.
- Enable debug logging. Set
GREMLIN_DEBUGtotrueon your function. The extension writes to your function's CloudWatch log group, prefixed with[gremlin-lambda]. - Invoke your function at least once. Gremlin creates Failure Flags from observed activity, so nothing appears until the function runs.
- Confirm the service in Gremlin. Open Failure Flags in the web app. Your function appears under its
SERVICE_NAME, or under its auto-detectedAWS_LAMBDA_FUNCTION_NAMEif you didn't set one. - Confirm the flags. You should see the
processflag, plus flags for each proxy mode you enabled.
If the service or its flags don't appear, see Troubleshooting Failure Flags.
Troubleshooting Failure Flags
This Lambda Extension provides debug logging when the GREMLIN_DEBUG environment variable is set to true . This information will be included with your Lambda logs and prefixed with [gremlin-lambda]. This additional information will include configuration details, registration status, connection tracing, any relevant errors encountered while interacting with the control plane, and requests for experiments from the Failure Flags SDKs.

