Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit 8bdd946

Browse files
authored
fix: warn if tracing might not work instead of err (#1068)
1 parent e1d0ed9 commit 8bdd946

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/tracing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export class Tracing implements Component {
7777
}
7878

7979
/**
80-
* Logs an error message detailing the list of modules that were loaded before
81-
* the Trace Agent. Loading these modules before the Trace Agent may prevent
82-
* us from monkeypatching those modules for automatic tracing.
80+
* Logs an warning message detailing the list of modules that were loaded
81+
* before the Trace Agent. Loading these modules before the Trace Agent may
82+
* prevent us from monkeypatching those modules for automatic tracing.
8383
* @param filesLoadedBeforeTrace The list of files that were loaded using
8484
* require() before the Stackdriver Trace Agent was required.
8585
*/
@@ -97,7 +97,7 @@ export class Tracing implements Component {
9797
}
9898
}
9999
if (modulesLoadedBeforeTrace.length > 0) {
100-
this.logger.error(
100+
this.logger.warn(
101101
'StackdriverTracer#start: Tracing might not work as the following modules',
102102
'were loaded before the trace agent was initialized:',
103103
`[${modulesLoadedBeforeTrace.sort().join(', ')}]`

test/test-modules-loaded-before-agent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ describe('modules loaded before agent', () => {
4444
testTraceModule.start();
4545
assert.strictEqual(
4646
logger.getNumLogsWith(
47-
'error',
48-
/modules.*loaded.*before.*trace agent.*: .*shimmer/
47+
'warn',
48+
/StackdriverTracer#start.*modules.*loaded.*before.*trace agent.*: \[.*shimmer.*\]/
4949
),
5050
1
5151
);

0 commit comments

Comments
 (0)