Installing the observability stack

WEM requires Prometheus and Loki to enable monitoring and log aggregation features, and a PostgreSQL database for its own configuration and application state. Alertmanager is bundled with WEM and runs as a managed subprocess, so no separate installation is required. You can deploy dedicated Prometheus and Loki instances for WEM or integrate with an existing enterprise monitoring stack.

You install Prometheus and Loki before WEM, since WEM's configuration depends on knowing their addresses. The steps below give you a working prometheus.yml to start from without needing anything from the WEM package.

Note

Once WEM is installed, this same example prometheus.yml is also available at /usr/local/greenplum-db/wem/config/prometheus/ on the WEM host, in case you need to refer to it again later.

Installing Prometheus

Prometheus collects and stores the metrics that WEM uses to display cluster performance data. The WHPG Collector pushes host-level metrics to Prometheus using its remote-write API, and Prometheus separately scrapes WEM's own metrics endpoint for SQL and cluster data.

  1. Download and install Prometheus from the official releases page, or install it using your system package manager.

  2. Create a prometheus.yml that scrapes WEM. WEM's bundled Alertmanager only listens on localhost on the WEM host, so it isn't reachable from Prometheus and isn't configured here. If Prometheus runs on the same host as WEM, localhost works as shown for the scrape target. Otherwise, replace it with the hostname or IP address of your WEM host:

    global:
      scrape_interval: 30s
      evaluation_interval: 30s
    
    scrape_configs:
      - job_name: 'wem'
        static_configs:
          - targets: ['localhost:8080']
        metrics_path: /prom/metrics
        scrape_interval: 15s
  3. Start Prometheus with --web.enable-remote-write-receiver so the WHPG Collector can push host metrics to it:

        prometheus --config.file=prometheus.yml --web.enable-remote-write-receiver > prometheus.log 2>&1 &
  4. Verify Prometheus is running:

    curl http://<prometheus-host>:9090/-/healthy

Installing Loki

Loki receives and stores WarehousePG log data forwarded by the WEM Collector.

  1. Download and install Loki from the official releases page, or install it using your system package manager.

  2. Start Loki with a minimal configuration:

    loki -config.file=/etc/loki/loki-local-config.yaml > loki.log 2>&1 &
  3. Verify Loki is accepting log pushes:

    curl http://<loki-host>:3100/ready

Installing PostgreSQL (optional)

WEM needs a PostgreSQL database to store its own configuration and application state, such as dashboard users, roles, and alert rules. You can use a database in your WHPG cluster, or a dedicated instance if you'd rather keep WEM's state separate. To use a dedicated instance:

  1. Download and install PostgreSQL from the official downloads page, or install it using your system package manager.

  2. Initialize the database and enable and start the PostgreSQL service. See the PostgreSQL documentation for details.

  3. On PostgreSQL 13 and earlier, password_encryption defaults to md5, which is incompatible with the scram-sha-256 authentication method configured below. Check the setting, and fix it if needed, before creating the user:

    sudo -i -u postgres psql -c "SHOW password_encryption;"
    sudo -i -u postgres psql -c "ALTER SYSTEM SET password_encryption = 'scram-sha-256';"
    sudo -i -u postgres psql -c "SELECT pg_reload_conf();"
  4. Create a dedicated database and user for WEM. The user name, password, and database name must match the WEM_USER, WEM_PASSWORD, and WEM_DATABASE values you configure later in Installing WEM:

    CREATE USER wem_admin WITH PASSWORD '<your-password>';
    CREATE DATABASE wem OWNER wem_admin;
  5. Configure pg_hba.conf to allow wem_admin to authenticate with a password, using all for the database field since wem setup connects to the postgres maintenance database before switching to wem:

    host    all    wem_admin    127.0.0.1/32    scram-sha-256
    host    all    wem_admin    ::1/128         scram-sha-256
  6. Verify PostgreSQL is accepting connections:

    pg_isready -h <postgres-host> -p 5432

Next steps

Continue to Installing WHPG Collector.


Could this page be better? Report a problem or suggest an addition!