Open sheenobu opened 1 year ago
client_python version: testing on 0.15.0 but the offending code exists in the master branch as well.
I'm trying to use the prometheus ASGI handler with Hypercorns DispatcherMiddleware. It sends lifecycle events which are not properly handled:
def make_asgi_app(registry: CollectorRegistry = REGISTRY, disable_compression: bool = False) -> Callable: """Create a ASGI app which serves the metrics from a registry.""" async def prometheus_app(scope, receive, send): assert scope.get("type") == "http" # Prepare parameters
assert scope.get("type") == "http" ensures any ASGI middleware sending lifecycle events will fail to start the prometheus asgi app.
assert scope.get("type") == "http"
middleware solution if you are eager for a fix:
https://gist.github.com/sheenobu/064b501b76415c6f6dacb6afa1ac6305
client_python version: testing on 0.15.0 but the offending code exists in the master branch as well.
I'm trying to use the prometheus ASGI handler with Hypercorns DispatcherMiddleware. It sends lifecycle events which are not properly handled:
assert scope.get("type") == "http"
ensures any ASGI middleware sending lifecycle events will fail to start the prometheus asgi app.