diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts index a2aa1c256f..87efaf6400 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts @@ -174,7 +174,7 @@ export function handleExecutionResult( span: Span, pgResult: pgTypes.QueryResult | pgTypes.QueryArrayResult | unknown ) { - if (config.responseHook !== undefined && pgResult !== undefined) { + if (typeof config.responseHook === 'function') { safeExecuteInTheMiddle( () => { config.responseHook!(span, {