Skip to content

Commit

Permalink
Ignore HTTP requests to socket.io
Browse files Browse the repository at this point in the history
For some reason I haven't quite managed to understand in full, our
HTTP instrumentation breaks socket.io by wrapping one of the event
callbacks in the request object. It is unclear why wrapping it
breaks it -- you can read more about it on [this comment for the
related support issue][descent-into-madness].

This commit adds the default path used by the server-side socket.io
library to the list of ignored paths in the HTTP instrumentation.
While this does not address the underlying issue, it will hopefully
side-step it for most socket.io users.

[descent-into-madness]: appsignal/support#173 (comment)
  • Loading branch information
unflxw committed Jun 1, 2022
1 parent f64c999 commit d92583f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d92583f

Please sign in to comment.