Skip to content

feat: add Prometheus instrumentation for FastAPI HTTP requests

Stan Hu requested to merge sh-prometheus-instrumentator into main

This commit adds the prometheus-fastapi-instrumentator and prometheus-client packages and uses them to instrument the /v1/completions endpoint. Prometheus metrics are exported on a separate port under /metrics to restrict access to internal IPs.

The following environment variables have been added:

  • FASTAPI_METRICS_HOST
  • FASTAPI_METRICS_PORT

By default, the metrics server can be scraped via http://localhost:8082/metrics.

Closes #69 (closed)

Merge request reports