René's URL Explorer Experiment


Title: Request-specific context does not work with express · Issue #1939 · getsentry/sentry-javascript · GitHub

Open Graph Title: Request-specific context does not work with express · Issue #1939 · getsentry/sentry-javascript

X Title: Request-specific context does not work with express · Issue #1939 · getsentry/sentry-javascript

Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Package + Version @sentry...

Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/1939

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Request-specific context does not work with express","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [X] Review the documentation: https://docs.sentry.io/\r\n- [X] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [X] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n\r\n## Package + Version\r\n\r\n- [ ] `@sentry/browser`\r\n- [X] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n4.6.4\r\n```\r\n\r\n## Description\r\n\r\nI'm having a lot of issues setting request-specific context when using Sentry with Express. As a reference, I took a look at the official Express integration docs, as well as the following issue and PR:\r\n\r\n- Docs: https://docs.sentry.io/platforms/node/express/\r\n- Issue: https://github.com/getsentry/sentry-javascript/issues/1632\r\n- Docs PR: https://github.com/getsentry/sentry-docs/pull/447/files (As an aside, I don't see these latest doc changes published anywhere though they were merged in)\r\n\r\n```js\r\nconst express = require('express')\r\nconst Sentry = require('@sentry/node')\r\nconst constants = require('./config/constants')\r\n\r\nconst api = express()\r\n\r\nSentry.init({\r\n   dsn: constants.SENTRY_DSN_KEY,\r\n   environment: constants.ENV_CURRENT\r\n})\r\n\r\napi.use(Sentry.Handlers.requestHandler())\r\napi.use((req, res, next) => {\r\n   console.log('Point A', Sentry.getHubFromCarrier(req))\r\n   Sentry.getHubFromCarrier(req).configureScope(scope => {\r\n      console.log('Point B')\r\n      scope.setTag('test', 'Tag')\r\n      scope.setExtra('test', req.path)\r\n   })\r\n\r\n   throw new Error('Request-specific context does not work')\r\n})\r\n\r\napi.use(Sentry.Handlers.errorHandler())\r\napi.listen(constants.API_PORT)\r\n```\r\n\r\nConsole Output:\r\n\r\n```\r\nPoint A \r\nHub {\r\n  version: 3,\r\n  stack: [ { client: undefined, scope: [Object] } ] }\r\n\r\nError: Request-specific context does not work\r\n    at api.use (api/index.js:21:10)\r\n    at Layer.handle [as handle_request] (api/node_modules/express/lib/router/layer.js:95:5)\r\n    at trim_prefix (api/node_modules/express/lib/router/index.js:317:13)\r\n    at api/node_modules/express/lib/router/index.js:284:7\r\n    at Function.process_params (api/node_modules/express/lib/router/index.js:335:12)\r\n    at next (api/node_modules/express/lib/router/index.js:275:10)\r\n    at Domain.\u003canonymous> (api/node_modules/@sentry/node/dist/handlers.js:161:13)\r\n    at Domain.run (domain.js:242:14)\r\n    at sentryRequestMiddleware (api/node_modules/@sentry/node/dist/handlers.js:155:15)\r\n    at Layer.handle [as handle_request] (api/node_modules/express/lib/router/layer.js:95:5)\r\n```\r\n\r\nNotice from the console output above: \r\n- that `Point B` is never output in the console\r\n- `client` in the `stack` of the `Hub` instance is `undefined` - not sure if this is related\r\n\r\nUsing node `8.14.0` and express `4.16.4`.\r\n","author":{"url":"https://github.com/asabhaney","@type":"Person","name":"asabhaney"},"datePublished":"2019-03-05T22:21:14Z","url":"https://github.com/getsentry/sentry-javascript/issues/1939"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:adf7e868-41f4-e667-8466-efaa2d791873
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EA4:2BB639:FA8991:15FACDF:6B0449DD
html-safe-noncee8c42a2d2e94892498a0b9c82dd35dda3fbcebead19cd7efa0a456569e0d193c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUE0OjJCQjYzOTpGQTg5OTE6MTVGQUNERjo2QjA0NDlERCIsInZpc2l0b3JfaWQiOiIyNDI2MDA4ODY4NzM3MDEwMTQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac50b82b9ac780cb95d17de32e2f0a50d01b373c0c535d6c17cc8d6b4b28b3c3cf
hovercard-subject-tagissue:417529067
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/1939/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0875657e3237a6a0520a39fb4a61c329955b892476a3858bb1630d8c012cf21f/getsentry/sentry-javascript/issues/1939
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0875657e3237a6a0520a39fb4a61c329955b892476a3858bb1630d8c012cf21f/getsentry/sentry-javascript/issues/1939
og:image:altReview the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameasabhaney
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/1939#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F1939
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F1939
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/1939
Reloadhttps://github.com/getsentry/sentry-javascript/issues/1939
Reloadhttps://github.com/getsentry/sentry-javascript/issues/1939
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests55 (55)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/1939
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/1939
Request-specific context does not work with expresshttps://github.com/getsentry/sentry-javascript/issues/1939#top
https://github.com/asabhaney
asabhaneyhttps://github.com/asabhaney
on Mar 5, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issue-417529067
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
https://docs.sentry.io/platforms/node/express/https://docs.sentry.io/platforms/node/express/
Unable to include tags #1632https://github.com/getsentry/sentry-javascript/issues/1632
https://github.com/getsentry/sentry-docs/pull/447/fileshttps://github.com/getsentry/sentry-docs/pull/447/files
https://github.com/kamilogorek
kamilogorekhttps://github.com/kamilogorek
on Mar 6, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-470046847
@asabhaneyhttps://github.com/asabhaney
sentry-javascript/packages/hub/src/hub.tshttps://github.com/getsentry/sentry-javascript/blob/f50e025b1e94699f440cd850cb463327022fde70/packages/hub/src/hub.ts#L335-L359
f50e025https://github.com/getsentry/sentry-javascript/commit/f50e025b1e94699f440cd850cb463327022fde70
https://github.com/avaly
avalyhttps://github.com/avaly
on Apr 2, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-478847842
https://docs.sentry.io/platforms/node/express/https://docs.sentry.io/platforms/node/express/
HazAThttps://github.com/HazAT
Type: Documentationhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Documentation%22
on Apr 4, 2019https://github.com/getsentry/sentry-javascript/issues/1939#event-2252186053
https://github.com/asabhaney
asabhaneyhttps://github.com/asabhaney
on May 13, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-491973716
Wrong request data being sent with error. #2045https://github.com/getsentry/sentry-javascript/issues/2045
Express middleware state leaking across requests #1773https://github.com/getsentry/sentry-javascript/issues/1773
https://github.com/kamilogorek
kamilogorekhttps://github.com/kamilogorek
on May 21, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-494373425
@asabhaneyhttps://github.com/asabhaney
https://gist.github.com/kamilogorek/654d471ebbcab3dc20a81d7a1bfe25a7https://gist.github.com/kamilogorek/654d471ebbcab3dc20a81d7a1bfe25a7
kamilogorekhttps://github.com/kamilogorek
Status: Needs Reproductionhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Reproduction%22
Type: Documentationhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Documentation%22
on May 21, 2019https://github.com/getsentry/sentry-javascript/issues/1939#event-2356014793
https://github.com/asabhaney
asabhaneyhttps://github.com/asabhaney
on May 21, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-494577474
@kamilogorekhttps://github.com/kamilogorek
express-sessionhttps://github.com/expressjs/session
connect-mongodb-sessionhttps://github.com/mongodb-js/connect-mongodb-session
connect-mongohttps://github.com/jdesboeufs/connect-mongo
https://github.com/bruun
bruunhttps://github.com/bruun
on Jun 7, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-500056592
https://github.com/kamilogorek
kamilogorekhttps://github.com/kamilogorek
on Jul 3, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-508156462
kamilogorekhttps://github.com/kamilogorek
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 3, 2019https://github.com/getsentry/sentry-javascript/issues/1939#event-2458096479
https://github.com/artdent
artdenthttps://github.com/artdent
on Aug 20, 2019https://github.com/getsentry/sentry-javascript/issues/1939#issuecomment-523087133
Automattic/mongoose#4803https://github.com/Automattic/mongoose/issues/4803
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/1939
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/1939
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.