Prometheus has its own local storage using a local on-disk time series database. However, this is not clustered or replicated. i.e. it’s not scalable or durable.
It does provide interfaces to integrate with remote storage. E.g.
One of these options is PostgreSQL and TimescaleDB. Note, TimescaleDB uses PostgreSQL but scales it for better performance using automatic partitioning across time and space:
Prometheus remote storage adapter for PostgreSQL
1. Install packages (both provided by Timescale):
The adapter is a translation proxy used by Prometheus for reading/writing data to the PostgreSQL/Timescale database. The data from Prometheus arrives as a Protobuf. The adapter deserializes it and converts it into the Prometheus native format (see Prometheus’ Exposition Formats) before inserting it into the database.
A Docker image provides the Prometheus PostgreSQL remote storage adapter: https://hub.docker.com/r/timescale/prometheus-postgresql-adapter/
pg_prometheusimplements the Prometheus data model for PostgreSQL.
A Docker image which provides PostgreSQL and TimescaleDB: https://hub.docker.com/r/timescale/pg_prometheus/
2. Configure Prometheus to use this remote storage adapter
i.e. add this to
- url: "http://<adapter-address>:9201/write"
- url: "http://<adapter-address>:9201/read"
See also this tutorial: https://docs.timescale.com/v0.10/tutorials/prometheus-adapter