prometheus-community / ecs_exporter

Prometheus exporter for Amazon Elastic Container Service (ECS)
Apache License 2.0
82 stars 21 forks source link

ECS Fargate monitoring #68

Open lazar-cl opened 1 year ago

lazar-cl commented 1 year ago

Hello,

I want to send metrics from the ECS cluster (there are 5 services inside it) to Grafana.

I tried everything possible.

Node exporter is not a solution because ECS is on Fargate.

Prometheus released its ecs-exporter, but it only collects data from the service where the ecs-exporter is installed.

But I want to set up another service, let's say ecs-exporter, which will collect data from all the services that are in that cluster, literally to select a service in Grafana for which it will send me metrics.

Cloudwatch is also not a solution because their response is quite slow, which is very bad in terms of monitoring.

Has anyone been able to solve this problem and encountered it?

Thanks in advance to everyone for the answers.

zahornyak commented 1 year ago

Hi, in my case(which is similar) I've created a separate service in ECS with the Prometheus image with a custom configuration that looks like this:

global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'fargate-tasks'
    dns_sd_configs:
      - names:
        - 'test-service.development.local'
        - 'jaeger.development.local'
        # etc.
        type: 'A'
        port: 9779
        refresh_interval: 10s

remote_write:
  - url: "https://aps-workspaces.eu-central-1.amazonaws.com/workspaces/ws-id-here/api/v1/remote_write"
    sigv4:
      region: "eu-central-1"

And installed sidecar containers with ecs-exporter to each service. Looks great, sidecar containers are lightweight a lot and I can see all the metrics I need. I guess that's the only way to do that with Prometheus. I know that's not the solution for you, but at least I gave you another point of view.

mwimpelberg28 commented 1 week ago

I found this container that was helpful in this case. https://hub.docker.com/r/coveo/ecs-exporter/