Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Export Metric data to GCS bucket ?

Hi, 
I need to export metric data to a GCS bucket. 

I run a QML query in metric explorer and can visualize graph.

There is a Download to CSV button available in the UI .

How can I achieve the same programmatically ?

Screenshot 2024-07-25 at 8.37.54 AM.png

Again, it is to export the data , not the metric itself .

Thank you

0 5 140
5 REPLIES 5

Hi Nico,

I think this article may help: https://cloud.google.com/monitoring/custom-metrics/reading-metrics

Please let me know if it worked for you.

Regards,
Lukasz

Thank you but unfortunately this is not addressing the problem I have here.  That article desribe how to create metric, I need to export the data from a metric. Like it is doable in the UI .

Please see this excerpt from the aforementioned article:

This will let you get the time-series data of the metric of your choice.

There is a metrics to BigQuery solution guide [1] that may be useful as a starting point. Can you share any additional details about the use case for downloading? 

[1] https://github.com/GoogleCloudPlatform/community/blob/master/archived/metrics-export-with-mql/index....

Hello,

Thank you for your engagement regarding this issue. We haven’t heard back from you regarding this issue for sometime now. Hence, I'm going to close this issue which will no longer be monitored. However, if you have any new issues, Please don’t hesitate to create a new issue. We will be happy to assist you on the same.

Regards,
Jai Ade