From 284ff9d8e46035573bcb1704d96cd84712c9753f Mon Sep 17 00:00:00 2001 From: Alec Mev Date: Thu, 15 Aug 2024 21:44:39 +0100 Subject: [PATCH] fix(instrumentation): Fix optional property types (#4833) --- CHANGELOG.md | 1 + .../packages/opentelemetry-instrumentation/src/types.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b59d23365..1d7493899a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ * fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values [#4879](https://github.com/open-telemetry/opentelemetry-js/pull/4879) @trentm * deps(opentelemetry-instrumentation): Bump `shimmer` types to 1.2.0 [#4865](https://github.com/open-telemetry/opentelemetry-js/pull/4865) @lforst +* fix(instrumentation): Fix optional property types [#4833](https://github.com/open-telemetry/opentelemetry-js/pull/4833) @alecmev ### :books: (Refine Doc) diff --git a/experimental/packages/opentelemetry-instrumentation/src/types.ts b/experimental/packages/opentelemetry-instrumentation/src/types.ts index 2fa567ff012..b58054ac0df 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/types.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/types.ts @@ -136,11 +136,15 @@ export interface InstrumentationModuleDefinition { /** Method to patch the instrumentation */ // eslint-disable-next-line @typescript-eslint/no-explicit-any - patch?: (moduleExports: any, moduleVersion?: string) => any; + patch?: + | ((moduleExports: any, moduleVersion?: string | undefined) => any) + | undefined; /** Method to unpatch the instrumentation */ // eslint-disable-next-line @typescript-eslint/no-explicit-any - unpatch?: (moduleExports: any, moduleVersion?: string) => void; + unpatch?: + | ((moduleExports: any, moduleVersion?: string | undefined) => void) + | undefined; } /**