From f5e8cf8b51812b9e79bb5312f84e29b3f8c2c81e Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Fri, 27 Aug 2021 10:04:14 -0700 Subject: [PATCH] docs(samples): include example writing of label data (#202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 🦕 --- samples/snippets/v3/cloud-client/snippets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/snippets/v3/cloud-client/snippets.py b/samples/snippets/v3/cloud-client/snippets.py index 9b47e5da..41ced1c6 100644 --- a/samples/snippets/v3/cloud-client/snippets.py +++ b/samples/snippets/v3/cloud-client/snippets.py @@ -67,6 +67,7 @@ def write_time_series(project_id): series.resource.type = "gce_instance" series.resource.labels["instance_id"] = "1234567890123456789" series.resource.labels["zone"] = "us-central1-f" + series.metric.labels["TestLabel"] = "My Label Data" now = time.time() seconds = int(now) nanos = int((now - seconds) * 10 ** 9)