From 7ab5a92005639bf0c133bcca5cbe1dc64895775e Mon Sep 17 00:00:00 2001 From: Drew Corlin Date: Mon, 15 Jan 2024 18:57:23 -0500 Subject: [PATCH 1/3] Make InstrumentationAbstract.init public --- .../opentelemetry-instrumentation/src/instrumentation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts index 4552f6dfab..7dc47f15c7 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts @@ -136,7 +136,7 @@ export abstract class InstrumentationAbstract * Init method in which plugin should define _modules and patches for * methods */ - protected abstract init(): + abstract init(): | InstrumentationModuleDefinition | InstrumentationModuleDefinition[] | void; From 44fd19542be7a436915f5a305bba1c48fcc41c2a Mon Sep 17 00:00:00 2001 From: Drew Corlin Date: Mon, 15 Jan 2024 20:43:10 -0500 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 2 ++ experimental/CHANGELOG.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc065fe434..e49f315e0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :rocket: (Enhancement) +* feat(instrumentation): Make `init()` method public [#4418](https://github.com/open-telemetry/opentelemetry-js/pull/4418) + ### :bug: (Bug Fix) * fix(sdk-trace-base): ensure attribute value length limit is enforced on span creation [#4417](https://github.com/open-telemetry/opentelemetry-js/pull/4417) @pichlermarc diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 21e254222e..66d0c29332 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to experimental packages in this project will be documented ### :rocket: (Enhancement) +* feat(instrumentation): Make `init()` method public [#4418](https://github.com/open-telemetry/opentelemetry-js/pull/4418) + ### :bug: (Bug Fix) ### :books: (Refine Doc) From ed101afe2fc80444cac73ab287099bcff69b8be2 Mon Sep 17 00:00:00 2001 From: Drew Corlin Date: Wed, 31 Jan 2024 19:05:50 -0500 Subject: [PATCH 3/3] Update JSDoc --- .../opentelemetry-instrumentation/src/instrumentation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts index 7dc47f15c7..13b305d13c 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts @@ -134,7 +134,10 @@ export abstract class InstrumentationAbstract /** * Init method in which plugin should define _modules and patches for - * methods + * methods. + * Use `enable()` if you are trying to turn on this plugin. This method + * will return objects to patch specific modules with the appropriate + * instrumentation (or not return anything). */ abstract init(): | InstrumentationModuleDefinition