Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 955c923

Browse files
authored
Add region tags for writing time series [(#757)](GoogleCloudPlatform/python-docs-samples#757)
1 parent af6ee34 commit 955c923

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

samples/snippets/v3/custom_metric.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def get_custom_data_point():
100100
return length
101101

102102

103+
# [START write_timeseries]
103104
def write_timeseries_value(client, project_resource,
104105
custom_metric_type, instance_id, metric_kind):
105106
"""Write the custom metric obtained by get_custom_data_point at a point in
@@ -136,6 +137,7 @@ def write_timeseries_value(client, project_resource,
136137
request = client.projects().timeSeries().create(
137138
name=project_resource, body={"timeSeries": [timeseries_data]})
138139
request.execute()
140+
# [END write_timeseries]
139141

140142

141143
def read_timeseries(client, project_resource, custom_metric_type):

0 commit comments

Comments
 (0)