cloudwatch_exporter icon indicating copy to clipboard operation
cloudwatch_exporter copied to clipboard

[request]: Support for Cloudwatch namespace ECS/ContainerInsights

Open mermino opened this issue 3 years ago • 3 comments

Proposal

Use case. Why is this important?

To collect metrics for ECS containers!

How do you think the new configuration should look like?

Example:

- aws_namespace: ECS/ContainerInsights
  aws_metric_name: NetworkTxBytes
  aws_dimensions: [ClusterName, ServiceName, EC2InstanceId, ContainerInstanceId, TaskDefinitionFamily]
  aws_statistics: [Average]

- aws_namespace: ECS/ContainerInsights
  aws_metric_name: TaskCount
  aws_dimensions: [ClusterName, ServiceName, EC2InstanceId, ContainerInstanceId, TaskDefinitionFamily]
  aws_statistics: [Average]

- aws_namespace: ECS/ContainerInsights
  aws_metric_name: DesiredTaskCount
  aws_dimensions: [ClusterName, ServiceName, EC2InstanceId, ContainerInstanceId, TaskDefinitionFamily]
  aws_statistics: [Average]

mermino avatar Jul 27 '22 22:07 mermino

I am not sure what the request is here. The exporter generically interacts with CloudWatch, and fetching these metrics should work. With the configuration you provided, what happens?

matthiasr avatar Oct 25 '22 08:10 matthiasr

I am not using ECS, so I can't test. Could you share how you would get the metrics using the AWS CLI?

matthiasr avatar Oct 25 '22 08:10 matthiasr

@mermino First check: do you have containerInsights enabled for the ECS service? Also, looking at your aws_dimensions they seem a little too crowded though I can only comment on the dimensions for ECS Fargate. I am able to see ContainerInsight metrics in Prometheus using this config for cloudwatch-exporter:

...
  - aws_namespace: ECS/ContainerInsights
    aws_metric_name: RunningTaskCount
    aws_statistics: [Average, Minimum]
    aws_dimensions: [ClusterName, ServiceName]
    aws_dimension_select_regex:
      ClusterName: ["<cluster-name>/foo*"]
    set_timestamp: false
...

This is a screenshot from Cloudwatch showing me the metrics dimensions: Screenshot 2023-06-13 at 17 58 10

robert-becker-hs avatar Jun 13 '23 15:06 robert-becker-hs