mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-12-05 01:10:52 +00:00
[Push monitor] Fix: Prometheus update with incorrect value (#6436)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -359,7 +359,11 @@ class Monitor extends BeanModel {
|
||||
let previousBeat = null;
|
||||
let retries = 0;
|
||||
|
||||
this.prometheus = new Prometheus(this, await this.getTags());
|
||||
try {
|
||||
this.prometheus = new Prometheus(this, await this.getTags());
|
||||
} catch (e) {
|
||||
log.error("prometheus", "Please submit an issue to our GitHub repo. Prometheus update error: ", e.message);
|
||||
}
|
||||
|
||||
const beat = async () => {
|
||||
|
||||
|
||||
@@ -119,7 +119,12 @@ router.all("/api/push/:pushToken", async (request, response) => {
|
||||
io.to(monitor.user_id).emit("heartbeat", bean.toJSON());
|
||||
|
||||
Monitor.sendStats(io, monitor.id, monitor.user_id);
|
||||
new Prometheus(monitor).update(bean, undefined);
|
||||
|
||||
try {
|
||||
new Prometheus(monitor, []).update(bean, undefined);
|
||||
} catch (e) {
|
||||
log.error("prometheus", "Please submit an issue to our GitHub repo. Prometheus update error: ", e.message);
|
||||
}
|
||||
|
||||
response.json({
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user