Closed JacobHenner closed 2 years ago
In Starlette, every middleware class that has been added to an application is called each time an additional middleware class is added.
Unless aioprometheus's MetricsMiddleware is added as the last piece of middleware, it's __init__(...) will be called more than once. This causes an Exception when the Counter metrics are redefined with the same name in the same registry.
__init__(...)
Hmm, yeah looks that way. I'll look into developing a solution to this problem.
Thanks for reporting issue. Hopefully fixed in latest 22.3.0 release.
In Starlette, every middleware class that has been added to an application is called each time an additional middleware class is added.
Unless aioprometheus's MetricsMiddleware is added as the last piece of middleware, it's
__init__(...)
will be called more than once. This causes an Exception when the Counter metrics are redefined with the same name in the same registry.