Skip to main content

Monitor projects in the Putki stack

If you run the full Putki stack with Docker Compose, execution monitoring is already part of it. The stack includes the grafana service with the same datasource and dashboards as the monitoring bundle, and the warehouse-db service holds the logging database. You do not need the monitoring bundle.

Grafana listens on port 3000 of the stack host, bound to 127.0.0.1 unless you set BIND_ADDR. Log in as admin with the GRAFANA_ADMIN_PASSWORD from the stack's .env.

Grafana reads the logs with a read-only database user of its own, grafana_reader, which warehouse-db-init creates on every start. Set its password, GRAFANA_DB_PASSWORD, in the stack's .env: the stack does not start without it.

Alerts and single sign-on are set up with the same settings as in the bundle, in the stack's .env.

Connect your own projects​

The putki-lab sample project logs out of the box. For each of your own projects, run the installer from the monitoring bundle against the project folder on the host:

./install-logging.sh --project-home /path/to/projects/sales --project-name sales

That is all: no --environment-file and no password. The stack's Hop containers (Putki Web, the Hop server and the scheduled jobs) get the logging database's address and credentials from the stack's .env through their environment, so nothing has to be written into the project. Keep LOGGING_* out of the project's environment files: a value there wins over the stack's, and goes stale when the stack's password changes.

Projects outside the stack, run with Hop on a laptop or a server of your own, still need the variables in an environment file: install those as in Set up execution monitoring.

Run the bundle's Grafana against the stack​

Only if you run the stack without its grafana service: the bundle can join the stack's network and read warehouse-db directly. In the bundle's .env, remove COMPOSE_PROFILES=logging-db and set:

LOGGING_DB_HOST=warehouse-db
LOGGING_DB_USER=developer
LOGGING_DB_PASSWORD=<the stack's WAREHOUSE_DB_PASSWORD>
GRAFANA_DB_PASSWORD=<the stack's GRAFANA_DB_PASSWORD>

The bundle's Grafana then reads as the stack's grafana_reader. Use the stack's password: the bundle's logging-db-init sets the user's password to this value.

Then start it with the join overlay. The stack must be running first, because the overlay attaches to its network:

docker compose -f docker-compose-monitoring.yml -f docker-compose-monitoring.join.yml up -d

Set PUTKI_NETWORK if your stack's network is not called putki-net.