def get_custom_metric(client, project_id, custom_metric_type):
    """Retrieve the custom metric we created"""
    request = client.projects().metricDescriptors().list(
        name=project_id,
        filter='metric.type=starts_with("{}")'.format(custom_metric_type))
    response = request.execute()
    print('ListCustomMetrics response:')
    pprint.pprint(response)
    try:
        return response['metricDescriptors']
    except __HOLE__:
        return None
dataset/ETHPy150Open GoogleCloudPlatform/python-docs-samples/monitoring/api/v3/custom_metric.py/get_custom_metric