Title: [v8] Replace `addGlobalEventProcessor` with `addEventProcessor` · Issue #9082 · getsentry/sentry-javascript · GitHub
Open Graph Title: [v8] Replace `addGlobalEventProcessor` with `addEventProcessor` · Issue #9082 · getsentry/sentry-javascript
X Title: [v8] Replace `addGlobalEventProcessor` with `addEventProcessor` · Issue #9082 · getsentry/sentry-javascript
Description: I wonder if we should completely drop global event processors in v8. Currently, when you do this: import * as Sentry from '@sentry/browser'; Sentry.addGlobalEventProcessor(eventProcessor); This will be added to a global and will apply to...
Open Graph Description: I wonder if we should completely drop global event processors in v8. Currently, when you do this: import * as Sentry from '@sentry/browser'; Sentry.addGlobalEventProcessor(eventProcessor); This wil...
X Description: I wonder if we should completely drop global event processors in v8. Currently, when you do this: import * as Sentry from '@sentry/browser'; Sentry.addGlobalEventProcessor(eventProcessor); ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9082
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v8] Replace `addGlobalEventProcessor` with `addEventProcessor`","articleBody":"I wonder if we should completely drop global event processors in v8.\r\n\r\nCurrently, when you do this:\r\n\r\n\r\n```js\r\nimport * as Sentry from '@sentry/browser';\r\n\r\nSentry.addGlobalEventProcessor(eventProcessor);\r\n```\r\n\r\nThis will be added to a global and will apply to all clients.\r\n\r\nNow we _also_ have event processors on the client, which makes more sense for isolation of integrations etc.\r\nHowever, this has the \"problem\" that if all our own code uses client integrations (to ensure isolation), but users use global event processors, they will potentially not run in a reasonable order.\r\n\r\nTo \"fix\" this, currently we run event processors in the order Client > Global > Scope. This is done to ensure current usage of global event processors works as expected (=they get the already processed event from the client processors). However, looking at it abstractly, this doesn't really make sense - why would client processors run before global ones? Normally processors should probably run in order of specificity, so Global > Client > Scope.\r\n\r\nWhile thinking this through, I wondered - do we actually _need_ global event processors? Is it not enough to have processors on the client + scope? Thus I would propose to:\r\n\r\n1. Add a new top level export `addEventProcessor` that puts the given processor on the current client.\r\n2. Deprecate `addGlobalEventProcessor` in favor of using `addEventProcessor`\r\n3. Remove `addGlobalEventProcessor` in v8\r\n\r\nThis will allow us to streamline this model a bit, and allow to remove the code where we have to keep the event processors on a global variable. I don't know if there is a reasonable scenario where you want an event processor that literally runs on all clients - IMHO the whole point of having multiple clients is that they should be isolated. And you can still just add the event processor to all clients like `clients.forEach((client) => client.addEventProcessor(eventProcessor))` if you really want this.","author":{"url":"https://github.com/mydea","@type":"Person","name":"mydea"},"datePublished":"2023-09-21T07:22:05Z","url":"https://github.com/getsentry/sentry-javascript/issues/9082"}
| 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:c0793475-879c-2927-4e86-4b803815aba0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9AA:14AEA2:16FA961:1E71530:6B041606 |
| html-safe-nonce | 7d9a11b261ff5947e399326997964b2040ba937c5e82a3ea5ffe33c949db3025 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUFBOjE0QUVBMjoxNkZBOTYxOjFFNzE1MzA6NkIwNDE2MDYiLCJ2aXNpdG9yX2lkIjoiNTM4NzY2NjAxMjIyMzMxMzQxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f7b374b2fe7b681cd981a110969582b6449d331761321d52ff740ef1744db8de |
| hovercard-subject-tag | issue:1906289735 |
| 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/9082/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4434695b6ed8916c8129e047c2c506d12e95bcc0f3e338cf17481f5094bd6de5/getsentry/sentry-javascript/issues/9082 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4434695b6ed8916c8129e047c2c506d12e95bcc0f3e338cf17481f5094bd6de5/getsentry/sentry-javascript/issues/9082 |
| og:image:alt | I wonder if we should completely drop global event processors in v8. Currently, when you do this: import * as Sentry from '@sentry/browser'; Sentry.addGlobalEventProcessor(eventProcessor); This wil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mydea |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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