Configuration¶
plywatch loads configuration from YAML files in apps/backend/config/ and every YAML value can be overridden with environment variables.
Security scope: this monitor is intended for internal/trusted environments. Expose it through an authenticated reverse proxy, not directly to the public internet.
Load order:
api.yamlincluded layers:
base.yaml,cache.yaml,celery.yamloc.env/oc.decoderesolution from environment variables
Common setup (production-safe baseline)¶
export PLYWATCH_CELERY_BROKER_URL=redis://redis:6379/0
export PLYWATCH_CELERY_RESULT_BACKEND=redis://redis:6379/1
export PLYWATCH_METRICS_ENABLED=true
export PLYWATCH_TRACE_ENABLED=true
export PLYWATCH_MAX_TASKS=5000
export PLYWATCH_MAX_COMPLETED_TASKS=50000
Local backend run with uv (metrics check)¶
cd apps/backend
uv sync --dev
export PLYWATCH_CELERY_BROKER_URL=redis://localhost:6379/0
export PLYWATCH_CELERY_RESULT_BACKEND=redis://localhost:6379/1
export PLYWATCH_METRICS_ENABLED=true
export PLYWATCH_METRICS_PATH=/metrics
uv run -- python -m uvicorn plywatch.main:app --app-dir src --host 0.0.0.0 --port 8080
In another terminal:
curl -i http://127.0.0.1:8080/metrics
Expected result:
HTTP/1.1 200 OKcontent-type: text/plain; version=0.0.4; charset=utf-8body with Prometheus families (
# HELP,# TYPE,plywatch_*and optionallyflower_*when compatibility is enabled)
Canonical metrics scrape path is exactly PLYWATCH_METRICS_PATH (default /metrics).
Requests to /metrics/ return 404.
If metrics is disabled (or the path does not match PLYWATCH_METRICS_PATH), the endpoint returns 404 instead of frontend HTML.
Complex values format¶
Use JSON-like strings for list and null values because those keys use oc.decode.
# list
export PLYWATCH_RAW_EVENT_BUFFER_EXCLUDED_TYPES='["worker-heartbeat","task-sent"]'
export PLYWATCH_METRICS_ADAPTERS='["prometheus"]'
# null
export PLYWATCH_REST_DOCS_URL=null
export PLYWATCH_REST_REDOC_URL=null
YAML keys and env variables¶
base.yaml (app, logger)¶
YAML key |
Environment variable |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api.yaml (trace, metrics, monitor)¶
YAML key |
Environment variable |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
celery.yaml (celery)¶
YAML key |
Environment variable |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Security note: /api/overview returns brokerUrl with sensitive parts redacted. User info (username[:password]@) is always masked and query parameter values are masked.
cache.yaml (cache)¶
YAML key |
Environment variable |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RabbitMQ note¶
RabbitMQ works as a Celery broker for Plywatch monitoring. Some Celery canvas patterns depend on the selected result backend. For example, rpc:// does not support chords.
Deeper references¶
Celery configuration: https://docs.celeryq.dev/en/stable/userguide/configuration.html
Celery canvas: https://docs.celeryq.dev/en/stable/userguide/canvas.html