whateverMan
whateverMan

Reputation: 65

Getting dummy data as response to a valid authenticated api call in GCP

I am currently trying to get percentage of cpu used by a VM instance using the following api in GCP: https://monitoring.googleapis.com/v3/projects//metricDescriptors?filter=metric.type="compute.googleapis.com/instance/cpu/utilization"

I have also enable the monitoring services, and have performed all the required authentications.

The api seems to be working but I am getting dummy data as response, I want to get real values of resource used, do I have to activate some metric which I don't know about? Any help will be appreciated .

Following is the response which I am getting from the api call:

The respone from the above api call

Upvotes: 0

Views: 45

Answers (1)

LundinCast
LundinCast

Reputation: 9810

The response you received isn't dummy data but a description of the metrics. This is because you hit the metricDescriptors endpoints. Its usage is described in the doc here.

To get the actual data for a given metric, you need to hit the timeSeries endpoint and provide the necessary filters. You can see the doc here about reading metric data. You can also test it via the API Explorer here.

Upvotes: 1

Related Questions