From 60d60d0be27f625819d9c4138488fb4d4c0a6b45 Mon Sep 17 00:00:00 2001 From: MartenH <72463136+mhennoch@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:06:12 +0200 Subject: [PATCH] fix(instrumentation-net): Don't operate on closed span (#1819) * fix(instrumentation-net): Don't operate on closed span * Fix lint --- .../src/instrumentation.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts index 848744bf42..e3aa6f1e33 100644 --- a/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts @@ -162,7 +162,11 @@ export class NetInstrumentation extends InstrumentationBase { } }; - for (const event of [SocketEvent.CLOSE, SocketEvent.ERROR]) { + for (const event of [ + SocketEvent.CLOSE, + SocketEvent.ERROR, + SocketEvent.SECURE_CONNECT, + ]) { socket.once(event, otelTlsRemoveListeners); }