|
| 1 | +# FireLens Example: Quickly Enable Resource Monitoring with ADOT |
| 2 | + |
| 3 | +The [AWS Distro for OpenTelemetry](https://aws-otel.github.io/) has many features for collecting telemetry from your applications. In this tutorial, you will learn how to quickly enable resource utilization monitoring for Fluent Bit using ADOT. OpenTelemetry can do a lot more than is shown in this tutorial. |
| 4 | + |
| 5 | +This guide is broken down into two tutorials: |
| 6 | +- [Tutorial 1: Quickly Enable Task Resource Monitoring](#tutorial-1-quickly-enable-task-resource-monitoring) |
| 7 | +- [Tutorial 2: Enable Container Level Metric Collection](#tutorial-2-enable-container-level-metric-collection) |
| 8 | + |
| 9 | +### Tutorial 1: Quickly Enable Task Resource Monitoring |
| 10 | + |
| 11 | +To quickly enable CPU, memory, network and disk usage metrics for your FireLens task, simply add the following container definition to your current task definition: |
| 12 | + |
| 13 | +``` |
| 14 | + { |
| 15 | + "essential": true, |
| 16 | + "image": "public.ecr.aws/aws-observability/aws-otel-collector:latest", |
| 17 | + "name": "aws-otel-collector", |
| 18 | + "logConfiguration": { |
| 19 | + "logDriver": "awslogs", |
| 20 | + "options": { |
| 21 | + "awslogs-group": "aws-otel-collector", |
| 22 | + "awslogs-region": "us-west-1", |
| 23 | + "awslogs-create-group": "true", |
| 24 | + "awslogs-stream-prefix": "ecs-" |
| 25 | + } |
| 26 | + }, |
| 27 | + "memoryReservation": 100, |
| 28 | + "command": [ |
| 29 | + "--config=/etc/ecs/container-insights/otel-task-metrics-config.yaml" |
| 30 | + ] |
| 31 | + } |
| 32 | +``` |
| 33 | + |
| 34 | +This uses the [built-in ADOT configuration](https://github.com/aws-observability/aws-otel-collector/blob/main/config/ecs/container-insights/otel-task-metrics-config.yaml) for ECS Task Level Metrics. Please read the full [documentation](https://aws-otel.github.io/docs/components/ecs-metrics-receiver). |
| 35 | + |
| 36 | +This configuration will send metrics to CloudWatch with the following sets of dimensions: |
| 37 | +- `ClusterName` |
| 38 | +- `ClusterName` and `TaskDefinitionFamily` |
| 39 | + |
| 40 | +This means that you will get CPU, Memory, Disk, and Network metrics for the entire task aggregated across your cluster, and the union of cluster and TaskDefinition Family. |
| 41 | + |
| 42 | +### Tutorial 2: Enable Container Level Metric Collection |
| 43 | + |
| 44 | +For this tutorial, you must do the following: |
| 45 | + |
| 46 | +1. Copy the "Full configuration for task- and container-level metrics" example from the [ADOT ECS Documentation](https://aws-otel.github.io/docs/components/ecs-metrics-receiver). |
| 47 | +2. Optionally modify the dimensions and metrics sent to CloudWatch with the `awsemf` exporter. For example, you could add `TaskId` and `ContainerName` as dimensions to monitoring specific Fluent Bit containers. However, please understand that this will lead to a very large number of individual metrics in CloudWatch which will induce cost. |
| 48 | +3. Follow the [ADOT ECS Custom Config tutorial](https://aws-otel.github.io/docs/setup/ecs/config-through-ssm) to run ADOT with your custom configuration. |
0 commit comments