From 0990001e65912c7e6ff56470eb1f3a0bfca9c315 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Mon, 21 Feb 2022 07:21:27 +0000 Subject: [PATCH] Add new default labels that can be set as tags to turn up in Prometheus --- server/prometheus.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/prometheus.js b/server/prometheus.js index 395df612..0d467bc2 100644 --- a/server/prometheus.js +++ b/server/prometheus.js @@ -7,6 +7,15 @@ const commonLabels = [ "monitor_url", "monitor_hostname", "monitor_port", + "location", + "region", + "datacenter", + "cloud_provider", + "az", + "rack", + "shelf", + "room", + "floor" ]; const monitor_cert_days_remaining = new PrometheusClient.Gauge({ @@ -55,7 +64,7 @@ class Prometheus { monitor_port: monitor.port }; - let tags = this.get_tags(monitor); + this.get_tags(monitor).then(tags => { for (let tag in tags) { let tag_detail = tags[tag]; let name = tag_detail.name; @@ -63,6 +72,8 @@ class Prometheus { console.log("New tag created: {" + name + ": " + value + "}"); this.monitorLabelValues[name] = value; } + } + ); } update(heartbeat, tlsInfo) {