Vikash
Vikash
I see then I guess switching the `OpenTelemetryInstrumentationMiddleware` from `AbstractMiddleware` to `ASGIMiddleware` should probably fix the issue. Let me try to see if that works.
@provinzkraut Is it worth it to create a PR for this? I notice that there are plans to drop the contrib namespace altogether? I don't want to step on any...
@provinzkraut from the [docs](https://docs.litestar.dev/latest/usage/middleware/creating-middleware.html#migrating-from-middlewareprotocol-abstractmiddleware) it seems like the ASGIMiddleware changes how middleware are initialized. Instead of getting the next app in `__init__` we get it during `__call__` and `__handle__`. But...
Also I see that this PR for v3 already does exactly what I intend to do and it does fix the issue https://github.com/litestar-org/litestar/pull/4055
@euri10 You do this in `_create_asgi_handler` ```python from litestar.contrib.opentelemetry import OpenTelemetryInstrumentationMiddleware if any(isinstance(m, OpenTelemetryInstrumentationMiddleware) for m in self.middleware): opentelemetry_middleware = next( m for m in self.middleware if isinstance(m, OpenTelemetryInstrumentationMiddleware) )...
Yeah I tried migrating but that still doesn't help. Probably because irrespective of the type of middleware the only way to check exclude_opt_key is to have an instance of the...