Title: [Feature Request] Expose Request Scope in Express Integration · Issue #4607 · getsentry/sentry-javascript · GitHub
Open Graph Title: [Feature Request] Expose Request Scope in Express Integration · Issue #4607 · getsentry/sentry-javascript
X Title: [Feature Request] Expose Request Scope in Express Integration · Issue #4607 · getsentry/sentry-javascript
Description: Hey there, I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access to the scope inside of middlewares or ro...
Open Graph Description: Hey there, I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access ...
X Description: Hey there, I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have acc...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4607
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature Request] Expose Request Scope in Express Integration","articleBody":"Hey there,\r\n\r\nI've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access to the scope inside of middlewares or route handlers.\r\n\r\nI want to enrich all Sentry events based on the request they are thrown/reported in and not globally set some values that get changed by other async requests on the same server.\r\n\r\ne.g.\r\n- Adding a client version (custom header value) as a tag to the scope\r\n- Using scope.setExtras in a request that is causing weird issues and we want to debug (without wrapping everything inside of Sentry.withScope and try/catch\r\n\r\nAfaik there is nothing yet like req.sentryScope, but it seems \"relatively easy\" to just add `req.sentryScope = scope` before [this line](https://github.com/getsentry/sentry-javascript/blob/1bf988322a6adb931905305747f4fafb742002b1/packages/node/src/handlers.ts#L421).\r\n\r\nIf so, it should help people that are having issues with async scopes inside their express apps.\r\n\r\nDo you see any downsides or problems with the described solution?","author":{"url":"https://github.com/derN3rd","@type":"Person","name":"derN3rd"},"datePublished":"2022-02-18T11:23:47Z","url":"https://github.com/getsentry/sentry-javascript/issues/4607"}
| 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:93db51de-258f-0e08-5f36-079d110264a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7F8:15A861:1AE05F9:23A5688:6B0425FA |
| html-safe-nonce | b1856228c7cd9ad342dad6c91d1d8782ae6ebd93f41c381ee95744a1414af029 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0Y4OjE1QTg2MToxQUUwNUY5OjIzQTU2ODg6NkIwNDI1RkEiLCJ2aXNpdG9yX2lkIjoiNTE2Mzc2NzcwMDYzNTUyNjY1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dd7efff4ac0404a43b39d4715770f92472d725ad549c531584b2a4289040c3ea |
| hovercard-subject-tag | issue:1142878443 |
| 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-javascript/4607/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7873ff06445925a15396b9d5171ff7464411677242d123705ef213ffdfbc161/getsentry/sentry-javascript/issues/4607 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7873ff06445925a15396b9d5171ff7464411677242d123705ef213ffdfbc161/getsentry/sentry-javascript/issues/4607 |
| og:image:alt | Hey there, I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | derN3rd |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width