mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Push monitor status parameter overrides retries #2223
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#2223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dallyger on GitHub (May 30, 2023).
⚠️ Please verify that this bug has NOT been raised before.
🛡️ Security Policy
Description
Hi,
thank you for this project. Helps a lot.
We have a couple scripts, where we push the result to push monitors.
If they fail, we push with
status=downand attach the error message via themsg=parameter.This works beautifully.
However, this will ignore the "Retry" option and immediately mark the monitor as "Down", causing notifications to go off. But most of the time, this is a temporary issue, which is gone in a minute or two.
This makes those notifications less impactful, as users ignore them thinking "Oh it's most likely just a temporary issue" or worse, silencing them.
It's not clear if this is a bug or intended behavior (we explicitly say
state=down).But even if this is a bug, someone will probably rely on this behavior.
I think the best action would be to add a third state (
up,downandpending) for opting into the retry functionality in push monitors (and update docs in the UI).Maybe someone has a scenario like this and therefore relies on the current behavior:
state=downto get notified immediately👟 Reproduction steps
status=downReproduction environment (required fields represent the production server):
Uptime-Kuma: 1.21.3
OS: Pop!_OS 22.04 LTS (x86_64)
Docker: 20.10.21, build 20.10.21-0ubuntu1~22.04.3
👀 Expected behavior
Monitor switching state to "Pending", as the retry option is not surpassed.
😓 Actual Behavior
Monitor switching state to "Down", ignoring the retry option.
Switching from "Down" to "Pending" if no heartbeats are sent after.
🐻 Uptime-Kuma Version
1.21.3
💻 Operating System and Arch
Linux 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
🌐 Browser
Firefox Developer Edition 114.0b9
🐋 Docker Version
20.10.5+dfsg1, build 55c4c88
🟩 NodeJS Version
v16.20.0 (from docker image)
📝 Relevant log output
@chakflying commented on GitHub (Jun 1, 2023):
Related: #1863
Thinking about how to fix this: Since the push route handling and the heartbeat loop are separate, there is currently no way to track the number of retries in the push route. What is the best way to get this information? We can recursively query the database for the last beat until we find the last successful beat, but it will build up a stack and get slow if the number of retries is high.
I guess we could query the last successful beat, then based on the returned ID use a second query to get all the beats since then.
There is also a problem that this way retries would persist across restart, which would be different to other monitors. We could mitigate this by saving the server restart time and adding that to the query, but yeah another point of complexity.
@chakflying commented on GitHub (Jun 1, 2023):
I like your idea of being able to set pending for the push route, but there is an issue as the heartbeat loop would be unaware of this, so you can get more than your set number of "retries" before the timer set it as down.
@ebricca commented on GitHub (Aug 28, 2023):
even a push calling "status=pending" would be ok in my case ..
it would allow me to represent services which are degraded / or busy with a msg notice ..
(the calling script itself could be made to tell after x times to set it to down ..)
@sypper-pit commented on GitHub (Mar 29, 2025):
i create https://github.com/sypper-pit/uptime-kuma-push may be next version https://github.com/louislam/uptime-kuma/
I hope give
state=warning- for send HDD \ CPU \ ROM