Skip to content

Commit

Permalink
add a diagnostic warning if attempting to use instr-fetch in Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Feb 22, 2024
1 parent 4dc49ae commit 6211772
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ export class FetchInstrumentation extends InstrumentationBase<
if (isNode) {
// Node.js v18+ *does* have a global `fetch()`, but this package does not
// support instrumenting it.
this._diag.warn('this instrumentation is intended for web usage only, it does not instrument Node.js\'s fetch()')
return;

Check warning on line 474 in experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts

View check run for this annotation

Codecov / codecov/patch

experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts#L473-L474

Added lines #L473 - L474 were not covered by tests
}
if (isWrapped(fetch)) {
Expand Down

0 comments on commit 6211772

Please sign in to comment.