Title: autoInstrumentMiddleware doesn't seem to work · Issue #9285 · getsentry/sentry-javascript · GitHub
Open Graph Title: autoInstrumentMiddleware doesn't seem to work · Issue #9285 · getsentry/sentry-javascript
X Title: autoInstrumentMiddleware doesn't seem to work · Issue #9285 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9285
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"autoInstrumentMiddleware doesn't seem to work","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.72.0\n\n### Framework Version\n\nNext 13.4.19\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\nFor this issue, I think what we're passing into `withSentryConfig` is more relevant:\r\n```js\r\nconst sentryConfig = {\r\n autoInstrumentMiddleware: false,\r\n hideSourceMaps: true\r\n};\r\n\r\nconst nextConfigWithSentry = withSentryConfig(\r\n nextConfig,\r\n sentryWebpackPluginOptions,\r\n sentryConfig,\r\n);\r\n```\r\n\r\nBut just in case, here's what the `sentry.edge.config.ts` file looks like:\r\n```javascript\r\nSentry.init({\r\n enabled: process.env.NODE_ENV === 'production',\r\n dsn: SENTRY_DSN,\r\n environment: process.env.SENTRY_ENVIRONMENT,\r\n tracesSampleRate: 1,\r\n});\r\n```\n\n### Steps to Reproduce\n\nPre-req: A Next.js application that has [middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware)\r\n\r\n1. As [per the docs](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#opt-out-of-auto-instrumentation-on-middleware), add the following to opt out of auto instrumentation of middleware:\r\n```js\r\nconst nextConfig = {\r\n sentry: {\r\n autoInstrumentMiddleware: false,\r\n },\r\n};\r\n```\r\n2. Start the application and perform the necessary steps for the middleware to be triggered\r\n3. Check Sentry to see if the request that was handled by the middleware shows up in the performance and/or discover sections.\n\n### Expected Result\n\nSince auto instrumentation is disabled, I don't expect to see any middleware transactions in Sentry.\n\n### Actual Result\n\nWe are still seeing middleware entries in Sentry\r\n\r\n","author":{"url":"https://github.com/seanparmelee","@type":"Person","name":"seanparmelee"},"datePublished":"2023-10-17T14:45:25Z","url":"https://github.com/getsentry/sentry-javascript/issues/9285"}
| 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:fdfacdac-338f-fbd2-26e7-ea73a5e1ed20 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF66:12C84:38242:4C645:6B04A2D7 |
| html-safe-nonce | deb5af06d64b25dcdd3270062116f05af05968f4da17b439e1587d4f009cd1b1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjY2OjEyQzg0OjM4MjQyOjRDNjQ1OjZCMDRBMkQ3IiwidmlzaXRvcl9pZCI6Ijc3MzUyMDY5MjE4ODM2NTY5MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 13cd8c9321610d36b02a7ee3cf312b1539444b9f0b135eba576d88c3ca72b26a |
| hovercard-subject-tag | issue:1947608819 |
| 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/9285/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6bcb0c7660d944522e6842ccdea7497460eb99f6044392592fa7281279fb08d9/getsentry/sentry-javascript/issues/9285 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6bcb0c7660d944522e6842ccdea7497460eb99f6044392592fa7281279fb08d9/getsentry/sentry-javascript/issues/9285 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | seanparmelee |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| 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