Observability & Monitoring
The Prometheus /metrics endpoint, /healthz probe, and structured JSON logging.
1. Overview
KOLMOS exposes a standard Prometheus text-exposition endpoint and structured logging. Turn them on with `METRICS_PORT` and `LOG_FORMAT` environment variables. Host-level CPU/RAM metrics are left to `node_exporter`/`cAdvisor`/`docker stats` running alongside the container, so KOLMOS's own `/metrics` stays focused on database internals.
2. Prometheus Metrics
Setting `METRICS_PORT=9090` starts a dedicated HTTP listener serving `GET /metrics` and `GET /healthz`. Exported series include: - `kolmos_connections_active`, `kolmos_connections_total` — labeled by `protocol="pg"|"mysql"|"mongo"` - `kolmos_queries_total`, `kolmos_query_errors_total` — per protocol - `kolmos_query_duration_seconds` — histogram, buckets 0.001s–5s - `kolmos_vacuum_runs_total`, `kolmos_vacuum_last_duration_seconds`
docker run -d -p 9090:9090 -e METRICS_PORT=9090 kolmos/kolmos:latest
curl http://127.0.0.1:9090/metrics
curl http://127.0.0.1:9090/healthz3. Example Prometheus Scrape Config
scrape_configs:
- job_name: kolmos
static_configs:
- targets: ["kolmos-host:9090"]
metrics_path: /metrics
scrape_interval: 15s4. Structured Logging
`LOG_FORMAT={text,json}` controls output shape (default `text`); pick `json` to emit one JSON object per line for Loki, CloudWatch, Datadog, or ELK ingestion. Log verbosity is controlled by `KOLMOS_LOG` (default `info`).
docker run -d -e KOLMOS_LOG=debug -e LOG_FORMAT=json kolmos/kolmos:latest