From 3fb8c061a6533b0e9cfaccd08a9ac04bdf66c77c Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Thu, 17 Mar 2016 12:12:29 -0700 Subject: [PATCH] Fix metric.name All the filters should be metric.type (API change, name is now the fully qualified REST resource). --- monitoring/api/v3/list_resources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring/api/v3/list_resources.py b/monitoring/api/v3/list_resources.py index 88a765fcac9a..2d088f414abe 100644 --- a/monitoring/api/v3/list_resources.py +++ b/monitoring/api/v3/list_resources.py @@ -74,7 +74,7 @@ def list_metric_descriptors(client, project_resource, metric): """ request = client.projects().metricDescriptors().list( name=project_resource, - filter='metric.name="{}"'.format(metric)) + filter='metric.type="{}"'.format(metric)) response = request.execute() print( 'list_metric_descriptors response:\n{}'.format( @@ -87,7 +87,7 @@ def list_timeseries(client, project_resource, metric): """ request = client.projects().timeSeries().list( name=project_resource, - filter='metric.name="{}"'.format(metric), + filter='metric.type="{}"'.format(metric), pageSize=3, interval_startTime=get_start_time(), interval_endTime=get_end_time())