Skip to content

Commit

Permalink
Merge pull request #2491 from RubenNL/fix-metrics-push
Browse files Browse the repository at this point in the history
Fixed the metrics for the push type.
  • Loading branch information
louislam authored Apr 1, 2023
2 parents 8f449ab + 896e338 commit 32f84b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/routers/api-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { UptimeKumaServer } = require("../uptime-kuma-server");
const { UptimeCacheList } = require("../uptime-cache-list");
const { makeBadge } = require("badge-maker");
const { badgeConstants } = require("../config");
const { Prometheus } = require("../prometheus");

let router = express.Router();

Expand Down Expand Up @@ -37,7 +38,7 @@ router.get("/api/push/:pushToken", async (request, response) => {

let pushToken = request.params.pushToken;
let msg = request.query.msg || "OK";
let ping = request.query.ping || null;
let ping = parseInt(request.query.ping) || null;
let statusString = request.query.status || "up";
let status = (statusString === "up") ? UP : DOWN;

Expand Down Expand Up @@ -89,6 +90,7 @@ router.get("/api/push/:pushToken", async (request, response) => {
io.to(monitor.user_id).emit("heartbeat", bean.toJSON());
UptimeCacheList.clearCache(monitor.id);
Monitor.sendStats(io, monitor.id, monitor.user_id);
new Prometheus(monitor).update(bean, undefined);

response.json({
ok: true,
Expand Down

0 comments on commit 32f84b5

Please sign in to comment.