Prometheus Monitoring

This deliverable adds Prometheus-based monitoring for the Python Wactorz runtime.

Scope

Included:

What Is Monitored

Python app

Prometheus scrapes the Python REST service and records:

The app exposes these at:

GET /metrics

Mosquitto and Fuseki

Mosquitto and Fuseki are optional Prometheus targets.

They are monitored with the Blackbox Exporter:

This is availability monitoring, not deep service-specific exporter telemetry.

Environment Flags

Add or adjust these in .env:

PROMETHEUS_EXTERNAL_PORT=9090
PROMETHEUS_SCRAPE_INTERVAL=15s
PROMETHEUS_PYTHON_TARGET=wactorz-python
PROMETHEUS_MONITOR_MOSQUITTO=0
PROMETHEUS_MONITOR_FUSEKI=0

Notes:

Docker Compose

Main stack

Use the Python profiles:

docker compose --profile python up -d
docker compose --profile python-full up -d

Development stack

docker compose -f compose.dev.yaml up -d

Prometheus is available at:

http://localhost:${PROMETHEUS_EXTERNAL_PORT:-9090}

Simple Ways To Run It

1. Wactorz in Compose, Prometheus in Compose

Leave:

PROMETHEUS_PYTHON_TARGET=wactorz-python

Then run:

docker compose --profile python up -d prometheus blackbox-exporter wactorz-python

2. Wactorz from terminal, Prometheus in Compose

Set:

PROMETHEUS_PYTHON_TARGET=host.docker.internal

Start Wactorz locally in REST mode, then run:

docker compose --profile python up -d --no-deps prometheus blackbox-exporter

This starts only the monitoring containers and points Prometheus at the Wactorz process running on your host.

Verification

1. Check Python metrics directly

curl -fsS http://localhost:8000/metrics | head

You should see Prometheus-formatted output such as wactorz_actors_total, wactorz_http_requests_total, and process metrics.

2. Check Prometheus targets

Open:

http://localhost:9090/targets

Expected:

3. Check optional probes

When PROMETHEUS_MONITOR_MOSQUITTO=1, Prometheus should show a mosquitto-blackbox target.

When PROMETHEUS_MONITOR_FUSEKI=1, Prometheus should show a fuseki-blackbox target.

If a flagged dependency is not running, that target will correctly show as failing.

Alert Rules

Basic Prometheus alert rules are included for: