Called for each auto-instrumented fetch and XMLHttpRequest span just
before it ends, so the response and error status are already on it.
Use it to rename the span or add attributes, for example to give it a
route template:
The span's trace and span ids are fixed when the request starts, so
renaming does not affect the traceparent sent to your backend.
Errors thrown by the callback are swallowed. Requires
networkRecording to be enabled, as the instrumentations are not
installed otherwise.
Called for each auto-instrumented
fetchandXMLHttpRequestspan just before it ends, so the response and error status are already on it. Use it to rename the span or add attributes, for example to give it a route template:The span's trace and span ids are fixed when the request starts, so renaming does not affect the
traceparentsent to your backend. Errors thrown by the callback are swallowed. RequiresnetworkRecordingto be enabled, as the instrumentations are not installed otherwise.