Skip to content

Commit

Permalink
Don’t send name in create custom metric
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Prin committed May 5, 2016
1 parent c69d2b2 commit 0ea1b66
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions monitoring/api/v3/custom_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def create_custom_metric(client, project_id,
custom_metric_type, metric_kind):
"""Create custom metric descriptor"""
metrics_descriptor = {
"name": "projects/{}/metricDescriptors/{}".format(
project_id, custom_metric_type),
"type": custom_metric_type,
"labels": [
{
Expand Down

2 comments on commit 0ea1b66

@Garciat
Copy link

@Garciat Garciat commented on 0ea1b66 May 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I may ask, why is this the case? Is the field optional?

This page says that name is what you use type here for, and that the domain for custom metrics is custom.cloudmonitoring.googleapis.com instead of custom.googleapis.com. Clarification, please? Thanks! (:

@waprin
Copy link
Contributor

@waprin waprin commented on 0ea1b66 May 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Garciat name is output only. name is the REST description of the resource and the server assigns it automatically, type is the correct field to provide on the input. custom.cloudmonitoring.googleapis.com is v2, custom.googleapis.com is v3. docs are currently incorrect and will be fixed soon.

Please sign in to comment.