This topic explains how to send container logs from Amazon ECS to LaunchDarkly’s observability dashboards using AWS FireLens. FireLens is AWS’s log router for Amazon ECS that lets you route container logs to various destinations using Fluent Bit.
There are two ways to send logs using FireLens:
After you set up the configuration, these logs appear in the Logs page of the LaunchDarkly user interface.
Before you configure FireLens, you must:
To learn how to find and copy your LaunchDarkly project key, read Project keys.
This approach uses a Fluent Bit sidecar container with the awsfirelens log driver to send logs directly to LaunchDarkly’s OpenTelemetry collector.
Here is an example ECS task definition:
Replace YOUR_PROJECT_KEY with your LaunchDarkly project key.
The key configuration values are:
This approach ships structured JSON logs through AWS Kinesis Data Streams. It preserves JSON fields in your logs as structured attributes in LaunchDarkly.
The task definition uses a Fluent Bit sidecar with the parse-json.conf configuration file to preserve structured JSON fields through the pipeline.
Here is an example ECS task definition:
Replace YOUR_KINESIS_DATA_STREAM with the name of your Kinesis Data Stream and update the region to match your AWS region.
Create a Kinesis Data Firehose delivery stream that reads from your Kinesis Data Stream and forwards to LaunchDarkly:
https://pub.observability.app.launchdarkly.com/v1/logs/firehoseUpdate your ECS task execution role to allow writing to your Kinesis Data Stream:
Replace YOUR_ACCOUNT_ID and YOUR_KINESIS_DATA_STREAM with your AWS account ID and Kinesis stream name.
After you configure FireLens, your container logs begin forwarding to LaunchDarkly.
To verify that your logs are being received:
It may take a few minutes for logs to appear after you first configure the log router.
You can configure ingestion filters to control which logs are stored in LaunchDarkly. This is useful for excluding noisy logs or limiting ingestion to stay within your observability quotas.
To learn more, read Filters.