Skip to main content
UptimeKit stores monitor events, status changes, and latency history in a time-series backend. You can use TimescaleDB with PostgreSQL or ClickHouse as a separate database.

Overview

UptimeKit supports two time-series backends:
  • TimescaleDB: Store time-series data in PostgreSQL with the TimescaleDB extension
  • ClickHouse: Store time-series data in a dedicated ClickHouse database
Choose the backend with the TIMESERIES_BACKEND environment variable. TimescaleDB can use your main application database or a separate database since its just a PostgreSQL extension.

Main Database

If your main PostgreSQL database has the TimescaleDB extension available, UptimeKit can reuse DATABASE_URL.

Separate Database

If you want time-series data in a different TimescaleDB database, set TIMESCALE_DATABASE_URL.
If TIMESCALE_DATABASE_URL is not set, UptimeKit uses DATABASE_URL for TimescaleDB.
The PostgreSQL database used for time-series data must have the TimescaleDB extension installed.

ClickHouse

ClickHouse can also be used as the time-series backend by setting the ClickHouse environment variables.
Set these variables for each UptimeKit app that reads or writes monitor history.

Disk usage

By default the ClickHouse image logs at trace level and keeps a dozen system log tables (text_log, trace_log, metric_log, part_log and more). On a small instance they write far more to disk than the monitoring data, which wears out SSDs. docker-compose.clickhouse.yml turns them off with this server config. If you run ClickHouse yourself, add it as /etc/clickhouse-server/config.d/zz-low-write.xml:
On ClickHouse 26.8 or newer, UptimeKit writes monitor events with deduplicated async inserts, so the server writes each worker batch as one part instead of one part per row. Older servers get synchronous inserts, because their async deduplication could drop or reject rows. Turning a log off does not delete data it already wrote. ClickHouse also keeps a renamed copy, such as system.query_log_1, each time an upgrade changes a log table’s schema. List them and drop the ones you no longer need:

Environment Variables