This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
Improve snippets.py example for adding label data #200
Labels
api: monitoring
Issues related to the googleapis/python-monitoring API.
type: docs
Improvement to the documentation for an API.
Is your feature request related to a problem? Please describe.
There aren't any examples of writing a timeseries which include writing label data in the python snippets. The metrics descriptor is created with a label [1] and a timeseries is written [2] but the time series doesn't include the label. This change would make it easier to understand how to push this (in python) data when following the gcp documentation [3] (which includes using these labels in go and C#).
[1] https://github.com/googleapis/python-monitoring/blob/2def0f3d66846d16fb58dd23fcf4a593ba084f7c/samples/snippets/v3/cloud-client/snippets.py#L39:L42
[2]
python-monitoring/samples/snippets/v3/cloud-client/snippets.py
Line 60 in 2def0f3
[3] https://cloud.google.com/monitoring/custom-metrics/creating-metrics#writing-ts
Describe the solution you'd like
It would be useful to modify write_time_series to include writing the label as well.
The text was updated successfully, but these errors were encountered: