CloudWatch get resourceType metric data

0

I want to get metric data to CloudWatch dashboard.

( I using get_metric_data() method )

but, explorer type can't get metric data

example, I can obtain metric data in the following format:

"metrics": [
    ["AWS/EC2", "CPUUtilization", "InstanceId", "i-0b...", { "period": 300, "stat": "Average" }]
]

but I can't get metric data of:

"metrics": [
  {
      "metricName": "CPUUtilization",
      "resourceType": "AWS::EC2::Instance",
      "stat": "Average"
  }
]

How do I get resourceType metric data?

ari
已提问 6 个月前166 查看次数
1 回答
0

Hello.

There is no option to specify resourceType in get_metric_data().
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch/client/get_metric_data.html

Do you know the namespace where "resourceType": "AWS::EC2::Instance" is saved?
If you know the namespace, there is a possibility that you can get it using get_metric_data().

profile picture
专家
已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则