fix(notifications): use real server name in remote threshold alerts#4791
Open
PixelPerfector wants to merge 1 commit into
Open
fix(notifications): use real server name in remote threshold alerts#4791PixelPerfector wants to merge 1 commit into
PixelPerfector wants to merge 1 commit into
Conversation
Server CPU/Memory threshold notifications for remote servers always showed "Server Name: Remote" instead of the actual server name, making it impossible to tell which server triggered the alert when more than one remote server is registered. The remote branch of receiveNotification already fetches the matching server row (looked up by its metrics token) but discarded it, hardcoding ServerName to the literal "Remote". Use the fetched row's name instead, falling back to "Remote" if it is somehow absent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Server CPU/Memory threshold notifications for remote servers always render
Server Name: Remoteinstead of the actual server name. When more than one remote server is registered, every alert is identical and it's impossible to tell which server actually breached the threshold.The remote branch of
receiveNotificationalready fetches the matchingserverrow (looked up by its metrics token), but it throws the row away and hardcodes the literal string"Remote":This uses the fetched row's
nameinstead, falling back to"Remote"if it is somehow absent:The
Dokploy(web server) branch is unaffected — it already reports"Dokploy", which is unambiguous. All channels (Telegram/Discord/Slack/etc.) share the samepayload.ServerName, so they are all fixed by this change.Issue ticket number and link
No issue reports this exact bug. Related to #3589 — the same "which server?" problem, but for the server restart notification (a separate notification and a feature request); this PR addresses it for the monitoring threshold notification.
Checklist before requesting a review
How was it tested?
On a self-hosted instance with 5 remote servers, sending a synthetic threshold POST to
notification.receiveNotificationwith a given server's metrics token now delivers a Telegram alert reading e.g.Server Name: panda-aggregatorinstead ofServer Name: Remote. Discord/Slack/other channels use the samepayload.ServerName, so they are fixed identically.🤖 Generated with Claude Code