Categorygithub.com/form3tech-oss/ecs-exporter

# README

This repository is not maintained anymore. It's stable and works as it is, it will not have new features or metrics.

ECS exporter Build status

Export AWS ECS cluster metrics to Prometheus

make
./bin/ecs-exporter --aws.region="${AWS_REGION}"

Notes:

  • This exporter will listen by default on the port 9222
  • Requires AWS credentials or permission from an EC2 instance
  • You can use the following IAM policy to grant required permissions:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "ecs:ListServices",
                "ecs:ListContainerInstances",
                "ecs:ListClusters",
                "ecs:DescribeServices",
                "ecs:DescribeContainerInstances",
                "ecs:DescribeClusters",
                "ec2:DescribeInstances"
            ],
            "Resource": "*"
        }
    ]
}

Exported Metrics

MetricMeaningLabels
ecs_upWas the last query of ecs successfulregion
ecs_clustersThe total number of clustersregion
ecs_servicesThe total number of servicesregion, cluster
ecs_service_desired_tasksThe desired number of instantiations of the task definition to keep running regarding a serviceregion, cluster, service
ecs_service_pending_tasksThe number of tasks in the cluster that are in the PENDING state regarding a serviceregion, cluster, service
ecs_service_running_tasksThe number of tasks in the cluster that are in the RUNNING state regarding a serviceregion, cluster, service
ecs_container_instancesThe total number of container instancesregion, cluster
ecs_container_instance_agent_connectedThe connected state of the container instance agentregion, cluster, instance
ecs_container_instance_activeThe status of the container instance in ACTIVE state, indicates that the container instance can accept tasks.region, cluster, instance
ecs_container_instance_pending_tasksThe number of tasks on the container instance that are in the PENDING status.region, cluster, instance
ecs_deployment_rollout_stateRollout status of an ECS service deployment (one of 'IN_PROGRESS', 'COMPLETED', or 'FAILED')region, cluster, service, deployment, rollout_state
ecs_deployment_desired_tasksDesired number of tasks an ECS service deployment is trying to reachregion, cluster, service, deployment
ecs_deployment_pending_tasksNumber of pending tasks an ECS service deployment is havingregion, cluster, service, deployment
ecs_deployment_running_tasksNumber of running tasks an ECS service deployment is havingregion, cluster, service, deployment
ecs_deployment_failed_tasksThe number of consecutively failed tasks of a service regarding a deploymentregion, cluster, service, deployment
ecs_container_instance_infoInformation about a container instance joined to the clusterregion, cluster, instance, ami_id, status

Flags

  • aws.region: The AWS region to get metrics from
  • aws.cluster-filter: Regex used to filter the cluster names, if doesn't match the cluster is ignored (default ".*")
  • debug: Run exporter in debug mode
  • web.listen-address: Address to listen on (default ":9222")
  • web.telemetry-path: The path where metrics will be exposed (default "/metrics")
  • metrics.disable-cinstances: Disable clusters container instances metrics gathering

Docker

You can deploy this exporter using the slok/ecs-exporter Docker image.

Note: Requires AWS credentials or permission from an EC2 instance, for example you can pass the env vars using -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} options

For example:

docker pull slok/ecs-exporter
docker run -d -p 9222:9222 slok/ecs-exporter -aws.region="eu-west-1"

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author