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
질문됨 5달 전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
전문가
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인