diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts b/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts index 29d52b09430..a564b76f5a4 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts +++ b/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts @@ -331,6 +331,7 @@ export class FetchInstrumentation extends InstrumentationBase< ): void { try { const resClone = response.clone(); + const resClone4Hook = response.clone(); const body = resClone.body; if (body) { const reader = body.getReader(); @@ -338,7 +339,7 @@ export class FetchInstrumentation extends InstrumentationBase< reader.read().then( ({ done }) => { if (done) { - endSpanOnSuccess(span, response); + endSpanOnSuccess(span, resClone4Hook); } else { read(); }