Optional analytics ingestion worker for self-hosted Enterprise. Powers the Cockpit dashboards (DORA, lifecycle, classifier).
The analytics worker is an Enterprise-only add-on. It runs the
ingestion cron that powers the Cockpit dashboards (DORA-style metrics,
PR lifecycle, LLM-based PR classifier).
The default installer does not ship this worker. Community self-hosted
deployments don’t need it and these vars are filtered out of the default
.env.example. Stop here unless you have a self-hosted Enterprise
license and want the Cockpit reports.
A separate Node process running the same image as worker (kodus-ai-worker),
selected at boot via WORKER_ROLE=analytics. Two crons fire from this
process and only this process:
Ingestion (ANALYTICS_INGESTION_CRON, default */30 * * * *) — reads
pull requests and review sessions from Mongo + the OLTP Postgres, projects
them into the analytics schema.
Classifier (ANALYTICS_CLASSIFIER_CRON, default */15 * * * *) — calls
an LLM to tag each PR with a type (feature/bugfix/refactor/etc).
Isolating it from the main worker keeps the code-review event loop
unaffected by long-running ingestion queries.
The analytics warehouse is a Postgres schema, not a separate database.
Two supported layouts:
Shared Postgres (recommended for self-hosted) — leave
ANALYTICS_PG_DB_HOST empty. The config loader falls back to the main
API_PG_DB_* vars and creates an analytics schema in the same instance.
One DB to back up and operate.
Dedicated Postgres — set the full ANALYTICS_PG_DB_* block to point
at a separate instance. Use this when you want analytical queries fully
isolated from the OLTP write path.
The worker-analytics container shares the same prod-entrypoint.sh as
api/worker/webhooks. With RUN_MIGRATIONS=true (installer default),
the analytics warehouse migrations (pnpm run analytics:migration:run:prod)
run on first boot, creating the analytics schema and its tables.
To stop ingestion at runtime without removing the container, set
ANALYTICS_INGESTION_DISABLED=true and/or ANALYTICS_CLASSIFIER_DISABLED=true
and restart worker-analytics. The cron stays scheduled but each tick
short-circuits. Use this for incident triage, not as a long-term config —
they are managed primarily for cloud and may not appear in the installer
template.
You should see lines like analytics ingestion done in NNNms — {...} every
30 minutes and analytics classifier done ... every 15 minutes. If you
don’t, check that WORKER_ROLE=analytics is set on this container only
(not on the main worker — that one must stay code-review).