WebSocketInstrumentationConfiginterface
Configuration for the WebSocket instrumentation.
Properties (11)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| bytesMetric⚓︎ | boolean | string | null | false | x | If |
| connectDurationMetric⚓︎ | boolean | string | null | false | x | If |
| connectDurationMetricBuckets⚓︎ | number[] | [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10] | x | Explicit histogram bucket boundaries for connectDurationMetric, in seconds, ascending. |
| enabled⚓︎ | boolean | x | Whether the WebSocket instrumentation is enabled. |
|
| ignoreGateway⚓︎ | boolean | false | x | If A second socket to the gateway - to that URL, or handed over by the io.Connect
API itself - is a reconnect: its spans carry Cost note: with the message/byte metrics enabled, the gateway socket contributes a sample per gateway message - volume that describes io.Connect itself rather than the application. Enable those metrics deliberately, or set this flag to exclude the gateway. Sockets explicitly handed to the pre-init recorder via its trackWebSocket hook (e.g. the core-js gateway transport handing over its own connection) bypass this flag even when set - explicit handover is a deliberate opt-in. ignorePattern still applies to them and remains the veto. |
| ignorePattern⚓︎ | string | x | x | Optional regex pattern for WebSocket URLs that should be excluded from instrumentation - e.g. infrastructure sockets beyond the gateway connection (which can be excluded using ignoreGateway). |
| matchPattern⚓︎ | string | x | x | Optional regex pattern; if specified, only matching WebSocket URLs are instrumented. |
| messagesMetric⚓︎ | boolean | string | null | false | x | If |
| platform⚓︎ | boolean | false | x | If |
| preInit⚓︎ | boolean | true | x | Unless |
| trace⚓︎ | boolean | true | x | If The handshake of each connection is a span of its own besides, "interopio.api.instrumentation.webSocket.connect": from the construction to the open event, with connectMs, the negotiated protocol and extensions. A connection that never opens ends it at its close, with ERROR and the close code - and it is the only span then: the failure is the handshake's, and there was no lifetime. It is published where the socket was opened - under the current tracing state, like the lifetime span - and is exported at the open, where the wait happened: the lifetime span is exported at the close, which for a long-lived connection (the gateway's) is far away, or never. The two point at each other with span links (link attribute webSocket: "lifetime" / "connect"). Sockets tracked from page start by the pre-init recorder get theirs with the recorded times. If |