Repository navigation
Conversation
…bhook Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
…--test-alerts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
…emplate Grafana loads a minute late Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
2 tasks done
Contributor
Author
|
Lab run (test node, 2026-11-19, The link is Grafana behind Access ( |
Teg79
marked this pull request as ready for review
November 19, 2026 14:33
stefanoghinelli
approved these changes
Nov 19, 2026
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.
Summary
Urbex's alerts reach a Telegram chat, a Discord channel or a webhook (#95), through Grafana's own integrations: no extra service.
internal/platform/config.go:observability.alertsinurbex.platform.yaml:telegram.chatId,discord: true,webhook: true, one or several. The chat id is validated: a number, or a channel's@name.internal/credentials/credentials.go:telegramBotToken,discordWebhookUrl,alertsWebhookUrl(URBEX_TELEGRAM_BOT_TOKEN, ...). They are user-provided, so teardown keeps them.internal/bootstrap/alerts.go(new): generatesgrafana/provisioning/alerting/urbex-notifications.ymlin the observability Stack, with:urbex, one integration per channel;alertname, service, host:group_wait 30s,group_interval 5m,repeat_interval 4h.The secrets are referenced as
$URBEX_ALERTS_*, which Grafana expands from its environment. They are in the Stack'ssecrets.sops.env, never in clear in the GitOps repo. With no channel the file is removed and nothing changes.The message, one per alert and machine, with resolved messages too:
DatasourceError) is named, instead of an empty summary.internal/bootstrap/stacks.go:PlatformStack.Generated: files written beside the embedded ones and hashed with them, so Grafana restarts when they change; a path mapped to""is removed;GF_SERVER_ROOT_URLis set: Grafana behind Access with Cloudflare, else its internal name. The alerts' links point there.internal/grafana(new) andinternal/doctor/alerts.go:urbex doctorchecks each channel's credential.--test-alertssends a test message through each channel with Grafana 13's receivers API (POST .../receivers/{uid}/test), using the secrets Grafana holds. It reports each channel's error, with a fix for the usual ones (wrong bot token, chat not found).platform/stacks/observability/.../urbex-reconcile.yml: the reconciler's two alerts carry aseverity(criticalwhen it doesn't run,warningwhen it holds applications back).CHANGELOG.md: under Unreleased.Companion: urbforge/urbex#100.
Why
#95: the alerts only showed in Grafana, so nobody heard about them.
Tests I ran
mise run test,mise run lint: pass. New: the provisioning file (valid YAML, no secret in clear, the missing credentials named), the chat id validation, the doctor checks, the Grafana client against a fake of the receivers API.mise run e2e: passed, 24 steps, on f6e8793. The later commits change only the generated message text and two alert labels.Grafana 13.2.3 in podman, with this provisioning:
group_interval, to Discord and the webhook (pointed at a local listener);grafana-default-emailcontact point, so a policy routing to it stopped Grafana from starting.On the test node (
lab-cubotto/alerts-test.sh), with a test Telegram bot and chat, not the team's group:urbex bootstraptook 161 s;urbex doctor --test-alertsok;urbexfolder fired, cleared and was deleted;urbex bootstrapchanged nothing.The first run failed on the empty message (see above); fixed, then passed. Messages received: in a comment below.
Not run: a real disk filling up on the lab (the temporary rule takes the same path); Discord against a real channel.
Checklist before review
Fixes #95
🤖 Generated with Claude Code
https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA