Integrations

Monitoring Integration

Monitoring Integration

WhoDB CE exposes a simple HTTP health endpoint and structured logging controls.

Health Checks

Use /health for process-level checks:

Bash

curl -fsS http://localhost:8080/health

Expected response:

text

ok

Docker health check:

YAML

services:
  whodb:
    image: clidey/whodb:latest
    ports:
      - "8080:8080"
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://localhost:8080/health | grep -qx ok"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 20s

Kubernetes probes:

YAML

livenessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 20
  periodSeconds: 30
readinessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 5
  periodSeconds: 10

Logs

WhoDB supports log environment variables:

Variable
Purpose
WHODB_LOG_LEVEL
debug, info, warn, error, or none
WHODB_LOG_FORMAT
text or json
WHODB_LOG_FILE
Non-HTTP log output. Use default for /var/log/whodb/whodb.log
WHODB_ACCESS_LOG_FILE
HTTP access log output. Use default for /var/log/whodb/whodb.access.log

Docker Compose log example:

YAML

services:
  whodb:
    image: clidey/whodb:latest
    ports:
      - "8080:8080"
    environment:
      WHODB_LOG_LEVEL: info
      WHODB_LOG_FORMAT: json
      WHODB_LOG_FILE: default
      WHODB_ACCESS_LOG_FILE: default
    volumes:
      - ./logs:/var/log/whodb

Prometheus And Grafana

For Prometheus and Grafana setups, monitor WhoDB with:

  • HTTP blackbox checks against /health.
  • Container metrics from cAdvisor, Docker, Kubernetes, or node exporters.
  • Database-specific exporters for PostgreSQL, MySQL, Redis, MongoDB, and other backing stores.
  • Log-based metrics from your log pipeline.

Complete standalone Compose example with Prometheus and Grafana:

YAML

services:
  whodb:
    image: clidey/whodb:latest
    ports:
      - "8080:8080"

  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    depends_on:
      - prometheus
    volumes:
      - grafana-data:/var/lib/grafana

volumes:
  grafana-data:

Example prometheus.yml files depend on your exporter deployment. Use blackbox exporter for HTTP checks, and scrape database/container exporters for runtime metrics.

Alerting

Alert on signals that exist in the current app and platform:

  • /health returns anything other than HTTP 200 with body ok.
  • Container restarts.
  • Elevated HTTP 5xx access logs.
  • High CPU or memory from container/runtime metrics.
  • Database exporter errors for the connected database.

Health Check Script

Bash

#!/usr/bin/env bash
set -euo pipefail

WHODB_URL="${WHODB_URL:-http://localhost:8080}"

body="$(curl -fsS "$WHODB_URL/health")"
if [ "$body" != "ok" ]; then
  echo "unexpected health response: $body" >&2
  exit 1
fi

echo "WhoDB is healthy"
Docker Integration

Run WhoDB with Docker health checks and logs.

Troubleshooting

Debug connectivity, performance, and UI issues.