mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-12-10 00:30:23 -06: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:
parent
6e49601eed
commit
f4ff234ec8
@ -359,7 +359,11 @@ class Monitor extends BeanModel {
|
|||||||
let previousBeat = null;
|
let previousBeat = null;
|
||||||
let retries = 0;
|
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 () => {
|
const beat = async () => {
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,12 @@ router.all("/api/push/:pushToken", async (request, response) => {
|
|||||||
io.to(monitor.user_id).emit("heartbeat", bean.toJSON());
|
io.to(monitor.user_id).emit("heartbeat", bean.toJSON());
|
||||||
|
|
||||||
Monitor.sendStats(io, monitor.id, monitor.user_id);
|
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({
|
response.json({
|
||||||
ok: true,
|
ok: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user