Prometheus (metrics)¶
Prometheus collects time-series metrics by scraping /metrics endpoints from services.
Services added¶
- Prometheus
- Service name:
prometheus - Default port:
9090 - Grafana
- Configure Prometheus as a datasource to build dashboards/alerts
Multi-Repricer metrics endpoint¶
The service-multi-repricer backend exposes:
GET http://service-multi-repricer:8001/metrics
It contains lightweight counters/gauges for the health audit and alerting.
Other backend services (service-invoice, service-jtl, service-plenty, service-tickets, service-omni) now also expose GET /metrics via prometheus-fastapi-instrumentator.
Debug / test page¶
In the dashboard: Debug → Observability (Sentry / Prometheus)
- Backend crash (
1 / 0), customlogger.errorwithexc_info,capture_message - Prometheus test counter
repricer_debug_test_total - Frontend client error /
captureMessage(needsVITE_SENTRY_DSN)
API (JWT required, prefix /api/v1/multi):
GET /health/debug/statusPOST /health/debug/sentry/crashPOST /health/debug/sentry/log-errorPOST /health/debug/sentry/capture-messagePOST /health/debug/prometheus/test
Prometheus scrape config (compose)¶
In this repo the Prometheus config lives in docker/prometheus/config.yml.
In both compose files (including the Portainer stack), Prometheus is started with an entrypoint that writes /etc/prometheus/config.yml inside the container at startup. This avoids Portainer host-path issues where /etc/prometheus/config.yml ends up missing inside the container.
scraped jobs (from docker/prometheus/config.yml) include:
metrics_path: /metrics- targets:
service-multi-repricer:8001service-invoice:8002service-jtl:8003service-plenty:8005service-tickets:8006service-omni:8007
Grafana usage (how to visualize)¶
- Add datasource in Grafana: type
Prometheus - URL:
http://prometheus:9090(inside docker network) - Create dashboards using the
repricer_health_audit_*metrics
Portainer / server troubleshooting¶
If Prometheus fails to start, it should no longer be caused by missing bind-mount files.
Instead, check Prometheus container logs for the entrypoint write step (it writes /etc/prometheus/config.yml before starting Prometheus).