Prometheus is an open-source systems monitoring and alerting toolkit. Prometheus collects and stores metrics as time series data, i.e. metrics information is stored with the timestamp at which it was recorded, alongside optional key-value pairs called labels.
Users can measure the internal status of a QuestDB instance via an HTTP endpoint
exposed by QuestDB at port
9003. This document describes how to enable metrics
via this endpoint, how to configure Prometheus to scrape metrics from a QuestDB
instance, and how to enable alerting from QuestDB to Prometheus Alertmanager.
QuestDB has a
/metrics HTTP endpoint on port
9003 to expose Prometheus
metrics. Before being able to query metrics, they must be enabled via the
metrics.enabled key in server configuration:
When running QuestDB via Docker, port
9003 must be exposed and the metrics
configuration can be enabled via the
QDB_METRICS_ENABLED environment variable:
To verify that metrics are being exposed correctly by QuestDB, navigate to
http://<questdb_ip>:9003/metrics in a browser, where
<questdb_ip> is the IP
address of an instance, or execute a basic curl like the following example:
To configure Prometheus to scrape these metrics, provide the QuestDB instance IP
9003 as a target. The following example configuration file
questdb.yml assumes there is a running QuestDB instance on localhost
(127.0.0.1) with port
Start Prometheus and pass this configuration on launch:
Prometheus should be available on
0.0.0.0:9090 and navigating to
http://0.0.0.0:9090/targets should show that QuestDB is being scraped
In the graphing tab of Prometheus (
can be used to graph QuestDB-specific metrics which are all prefixed with
QuestDB includes a log writer that sends any message logged at critical level
(by default) to Prometheus
Alertmanager over a
TCP/IP socket connection. To configure this writer, add it to the
config alongside other log writers. Details on logging configuration can be
found on the
server configuration documentation.
Alertmanager may be started via Docker with the following command:
To discover the IP address of this container, run the following command which
alertmanager as the container name:
To run QuestDB and point it towards Alertmanager for alerting, first create a
./conf/log.conf with the following contents.
172.17.0.2 in this case is
the IP address of the docker container for alertmanager that was discovered by
docker inspect command above.
Start up QuestDB in Docker using the following command:
When alerts are successfully triggered, QuestDB logs will indicate the sent and received status:
The template used by QuestDB for alerts is user-configurable and is described in more detail in the server configuration documentation.