Skip to content

feat: add Prometheus /metrics endpointΒ #90

@saidsef

Description

@saidsef

🩺 Problem Statement

The application currently lacks a standardized endpoint for exposing runtime metrics, making it difficult to monitor health, performance, and usage in production environments. This limits observability and proactive troubleshooting.

πŸ“ Description

Integrate a Prometheus-compatible /metrics endpoint using the prometheus_client Python library. The endpoint should expose key application metrics such as request count, latency, active requests, and response size. The metrics server should run on a configurable port and be accessible for Prometheus scraping. Implementation should be robust, well-documented, and follow best practices for production monitoring.

🎯 Goals

  • Add /metrics endpoint using prometheus_client.
  • Track and expose:
    • Total request count
    • Request latency (histogram)
    • Number of active requests
    • Response size (summary)
  • Make metrics server port configurable via environment variable.
  • Ensure endpoint is accessible and compatible with Prometheus scraping.
  • Document usage, configuration, and integration steps.

βœ… Expected Result

  • /metrics endpoint available and serving Prometheus metrics.
  • Metrics are updated in real-time and reflect application activity.
  • Documentation is clear and enables easy integration with Prometheus/Grafana.
  • Improved observability and monitoring for the application.

πŸ“š Resources

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions