This topic explains how to send container logs from Amazon ECS to LaunchDarkly 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:Replace
Replace Replace
- Direct forwarding: Use the Fluent Forward protocol to send logs directly to the LaunchDarkly OpenTelemetry collector.
- Kinesis Firehose: Ship structured JSON logs through AWS Kinesis Data Streams, then forward them to LaunchDarkly using Kinesis Data Firehose. This approach preserves JSON fields in your logs as structured attributes in LaunchDarkly.
Prerequisites
Before you configure FireLens, you must:- Have LaunchDarkly observability enabled for your project
- Have an Amazon ECS cluster running
- Know your LaunchDarkly project key
Option 1: Direct forwarding with Fluent Forward
This approach uses a Fluent Bit sidecar container with theawsfirelens log driver to send logs directly to the LaunchDarkly OpenTelemetry collector.Here is an example ECS task definition:YOUR_PROJECT_KEY with your LaunchDarkly project key.The key configuration values are:| Option | Value | Description |
|---|---|---|
Host | otel.observability.app.launchdarkly.com | The LaunchDarkly OpenTelemetry collector endpoint |
Port | 24224 | The Fluent Forward protocol port |
Tag | launchdarkly.project_id=YOUR_PROJECT_KEY | Routes logs to your LaunchDarkly project |
Option 2: Structured JSON logging using Kinesis
This approach ships structured JSON logs through AWS Kinesis Data Streams. It preserves JSON fields in your logs as structured attributes in LaunchDarkly.Configure the ECS task definition
The task definition uses a Fluent Bit sidecar with theparse-json.conf configuration file to preserve structured JSON fields through the pipeline.Here is an example ECS task definition:YOUR_KINESIS_DATA_STREAM with the name of your Kinesis Data Stream and update the region to match your AWS region.Configure Kinesis Data Firehose
Create a Kinesis Data Firehose delivery stream that reads from your Kinesis Data Stream and forwards to LaunchDarkly:- Source: Your Kinesis Data Stream
- Destination: HTTP endpoint
- Endpoint URL:
https://pub.observability.app.launchdarkly.com/v1/logs/firehose
Configure Identity and Access Management (IAM) permissions
Update your ECS task execution role to allow writing to your Kinesis Data Stream:YOUR_ACCOUNT_ID and YOUR_KINESIS_DATA_STREAM with your AWS account ID and Kinesis stream name.Verify that logs are being received
After you configure FireLens, your container logs begin forwarding to LaunchDarkly.To verify that your logs are being received:- Open the Telemetry section and navigate to the Logs list.
- Look for logs from your ECS services.