From f1d2fd084c8e3e494e3606c4eca53158495f43f6 Mon Sep 17 00:00:00 2001 From: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com> Date: Mon, 21 Feb 2022 09:59:29 +0200 Subject: [PATCH] fix(opentelemetry-instrumentation-redis): add condition before error print (#897) --- plugins/node/opentelemetry-instrumentation-redis/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts index e3e3b68c1b..471e288dbc 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts @@ -140,7 +140,9 @@ export const getTracedInternalSendCommand = ( responseHook(span, cmd.command, cmd.args, reply); }, err => { - diag.error('Error executing responseHook', err); + if (err) { + diag.error('Error executing responseHook', err); + } }, true );