mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 12:06:04 -04:00
separate log functions
This commit is contained in:
parent
d21f7971b5
commit
e5913c5abc
15 changed files with 230 additions and 203 deletions
|
@ -1,5 +1,5 @@
|
|||
const PrometheusClient = require("prom-client");
|
||||
const { log } = require("../src/util");
|
||||
const { log_error } = require("../src/util");
|
||||
|
||||
const commonLabels = [
|
||||
"monitor_name",
|
||||
|
@ -57,23 +57,23 @@ class Prometheus {
|
|||
}
|
||||
monitor_cert_is_valid.set(this.monitorLabelValues, is_valid);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
|
||||
try {
|
||||
monitor_cert_days_remaining.set(this.monitorLabelValues, tlsInfo.certInfo.daysRemaining);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
monitor_status.set(this.monitorLabelValues, heartbeat.status);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -84,8 +84,8 @@ class Prometheus {
|
|||
monitor_response_time.set(this.monitorLabelValues, -1);
|
||||
}
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue