All Projects → Spaced-Out → ecs-container-exporter

Spaced-Out / ecs-container-exporter

Licence: MIT license
AWS ECS side car that exports ECS container level docker stats metrics to Prometheus as well as publish it via Statsd.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ecs-container-exporter

aws-ecs-orb
An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
Stars: ✭ 48 (+118.18%)
Mutual labels:  aws-ecs, fargate
cdk-github-actions-runner
Deploy self-hosted GitHub Actions runner to AWS Fargate using AWS Cloud Development Kit (CDK)
Stars: ✭ 89 (+304.55%)
Mutual labels:  aws-ecs, fargate
terraform-aws-ecs-fargate-task-definition
AWS ECS Fargate Task Definition Terraform Module
Stars: ✭ 20 (-9.09%)
Mutual labels:  aws-ecs, fargate
Java Dogstatsd Client
a java statsd client library
Stars: ✭ 140 (+536.36%)
Mutual labels:  statsd
Statsite
C implementation of statsd
Stars: ✭ 1,791 (+8040.91%)
Mutual labels:  statsd
MPContribs
Platform for materials scientists to contribute and disseminate their materials data through Materials Project
Stars: ✭ 30 (+36.36%)
Mutual labels:  fargate
statsd.cr
A statsd client library for Crystal.
Stars: ✭ 32 (+45.45%)
Mutual labels:  statsd
Statsd Csharp Client
Statsd C# Client
Stars: ✭ 110 (+400%)
Mutual labels:  statsd
http-api-aws-fargate-cdk
Build HTTP API Based Services using Amazon API Gateway, AWS PrivateLink, AWS Fargate and AWS CDK
Stars: ✭ 5 (-77.27%)
Mutual labels:  fargate
Datadog Go
go dogstatsd client library for datadog
Stars: ✭ 238 (+981.82%)
Mutual labels:  statsd
Statix
Fast and reliable Elixir client for StatsD-compatible servers
Stars: ✭ 228 (+936.36%)
Mutual labels:  statsd
Go Statsd Client
statsd client for Go
Stars: ✭ 163 (+640.91%)
Mutual labels:  statsd
nvidia-docker-bootstrap
For those times when nvidia-docker is not possible (like AWS ECS)
Stars: ✭ 19 (-13.64%)
Mutual labels:  aws-ecs
Promitor
Bringing Azure Monitor metrics where you need them.
Stars: ✭ 140 (+536.36%)
Mutual labels:  statsd
docker grafana statsd elk
Docker repo for a general purpose graphing and logging container - includes graphite+carbon, grafana, statsd, elasticsearch, kibana, nginx, logstash indexer (currently using redis as an intermediary)
Stars: ✭ 19 (-13.64%)
Mutual labels:  statsd
Statsd Vis
Standalone StatsD server with built-in visualization
Stars: ✭ 124 (+463.64%)
Mutual labels:  statsd
flask-react-aws
testdriven.io/courses/aws-flask-react/
Stars: ✭ 25 (+13.64%)
Mutual labels:  aws-ecs
Redis Timeseries
Future development of redis-timeseries is at github.com/RedisLabsModules/redis-timeseries.
Stars: ✭ 197 (+795.45%)
Mutual labels:  statsd
Trashed
Tell StatsD about request time, GC, objects and more. Latest Rails 4 and Ruby 2.1 support, and ancient Rails 2 and Ruby 1.8 support.
Stars: ✭ 188 (+754.55%)
Mutual labels:  statsd
Netdata
Real-time performance monitoring, done right! https://www.netdata.cloud
Stars: ✭ 57,056 (+259245.45%)
Mutual labels:  statsd

ecs-container-exporter

AWS ECS side car that exports ECS container level docker stats metrics to Prometheus as well as publish it via Statsd.

Motivation

The default metrics available in AWS ECS are limited, mostly at the task level, across all containers in a task; the container level metrics are not available. In addition, more detailed cgroup metrics are also not available, such as per cpu, and memory usage breakdown into cache, rss, etc.

Luckily AWS exposes the docker stats data via a Task metadata endpoint.

The ecs-container-exporter parses this data, and can expose it to Prometheus or push them via StatsD.

Usage

Install via Pip:

$ pip3 install ecs-container-exporter

or via docker:

$ docker pull raags/ecs-container-exporter

On ECS, add the following json to the task definition:

{
	"name": "ecs-container-exporter",
	"image": "raags/ecs-container-exporter:latest",
	"portMappings": [
	{
		"hostPort": 0,
		"protocol": "tcp",
		"containerPort": 9545
	}
	],
	"command": [],
	"cpu": 256,
	"dockerLabels": {
		"PROMETHEUS_EXPORTER_PORT": "9545"
	}
}

The PROMETHEUS_EXPORTER_PORT label is for ECS discovery via https://github.com/teralytics/prometheus-ecs-discovery

To include or exclude application containers use the INCLUDE or EXCLUDE environment variable. By default ecs-container-exporter and ~internal~ecs~pause (a Fargate internal sidecar) is excluded.

Statsd

Version 2.0.0 add Statsd support with --use-statsd flag or env USE_STATSD. Metrics are emitted with DogStatsd Tag format.

Metrics

The metrics are sampled twice as per the configured interval (default 60s), and than aggregated in this interval. This should be set to the Prometheus scrape interval.

CPU

CPU usage ratio is calculated and scaled as per the applicable container or task cpu limit:

Task Limit Container Limit Task Metric Container Metric
0 0 no scaling no scaling
0 x no scaling scale cpu (can burst above 100%)
x 0 scale as per limit scale as per task limit
x x scale as per limit scale as per container limit (can burst above 100%)

Note that unlike docker stats command and others, CPU usage is not scaled to the number of CPUs. This means a task with 4 CPUs with all 4 having full utilization will show up as 400% in docker stats, but 100% here.

Memory

Memory usage and cache is emitted separately, but the memory usage also includes cache, so subtract cache from it to plot application memory usage specifically.

IO

Network

Network metrics were recently added in Fargate 1.4.0 and ECS agent 1.41.0 onwards.

TODO

[] - Support Non ECS docker host containers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].