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.
Download and install Prometheus from the official releases page, or install it using your system package manager.
Create a
prometheus.ymlthat scrapes WEM. WEM's bundled Alertmanager only listens onlocalhoston the WEM host, so it isn't reachable from Prometheus and isn't configured here. If Prometheus runs on the same host as WEM,localhostworks 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
Start Prometheus with
--web.enable-remote-write-receiverso the WHPG Collector can push host metrics to it:prometheus --config.file=prometheus.yml --web.enable-remote-write-receiver > prometheus.log 2>&1 &
Verify Prometheus is running:
curl http://<prometheus-host>:9090/-/healthy
Installing Loki
Loki receives and stores WarehousePG log data forwarded by the WEM Collector.
Download and install Loki from the official releases page, or install it using your system package manager.
Start Loki with a minimal configuration:
loki -config.file=/etc/loki/loki-local-config.yaml > loki.log 2>&1 &
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:
Download and install PostgreSQL from the official downloads page, or install it using your system package manager.
Initialize the database and enable and start the PostgreSQL service. See the PostgreSQL documentation for details.
On PostgreSQL 13 and earlier,
password_encryptiondefaults tomd5, which is incompatible with thescram-sha-256authentication 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();"
Create a dedicated database and user for WEM. The user name, password, and database name must match the
WEM_USER,WEM_PASSWORD, andWEM_DATABASEvalues you configure later in Installing WEM:CREATE USER wem_admin WITH PASSWORD '<your-password>'; CREATE DATABASE wem OWNER wem_admin;
Configure
pg_hba.confto allowwem_adminto authenticate with a password, usingallfor the database field sincewem setupconnects to thepostgresmaintenance database before switching towem:host all wem_admin 127.0.0.1/32 scram-sha-256 host all wem_admin ::1/128 scram-sha-256
Verify PostgreSQL is accepting connections:
pg_isready -h <postgres-host> -p 5432
Next steps
Continue to Installing WHPG Collector.