Skip to content

The Moving Parts

Gatus looks like one program, and as a file on disk it is one program. Inside, five parts do five different jobs, and nearly every surprise in this guide — including most of the troubleshooting chapter — is one of these parts behaving exactly as designed while the reader expected another part's behaviour. This chapter names them, so that later confusion has an address.

The config file: the whole truth

Gatus is told everything by one YAML config file — by default at config/config.yaml, or wherever the GATUS_CONFIG_PATH environment variable points. The endpoints, the conditions, the alert providers, the dashboard's title, the storage: all of it is in that file, and almost nothing is set anywhere else. Two consequences follow. You can read the whole behaviour of a running Gatus by reading one file. And you can change that behaviour by editing the file — Gatus watches it and reloads when it changes, no restart needed. The lab proves the reload in transcript t07-config-reload.txt.

The watchdog: the visiting part

The watchdog is the part that works. On each endpoint's interval — 60 seconds unless you say otherwise — it makes the request: an HTTP GET, a TCP connection, a ping. It measures how long the reply took, keeps the status, the body, and whether a connection could be made at all, and hands the raw facts to the evaluator. It is deliberately unopinionated: the watchdog never decides what "healthy" means. It only reports what happened.

The evaluator: conditions in, verdict out

The evaluator compares the watchdog's facts against the endpoint's conditions and produces one verdict per visit: success or failure, with a line-by-line account of which conditions passed and which did not. A condition is a small comparison — [STATUS] == 200, [BODY].status == UP, [RESPONSE_TIME] < 500 — where the bracketed words are placeholders that resolve to the facts of that visit. All conditions must pass for the visit to count as a success. Chapter 5 is this part, in full.

The storage: the memory

Every verdict goes to storage, with its timestamp, its response time, and its condition results. Storage answers the dashboard's questions: the last hundred results draw the strip of blocks on the dashboard, the last fifty state changes become the events list (down at 14:02, back at 14:19), and the uptime percentages are counted from what storage kept. Three kinds exist: in memory, in a SQLite file, or in a PostgreSQL database. The choice decides one thing above all — whether history survives a restart. Chapter 8 compares them, and the lab demonstrates the SQLite kind surviving a restart in transcript t06-storage-restart.txt.

The web server and the alerting engine

The last two parts face outward. The web server serves the dashboard page and the JSON API on one port — 8080 by default — and also generates the badges: small SVG images ("uptime 24h: 100%") that other pages can embed. Everything you read in chapter 7 comes from this part.

The alerting engine watches the stream of verdicts per endpoint and counts consecutive failures. A single failed visit is a fact; it is not yet a notification. When the count reaches the endpoint's failure-threshold (3 unless you set it), the engine sends one alert per configured provider — Slack, email, PagerDuty, a generic webhook, and dozens more — and, if you asked, a second message when enough consecutive successes mark the incident resolved. Chapter 6 is built around this part, because the counting is where beginners are most often surprised.

Which part holds what

Question The part that answers it
Why did it check at 14:02 and 14:03? The watchdog, obeying the endpoint's interval
Why did a 200 reply count as a failure? The evaluator — a body or response-time condition failed
Why does the dashboard show nothing before yesterday? The storage — it was in memory, or the caps trimmed it
Why no alert after one failed check? The alerting engine — the failure-threshold was not reached
Why did it say "resolved" when it is still slow? The evaluator again — slow is not failing unless a condition says so
Why did the port change when I restarted? The web server section of the config file

Keep this table in mind. When Gatus surprises you, the surprise has an address, and the address is one of these five.