Skip to content

Commit

Permalink
fix(fetch): revert to original code in endSpanOnSuccess
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugzuzg committed Jul 29, 2022
1 parent 492a3e8 commit 47ab8c2
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,22 +321,15 @@ export class FetchInstrumentation extends InstrumentationBase<Promise<Response>>

function endSpanOnSuccess(span: api.Span, response: Response) {
plugin._applyAttributesAfterFetch(span, options, response);
const spanResponse = {
status: response.status,
statusText: response.statusText,
headers: response.headers,
url
};
if (response.status >= 200 && response.status < 400) {
if (response.url != null && response.url !== '') {
spanResponse.url = url;
}
}
plugin._endSpan(span, spanData, {
status: response.status,
statusText: response.statusText,
url,
});
plugin._endSpan(span, spanData, response);
} else {
plugin._endSpan(span, spanData, {
status: response.status,
statusText: response.statusText,
url,
});
}(
}

function onSuccess(
Expand Down

0 comments on commit 47ab8c2

Please sign in to comment.