Commit e9fed7d
committed
fix(flask): wrap wsgi_app call in try/except to prevent active_requests gauge leak
If wsgi_app() raises an uncaught exception, the active_requests_counter
decrement at the end of _wrapped_app was never reached, causing the gauge
to permanently read high. Kubernetes HPA and similar systems would see
phantom load.
Add a bare try/except that decrements the counter and re-raises on
exception, matching the pattern already used in the WSGI instrumentation.
Fixes #4431
Signed-off-by: alliasgher <alliasgher123@gmail.com>1 parent a912524 commit e9fed7d
1 file changed
Lines changed: 5 additions & 1 deletion
File tree
- instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| |||
0 commit comments