What Gatus Does
- Health Checks: HTTP, TCP, DNS, ICMP, SSH, STARTTLS, and TLS monitoring
- Conditions: Flexible condition expressions (status code, response time, body content, certificate expiry)
- Status Page: Beautiful, auto-generated public status page
- Alerts: Slack, Discord, PagerDuty, OpsGenie, Telegram, email, webhook, and more
- Uptime Badges: Embeddable SVG badges for README files
- Incidents: Manual and automatic incident annotations on the status page
- Groups: Organize endpoints into logical groups (Production, Staging, External)
- Metrics: Prometheus and InfluxDB metrics export
- Configuration as Code: Everything defined in YAML — version control your monitoring
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ config.yaml │────▶│ Gatus │────▶│ Endpoints │
│ (Endpoints │ │ Engine (Go) │ │ (HTTP/TCP/ │
│ Conditions │ └──────┬───────┘ │ DNS/etc) │
│ Alerts) │ │ └──────────────┘
└──────────────┘ ┌──────┴───────┐
│ Status Page │
│ + Alerts │
│ + Badges │
└──────────────┘Configuration
Basic Example
endpoints:
- name: Website
group: Production
url: "https://yourdomain.com"
interval: 60s
conditions:
- "[STATUS] == 200"
- "[RESPONSE_TIME] < 2000"
- name: API
group: Production
url: "https://api.yourdomain.com/health"
interval: 30s
conditions:
- "[STATUS] == 200"
- "[BODY].status == UP"
- "[RESPONSE_TIME] < 500"
- name: Database
group: Infrastructure
url: "tcp://db.internal:5432"
interval: 30s
conditions:
- "[CONNECTED] == true"
- name: DNS
group: Infrastructure
url: "dns://8.8.8.8"
interval: 120s
dns:
query-name: "yourdomain.com"
query-type: "A"
conditions:
- "[DNS_RCODE] == NOERROR"
- name: SSL Certificate
group: Security
url: "https://yourdomain.com"
interval: 3600s
conditions:
- "[CERTIFICATE_EXPIRATION] > 720h" # Alert if < 30 daysWith Alerts
alerting:
slack:
webhook-url: "https://hooks.slack.com/services/xxx/yyy/zzz"
default-alert:
enabled: true
failure-threshold: 3
success-threshold: 2
send-on-resolved: true
discord:
webhook-url: "https://discord.com/api/webhooks/xxx/yyy"
pagerduty:
integration-key: "your-pagerduty-key"
endpoints:
- name: Critical API
url: "https://api.yourdomain.com/health"
interval: 30s
conditions:
- "[STATUS] == 200"
alerts:
- type: slack
failure-threshold: 2
description: "API is down!"
- type: pagerduty
failure-threshold: 5
description: "API critical failure"Response Body Checks
endpoints:
- name: API Health
url: "https://api.example.com/health"
conditions:
- "[STATUS] == 200"
- "[BODY].status == ok"
- "[BODY].database == connected"
- "[BODY].cache == connected"
- "[BODY].version == any(v2.0.0, v2.1.0)"Self-Hosting
Docker Compose
services:
gatus:
image: twinproduction/gatus:latest
ports:
- "8080:8080"
volumes:
- ./config.yaml:/config/config.yaml
- gatus-data:/data
restart: unless-stopped
volumes:
gatus-data:Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: gatus-config
data:
config.yaml: |
endpoints:
- name: Frontend
url: "https://myapp.com"
interval: 60s
conditions:
- "[STATUS] == 200"Key Features
Uptime Badges
Embed in your README:

Maintenance Windows
endpoints:
- name: API
url: "https://api.example.com"
maintenance:
start: "23:00"
duration: 1h
every: [Monday, Thursday]
conditions:
- "[STATUS] == 200"External Endpoints
external-endpoints:
- name: GitHub Actions
group: CI/CD
token: "your-secret-token"
# Push results via API:
# curl -X POST https://status.yourdomain.com/api/v1/endpoints/github-actions/external
# -H "Authorization: Bearer your-secret-token"
# -d '{"status": "UP", "duration": 5000}'Gatus vs Alternatives
| Feature | Gatus | Uptime Kuma | Statuspage.io | Cachet |
|---|---|---|---|---|
| Open Source | Yes (Apache-2.0) | Yes (MIT) | No | Yes (BSD) |
| Config | YAML (code) | Web UI | Web UI | Web UI |
| Status page | Built-in | Basic | Premium | Built-in |
| Health checks | HTTP/TCP/DNS/ICMP | HTTP/TCP/DNS | HTTP | HTTP |
| Body validation | JSON path conditions | No | No | No |
| Badges | Yes | Yes | Yes | No |
| Alerts | 10+ channels | 90+ channels | Email/SMS | |
| GitOps friendly | Yes (YAML) | No (UI) | No | No |
常见问题
Q: Gatus 和 Uptime Kuma 怎么选? A: Uptime Kuma 有漂亮的 Web UI,适合通过界面管理监控。Gatus 是 YAML 配置驱动,适合 DevOps 团队将监控纳入 Git 版本控制。如果你喜欢 Infrastructure as Code,选 Gatus。如果你喜欢 UI 操作,选 Uptime Kuma。
Q: 可以监控内网服务吗? A: 可以。Gatus 支持 TCP 端口检查和 ICMP ping,可以监控内网数据库、缓存、消息队列等不暴露 HTTP 的服务。
Q: 数据存储在哪里? A: 默认使用 SQLite 存储历史数据。也支持 PostgreSQL 作为后端。数据保留时间可配置。
来源与致谢
- GitHub: TwiN/gatus — 10.6K+ ⭐ | Apache-2.0
- 文档: gatus.io