Skip to content

Monitoring

For observing and tracking performance, availability, and health of the system, we use Prometheus, a powerful open-source monitoring and alerting toolkit.

To collect telemetry data, Prometheus utilizes an endpoint called /metrics. This endpoint serves as the interface through which metrics are exposed and made available for scraping. By accessing this endpoint, Prometheus can retrieve metrics from different targets and store them for analysis and visualization.

Gunicorn metrics

Gunicorn provides the following metrics for monitoring and analyzing HTTP requests:

Summary metrics

  • gunicorn_queue_time: Measures the time a request spends in the queue (latency).
  • Sub-metrics:
    • gunicorn_queue_time_count: Total count of requests in the queue.
    • gunicorn_queue_time_sum: Sum of the time spent by requests in the queue.

Histogram metrics

  • gunicorn_request_time_histogram: Represents the time a request spends in the queue as a histogram.
  • Sub-metrics:
    • gunicorn_request_time_histogram_count: Total count of requests in the histogram.
    • gunicorn_request_time_histogram_bucket: Distribution of requests in different time intervals.
    • gunicorn_request_time_histogram_sum: Sum of the time spent by requests in the histogram.

HTTP Request Analysis Metrics

For analyzing HTTP requests, the following metrics are available:

Counter Metric

  • flask_http_request_total: Tracks the total count of requests.

Histogram metrics

  • flask_http_request_duration_seconds_bucket: Represents the duration of request execution in different time intervals.
  • flask_http_request_duration_seconds_count: Total count of requests in the histogram.
  • flask_http_request_duration_seconds_sum: Sum of the durations of requests in the histogram.

You can filter the metrics using the following parameters:

  • method: Filters requests by HTTP method (e.g., GET, POST, etc.).
  • path: Filters requests by the path (/api/match, /api/match_and_search, /api/detect, /api/groups, /api/search, /api/v2/liveness).
  • status: Filters requests by the response code (e.g., 200, 404, etc.).