Phase 8: widgets and polish

- Live job card widget (progress bar, in-widget cancel via widget_query)
  and live invoice widget (QR drawn from a bitmap, countdown, paid state),
  Bot API 10.4 sendWidget, private chats only
- Automatic fallback to the ordinary message when sendWidget fails, with
  a breaker that pauses widgets after repeated failures or on servers
  without the method; TELEGRAM_WIDGETS
- Prometheus metrics on the core (/metrics) and on every worker: queue
  depth and wait, slots, heartbeats, job outcomes, errors per site,
  deliveries, cache, invoices, Lightning, ledger check, widgets
- Example Prometheus config and alert rules, Caddyfile, dashboard notes
- Load test: cmd/loadtest and deploy/loadtest (make loadtest)
- Browser check of the widgets' HTML, including decoding a drawn QR
- docs/DEPLOY.md (production in under an hour) and docs/MONITORING.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michilis
2026-11-18 18:24:36 +00:00
co-authored by Claude Opus 5.5
parent f1f9c6156c
commit 3c153af97f
45 changed files with 3158 additions and 20 deletions
+6 -1
View File
@@ -2,7 +2,7 @@ GO ?= go
BIN := bin
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
.PHONY: all build faketelegram miniapp miniapp-e2e i18n-check test test-postgres race vet fmt check run e2e acceptance clean
.PHONY: all build faketelegram miniapp miniapp-e2e i18n-check loadtest test test-postgres race vet fmt check run e2e acceptance clean
all: check build
@@ -54,6 +54,11 @@ test-postgres:
@test -n "$(PG_DSN)" || { echo "set PG_DSN, see the comment in the Makefile"; exit 1; }
DLBOT_TEST_DB=postgres DLBOT_TEST_PG_DSN="$(PG_DSN)" $(GO) test -count=1 ./...
# Many simulated users against a real core and workers, on the fake Bot
# API and a yt-dlp stand-in. USERS, LINKS, WORKERS, SLOTS: see the script.
loadtest:
deploy/loadtest/run.sh
# Kill a worker mid-job and watch the other one finish it. MODE=compose
# runs it in containers.
acceptance: