Agent-Hellboy / Agent-Hellboy/gunicorn-prometheus-exporter

Failed request metrics not appearing in multiprocess mode

Open
#44 0 comments 0 reactions 0 assignees View on GitHub
explore metrics
Dominant language
Python
Stars
18
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Description:

The following metrics are defined and implemented but don't show up in the Prometheus endpoint:
gunicorn_worker_failed_requests_total
gunicorn_worker_error_handling_total
gunicorn_worker_state

### Expected behavior:

These metrics should appear when errors occur or workers receive signals.
Current behavior: Metrics are defined in metrics.py and implemented in plugin.py but never show values in /metrics endpoint.

### Root cause:
Flask's error handling catches exceptions before they reach Gunicorn worker's error handling, and signal handlers aren't triggered during normal operation.

### Files affected:
src/gunicorn_prometheus_exporter/metrics.py (lines 175-191)
src/gunicorn_prometheus_exporter/plugin.py (lines 147-165, 172-191)

Repro: Start server with any config, generate errors via /error or /crash endpoints, check /metrics - failed request metrics remain empty.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.