Package + Version
Version:
Description
http.client spans get marked as 'cancelled' due to Xhr responses being falsely reported as requests.
Setup:
- Use
vueRouterInstrumentation
- Make some xhr requests before Vue routing happens (i.e. before 'pageload' transaction has even started).
Actual result:
- If the responses (of the before-vue-routing requests) return after Vue routing, they are recognized as new spans.
Consequently, these spans never receive any further update and eventually get marked as 'cancelled'
Expected result:
- The responses (of the before-vue-routing requests) get discarded?
Troubleshooting:
- For every xhr request, xhrCallBack is called two times:
- When the request is created, to start the
http.client span
- When the request is completed, to finish the
http.client span
- However, in the first call, Vue routing has not happened and hence instrumentation has not started the 'pageload' transaction yet. Thus, the execution is halted and the
http.client span is not properly initialized. Then, in the second call, handlerData.xhr.__sentry_xhr_span_id__ is not available, so the xhr request completion is mistaken as a new request creation.
Possible fix
Update 1
fetch also has the similar issue
Package + Version
@sentry/browser@sentry/noderaven-jsraven-node(raven for node)@sentry/vue,@sentry/tracingVersion:
Description
http.client spans get marked as 'cancelled' due to Xhr responses being falsely reported as requests.
Setup:
vueRouterInstrumentationActual result:
Consequently, these spans never receive any further update and eventually get marked as 'cancelled'
Expected result:
Troubleshooting:
http.clientspanhttp.clientspanhttp.clientspan is not properly initialized. Then, in the second call,handlerData.xhr.__sentry_xhr_span_id__is not available, so the xhr request completion is mistaken as a new request creation.Possible fix
if (handlerData.endTimestamp && !handlerData.xhr.__sentry_xhr_span_id__) return;?Update 1
fetchalso has the similar issue