Add new default labels that can be set as tags to turn up in Prometheus

pull/898/head
Matthew Macdonald-Wallace 3 years ago
parent d1f0e9b40f
commit 0990001e65

@ -7,6 +7,15 @@ const commonLabels = [
"monitor_url", "monitor_url",
"monitor_hostname", "monitor_hostname",
"monitor_port", "monitor_port",
"location",
"region",
"datacenter",
"cloud_provider",
"az",
"rack",
"shelf",
"room",
"floor"
]; ];
const monitor_cert_days_remaining = new PrometheusClient.Gauge({ const monitor_cert_days_remaining = new PrometheusClient.Gauge({
@ -55,7 +64,7 @@ class Prometheus {
monitor_port: monitor.port monitor_port: monitor.port
}; };
let tags = this.get_tags(monitor); this.get_tags(monitor).then(tags => {
for (let tag in tags) { for (let tag in tags) {
let tag_detail = tags[tag]; let tag_detail = tags[tag];
let name = tag_detail.name; let name = tag_detail.name;
@ -63,6 +72,8 @@ class Prometheus {
console.log("New tag created: {" + name + ": " + value + "}"); console.log("New tag created: {" + name + ": " + value + "}");
this.monitorLabelValues[name] = value; this.monitorLabelValues[name] = value;
} }
}
);
} }
update(heartbeat, tlsInfo) { update(heartbeat, tlsInfo) {

Loading…
Cancel
Save