Skip to content

Alert before the shared collab Postgres cluster fills its disk #727

Done

Description

@HMarzban

Summary

Nothing watches the size of the collab database. Two measured events show how fast it can grow. The 2026-11-09 MCP session (#726) added 58.5 MB. On 2026-11-07, it grew 199.1 MB with no MCP write. The disk is shared with every other database on the cluster. This issue adds a panel, a size rule and a growth rule. It also checked that server error output reaches Loki (done, 2026-11-10).

The storage-at-scale review of 2026-11-10 found this gap. The maintainer ruled it on 2026-11-10 ("yes"). Related: #726, #704, #707, #571.

The collab database moved to London, on PostgreSQL 18.6, on 2026-11-11. Every reading in the 2026-11-10 comment comes from the old cluster.

Benchmark

Field Value
Metric (a) Rules and panels that watch database size, count. (b) sum(pg_database_size_bytes) on the collab cluster, B. (c) pg_stat_user_tables_size_bytes{relname="Documents"}, B. (d) Largest 24 h growth of (b), B
Before (a) 0 rules, 0 panels at HEAD 0b302b222. (b), (c) on the London cluster: context only, shown on AP 80. Old cluster, 2026-11-10 (comment): collab database 458,370,000 B; 7 other databases 2,366,930,600 B in total; Documents 446,406,656 B. (d) Old cluster: 199,221,248 B (2026-11-07), the largest 24 h growth in 13 days (review read, 2026-11-11). Source: the growth-rule backtest, peak at 2026-11-07 18:39Z. The 2026-11-10 comment gives the same event as +199.1 MB from 11:07Z to 23:07Z
After (a) 3 rules, live since 2026-11-12 (Measured). 1 panel, AP 80, live since 2026-11-16 13:43Z (Measured). Step 5: 25 of 25 at the old 128 MiB bar (Measured). The re-run at 256 MiB is owed
Condition Production postgres-exporter v0.17.0 against the London cluster (PostgreSQL 18.6, moved 2026-11-11). Disk size from the DigitalOcean console on the read day. pg_database_size_bytes leaves out WAL
How to run (b) sum(pg_database_size_bytes) and count by (datname) (pg_database_size_bytes) in Grafana Explore. (c) pg_stat_user_tables_size_bytes{relname="Documents"}. (d) max_over_time((sum(pg_database_size_bytes) - sum(pg_database_size_bytes offset 24h))[13d:1h]). Loki reads use hour-sized windows, one at a time, each with a timeout (#712 ruling 2026-11-11)
Pass rule (a) 3 rules, 1 panel. Every step 5 promtool case passes. (b), (c) context only, no bar; the size and growth rules watch them. (d) growth-rule backtest: 0 firings outside a real growth event. Revert rule: if a rule fires with no real growth, run the Rollback
Guard dep-postgres-down still pages when the exporter stops. Rule count: the count before this change + 3 (one size rule per severity since 79f91596b). If this ships with other rule changes, the #753 want for that deploy is the check. Depends on #753
Owner Agent in the repo: rules, panel, step 5 fire test. Maintainer: console read, production readings, deploy after #753
Claim Internal: "Database growth now pages before the disk fills." Storage-per-pad claims belong to #726

Facts

Read from code on 2026-11-10, unless a line says otherwise.

  • No alert rule or dashboard under scripts/observability/ reads pg_database_size_bytes. The only Postgres rule is dep-postgres-down, on pg_up (scripts/observability/grafana/provisioning/alerting/rules-deps.yml).
  • The Postgres panels live in scripts/observability/grafana/provisioning/dashboards/json/app-performance.json. They show connections, cache hits and transactions, but no size.
  • postgres-exporter v0.17.0 runs with --no-collector.wal, as the read-only metrics_reader login with pg_read_all_stats. It exports pg_database_size_bytes on production (2026-11-10 comment).
  • It also exports pg_stat_user_tables_size_bytes, the table's total size with its indexes and TOAST data. So the panel needs no custom query (2026-11-10 comment).
  • The Documents size read 185 MB across all versions on 2026-09-05 (apps/hocuspocus.server/CLAUDE.md), and 446,406,656 B on 2026-11-10.
  • On 2026-11-09, one MCP session wrote about 110 full snapshot rows of 1 to 4 MiB in 40 minutes (Cut MCP write time on large pads and stop its four false alerts #726). The database grew 58.5 MB in that session. The retention reaper never thins a row younger than 30 days (apps/hocuspocus.server/src/lib/retention.ts).
  • On 2026-11-07, between 11:07Z and 23:07Z, the collab database grew 199.1 MB with no MCP write. Find the cause of the +199.1 MB collab database growth on 2026-11-07 #761 owns the cause.
  • pg_database_size_bytes leaves out WAL. So the 60 % and 80 % byte values subtract the WAL size, or the rules fire late.
  • A dump and restore can shrink the size. So the growth rule reads a negative 24 h delta on the move day, and stays Normal.
  • Alloy reads container logs through the Docker logs API (scripts/observability/alloy/config.alloy). It parses pino JSON for the level label, so a plain-text line arrives with no level.
  • A lost store lock leaves only one upstream console.error line, "Caught error during storeDocumentHooks", and no persist metric moves. So every "no lost save" reading depends on that line reaching Loki. It does (step 0 below).

What to build

Left, 2026-11-16. Steps 0, 2, 3 and 7 are done. Left: step 1, the step 4 bar change, the step 5 re-run, one step 6 deploy, and the AP 80 check in production Grafana.

  1. Done, 2026-11-10: the Loki check. Plain-text hocuspocus-server output reaches Loki, and no follow-up for log shipping is needed. See the 2026-11-10 comment. A re-run uses hour-sized windows, one at a time, each with a timeout (Cut Loki self-logs and bound its queries, so Loki stays under 80 % of its memory #712 ruling 2026-11-11). [7d] instant queries caused the Cut Loki self-logs and bound its queries, so Loki stays under 80 % of its memory #712 memory peak, and after Cut Loki self-logs and bound its queries, so Loki stays under 80 % of its memory #712 Loki refuses them.
  2. Maintainer, read-only. In the DigitalOcean console, confirm the London cluster disk is still 60 GiB. The live bars (35,591,815,168 B and 48,476,717,056 B) are 60 % and 80 % of 64,424,509,440 B minus max_wal_size 3,062,890,496 B (ruled 2026-11-12). Only a changed disk size changes them. If the disk is not 60 GiB, recompute both bars and post them with the read date.
  3. Agent in the repo. The panel. In app-performance.json, beside the Postgres panels, add a panel for pg_database_size_bytes per datname, plus pg_stat_user_tables_size_bytes{relname="Documents"}. No custom query.
  4. Agent in the repo. Rule 1, size. In rules-deps.yml: sum(pg_database_size_bytes), warning above the 60 % byte value, critical above the 80 % byte value, from step 1. Set noDataState: OK, because dep-postgres-down already pages when the exporter stops. The summary states that WAL is left out.
  5. Agent in the repo. Rule 2, growth. In rules-deps.yml: sum(pg_database_size_bytes) - sum(pg_database_size_bytes offset 24h) > <bar>, warning, noDataState: OK. The bar is ruled at 256 MiB (Decision 3). The live rule still reads params: [134217728] (rules-deps.yml:296). Change it to 268435456 in one line, and the title to 256 MiB. Fix the summary: at 256 MiB the 2026-11-07 event (199,221,248 B) does not fire this rule, so the summary must not cite it as an example. The backtest reads 0 firings at 256 MiB.
  6. Agent in the repo. Fire test. The repo has no local Prometheus and Grafana stack. So use the Keep health checks out of the API error and latency alerts #710 step 6 method: promtool test rules, with a temporary rule file and synthetic series. It needs no production access. Cases: the size rule goes Firing above its warning and critical byte values, and stays Normal below them. The growth rule goes Firing on a 24 h rise above the ruled bar, and stays Normal on a negative delta (the move-day case). After the step 4 change, re-run the existing script, which reads the bar from the file. Flip the expected state to Normal for the cases between 128 and 256 MiB: the 150 MiB step, the 2026-11-07 shape and the 2026-11-13 shape. Post the before and after.
  7. Maintainer, observability deploy, after Fail the observability deploy when Grafana or its provisioned rules do not load #753. Commit through the commit-review skill with a (build): observability subject and push.
  8. Done, 2026-11-10: the first reading (old cluster). See the 2026-11-10 comment. It also gave Cut MCP write time on large pads and stop its four false alerts #726 its storage baseline.

Decisions

The owner is the maintainer. Decisions 1 and 2 are ruled (2026-11-10 and 2026-11-11 comments). Decision 3 is ruled (2026-11-16 ruling).

  1. Alert thresholds. Recommended: warning when the collab database passes 60 % of the disk that the cluster gives it, and critical at 80 %. The exporter cannot read a managed disk size, so the maintainer reads it in the DigitalOcean console, and the rule uses fixed byte values. Other: alert on growth instead, for example more than 2 GiB in 24 hours. Ruled 2026-11-11: the size rule sums every database on the cluster, because the disk is shared. The growth rule was added in the 2026-11-11 milestone review (approved). Its bar is Decision 3.
  2. Table sizes. Recommended: one custom exporter query that returns pg_total_relation_size for Documents and for its TOAST table. First check that v0.17.0 still supports custom queries (--extend.query-path). If it does not, ship the database size only, and record the table sizes by hand in the Cut MCP write time on large pads and stop its four false alerts #726 reads. Other: the database size only. Resolved 2026-11-10: pg_stat_user_tables_size_bytes already covers Documents, so no custom query is needed.
  3. Growth-rule bar. Ruled 2026-11-16: 256 MiB in 24 hours. Accepted trade: the 2026-11-07 event (199,221,248 B), which started Find the cause of the +199.1 MB collab database growth on 2026-11-07 #761, does not fire this rule. The size rules still cover the disk.

Acceptance criteria

  • The Loki check result is posted here (2026-11-10 comment).
  • The step 1 disk-size check is posted (London cluster confirmed at 60 GiB, 2026-11-24).
  • The panel shows the size of each database and the Documents size.
  • Decision 3, the growth-rule bar, is ruled (256 MiB, 2026-11-16).
  • The growth rule reads 268435456 in rules-deps.yml, with a summary that does not cite the 2026-11-07 event as a firing case.
  • Every step 5 promtool case passes, for the size rule and the growth rule.
  • Grafana holds the count before this change + 3 rules.
  • The first production reading is posted here (old cluster, 2026-11-10).

Rollback

Revert the rule and panel commit and run the observability deploy.

Out of scope

Activity

  1. added this to the v2.3.6 milestone on Nov 10, 2026
  2. added
    Performance
    on Nov 10, 2026
  3. HMarzban commented on Nov 10, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-10

    Answer: "yes" to both recommendations.

    1. Thresholds: warning at 60 % of the disk that the cluster gives the collab database, and critical at 80 %. The maintainer reads that disk size in the DigitalOcean console, and the rule uses fixed byte values from it.
    2. Table sizes: one custom exporter query returns pg_total_relation_size for Documents and for its TOAST table, if postgres-exporter v0.17.0 still supports custom queries. If it does not, ship the database size only, and record the table sizes by hand in the Cut MCP write time on large pads and stop its four false alerts #726 reads.

    No open decision is left on this issue.

  4. HMarzban commented on Nov 11, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-10: the Loki check and the first size reading

    Read-only, through the Grafana data-source proxy, on 2026-11-10 from 16:59Z to 17:20Z.

    Step 1: plain-text output reaches Loki

    • sum(count_over_time({service="hocuspocus-server"} !~ "^\\{" [7d])) returned 320 lines. The newest ones are startup output from the 2026-11-09 20:16:15Z deploy, with no level label. One example is BullMQ's IMPORTANT! Eviction policy is volatile-lru. It should be "noeviction".
    • The lost-lock line Caught error during storeDocumentHooks appears 0 times from 2026-10-11 to 2026-11-10. The query ran in five chunks, and each chunk read 1,467 to 5,155 lines, so the empty result is real. One 30-day query returned empty after exactly 30 s, so the chunks replaced it.
    • So no follow-up for log shipping is needed. A "no lost save" claim can rely on this line.

    Step 4: the first size reading

    postgres-exporter already exports pg_database_size_bytes, so this reading needed no deploy.

    Database Now 7 days earlier
    prod_docsplus 458,370,000 B 191,970,000 B
    7 other databases on the same cluster 2,366,930,600 B in total 2,366,906,000 B in total
    • prod_docsplus grew by 266.4 MB in 7 days. Two events explain almost all of it:
    • The cluster disk is 60 GiB (DigitalOcean console, 2026-11-10). So the ruled thresholds are 60 % = 38,654,705,664 B and 80 % = 51,539,607,552 B.
    • Decision 2 needs no custom query. postgres-exporter already exports pg_stat_user_tables_size_bytes, the table's total size with its indexes and TOAST data. For Documents it reads 446,406,656 B now and 180,297,728 B 7 days earlier. So the panel can use it directly.

    Maintainer ruling, 2026-11-11: the rule reads every database

    The first ruling put the rule on the collab database alone. The disk is shared, though. 7 other databases on the cluster hold about 2.37 GB, and WAL uses more.

    • The rule alerts on the sum of pg_database_size_bytes over all databases, with the same byte thresholds.
    • The panel shows each database.
  5. changed the title [-]Watch the collab database size, and check that server error output reaches Loki[/-] [+]Alert before the shared collab Postgres cluster fills its disk[/+] on Nov 11, 2026
  6. HMarzban commented on Nov 12, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-12: production after the observability deploy. Run 43224277563 ((build): observability, f61647754). Steps 1 to 8 passed, including "Deploy stack" at 13:08:16Z. A newer push cancelled the last step, Verify, during its wait, so its checks were read by hand, read-only, at about 13:12Z.

    • dep-postgres-db-size (warning above 35,591,815,168 B), dep-postgres-db-size-critical (critical above 48,476,717,056 B) and dep-postgres-db-growth (warning above 128 MiB in 24 h) are live, 0 in error health, and none fires.
    • Rule count 57 before, 60 after (this issue +3, after the split into one rule per severity in 79f91596b).
  7. HMarzban commented on Nov 13, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-13: first live fire of dep-postgres-db-growth, with a known cause.

    The #726 London before-2 session (Measured) wrote about 104 version rows of a 3.5 MB scratch pad between 05:30Z and 06:05Z. The rule was not in that session's silence.

    Time (UTC) State Rule value (growth in 24 h)
    05:54:30Z Normal to Pending —
    05:59:30Z Pending to Alerting; the Telegram notice arrived 169,254,912 B (161.4 MiB)
    06:06:04Z The session purged the pad and its rows —
    06:06:30Z Alerting to Normal; resolved notice at about 06:10Z 2,285,568 B (2.18 MiB)
    • The rule fired on real growth, with the right value, and cleared within 30 s of the cleanup in rule state. The Telegram resolve came about 4 min later.
    • The for: 5m hold worked: Pending at 05:54:30Z, Alerting at 05:59:30Z.
    • The two size rules (60 % and 80 %) stayed Normal.

    Next step: the #726 after session adds dep-postgres-db-growth to its silence. No change to the rule.

  8. HMarzban commented on Nov 14, 2026

    @HMarzban
    CollaboratorAuthor

    Moved to v2.3.7 at the v2.3.6 release audit. Rules are live, but the London reading, the panel check and 4 weekly London size reads are not posted.

  9. modified the milestones: v2.3.6, v2.3.7 on Nov 14, 2026
  10. HMarzban commented on Nov 14, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-12: growth-rule backtest (posted 2026-11-14)

    This is the backtest behind the dep-postgres-db-growth bar of 128 MiB. The CHANGELOG and commit 0a1dff17c quote it ("over 15 days of history it fires once"). It was taken on 2026-11-12 and kept locally, so it is posted here for the record.

    Setup. Production Prometheus, read-only, HEAD cfac48d87. The 24 h delta of sum(pg_database_size_bytes) on the collab cluster, 1 min step, from 2026-10-29 00:01Z to 2026-11-12 11:50Z: 20,870 points with no gap. These points are from the old cluster, before the 2026-11-11 London move.

    • The issue query, max_over_time((sum - sum offset 24h)[13d:1h]), reads 199,221,248 B. The peak is at 2026-11-07 18:39Z.
    • The smallest delta is -11,255,736 B, at 2026-11-11 08:25Z (the PostgreSQL upgrade).
    • The 2026-11-07 event: the first minute with more than 1 MB of rise is 12:38Z, and the last is 18:39Z.
    Bar Firings Firing minutes (no for) First crossing
    64 MiB (67,108,864 B) 1 1,642 2026-11-07 13:38Z
    100,000,000 B 1 1,440 2026-11-07 15:58Z
    128 MiB (134,217,728 B) 1 1,230 2026-11-07 17:06Z
    160 MiB (167,772,160 B) 1 1,154 2026-11-07 17:48Z
    199,221,248 B 0 0 none
    200 MiB (209,715,200 B) 0 0 none
    256 MiB (268,435,456 B) 0 0 none

    Reading. At 128 MiB the rule fires once, during the real 2026-11-07 growth event. With for: 5m it fires at 17:11Z, 4 h 33 min after the first big minute, and clears at 13:36Z on 2026-11-08. It stays Normal on the #726 MCP window, which peaks at 65,350,488 B (2026-11-10 07:43Z), a margin of 2.05 times. Outside those two windows, every daily peak is at most 4,342,152 B.

    Next. The 4 weekly London size reads in this issue check the bar on the new cluster.

  11. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    This covers step 5, the fire test for the size rules and the growth rule. It uses the #710 step 6 method: promtool test rules, a temporary rule file and synthetic series. It read no production data.

    What changed

    • No repo file changed. The rules in rules-deps.yml are as of 79f91596b, at HEAD 3bd5ca1c0.
    • A script reads dep-postgres-db-size, dep-postgres-db-size-critical and dep-postgres-db-growth from rules-deps.yml. It takes each rule's query (A), bar (C), for and group interval. It checks that B is reduce last.
    • It writes each rule as a Prometheus alert, (<A>) > <bar>, for: 5m, evaluated every 1 min. That is the same as Grafana's instant query, last reduce and gt threshold.
    • It runs two passes. The scan pass finds the first Firing minute of each case. The assert pass then checks Normal at every minute before it, and Firing at that minute. A Normal case must be Normal at every minute.

    Before and after

    Metric Before After Change n, range, condition, source
    Pass rule: step 5 promtool cases that reach the expected state 0 of 0 (no fire test) 25 of 25 — (0 before) n = 16 inputs, 25 rule checks. Size inputs: 0 to 60 min. Growth inputs: 0 to 2,100 min. promtool in prom/prometheus:v3.12.0, local, 2026-11-16

    Time to Firing per case. Onset is the first minute that should page.

    Case Rule Expected First Firing After onset
    Sum 35,666,930,600 B from 10 min warning Firing 15 min 5 min
    Sum 35,666,930,600 B from 10 min critical Normal none —
    Sum 48,566,930,600 B from 10 min warning Firing 15 min 5 min
    Sum 48,566,930,600 B from 10 min critical Firing 15 min 5 min
    Two databases of 20,000,000,000 B each (each under the bar alone) warning Firing 5 min 5 min
    Two databases of 20,000,000,000 B each critical Normal none —
    Control: sum 35,566,930,600 B (24.9 MB under warning) both Normal none —
    Control: sum exactly 35,591,815,168 B (warning bar) both Normal none —
    Control: sum exactly 48,476,717,056 B (critical bar) warning Firing 15 min 5 min
    Control: sum exactly 48,476,717,056 B (critical bar) critical Normal none —
    Control: above critical for 4 min only both Normal none —
    Control: no pg_database_size_bytes series (exporter down) both Normal none —
    Growth: step of +157,286,400 B (150 MiB) growth Firing onset + 5 min 5 min
    Growth: step of +157,286,400 B warning size Normal none —
    Growth: 2026-11-07 shape, +199,221,120 B over 6 h (the 199,221,248 B event as a straight line) growth Firing onset + 247 min 247 min
    Growth: 2026-11-13 shape, +169,254,912 B in 30 min, then purge growth Firing, then Normal onset + 28 min, Normal at the purge minute 28 min
    Growth: series starts 15 h before a +157,286,400 B step growth Firing 545 min after the step 5 min after 24 h of history
    Control: dump and restore, -278,370,000 B (move day) growth Normal none —
    Control: upgrade, -11,255,736 B (2026-11-11 reading) growth Normal none —
    Control: +65,350,488 B (#726 MCP window peak) growth Normal none —
    Control: +134,217,728 B (exactly the bar) growth Normal none —

    Reading:

    • Each size rule goes Firing 5 min after the sum passes its bar. It stays Normal below the bar and at the bar. It also stays Normal when a rise lasts under 5 min, and when no series exists.
    • The warning fires on the sum of two databases that are each under the bar. So the rule follows the 2026-11-11 ruling (the disk is shared).
    • The growth rule goes Firing 5 min after the 24 h rise passes 128 MiB. It stays Normal on a negative delta (the move-day case) and at the bar.
    • The straight-line 2026-11-07 shape crosses the bar 242 min after onset and fires 5 min later. The real event crossed at 17:06Z, 268 min after 12:38Z (backtest, 2026-11-12). The real rise was not a straight line.
    • The 2026-11-13 shape fires 5 min after the crossing and clears at the purge minute. The live fire on 2026-11-13 showed the same 5 min hold.
    • Context, not a defect: the growth rule needs a pg_database_size_bytes series 24 h back. With less history, the query returns no data, and the rule stays Normal. The size rules still cover that window.

    Sabotage

    The same assert tests ran against a rule file with the warning bar moved to 48,476,717,056 B and the growth bar moved to 268,435,456 B. promtool failed (exit 1) on all 7 rule checks that need those bars: 2 warning cases, the critical-bar control, and 4 growth cases. So the test can fail.

    Gates

    • promtool check rules rules.yml (prom/prometheus:v3.12.0): pass, 3 rules.
    • promtool test rules test-assert.yml (prom/prometheus:v3.12.0): pass, 25 of 25.
    • No repo file changed, so Prettier, ESLint and typecheck did not apply.

    Limits

    • promtool tests Prometheus evaluation of the same query and bar. It does not run Grafana's alert engine. The live 2026-11-13 fire gives the Grafana side for the growth rule.

    Left

    • Step 1: the London disk read, the WAL size and the recomputed bars. Owner: maintainer.
    • Check the panel in production Grafana after the deploy. Owner: maintainer.
    • 4 weekly London reads of (b) and (c). Owner: maintainer.
    • Push and deploy 6a99bee10 (the step 2 panel, committed locally, not pushed yet) with (build): observability. Owner: maintainer.
  12. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    This covers step 2, the panel, committed in 6a99bee10.

    What changed

    • New panel AP 80, "Postgres Size by Database + Documents Table". It sits beside the Postgres panels in the Dependencies row.
    • Series: pg_database_size_bytes per datname, and pg_stat_user_tables_size_bytes{relname="Documents"}. There is no custom query.
    • The panel description says WAL is not counted.
    • To make room, AP 25, 26 and 27 go from width 8 to 6. No panel overlaps.

    Before and after

    Metric Before After Change n, range, condition, source
    (a) Panels that watch database size 0 1 — (0 before) static check of app-performance.json, 2026-11-16
    (a) Rules that watch database size 3 3 0 live since 2026-11-12; this change adds none

    Gates

    • bunx prettier --check app-performance.json: pass.
    • python3 -m json.tool (the CI step): pass.
    • All 88 dashboard expressions parse in promtool check rules: pass.
    • Grafana 13.1.0 load, --network none: AP 80 is present, and ids are unique. Pass.

    Left

    • Check that the panel shows each database and the Documents size in production Grafana. Owner: maintainer, after the deploy.
    • Step 1 London disk read and WAL size. Owner: maintainer.
    • Step 5 promtool fire test for the size and growth rules. Owner: agent, next batch.
    • 4 weekly London reads of (b) and (c). Owner: maintainer.
    • Deploy with (build): observability. Owner: maintainer.

    After the deploy

    Deployed with (build): observability (288d4d260, run 43878530215, 2026-11-16 13:43Z). AP 80 is live on the app dashboard (74 panels). The step 5 fire test is posted separately.

  13. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-16

    Answered by the maintainer in the 2026-11-16 working session; posted by the agent.

    • Decision 3 (growth bar): 256 MiB in 24 h. The live rule (128 MiB) changes to 256 MiB. Accepted trade: a 2026-11-07-sized event (199,221,248 B) will not fire this rule; the size rules still cover the disk.
  14. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Review, 2026-11-16 (maintainer approved).

    • Decision 3 is marked ruled: 256 MiB (2026-11-16). Step 4 now says to change params: [134217728] to 268435456 and fix the growth rule summary. At 256 MiB the 2026-11-07 event no longer fires it.
    • Step 5 now re-runs the existing script with Normal expected for the 128 to 256 MiB cases. The posted 25 of 25 covers only the old bar.
    • Step 1 is narrowed to "confirm the London disk is still 60 GiB". Only a changed disk size changes the bars.
    • Deleted the 4 weekly London reads and the (d) re-read. The size and growth rules watch those values, and the 2026-11-14 backtest is the (d) source.
    • Fixed "+ 2 rules" to "+ 3". Three rules shipped after the 79f91596b split.
  15. HMarzban commented on Nov 17, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-17

    This covers step 4, the growth bar change, and the step 5 re-run at the new bar. It read no production data.

    What changed

    • rules-deps.yml, rule dep-postgres-db-growth, at HEAD 5aa56e1d1 plus this change:
      • params: [134217728] is now params: [268435456] (256 MiB), as ruled on 2026-11-16.
      • The title now reads "Postgres databases grew more than 256 MiB in 24h".
      • The summary no longer cites the 2026-11-07 event. At 256 MiB that event does not fire this rule. The new summary names the bar and says the size rules watch the disk.
    • The step 5 script is the one posted on 2026-11-16. It still reads each query and bar from rules-deps.yml. Its case list changed in four places:
      • Flipped to Normal: the 150 MiB step, the 2026-11-07 shape and the 2026-11-13 shape.
      • Added: a step of +314,572,800 B (300 MiB), expected Firing. Without it, no growth case fires above the ruled bar.
      • The under-24-h-history case now steps +314,572,800 B, not +157,286,400 B. At 150 MiB it would no longer test the history window.
      • The "exactly the bar" control reads the bar from the file, so it now steps +268,435,456 B.
      • The sabotage arm now moves the growth bar back to 134,217,728 B.

    Before and after

    Metric Before After Change n, range, condition, source
    Pass rule: step 5 checks (256 MiB expectations) that reach the expected state 24 of 27 27 of 27 +3 n = 17 inputs, 27 rule checks. Size inputs: 0 to 60 min. Growth inputs: 0 to 2,100 min. Before: rules-deps.yml at HEAD 5aa56e1d1 (128 MiB). After: the changed file. promtool in prom/prometheus:v3.12.0, local, 2026-11-17
    The 2026-11-16 test set (128 MiB expectations), checks that reach the expected state 25 of 25 (posted 2026-11-16) 21 of 25 -4 Same script and image. The 4 misses are the growth cases between 128 and 256 MiB. This shows the old set covers only the old bar

    The 3 before misses are the flipped cases. At 128 MiB each one fires.

    Case Rule Expected Before (128 MiB) After (256 MiB)
    Growth: step of +157,286,400 B (150 MiB) growth Normal Firing, onset + 5 min Normal
    Growth: 2026-11-07 shape, +199,221,248 B over 6 h growth Normal Firing, onset + 247 min Normal
    Growth: 2026-11-13 shape, +169,254,912 B in 30 min, then purge growth Normal Firing, onset + 28 min, for 8 min Normal
    Growth: step of +314,572,800 B (300 MiB) growth Firing Firing, onset + 5 min Firing, onset + 5 min
    Growth: step of +314,572,800 B warning size Normal Normal Normal
    Growth: series starts 15 h before a +314,572,800 B step growth Firing Firing, 545 min after the step Firing, 545 min after the step (5 min after 24 h of history)
    Control: +268,435,456 B (exactly the bar) growth Normal Normal (the before file holds 134,217,728 B, so this case stepped that much) Normal
    Control: dump and restore, -278,370,000 B (move day) growth Normal Normal Normal
    Control: upgrade, -11,255,736 B growth Normal Normal Normal
    Control: +65,350,488 B (#726 MCP window peak) growth Normal Normal Normal
    All 16 size-rule checks (posted 2026-11-16) warning, critical as posted 16 of 16 16 of 16

    Reading:

    • At 256 MiB the growth rule stays Normal on the two real events, 2026-11-07 and 2026-11-13. That is the accepted trade in the ruling.
    • It still fires 5 min after a 24 h rise passes 256 MiB. It stays Normal at the bar and on a negative delta.
    • The size rules did not change. All 16 size checks give the same first Firing minute as on 2026-11-16.

    Sabotage

    The same assert tests ran against a rule file with the warning bar moved to 48,476,717,056 B and the growth bar moved back to 134,217,728 B. promtool failed (exit 1) on 7 rule checks. They are 3 warning checks (2 warning cases, the critical-bar control) and 4 growth controls (150 MiB, 2026-11-07, 2026-11-13, exactly 268,435,456 B). So the test can fail.

    Gates

    • bun fmt --check rules-deps.yml: pass.
    • YAML parse with Bun.YAML.parse: pass. Rules in rules-deps.yml: 8 before, 8 after.
    • promtool check rules rules.yml (prom/prometheus:v3.12.0): pass, 3 rules.
    • promtool test rules test-assert.yml (prom/prometheus:v3.12.0): pass, 27 of 27.
    • ESLint and typecheck do not apply to a YAML file.

    Limits

    • promtool tests Prometheus evaluation of the same query and bar. It does not run Grafana's alert engine.
    • The Grafana provisioning load check was not re-run. The change is one number, one title and one summary string.

    Left

    • The CHANGELOG [Unreleased] entry for Alert before the shared collab Postgres cluster fills its disk #727 still says "more than 128 MiB" and "it would have fired once, on the 2026-11-07 growth". It needs the 256 MiB bar. Owner: release step.
    • Step 1: confirm the London disk is still 60 GiB. Owner: maintainer.
    • Done: committed in ccdbb89b3, deployed by (build): observability (run 44027220672, 2026-11-17).
    • Check AP 80 in production Grafana. Owner: maintainer.
  16. HMarzban commented on Nov 24, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-24: live AP 80 panel and 256 MiB rules in production Grafana

    Question: Did the 45393ece7 observability deploy put AP 80 and all 3 256 MiB-threshold database rules live cleanly?

    Setup. Production Grafana API and Prometheus, read-only, 2026-11-24 07:15Z.

    Result:

    • Total live Grafana alert rules: 67 (all health=ok).
    • Size and growth rules:
      • dep-postgres-db-size (> 60 %): state=inactive, health=ok.
      • dep-postgres-db-size-critical (> 80 %): state=inactive, health=ok.
      • dep-postgres-db-growth ("Postgres databases grew more than 256 MiB in 24h"): state=inactive, health=ok.
    • Panel "Postgres Size by Database + Documents Table" is live on docsplus-app-performance.
    • Live sizes exported on 2026-11-24: sum(pg_database_size_bytes) = 2,871,506,424 B across 8 databases; prod_docsplus = 511,186,623 B; pg_stat_user_tables_size_bytes{relname="Documents"} = 500,097,024 B.
    • Earlier CHANGELOG.md:188 typo (128 MiB -> 256 MiB) is fixed locally on main (uncommitted).

    Next step: Maintainer confirms in the DigitalOcean console that the London cluster disk is still 60 GiB (Step 1) and closes #727.

  17. HMarzban commented on Nov 24, 2026

    @HMarzban
    CollaboratorAuthor

    Update, 2026-11-24: root changelog corrected and committed (fdb1af6e8)

    Committed CHANGELOG.md (fdb1af6e8) fixing both #727 documentation mismatches:

    • Fixed threshold typo 128 MiB -> 256 MiB.
    • Corrected the 15-day backtest wording to state that the growth rule would not have fired (0 firings, since 2026-11-07's 199.1 MB event sits under 256 MiB).

    Next step: Maintainer confirms in the DigitalOcean console that the London cluster disk stays 60 GiB (Step 1) and closes #727.

  18. added a commit that references this issue on Nov 24, 2026
  19. HMarzban commented on Nov 24, 2026

    @HMarzban
    CollaboratorAuthor

    Closed, 2026-11-24: London cluster disk confirmed at 60 GiB

    The maintainer checked the DigitalOcean console on 2026-11-24 and confirmed the London Managed PostgreSQL 18 cluster (4 GB RAM, 2 vCPU, LON1) still has a 60 GiB disk. The byte thresholds in rules-deps.yml therefore stay unchanged (60 % = 38,654,705,664 B / warning at 35,591,815,168 B; 80 % = 51,539,607,552 B / critical at 48,476,717,056 B).

    Check Result Source
    Step 1: London cluster disk size Pass. Confirmed 60 GiB (unchanged) DigitalOcean console, 2026-11-24
    Live Grafana rules (dep-postgres-db-size, dep-postgres-db-size-critical, dep-postgres-db-growth at 256 MiB) Pass. All 3 live, state=inactive, health=ok (67 rules total, all health=ok) 2026-11-24 live read
    Live panel AP 80 (Postgres Size by Database + Documents Table) Pass. Live on docsplus-app-performance; sum(pg_database_size_bytes) = 2,871,506,424 B (2.87 GB) across 8 databases vs 38.65 GB (60 %) / 35.59 GB warning bar same
    Root CHANGELOG.md (256 MiB bar and backtest text) Pass. Fixed and pushed in fdb1af6e8 2026-11-24 update

    All acceptance checks are complete. Closing #727.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOpsPerformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions