diff --git a/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts index 83d3657d07..25cfcba838 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts @@ -338,7 +338,10 @@ export class HapiInstrumentation extends InstrumentationBase { attributes: metadata.attributes, }); try { - return await api.context.with, Hapi.Lifecycle.Method>( + return await api.context.with< + Parameters, + Hapi.Lifecycle.Method + >( api.trace.setSpan(api.context.active(), span), method, undefined,