Documentation
Monitors / Monitor databases

Monitor databases

PostgreSQL, MySQL and MariaDB, Microsoft SQL Server and Redis checks with a query or a command.

Database monitors connect with a connection string and run a query or a command. A successful check proves more than an open port: the server accepts the credentials and answers.

Create a dedicated user with read-only rights for monitoring. Its password is stored encrypted with your ENCRYPTION_MASTER_KEY.

PostgreSQL

The What to monitor card of a PostgreSQL monitorThe What to monitor card of a PostgreSQL monitor
A PostgreSQL check with SELECT 1.
  • PostgreSQL connection string: postgres://username:password@host:5432/database. The postgresql:// prefix works too.
  • Query: SELECT 1 by default.

MySQL and MariaDB

The What to monitor card of a MySQL / MariaDB monitorThe What to monitor card of a MySQL / MariaDB monitor
One protocol for MySQL and MariaDB.
  • MySQL/MariaDB connection string: mysql://username:password@host:3306/database. The mariadb:// prefix works too.
  • Query: SELECT 1 by default.

Microsoft SQL Server

The What to monitor card of a Microsoft SQL Server monitorThe What to monitor card of a Microsoft SQL Server monitor
A SQL Server check.
  • Microsoft SQL Server connection string: sqlserver://username:password@host:1433/database. The mssql:// prefix works too.
  • Query: SELECT 1 by default.

Redis

The What to monitor card of a Redis monitorThe What to monitor card of a Redis monitor
A Redis check with PING.
  • Redis connection string: redis://username:password@host:6379/0. The rediss:// prefix is accepted too.
  • Command: PING by default.

Write a useful query

SELECT 1 checks that the server answers. A query on your own data goes further and catches a missing table, a broken replica or an exhausted connection pool:

SQL
SELECT 1 FROM orders LIMIT 1

Keep the query cheap: it runs at every interval. The check fails when the query fails or takes longer than the Timeout of the schedule.