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
preguntada hace 6 meses166 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace 6 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas