Merge ~adam-collard/maas:prometheus-gateway-ip-cache into maas:master

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: 1fa6d3820463572243c6ee890f0d7beb338dc626
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas:prometheus-gateway-ip-cache
Merge into: maas:master
Diff against target: 13 lines (+1/-1)
1 file modified
src/provisioningserver/prometheus/metrics.py (+1/-1)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Jack Lloyd-Walters Approve
Review via email: mp+427558@code.launchpad.net

Commit message

Don't get_machine_default_gateway every time we collect metrics

Partial fix for LP:1978225

To post a comment you must log in.
Revision history for this message
Jack Lloyd-Walters (lloydwaltersj) wrote :

+1

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b prometheus-gateway-ip-cache lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://maas-ci.internal:8080/job/maas-tester/207/consoleText

Revision history for this message
Jack Lloyd-Walters (lloydwaltersj) wrote (last edit ):

I'm going to start another build, because that one hit timeout, rather than any code issue

Revision history for this message
Jack Lloyd-Walters (lloydwaltersj) wrote :

jenkins: !test

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b prometheus-gateway-ip-cache lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 1fa6d3820463572243c6ee890f0d7beb338dc626

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/provisioningserver/prometheus/metrics.py b/src/provisioningserver/prometheus/metrics.py
index 68719d4..8f117ff 100644
--- a/src/provisioningserver/prometheus/metrics.py
+++ b/src/provisioningserver/prometheus/metrics.py
@@ -134,7 +134,7 @@ def set_global_labels(**labels):
134PROMETHEUS_METRICS = create_metrics(134PROMETHEUS_METRICS = create_metrics(
135 METRICS_DEFINITIONS,135 METRICS_DEFINITIONS,
136 extra_labels={136 extra_labels={
137 "host": get_machine_default_gateway_ip,137 "host": get_machine_default_gateway_ip(),
138 "maas_id": lambda: GLOBAL_LABELS["maas_uuid"],138 "maas_id": lambda: GLOBAL_LABELS["maas_uuid"],
139 },139 },
140 update_handlers=[update_cpu_metrics, update_memory_metrics],140 update_handlers=[update_cpu_metrics, update_memory_metrics],

Subscribers

People subscribed via source and target branches