File tree 1 file changed +3
-3
lines changed
monitoring/snippets/v3/cloud-client
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 18
18
import time
19
19
import uuid
20
20
21
- from google .api import metric_pb2 as ga_metric
22
21
from google .api import label_pb2 as ga_label
22
+ from google .api import metric_pb2 as ga_metric
23
23
from google .cloud import monitoring_v3
24
24
25
25
@@ -35,13 +35,13 @@ def create_metric_descriptor(project_id):
35
35
descriptor .metric_kind = ga_metric .MetricDescriptor .MetricKind .GAUGE
36
36
descriptor .value_type = ga_metric .MetricDescriptor .ValueType .DOUBLE
37
37
descriptor .description = "This is a simple example of a custom metric."
38
-
38
+
39
39
labels = ga_label .LabelDescriptor ()
40
40
labels .key = "TestLabel"
41
41
labels .value_type = ga_label .LabelDescriptor .ValueType .STRING
42
42
labels .description = "This is a test label"
43
43
descriptor .labels .append (labels )
44
-
44
+
45
45
descriptor = client .create_metric_descriptor (
46
46
name = project_name , metric_descriptor = descriptor
47
47
)
You can’t perform that action at this time.
0 commit comments