Skip to content

Monitoring

James Brucker edited this page Nov 25, 2025 · 10 revisions

We want to remotely monitor the health, activity, and related metrics of

  • back-end application code
  • web server, e.g. Nginx (production) or Uvicorn (development)
  • database
  • front-end

For the first three items, the initial implementation will use Prometheus for metrics and Grafana for visual display of the data.

Monitoring Components and URLs

Component Monitor URL
FastAPI WS prometheus-fastapi-instrumentor + custom code in main.py http://localhost:8080/metrics
Nginx /stub_status, accessible only inside Docker network http://nginx:8080/stub_status
Nginx Exportor nginx-exporter running in a separate container exposed port 9113 http://localhost:9113/metrics
Prometheus Server & UI Collects ("scrapes") metrics http://localhost:9090
Grafana UI http://localhost:3000

Note that Docker resolves container names like nginx to IP addresses. Use docker network ls to discover network names, docker network inspect homelog_default to discover container IP addresses.

As of this writing, the relevant files and directories are:

project/
├── docker-compose.yml    Configure containers, exposed ports, and volumes
├── backend/
│   ├── Dockerfile        FastAPI web service + Uvicorn
│   └── main.py           Configure and expose metrics for Prometheus
├── nginx/                Nginx proxies the backend web service
│   └── nginx.conf        Exposes metrics at path `/stub_status`
└── monitor/
    └── prometheus.yml

Clone this wiki locally