Skip to content

Latest commit

 

History

History

adot-resource-monitoring

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

FireLens Example: Quickly Enable Resource Monitoring with ADOT

The AWS Distro for OpenTelemetry 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.

This guide is broken down into two tutorials:

Tutorial 1: Quickly Enable Task Resource Monitoring

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:

        {
            "essential": true,
            "image": "public.ecr.aws/aws-observability/aws-otel-collector:latest",
            "name": "aws-otel-collector",
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-group": "aws-otel-collector",
                    "awslogs-region": "us-west-1",
                    "awslogs-create-group": "true",
                    "awslogs-stream-prefix": "ecs-"
                }
            },
            "memoryReservation": 100,
            "command": [
                "--config=/etc/ecs/container-insights/otel-task-metrics-config.yaml"
            ]
        }

This uses the built-in ADOT configuration for ECS Task Level Metrics. Please read the full documentation.

This configuration will send metrics to CloudWatch with the following sets of dimensions:

  • ClusterName
  • ClusterName and TaskDefinitionFamily

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.

Tutorial 2: Enable Container Level Metric Collection

For this tutorial, you must do the following:

  1. Copy the "Full configuration for task- and container-level metrics" example from the ADOT ECS Documentation.
  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.
  3. Follow the ADOT ECS Custom Config tutorial to run ADOT with your custom configuration.