Skip to content

Extract the number of in-flight requests? #1005

@deliahu

Description

@deliahu

First check

  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.

Description

Is there a way to extract the total number of in-flight requests? I.e. the number of requests that have been received and not yet responded to (not including background tasks).

If so, how can it be consumed? E.g. can I create an endpoint like /requests which responds with the number? Or perhaps a cron task which can query the number so I could send it to a stats database?

Motivation

I'd like to trigger autoscaling events based on the number of in-flight requests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions