> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS FireLens

export const otelhost_2 = "otel.observability.app.eu.launchdarkly.com"

export const pubhost_2 = "pub.observability.app.eu.launchdarkly.com"

export const otelhost_1 = "otel.observability.app.launchdarkly.com"

export const pubhost_1 = "pub.observability.app.launchdarkly.com"

export const otelhost_0 = "otel.observability.app.launchdarkly.com"

export const pubhost_0 = "pub.observability.app.launchdarkly.com"

<View title="Developer">
  <View title="Federal docs">
    <Danger>
      **Observability is not available in federal environments**

      To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
    </Danger>
  </View>

  This topic explains how to send container logs from Amazon ECS to LaunchDarkly observability dashboards using [AWS FireLens](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html). 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:

  * **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.

  After you set up the configuration, these logs appear in the [Logs](/docs/home/observability/logs) page of the LaunchDarkly user interface.

  ## 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

  To learn how to find and copy your LaunchDarkly project key, read [Project keys](/docs/home/account/project#project-keys).

  ## Option 1: Direct forwarding with Fluent Forward

  This approach uses a Fluent Bit sidecar container with the `awsfirelens` log driver to send logs directly to the LaunchDarkly OpenTelemetry collector.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "906394416424.dkr.ecr.us-east-1.amazonaws.com/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit"
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "Name": "Forward",
              "Host": "otel.observability.app.launchdarkly.com",
              "Port": "24224",
              "Tag": "launchdarkly.project_id=YOUR_PROJECT_KEY"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `YOUR_PROJECT_KEY` with your LaunchDarkly project key.

  The key configuration values are:

  <table>
    <thead>
      <tr>
        <th>Option</th>
        <th>Value</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td><code>Host</code></td>

        <td>
          <code>
            {otelhost_0}
          </code>
        </td>

        <td>The LaunchDarkly OpenTelemetry collector endpoint</td>
      </tr>

      <tr>
        <td><code>Port</code></td>
        <td><code>24224</code></td>
        <td>The Fluent Forward protocol port</td>
      </tr>

      <tr>
        <td><code>Tag</code></td>
        <td><code>launchdarkly.project\_id=YOUR\_PROJECT\_KEY</code></td>
        <td>Routes logs to your LaunchDarkly project</td>
      </tr>
    </tbody>
  </table>

  ## 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 the `parse-json.conf` configuration file to preserve structured JSON fields through the pipeline.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit",
            "options": {
              "config-file-type": "file",
              "config-file-value": "/fluent-bit/configs/parse-json.conf",
              "enable-ecs-log-metadata": "true"
            }
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "region": "us-east-2",
              "stream": "YOUR_KINESIS_DATA_STREAM",
              "Name": "kinesis_streams"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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**: <code>https\://{pubhost_0}/v1/logs/firehose</code>

  ### Configure Identity and Access Management (IAM) permissions

  Update your ECS task execution role to allow writing to your Kinesis Data Stream:

  <CodeGroup>
    ```json title="iam-policy.json" lines wrap theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "kinesis:PutRecords",
          "Resource": "arn:aws:kinesis:us-east-2:YOUR_ACCOUNT_ID:stream/YOUR_KINESIS_DATA_STREAM"
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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:

  1. Open the **Telemetry** section and navigate to the **Logs** list.
  2. Look for logs from your ECS services.

  It may take a few minutes for logs to appear after you first configure the log router.

  ## Filtering logs

  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](/docs/home/observability/settings#filters).
</View>

<View title="Federal docs">
  <View title="Federal docs">
    <Danger>
      **Observability is not available in federal environments**

      To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
    </Danger>
  </View>

  This topic explains how to send container logs from Amazon ECS to LaunchDarkly observability dashboards using [AWS FireLens](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html). 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:

  * **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.

  After you set up the configuration, these logs appear in the [Logs](/docs/home/observability/logs) page of the LaunchDarkly user interface.

  ## 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

  To learn how to find and copy your LaunchDarkly project key, read [Project keys](/docs/home/account/project#project-keys).

  ## Option 1: Direct forwarding with Fluent Forward

  This approach uses a Fluent Bit sidecar container with the `awsfirelens` log driver to send logs directly to the LaunchDarkly OpenTelemetry collector.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "906394416424.dkr.ecr.us-east-1.amazonaws.com/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit"
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "Name": "Forward",
              "Host": "otel.observability.app.launchdarkly.com",
              "Port": "24224",
              "Tag": "launchdarkly.project_id=YOUR_PROJECT_KEY"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `YOUR_PROJECT_KEY` with your LaunchDarkly project key.

  The key configuration values are:

  <table>
    <thead>
      <tr>
        <th>Option</th>
        <th>Value</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td><code>Host</code></td>

        <td>
          <code>
            {otelhost_1}
          </code>
        </td>

        <td>The LaunchDarkly OpenTelemetry collector endpoint</td>
      </tr>

      <tr>
        <td><code>Port</code></td>
        <td><code>24224</code></td>
        <td>The Fluent Forward protocol port</td>
      </tr>

      <tr>
        <td><code>Tag</code></td>
        <td><code>launchdarkly.project\_id=YOUR\_PROJECT\_KEY</code></td>
        <td>Routes logs to your LaunchDarkly project</td>
      </tr>
    </tbody>
  </table>

  ## 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 the `parse-json.conf` configuration file to preserve structured JSON fields through the pipeline.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit",
            "options": {
              "config-file-type": "file",
              "config-file-value": "/fluent-bit/configs/parse-json.conf",
              "enable-ecs-log-metadata": "true"
            }
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "region": "us-east-2",
              "stream": "YOUR_KINESIS_DATA_STREAM",
              "Name": "kinesis_streams"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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**: <code>https\://{pubhost_1}/v1/logs/firehose</code>

  ### Configure Identity and Access Management (IAM) permissions

  Update your ECS task execution role to allow writing to your Kinesis Data Stream:

  <CodeGroup>
    ```json title="iam-policy.json" lines wrap theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "kinesis:PutRecords",
          "Resource": "arn:aws:kinesis:us-east-2:YOUR_ACCOUNT_ID:stream/YOUR_KINESIS_DATA_STREAM"
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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:

  1. Open the **Telemetry** section and navigate to the **Logs** list.
  2. Look for logs from your ECS services.

  It may take a few minutes for logs to appear after you first configure the log router.

  ## Filtering logs

  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](/docs/home/observability/settings#filters).
</View>

<View title="EU docs">
  <View title="Federal docs">
    <Danger>
      **Observability is not available in federal environments**

      To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
    </Danger>
  </View>

  This topic explains how to send container logs from Amazon ECS to LaunchDarkly observability dashboards using [AWS FireLens](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html). 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:

  * **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.

  After you set up the configuration, these logs appear in the [Logs](/docs/home/observability/logs) page of the LaunchDarkly user interface.

  ## 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

  To learn how to find and copy your LaunchDarkly project key, read [Project keys](/docs/home/account/project#project-keys).

  ## Option 1: Direct forwarding with Fluent Forward

  This approach uses a Fluent Bit sidecar container with the `awsfirelens` log driver to send logs directly to the LaunchDarkly OpenTelemetry collector.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "906394416424.dkr.ecr.us-east-1.amazonaws.com/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit"
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "Name": "Forward",
              "Host": "otel.observability.app.eu.launchdarkly.com",
              "Port": "24224",
              "Tag": "launchdarkly.project_id=YOUR_PROJECT_KEY"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `YOUR_PROJECT_KEY` with your LaunchDarkly project key.

  The key configuration values are:

  <table>
    <thead>
      <tr>
        <th>Option</th>
        <th>Value</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td><code>Host</code></td>

        <td>
          <code>
            {otelhost_2}
          </code>
        </td>

        <td>The LaunchDarkly OpenTelemetry collector endpoint</td>
      </tr>

      <tr>
        <td><code>Port</code></td>
        <td><code>24224</code></td>
        <td>The Fluent Forward protocol port</td>
      </tr>

      <tr>
        <td><code>Tag</code></td>
        <td><code>launchdarkly.project\_id=YOUR\_PROJECT\_KEY</code></td>
        <td>Routes logs to your LaunchDarkly project</td>
      </tr>
    </tbody>
  </table>

  ## 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 the `parse-json.conf` configuration file to preserve structured JSON fields through the pipeline.

  Here is an example ECS task definition:

  <CodeGroup>
    ```json title="task-definition.json" expandable lines wrap theme={null}
    {
      "family": "my-app",
      "containerDefinitions": [
        {
          "essential": true,
          "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:stable",
          "name": "log_router",
          "firelensConfiguration": {
            "type": "fluentbit",
            "options": {
              "config-file-type": "file",
              "config-file-value": "/fluent-bit/configs/parse-json.conf",
              "enable-ecs-log-metadata": "true"
            }
          }
        },
        {
          "essential": true,
          "image": "my-app:latest",
          "name": "app",
          "logConfiguration": {
            "logDriver": "awsfirelens",
            "options": {
              "region": "us-east-2",
              "stream": "YOUR_KINESIS_DATA_STREAM",
              "Name": "kinesis_streams"
            }
          }
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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**: <code>https\://{pubhost_2}/v1/logs/firehose</code>

  ### Configure Identity and Access Management (IAM) permissions

  Update your ECS task execution role to allow writing to your Kinesis Data Stream:

  <CodeGroup>
    ```json title="iam-policy.json" lines wrap theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "kinesis:PutRecords",
          "Resource": "arn:aws:kinesis:us-east-2:YOUR_ACCOUNT_ID:stream/YOUR_KINESIS_DATA_STREAM"
        }
      ]
    }
    ```
  </CodeGroup>

  Replace `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:

  1. Open the **Telemetry** section and navigate to the **Logs** list.
  2. Look for logs from your ECS services.

  It may take a few minutes for logs to appear after you first configure the log router.

  ## Filtering logs

  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](/docs/home/observability/settings#filters).
</View>
