feat(bot): add a /status command that names the failing layer - #87
Merged
Conversation
In the alert chat (or from the admin in private), /status probes each layer between a user and the service and blames the first broken one: the app's readiness from inside, cloudflared's edge connections, the public probes and heartbeats as the external monitor sees them, and Cloudflare's own status page. The Worker gains a token-gated GET /status that returns its recorded state. node index.js --status prints the same report from a shell.
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
/statusin the alert chat (or from the admin in a private chat) replies with a layer-by-layer breakdown and a verdict: UP, DEGRADED or DOWN, plus the layer to blame (host app, worker, tunnel, Cloudflare edge) or a note that a remaining failure is on the caller's side/ready, the external monitor's recorded state, and Cloudflare's public status page, in parallel with bounded timeouts; the request path is walked from the origin outwards and the first broken layer winsGET /statusreturning its checks and heartbeats with its own clock, so heartbeat ages do not depend on the host clocknode index.js --statusprints the same report from a shell; the command is ignored outside the gated chatsALERT_TELEGRAM_CHAT_ID,MONITOR_STATUS_URLandCLOUDFLARED_READY_URLto the bot; CI builds the bot image and imports the new module; docs and runbook updated, including a--no-depsnote for rebuilding the worker or bot without recreating the appVerification
docker compose exec bot node index.js --statusin production printed a complete report with all layers ok and Cloudflare's current minor incident shown