Using TimescaleDB to store Prometheus data

    You can use postgres as the remote storage database used by the Prometheus backend.

    While this is not the recommended behavior, it is a good opportunity to understand how the Pigsty deployment system is used.

    Create a Prometheus business database with business users.

    1. bin/createdb pg-meta prometheus

      Install promscale by executing the following command on the meta node

      If not available in the default package, you can directly download it.

      1. wget https://github.com/timescale/promscale/releases/download/0.6.1/promscale_0.6.1_Linux_x86_64.rpm
      2. sudo rpm -ivh promscale_0.6.1_Linux_x86_64.rpm

      Edit the config file /etc/sysconfig/promscale.conf.

      1. PROMSCALE_DB_HOST="127.0.0.1"
      2. PROMSCALE_DB_NAME="prometheus"
      3. PROMSCALE_DB_PASSWORD="DBUser.Prometheus"
      4. PROMSCALE_DB_USER="dbuser_prometheus"

      Prometheus can use Remote Write/ Remote Read via Promscale, using Postgres as remote storage.

      Edit Prometheus config file.

      1. vi /etc/prometheus/prometheus.yml

      Add the following record.

      1. remote_write:
      2. - url: "http://127.0.0.1:9201/write"
      3. - url: "http://127.0.0.1:9201/read"