Skip to content

Starlette middleware feature requests #637

@bitdivision

Description

@bitdivision

We're using a modified version of the Starlette middleware at the moment, primarily to support asyncio better.

Assuming asyncio support is added in future, there are a couple of other features we've added which it would be nice to see too:

  • An optional list of routes to monitor which can be passed in.
    • Allows us to monitor the specific endpoints we want without health checks / documentation endpoints etc.
    • This can be accomplished manually, but I think being able to set it in config / on the middleware would be a nice addition
    • This requires getting the templated route name from the FastAPI router in our case, I think the same applies to Starlette.
  • Request sampling
    • To reduce the number of events we send, I've added the ability to sample requests
    • i.e monitor 50% of requests.

If I've missed a better way / place to implement these, then please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions