cloudwatch_exporter icon indicating copy to clipboard operation
cloudwatch_exporter copied to clipboard

Multiple dimensions not able to display under AWS/EC2 namespace

Open ravik1176 opened this issue 3 years ago • 5 comments

Hi Team,

Multiple dimensions not able to display under AWS/EC2 namespace. Below parameters are not working... Please find the code i'm using on it. Please help me on the same to sort our issue. Thanks..

- aws_dimensions: [InstanceType, InstanceId ]
  aws_metric_name: EBSWriteBytes
  aws_namespace: AWS/EC2
  aws_statistics:
  - Average

We able to get only these metrics

# TYPE aws_ec2_ebswrite_bytes_average gauge
aws_ec2_ebswrite_bytes_average{job="aws_ec2",instance="",instance_type="r5d.xlarge",} 276992.0 1646919780000

ravik1176 avatar Mar 10 '22 14:03 ravik1176

Can anyone help me on this issue. Thanks.

ravik1176 avatar Mar 16 '22 12:03 ravik1176

I have the same issue, did you manage to figure it out?

a-monteiro avatar May 12 '22 18:05 a-monteiro

@ravik1176 the issue is a little incomplete. Is what you shared the complete configuration or just a part of it? Please try to update to the latest version of the tool, it might emit helpful logs: https://github.com/prometheus/cloudwatch_exporter/pull/436

or-shachar avatar Jun 23 '22 15:06 or-shachar

Any updates on this issue?

rturatti avatar Aug 11 '23 19:08 rturatti

I would like to dig into this deeper, since it seems to be a recurring issue.

What results are you getting? What results do you expect? What differences are there between the instances that show up and those that don't? In particular, are they on Basic or Detailed monitoring?

I've been playing around with aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name EBSWriteBytes --dimensions Name=InstanceId,Value=$instanceId, what results do you get when you plug in an instance that you do or don't get in metrics? One thing I noticed is that (with an instance on basic monitoring), I get data points every 5 minutes even if I plug in a period of 60 seconds (which is the exporter default). I wonder if this confuses the exporter. I am also getting weirdly different alignment depending on the period in the request. If I specify a period of 60, I get samples aligned on 5-minute-boundaries, but if I specify a period of 300, I don't 😕

collapsed because it's long
❯ aws cloudwatch get-metric-data --cli-input-json "$(cat <<EOF
{
  "MetricDataQueries": [
    {
      "Id": "ebs",
      "MetricStat": {
        "Metric": {
          "Namespace": "AWS/EC2",
          "MetricName": "EBSWriteBytes",
          "Dimensions": [
            {
              "Name": "InstanceId",
              "Value": "$instanceId"
            }
          ]
        },
        "Period": 60,
        "Stat": "Sum",
        "Unit": "Bytes"
      },
      "ReturnData": true
    }
  ],
  "StartTime": "2023-09-25T16:13:00Z",
  "EndTime": "2023-09-25T16:23:00Z"
}
EOF
)"
{
    "MetricDataResults": [
        {
            "Id": "ebs",
            "Label": "EBSWriteBytes",
            "Timestamps": [
                "2023-09-25T16:20:00+00:00",
                "2023-09-25T16:15:00+00:00"
            ],
            "Values": [
                1171161088.0,
                2212270080.0
            ],
            "StatusCode": "Complete"
        }
    ],
    "Messages": []
}
❯ aws cloudwatch get-metric-data --cli-input-json "$(cat <<EOF
{
  "MetricDataQueries": [
    {
      "Id": "ebs",
      "MetricStat": {
        "Metric": {
          "Namespace": "AWS/EC2",
          "MetricName": "EBSWriteBytes",
          "Dimensions": [
            {
              "Name": "InstanceId",
              "Value": "$instanceId"
            }
          ]
        },
        "Period": 300,
        "Stat": "Sum",
        "Unit": "Bytes"
      },
      "ReturnData": true
    }
  ],
  "StartTime": "2023-09-25T16:13:00Z",
  "EndTime": "2023-09-25T16:23:00Z"
}
EOF
)"
{
    "MetricDataResults": [
        {
            "Id": "ebs",
            "Label": "EBSWriteBytes",
            "Timestamps": [
                "2023-09-25T16:18:00+00:00",
                "2023-09-25T16:13:00+00:00"
            ],
            "Values": [
                1171161088.0,
                2212270080.0
            ],
            "StatusCode": "Complete"
        }
    ],
    "Messages": []
}

matthiasr avatar Sep 25 '23 16:09 matthiasr