aioprometheus.asgi.starlette module

async aioprometheus.asgi.starlette.metrics(request: starlette.requests.Request) starlette.responses.Response

Render metrics into format specified by ‘accept’ header.

This function first attempts to retrieve the metrics Registry from request.app.state in case the app is using a custom registry instead of the default registry. If this fails then the default registry is used.