trallnag / prometheus-fastapi-instrumentator

Instrument your FastAPI with Prometheus metrics.
ISC License
948 stars 84 forks source link

Instrumentator middleware includes BackgroundTask duration in http request latency metrics #275

Open Blejwi opened 11 months ago

Blejwi commented 11 months ago

Hello,

PrometheusInstrumentatorMiddleware measures HTTP request time including the time of background tasks added during that request. I don't think it's an expected behavior.

Do you have any idea how to deal with that?

CuriousDolphin commented 2 months ago

Hello, i have the same problem, someone managed to bypass it?

causalbody commented 2 months ago

I am also running into this. Apparently was also reported in https://github.com/trallnag/prometheus-fastapi-instrumentator/issues/191

Is this a known issue on the to be fixed radar?