Skip to content

feat(monitoring): server timings, Web Vitals and uptime checks on the site's own server - #39

Open
xiregroup wants to merge 3 commits into
mainfrom
feat/monitoring
Open

xiregroup wants to merge 3 commits into
mainfrom
feat/monitoring

Conversation

@xiregroup

@xiregroup xiregroup commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

A new module, alveby/atrium-monitoring, with no outside service.

  • Server timings: a middleware measures time to the first byte, database
    queries and their time, cache hits and misses and peak memory by route,
    site and language; slow queries are kept with their values replaced.
    One line per request goes to a buffer file after the response and to
    the database once a minute, with a sample rate. About 0.15 ms per
    request with 20 queries, checked by atrium:monitoring:benchmark.
  • Web Vitals (LCP, INP, CLS, TTFB, FCP) from a script under 2 KB sent with
    sendBeacon: no cookies, no IP, Do Not Track respected, a sample rate;
    malformed, oversized and too frequent beacons are refused.
  • Uptime checks every minute, an incident after N failures in a row,
    e-mail and Telegram alerts (token from settings or .env).
  • Admin: "Speed and uptime" in the "Site health" group shared with the
    error log, p50/p75/p95 by day, week or month, the slowest routes,
    queries and pages, links to a page's errors when the error log is
    installed, a dashboard tile. Charts read without colour: markers,
    dashes, labels and a table of the numbers.
  • Raw data 7 days, daily aggregates 13 months (atrium:monitoring:prune).
  • Docs in English and Russian, labels in 15 languages.

Checked locally with bin/ci (PHPUnit output not in JSON mode): tests on SQLite, MySQL and PostgreSQL, line coverage 100% (1196/1196), Infection MSI 100% (2204 mutants), PHPStan, Pint, Dusk (dashboard tile, report and filters, a query's page, the Site health menu).

Works with or without the error log (#34): whichever module comes first creates the "Site health" group; the errors links appear only when admin.errors.index exists and the administrator has errors.view.

@xiregroup
xiregroup enabled auto-merge November 18, 2026 09:30
@xiregroup xiregroup changed the title feat/monitoring feat(monitoring): server timings, Web Vitals and uptime checks on the site's own server Nov 18, 2026
@xiregroup
xiregroup disabled auto-merge November 18, 2026 12:18
… site's own server

A new module, alveby/atrium-monitoring, with no outside service.

- Server timings: a middleware measures time to the first byte, database
  queries and their time, cache hits and misses and peak memory by route,
  site and language; slow queries are kept with their values replaced.
  One line per request goes to a buffer file after the response and to
  the database once a minute, with a sample rate. About 0.15 ms per
  request with 20 queries, checked by atrium:monitoring:benchmark.
- Web Vitals (LCP, INP, CLS, TTFB, FCP) from a script under 2 KB sent with
  sendBeacon: no cookies, no IP, Do Not Track respected, a sample rate;
  malformed, oversized and too frequent beacons are refused.
- Uptime checks every minute, an incident after N failures in a row,
  e-mail and Telegram alerts (token from settings or .env).
- Admin: "Speed and uptime" in the "Site health" group shared with the
  error log, p50/p75/p95 by day, week or month, the slowest routes,
  queries and pages, links to a page's errors when the error log is
  installed, a dashboard tile. Charts read without colour: markers,
  dashes, labels and a table of the numbers.
- Raw data 7 days, daily aggregates 13 months (atrium:monitoring:prune).
- Docs in English and Russian, labels in 15 languages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant