diff --git a/packages/opentelemetry-plugin-http/src/http.ts b/packages/opentelemetry-plugin-http/src/http.ts index 88b05eb838..fbca014ece 100644 --- a/packages/opentelemetry-plugin-http/src/http.ts +++ b/packages/opentelemetry-plugin-http/src/http.ts @@ -32,7 +32,6 @@ import { import type { ClientRequest, IncomingMessage, - request, RequestOptions, ServerResponse, } from 'http'; @@ -95,7 +94,7 @@ export class HttpPlugin extends BasePlugin { shimmer.wrap( this._moduleExports, 'get', - this._getPatchOutgoingGetFunction(request) + this._getPatchOutgoingGetFunction(this._moduleExports.request) ); } diff --git a/packages/opentelemetry-plugin-https/src/https.ts b/packages/opentelemetry-plugin-https/src/https.ts index 8786309e2e..40dc543a9a 100644 --- a/packages/opentelemetry-plugin-https/src/https.ts +++ b/packages/opentelemetry-plugin-https/src/https.ts @@ -69,7 +69,7 @@ export class HttpsPlugin extends HttpPlugin { shimmer.wrap( this._moduleExports, 'get', - this._getPatchHttpsOutgoingGetFunction(https.request) + this._getPatchHttpsOutgoingGetFunction(this._moduleExports.request) ); }