Auto-enable Starlette and FastAPI integrations
Problem Statement
Right now the users have to set the integrations by themselves. Better would be auto enabling it like Django.
Solution Brainstorm
Detect starlette and fastfapi python modules and if present enable the integrations. See other integration how they do it. Also update the guide in documentation, the wizard and the static "for" pages to reflect this.
TODO
- [X] Auto-enable Integrations
- [ ] Fix tests to reflect new behavior
- [ ] Update Starlette Guide: https://docs.sentry.io/platforms/python/guides/starlette/
- [ ] Update FastAPI Guide: https://docs.sentry.io/platforms/python/guides/fastapi/
- [ ] Update wizard snippets for Starlette: https://github.com/getsentry/sentry-docs/blob/master/src/wizard/python/starlette.md
- [ ] Update wizard snippets for FastAPI: https://github.com/getsentry/sentry-docs/blob/master/src/wizard/python/fastapi.md
- [ ] Update "for" page for Starlette: https://github.com/getsentry/static-sites/blob/master/packages/www/src/pages/for/starlette.js
- [ ] Update "for" page for FastApi: https://github.com/getsentry/static-sites/blob/master/packages/www/src/pages/for/fastapi.js
In case that the ASGIMiddleware is used when also the integrations are auto enabled I now output an error message during startup: The Python SDK can now automatically support ASGI frameworks like Starlette and FastAPI. Please remove 'SentryAsgiMiddleware' from your project. See https://docs.sentry.io/platforms/python/guides/asgi/ for more information.
There is also a PR to improve the linked documentation: https://github.com/getsentry/sentry-docs/pull/5390
@antonpirker, please extract the leftovers of this issue into a separate one and close this.