Skip to content

Storage and History

By the end of this chapter your history survives a restart — and you know exactly how much history Gatus keeps, because the caps are small, deliberate, and worth planning around. The lab demonstrates the restart test for real: twenty-two results per endpoint, a stopped program, a started program, and the same twenty-two still there.

The three kinds of memory

storage:
  type: sqlite
  path: data.db

That block is the whole decision:

  • memory — the default, when there is no storage: block at all. Results live in the program's head. Restart Gatus and the dashboard opens empty, every endpoint reborn at its first check. Fine for a first afternoon; quietly ruinous for a status page anyone trusts, because every restart, crash and config-driven reboot wipes the evidence.
  • sqlite — one file on disk, no server to run. This is the right answer for nearly every reader of this guide: Gatus keeps its tables in the file you name, and history becomes a property of the disk, not of the process.
  • postgres — a real database, at the end of a connection string in path. For setups where several tools already share a PostgreSQL, or where the Gatus machine's own disk is not where data should live. The lab did not run a database server, so this kind is documented here, not demonstrated.

The lab looked inside its SQLite file (transcript t08-storage-restart.txt): ordinary tables with plain names — endpoints, endpoint_results, endpoint_result_conditions, endpoint_events, endpoint_uptimes, endpoint_alerts_triggered. Nothing precious is locked in an opaque format; if Gatus vanished tomorrow, the record of what it saw could still be read with any SQLite tool.

The caps: a window, not an archive

However it is stored, Gatus keeps at most, per endpoint:

  • 100 results (storage.maximum-number-of-results)
  • 50 events (storage.maximum-number-of-events)

Both are defaults you may raise in the same storage: block — the project's own example raises results to 200 and lowers events to 5, which tells you the intended spirit: these numbers are a budget, not an oversight. Do the arithmetic before choosing. At a 60-second interval, 100 results is the last hour and forty minutes of checks; at the lab's teaching pace of 10 seconds, it is under seventeen minutes. The dashboard's strips and the badges' 24-hour uptime are computed from what is inside the window — uptime over 7 days cannot be reconstructed from results that were trimmed on day two. Raise the caps if you want longer memory, and know that you are trading disk and load time for it; Gatus is a watcher with a good short memory, and chapter 11 is plain that a long-term record belongs to the metrics tools of chapter 10.

The restart test, run

From the lab (transcript t08-storage-restart.txt):

  1. With SQLite configured, Gatus ran three endpoints for about three minutes: 22 results each, 66 rows in endpoint_results, and data.db on disk at 106,496 bytes.
  2. Gatus was stopped, completely.
  3. Gatus was started again, same config, same file.
  4. The API now reported 24 results per endpoint — the original 22 plus the 2 new checks since the restart — and the first result still carried its original timestamp, 2026-10-29T18:24:31Z, from before the stop.

History that survives its own program: that is the whole claim, and it is proven rather than promised. Run the same test on your own install — it is this chapter's check. Count one endpoint's results in the API, restart Gatus, count again. The second number should be the first number plus a few new checks, never a small number starting over. If it restarts from nothing, you are on in-memory storage whatever you intended — the storage: block is missing, misspelled, or pointing somewhere the program could not write, and the startup log will say which config file was actually read (chapter 12).

One corollary worth stating: because the file is the memory, backing up a Gatus install is backing up two files — the config and the database. The pair is the whole watcher; either alone is only half of it.