From d958c3607f4e05953043dc224b534304f2043242 Mon Sep 17 00:00:00 2001 From: legendecas Date: Mon, 10 Oct 2022 22:54:57 +0800 Subject: [PATCH] fix(instrumentation): debug log on no modules defined for instrumentation --- experimental/CHANGELOG.md | 1 + .../src/platform/node/instrumentation.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index f14d274c65..9b6d0b4625 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to experimental packages in this project will be documented * fix(node-sdk): move `@opentelemetry/semantic-conventions` to `dependencies` [#3283](https://github.com/open-telemetry/opentelemetry-js/pull/3283) @mhassan1 * fix(exporters): do not append trailing '/' when URL contains path [#3274](https://github.com/open-telemetry/opentelemetry-js/pull/3274) @pichlermarc +* fix(instrumentation): debug log on no modules defined for instrumentation [#3308](https://github.com/open-telemetry/opentelemetry-js/pull/3308) @legendecas ### :books: (Refine Doc) diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts index 70dac85332..5bc0921778 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts @@ -48,9 +48,10 @@ export abstract class InstrumentationBase this._modules = (modules as InstrumentationModuleDefinition[]) || []; if (this._modules.length === 0) { - diag.warn( - 'No modules instrumentation has been defined,' + - ' nothing will be patched' + diag.debug( + 'No modules instrumentation has been defined for ' + + `'${this.instrumentationName}@${this.instrumentationVersion}'` + + ', nothing will be patched' ); }