Looking to export a Log-based Metric in JSON Format

679 Views Asked by At

I have several GCP project that are all monitored by one central project. I want to add a Log-based metric to each of the sub-projects. The structure of the metric is identical across all the projects, with the exception that the name of the project is appended to the name of the metric. To do this, I have a Python Script that can use the GCP API to create the Metric. The script, however, requires the JSON description of the Metric. I cannot, however, find out where to export a metric's JSON. Does anyone know how to export, fetch, or GET a metric in JSON form? I have attempted to use the API call outlined here, but it lacks the filter and lableExtractors fields for the metric.

1

There are 1 best solutions below

0
On BEST ANSWER

Since it was created as a log-based metric, you can: