diff --git a/packages/nodejs/.changesets/ignore-http-requests-to-socket-io.md b/packages/nodejs/.changesets/ignore-http-requests-to-socket-io.md new file mode 100644 index 00000000..4ecb4d9f --- /dev/null +++ b/packages/nodejs/.changesets/ignore-http-requests-to-socket-io.md @@ -0,0 +1,6 @@ +--- +bump: "patch" +type: "fix" +--- + +Do not instrument HTTP requests to the default socket.io path. This works around an issue where our HTTP instrumentation breaks socket.io's server side, causing the client side to get stuck in a connection loop. diff --git a/packages/nodejs/src/instrumentation/http/lifecycle/incoming.ts b/packages/nodejs/src/instrumentation/http/lifecycle/incoming.ts index 6eaf44b5..1c349bf5 100644 --- a/packages/nodejs/src/instrumentation/http/lifecycle/incoming.ts +++ b/packages/nodejs/src/instrumentation/http/lifecycle/incoming.ts @@ -20,7 +20,9 @@ const DEFAULT_IGNORED_URLS = [ // gatsby hot reloading /(\/__webpack_hmr)/i, // next.js integration web vitals endpoint - /(\/__appsignal-web-vitals)$/i + /(\/__appsignal-web-vitals)$/i, + // socket.io default path + /^(\/socket.io)/i ] function incomingRequest(