Skip to content

Commit 6ccd5bb

Browse files
minherzdandhlee
authored andcommitted
fix: add metric label example to the snippet (#509)
add code line to set metric label in addition to resource label. make the code sample align with similar samples in other languages.
1 parent a770b70 commit 6ccd5bb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

monitoring/snippets/v3/cloud-client/quickstart.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def run_quickstart(project=""):
2525

2626
series = monitoring_v3.TimeSeries()
2727
series.metric.type = "custom.googleapis.com/my_metric"
28+
series.metric.labels["store_id"] = "Pittsburgh"
2829
series.resource.type = "gce_instance"
2930
series.resource.labels["instance_id"] = "1234567890123456789"
3031
series.resource.labels["zone"] = "us-central1-f"

0 commit comments

Comments
 (0)