Title: Capturing user in Flask · Issue #769 · getsentry/sentry-python · GitHub
Open Graph Title: Capturing user in Flask · Issue #769 · getsentry/sentry-python
X Title: Capturing user in Flask · Issue #769 · getsentry/sentry-python
Description: tl;dr: What is the recommended way to capture user in Flask, in case when there is no flask-login? First try is to configure scope, so maybe decorate view with push_scope? Nope - it looks nice, but it is not enough if you want to have us...
Open Graph Description: tl;dr: What is the recommended way to capture user in Flask, in case when there is no flask-login? First try is to configure scope, so maybe decorate view with push_scope? Nope - it looks nice, but...
X Description: tl;dr: What is the recommended way to capture user in Flask, in case when there is no flask-login? First try is to configure scope, so maybe decorate view with push_scope? Nope - it looks nice, but...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/769
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Capturing user in Flask","articleBody":"tl;dr: What is the recommended way to capture user in Flask, in case when there is no `flask-login`?\r\n\r\nFirst try is to configure scope, so maybe decorate view with `push_scope`? Nope - it looks nice, but it is not enough if you want to have user info during e.g. error handling, which could be outside view method.\r\n\r\nSo we have `configure_scope`, what tell us the [Sentry doc](https://docs.sentry.io/platforms/python/#capturing-the-user)? Great, but only before #758 - before this PR, `FlaskIntegration` cleared the scope on every app context change (so typically for every request). Now information set global can be shared during requests - not the best option for user info.\r\n\r\nAnd the last try, we have `before_send` hook, what is currently probably the only way to capture user. Ok, but it's like totally different use as designed for it (stripping sensitive data), and this way is undocumented neither in general Sentry doc, nor in Flask-specific page (as an option for capturing user).\r\n\r\nI think we should have a recommended way for capturing user in Flask: by scope (similar like other platforms), hook (which works now) or a special one (like new hook in FlaskIntegration instead of hard coded support for `flask-login` only). ","author":{"url":"https://github.com/kam193","@type":"Person","name":"kam193"},"datePublished":"2020-07-28T08:01:46Z","url":"https://github.com/getsentry/sentry-python/issues/769"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8453d754-8ec3-908e-70f1-8d62ba571368 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82F4:299B35:3F48C7:5549EF:6B008CC0 |
| html-safe-nonce | 0c0f197efe0bf40b0754406918eeb3b5da1e1c70ad7c8b55f4a4e668f1a98edd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkY0OjI5OUIzNTozRjQ4Qzc6NTU0OUVGOjZCMDA4Q0MwIiwidmlzaXRvcl9pZCI6IjIwNDE0ODA1OTcwNDk3NDA0ODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 79e67540a63cebb43ee6102651fe2544180675373e7de2a59b91c84435a89c88 |
| hovercard-subject-tag | issue:666854296 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/769/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71e1f28382a1bccae761522e2cf1ea713865ffc140fd8a6228a6519514b05f56/getsentry/sentry-python/issues/769 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71e1f28382a1bccae761522e2cf1ea713865ffc140fd8a6228a6519514b05f56/getsentry/sentry-python/issues/769 |
| og:image:alt | tl;dr: What is the recommended way to capture user in Flask, in case when there is no flask-login? First try is to configure scope, so maybe decorate view with push_scope? Nope - it looks nice, but... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kam193 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | be616a2a6ec1c609d6e002896dff5352d5c5f28b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width