Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starlette middleware feature requests #637

Open
bitdivision opened this issue Mar 22, 2021 · 1 comment
Open

Starlette middleware feature requests #637

bitdivision opened this issue Mar 22, 2021 · 1 comment

Comments

@bitdivision
Copy link

bitdivision commented Mar 22, 2021

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.

@tim-schilling
Copy link
Collaborator

Hi @bitdivision, thank you for the suggestions. Would the ignore setting in the config work for you? Another option would be to define a decorator that calls scout_apm.api.ignore_transaction().

Regarding sampling based on a percentage of requests, you're correct that is currently not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants