Skip to content

Metrics exposure is blocking #98

@stephanecollot

Description

@stephanecollot

Hello,

I'm using aioprometheus in my FastAPI like this:

@app.get("/metrics")
async def handle_metrics(
    accept: List[str] = Header(None),
) -> Response:
    content, http_headers = render(REGISTRY, accept)
    return Response(content=content, media_type=http_headers["Content-Type"])

And I notice that when querying /metrics my application freeze for few seconds.
Is this normal? I'm looking at the code of render() and it seems not async.

Do you plan to make it async?
If not what solution do you suggest?

Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions