Probe type · Business
Database probe
A real authenticated connection — not a TCP ping — that runs your own SELECT and asserts the result so you catch replication lag, queue backlogs, and silent data drift.
What the database check runs
A Database probe logs in to your database on a schedule and runs a query. It sits between a TCP probe, which only proves the port is open, and an application check, which can't see replica lag. It proves the engine is up, the credentials still work and the data looks right.
Four engines are supported: PostgreSQL, MySQL (and MariaDB), SQL Server and Redis. Managed services that speak one of these protocols on a public endpoint work the same way.
Two depths
- Log in and ping. Connect with your credentials and run the engine's hello:
SELECT 1, or PING for Redis. The probe records connect time, query time and the server's version string, so an upgrade shows up. - Your own query. Supply a SELECT and an assertion:
RowCountAtLeast,RowCountExact,ColumnEqualsorColumnInRange. A server-side guard rejects anything that isn't a single SELECT. Redis is limited to read commands such as GET, EXISTS, LLEN and INFO.
The connection string is never stored. It's assembled in memory for each check from the fields you enter. The password is encrypted at rest with AES-GCM. Total query time above 500 ms, by default, turns the probe amber.
Queries worth running
| What to watch | Query | Assertion |
|---|---|---|
| Postgres replica lag (seconds) | SELECT EXTRACT(EPOCH FROM now() - pg_last_xact_replay_timestamp()) | ColumnInRange 0..30 |
| Stuck job queue | SELECT COUNT(*) FROM jobs WHERE status = 'pending' AND created_at < now() - interval '15 minutes' | ColumnEquals 0 |
| Connections in use | SELECT count(*) FROM pg_stat_activity WHERE state = 'active' | ColumnInRange 0..80 |
Run the lag query against the replica; on a primary it returns NULL, which fails the range.
pg_stat_activity is documented in the
cumulative statistics chapter.
On SQL Server, sys.dm_exec_requests
answers the same questions about running work. Give the probe a read-only login that can see only
what the query needs.
Databases to probe directly
- Primaries and replicas. One probe each, so a replica that stops replaying is caught on its own.
- Redis caches. If the cache disappears, your app hammers the primary. Catch it at the cache.
- Queues kept in tables. Alert when work piles up, not when users complain.
StatusPulse connects from the public internet, and private addresses are refused. A database with no public endpoint can't be probed this way. Run the query from inside your network and report it with a Heartbeat instead.
Database probe settings
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
Engine |
PostgreSql | MySql | SqlServer | Redis |
Required | PostgreSql | Which database driver and default ping query the probe uses. Locked in at create time. |
Host |
string |
Required | — | Hostname or IP. Internal hostnames rejected at save time (SSRF guard). |
Port |
integer |
Optional | engine default | Override default port (5432 / 3306 / 1433 / 6379). |
Database name |
string |
Required (relational engines) | — | Catalog / database name. Ignored for Redis. |
Username |
string |
Required (when engine requires auth) | — | Auth username. |
Password |
string (encrypted at rest) |
Required (when username set) | — | Auth password. AES-GCM encrypted. |
Use TLS |
boolean |
Optional | true | Whether the connection negotiates TLS. |
Trust server certificate |
boolean |
Optional | false | When on, accepts self-signed or untrusted server certs. |
Connect timeout (ms) |
integer |
Optional | 5000 | Hard ceiling on the auth handshake. |
Custom query |
string (SELECT only) |
Optional | — | Custom SELECT (or Redis command) to run instead of the engine's default ping. Server-side parser rejects non-SELECT statements. |
Assertion mode |
None | RowCountAtLeast | RowCountExact | ColumnEquals | ColumnInRange |
Optional | None | How to evaluate the custom query's result. |
Expected value |
string |
Required if Assertion mode != None | — | Parameter for the assertion. Integer for row-count modes; string for ColumnEquals; "min..max" for ColumnInRange. |
Latency Degraded (ms) |
integer |
Optional | 500 | Total query latency above which the probe reports Degraded. |
SLA target |
decimal (99.0-99.999) |
Optional | — | Optional uptime SLO. |
Paused |
boolean |
Optional | false | Master kill-switch. |
Plans: Business · Help: Database probe