Skip to content
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

Closed
bws0013 opened this issue Aug 18, 2021 · 0 comments · Fixed by #202
Closed

Improve snippets.py example for adding label data #200

bws0013 opened this issue Aug 18, 2021 · 0 comments · Fixed by #202
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. type: docs Improvement to the documentation for an API.

Comments

@bws0013
Copy link
Contributor

bws0013 commented Aug 18, 2021

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]

def write_time_series(project_id):

[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.

@product-auto-label product-auto-label bot added the api: monitoring Issues related to the googleapis/python-monitoring API. label Aug 18, 2021
@busunkim96 busunkim96 added the type: docs Improvement to the documentation for an API. label Aug 18, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Aug 27, 2021
adding label example when writing a timeseries in python

Remaking this due to the commit lint failure in #200 and it being easier to just make a new PR.  Closing #200. 

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [✔️] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-monitoring/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [✔️ for linter, unable to run the nox tests because of issues unrelated] Ensure the tests and linter pass
- [✔️] Code coverage does not decrease (if any source code was changed)
- [✔️, no doc updates required ] Appropriate docs were updated (if necessary)

Fixes #200  🦕
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. type: docs Improvement to the documentation for an API.
Projects
None yet
2 participants