Merge ~xavpaice/charm-telegraf:add_juju_model_uuid into charm-telegraf:master

Proposed by Xav Paice
Status: Merged
Approved by: James Troup
Approved revision: 7c9a9242303a380df75971db8e3b1dfacada0ceb
Merged at revision: c4a8e0688eeaef3a0fd432ac1550dc23a6d5a050
Proposed branch: ~xavpaice/charm-telegraf:add_juju_model_uuid
Merge into: charm-telegraf:master
Diff against target: 26 lines (+4/-0)
2 files modified
src/reactive/telegraf.py (+1/-0)
src/tests/unit/test_telegraf.py (+3/-0)
Reviewer Review Type Date Requested Status
Celia Wang Approve
Haw Loeung +1 Approve
🤖 prod-jenkaas-bootstack (community) continuous-integration Needs Fixing
BootStack Reviewers Pending
Review via email: mp+407421@code.launchpad.net

Commit message

Add juju_model_uuid to tags

Adds the juju_model_uuid tag to metrics, to match up with the metadata provided in the charms interfacing with the prometheus-k8s charm.

To post a comment you must log in.
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)
Revision history for this message
Celia Wang (ziyiwang) wrote :

lgtm

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision c4a8e0688eeaef3a0fd432ac1550dc23a6d5a050

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/reactive/telegraf.py b/src/reactive/telegraf.py
index ecbbf57..137d4d8 100644
--- a/src/reactive/telegraf.py
+++ b/src/reactive/telegraf.py
@@ -712,6 +712,7 @@ def configure_telegraf(): # noqa: C901
712 tags_dict["juju_unit"] = get_remote_unit_name().replace("/", "-")712 tags_dict["juju_unit"] = get_remote_unit_name().replace("/", "-")
713 try:713 try:
714 tags_dict["juju_model"] = hookenv.model_name()714 tags_dict["juju_model"] = hookenv.model_name()
715 tags_dict["juju_model_uuid"] = hookenv.model_uuid()
715 except KeyError:716 except KeyError:
716 pass # support older Juju 1.x deploys717 pass # support older Juju 1.x deploys
717 # Parse juju-configured tags, which can override the 3 juju_* defined above718 # Parse juju-configured tags, which can override the 3 juju_* defined above
diff --git a/src/tests/unit/test_telegraf.py b/src/tests/unit/test_telegraf.py
index 55eae97..8379987 100644
--- a/src/tests/unit/test_telegraf.py
+++ b/src/tests/unit/test_telegraf.py
@@ -66,6 +66,9 @@ UNIT_TESTS_DATA_DIR = os.path.join(UNIT_TESTS_DIR, "data")
66def setup(monkeypatch, tmpdir):66def setup(monkeypatch, tmpdir):
67 monkeypatch.setitem(os.environ, "JUJU_UNIT_NAME", "telegraf/0")67 monkeypatch.setitem(os.environ, "JUJU_UNIT_NAME", "telegraf/0")
68 monkeypatch.setitem(os.environ, "JUJU_MODEL_NAME", "telegraf-test-model")68 monkeypatch.setitem(os.environ, "JUJU_MODEL_NAME", "telegraf-test-model")
69 monkeypatch.setitem(
70 os.environ, "JUJU_MODEL_UUID", "abcdef12-0000-0000-0000-abcdabcdabcd"
71 )
69 monkeypatch.setattr(telegraf, "get_remote_unit_name", lambda: "remote-unit/0")72 monkeypatch.setattr(telegraf, "get_remote_unit_name", lambda: "remote-unit/0")
70 # mock this to avoid permission errors73 # mock this to avoid permission errors
71 monkeypatch.setattr(telegraf, "update_sysstat_config_with_sdac_xall", lambda: True)74 monkeypatch.setattr(telegraf, "update_sysstat_config_with_sdac_xall", lambda: True)

Subscribers

People subscribed via source and target branches

to all changes: