Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(tracing): Remove startChild calls from fetch/xhr instrumentation #10236

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

AbhiPrasad
Copy link
Member

These are pretty easy.

The rest of the startChild calls in this package are either node integrations (which we don't want to touch) or part of BrowserTracing, which needs independent look at in general.

@AbhiPrasad AbhiPrasad requested review from a team, anonrig and Lms24 and removed request for a team January 18, 2024 00:42
@AbhiPrasad AbhiPrasad self-assigned this Jan 18, 2024
Copy link
Contributor

github-actions bot commented Jan 18, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.89 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.07 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.97 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.7 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.09 KB (+0.15% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.25 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.26 KB (0%)
@sentry/browser - Webpack (gzipped) 22.5 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.6 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.17 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.45 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 211.58 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 99.57 KB (-0.04% 🔽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.14 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.09 KB (-0.02% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.5 KB (+0.08% 🔺)
@sentry/react - Webpack (gzipped) 22.55 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 86.14 KB (+0.06% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.44 KB (+0.09% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.21 KB (0%)

: undefined;

const span = shouldCreateSpanResult
? startInactiveSpan({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is no easy way to make these active spans 🤔 They aren't now either, so I guess it's OK, but just thinking, for the future!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't want to make them active spans because they are async, it's not ideal, but something we can come back to later on.

Comment on lines +282 to +284
type: 'xhr',
'http.method': sentryXhrData.method,
url: sentryXhrData.url,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make sure: Do these attribute keys need sentry. prefixes?

If not, is there a source where we define which attributes need a prefix vs which don't? I assume it's somewhere here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attribute keys do not need sentry.X because they are not specific to sentry product or schema. The conventions you linked are the list so far!

These unit tests are brittle, and given we have browser integration
tests we can rely on those instead.
@@ -59,363 +41,6 @@ describe('instrumentOutgoingRequests', () => {
});
});

describe('callbacks', () => {
let hub: Hub;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up deleting these tests because they are so bound to hub/transaction/span current implementations.

We have playwright tests that cover testing these spans, those are good enough to validate that we have the expected behaviour.

@AbhiPrasad AbhiPrasad merged commit 52495c0 into develop Jan 24, 2024
92 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-tracing-internal branch January 24, 2024 20:39
AbhiPrasad added a commit that referenced this pull request Jan 29, 2024
This was a regression introduced with
#10236, we shouldn't
arbitrarily call `startInactiveSpan` given we create transactions under
the hood currently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants