Get a DemoStart Free TrialSign In

AWS ECS Fargate Metrics via Telegraf

Ship your ECS and ECS Fargate Metrics via Telegraf to your Logit.io Stack

Configure Telegraf to ship AWS ECS metrics to your Logit.io stacks.

Send Your DataMetricsAWSAWS ECS Fargate Metrics via Telegraf Guide

Follow this step by step guide to get 'logs' from your system to Logit.io:

Step 1 - Telegraf ECS/Fargate plugin

The Telegraf Amazon ECS plugin is Fargate compatible. It uses the ECS metadata and the stats API endpoints to gether stats on the containers in the Task it is configured in.

The telegraf container must be run in the same Task as the workload you with to collect stats for

Step 2 - Prepare the Configuration file

You will need to prepare the telegraf-ecs.conf file with the contents of the next step.

As a ECS user you likely already have a solution for loading a configuration file into a container.

For Demonstation purposed we will be using a remote configuration file, this would not be the recommended solution for a production environment

Step 3 - Configure the Telegraf input plugin

You can download a copy of the configuration file that you will need telegraf-ecs.conf

Or a copy of the configuration file is below.

[[inputs.ecs]]
  ## ECS metadata url.
  ## Metadata v2 API is used if set explicitly. Otherwise,
  ## v3 metadata endpoint API is used if available.
  # endpoint_url = ""

  ## Containers to include and exclude. Globs accepted.
  ## Note that an empty array for both will include all containers
  # container_name_include = []
  # container_name_exclude = []

  ## Container states to include and exclude. Globs accepted.
  ## When empty only containers in the "RUNNING" state will be captured.
  ## Possible values are "NONE", "PULLED", "CREATED", "RUNNING",
  ## "RESOURCES_PROVISIONED", "STOPPED".
  # container_status_include = []
  # container_status_exclude = []

  ## ecs labels to include and exclude as tags.  Globs accepted.
  ## Note that an empty array for both will include all labels as tags
  ecs_label_include = [ "com.amazonaws.ecs.*" ]
  ecs_label_exclude = []

  ## Timeout for queries.
  # timeout = "5s"

[[outputs.http]]
  url = "${LOGIT_METRICS_URL}"
  data_format = "prometheusremotewrite"

  [outputs.http.headers]
    Content-Type = "application/x-protobuf"
    Content-Encoding = "snappy"

Step 4 - Configure an additional container on your Task Template

You will need to do this for each task you wish to monitor

Add an additional container to your existing task or as part of your container images

NOTE: you will need to pass the LOGIT_METRICS_URL env variable.

Demonstration configuration only

Name: Telegraf
Image URI: telegraf:latest
Environment variables:
  LOGIT_METRICS_URL = "https://<your-metrics-username>:<your-metrics-password>@<your-metrics-stack-id>-vm.logit.io:0/api/v1/write"
  
Docker configuration - Command:
  "--config", "https://cdn.logit.io/telegraf-ecs.conf"

Step 5 - View your metrics

Data should now have been sent to your Stack.

View my data

If you don't see metrics take a look at How to diagnose no data in Stack below for how to diagnose common issues.

Step 6 - How to diagnose no data in Stack

If you don't see data appearing in your Stack after following the steps, visit the Help Centre guide for steps to diagnose no data appearing in your Stack or Chat to support now.

Step 7 - Telegraf AWS ECS and Fargate metrics Overview

Telegraf offers a comprehensive solution for monitoring Amazon ECS and Fargate metrics, simplifying the management of containerized environments on AWS. With Telegraf's seamless integration with Amazon CloudWatch, users gain access to a rich array of performance data, including CPU utilization, memory usage, disk I/O, and network metrics.

Telegraf automates the collection of these metrics, providing real-time insights into the health and performance of ECS and Fargate workloads. Its lightweight, agent-based architecture ensures minimal overhead, making it an ideal choice for monitoring containerized applications running on AWS infrastructure.

Telegraf's extensible plugin system allows users to easily customize monitoring configurations to meet their specific requirements, ensuring flexibility and scalability as their monitoring needs evolve. Whether you're managing a small-scale ECS deployment or a complex Fargate architecture, Telegraf empowers you to monitor with precision, optimize resource allocation, and ensure the reliability of your containerized applications on AWS.

Return to Search
Sign Up

© 2024 Logit.io Ltd, All rights reserved.