10

I have my ecs cluster running and in the metrics section the 4 metrics is coming i.e CPUUtilization, MemoryUtilization, CPUReservation, MemoryReservation but all the metrics is empty even when I select 4 months. I have running many Scheduled Tasks and tasks with fargate launch type only.

I am very new to ECS, please help I want to setup the metrics alarms on fargate so from their metrics I will select the overall threshold values.

Thanks in advance !

user12417145
  • 439
  • 1
  • 6
  • 12
  • Do you have `ecs:StartTelemetrySession` permission on the IAM role that you launch your container instances with? – MisterSmith Jul 25 '20 at 14:34
  • @MisterSmith This would be needed for EC2 launch type, not Fargate. Accroding to [docs](https://docs.aws.amazon.com/AmazonECS/latest/userguide/cloudwatch-metrics.html), metrics for fargate are always on by default. – Marcin Jul 27 '20 at 01:07
  • @MisterSmith Yes, I have ecs:StartTelemetrySession permission on the IAM role but still can't see the metrics of ECS. – user12417145 Jul 27 '20 at 06:39
  • @Marcin Yes, I can see the metrics but there is no data in it even when task is in running state. – user12417145 Jul 27 '20 at 06:40

1 Answers1

16

Fargate provides metrics on ECS "Service" level, and not Task level since you have scheduled tasks which are not running as an ECS Service thus you are not seeing the metrics. Some discussion on why task level metrics are not provided is here: 1

I suggest you setup Container insights 2 which will give container level metrics 3 as required for your use case.

shariqmaws
  • 8,152
  • 1
  • 16
  • 35