Title: Expand SentryTracingInterceptor to ws context · Issue #13810 · getsentry/sentry-javascript · GitHub
Open Graph Title: Expand SentryTracingInterceptor to ws context · Issue #13810 · getsentry/sentry-javascript
X Title: Expand SentryTracingInterceptor to ws context · Issue #13810 · getsentry/sentry-javascript
Description: Problem Statement Nestjs supports websocket gateway. It would be nice to have built in tracing interceptor like sentry has for http requests Solution Brainstorm This is implementation which we wrote in our project import { CallHandler, E...
Open Graph Description: Problem Statement Nestjs supports websocket gateway. It would be nice to have built in tracing interceptor like sentry has for http requests Solution Brainstorm This is implementation which we wrot...
X Description: Problem Statement Nestjs supports websocket gateway. It would be nice to have built in tracing interceptor like sentry has for http requests Solution Brainstorm This is implementation which we wrot...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/13810
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Expand SentryTracingInterceptor to ws context","articleBody":"### Problem Statement\n\nNestjs supports [websocket gateway](https://docs.nestjs.com/websockets/gateways). It would be nice to have built in tracing interceptor like sentry has for http requests\n\n### Solution Brainstorm\n\nThis is implementation which we wrote in our project\n\n```typescript\nimport { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';\nimport * as Sentry from '@sentry/core';\nimport { Observable } from 'rxjs';\nimport { tap } from 'rxjs';\n\nexport class SentryWsTracingInterceptor implements NestInterceptor {\n /**\n * Intercepts WS requests to set the transaction name for Sentry tracing.\n */\n public intercept(\n context: ExecutionContext,\n next: CallHandler,\n ): Observable\u003cunknown> {\n if (context.getType() === 'ws') {\n const client = context.switchToWs().getClient();\n const pattern = context.switchToWs().getPattern();\n Sentry.getIsolationScope().setTransactionName(\n `WS ${client.nsp.name} ${pattern}`,\n );\n\n return Sentry.startSpanManual(\n {\n op: 'ws',\n name: `WS ${client.nsp.name} ${pattern}`,\n },\n (span) => {\n return next.handle().pipe(\n tap({\n finalize: () => span.end(),\n }),\n );\n },\n );\n }\n\n return next.handle();\n }\n}\n```\n\n### Product Area\n\nProfiling","author":{"url":"https://github.com/CSenshi","@type":"Person","name":"CSenshi"},"datePublished":"2024-09-25T17:08:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/13810"}
| 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:1bbb23bf-c314-d0af-9992-50b2904384e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A01A:2876DA:19B4611:2173821:6B051B92 |
| html-safe-nonce | 366aa1658fcafa29c10172700a1ab6e055e474b3b7e4ad20977a2e91f38d4f78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDFBOjI4NzZEQToxOUI0NjExOjIxNzM4MjE6NkIwNTFCOTIiLCJ2aXNpdG9yX2lkIjoiNjEwMDc4NTE2MzUyNzMzMDcwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8064dfbf01a66c6a1daeddb7fc9426884afb8d2ad785cbcb0910448e08ad9cdd |
| hovercard-subject-tag | issue:2550268754 |
| 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/13810/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d07ae890671a6ae948abe1acf1ae9e5296442584642a4739551a57db9cf157ff/getsentry/sentry-javascript/issues/13810 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d07ae890671a6ae948abe1acf1ae9e5296442584642a4739551a57db9cf157ff/getsentry/sentry-javascript/issues/13810 |
| og:image:alt | Problem Statement Nestjs supports websocket gateway. It would be nice to have built in tracing interceptor like sentry has for http requests Solution Brainstorm This is implementation which we wrot... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CSenshi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| 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 | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| 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