sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

[v8] HTTP client spans

Open cleptric opened this issue 1 year ago • 1 comments
trafficstars

Many users have been confused and frustrated by the fact that after the automatically created page load transaction is finished, XMLHttpRequest and fetch requests are only automatically instrumented with the user explicitly wrapping these requests in a transaction.

For v8, we want to change this by utilizing single-span ingestion. By default, each request will be traced and sent to Sentry as a segment span (span.isSegment: true,). The user can turn off the behaviour with a new Sentry.browserTracingIntegration() option.

### Tasks
- [x] Create/send span envelope (already done via https://github.com/getsentry/sentry-javascript/pull/11534)
- [ ] https://github.com/getsentry/sentry-javascript/pull/11696
- [ ] https://github.com/getsentry/sentry-javascript/pull/11699
- [ ] Adjust `fetch` instrumentation (https://github.com/getsentry/sentry-javascript/pull/11783)
- [ ] Adjust `xhr` instrumentation (https://github.com/getsentry/sentry-javascript/pull/11783)
- [ ] Define a proper Span schema (OP, description, ...)
- [ ] Document these changes in https://develop.sentry.dev/ but mark as "do not use"

cleptric avatar Apr 11 '24 14:04 cleptric

http.client spans count as segment spans and they need to have the following properties:

segmentId = spanId
isSegment: true

In contrast, INP spans don't need to set segment properties because we don't care about them not showing up in the trace view.

Lms24 avatar Apr 18 '24 14:04 Lms24

Closing this at the moment as this is officially on hold until further notice. The experimental standalone option still exists but XHR and fetch request spans are still only created if there's a parent segment/root span. The PRs to send standalone fetch and XHR spans were reverted.

Lms24 avatar May 23 '24 16:05 Lms24