Skip to content

Commit

Permalink
Merge branch 'main' into fix-grpc-instrumentation-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Jul 30, 2022
2 parents aad7024 + fc4dcba commit 3657cd2
Showing 1 changed file with 7 additions and 14 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, response);
} else {
plugin._endSpan(span, spanData, {
status: response.status,
statusText: response.statusText,
url,
});
}
plugin._endSpan(span, spanData, {
status: response.status,
statusText: response.statusText,
url,
});
}

function onSuccess(
Expand Down

0 comments on commit 3657cd2

Please sign in to comment.