-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(tracing): Don't consider tracingOrigins
when creating spans
#6039
fix(tracing): Don't consider tracingOrigins
when creating spans
#6039
Conversation
I guess this would be a breaking change then right? But it's more correct behavior, so I'd be fine with keeping it. |
Yep, my comment further down the linked issue mentions just that. Feels breaking but fixes incorrect behaviour so technically isn't 🤔 This change would certainly need to be prominent in the change-log! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it!
P.S. I left some comments in #6041 about tests which by rights probably should be in this PR. I'll leave it up to you where to put them, but we should definitely test the new behavior somewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna merge this in so we can release it - but will add a changelog note about it
In the process of working on #5285, we missed the fact that the first two PRs (#6039 and #6041) were interdependent, in that the former accidentally introduced a bug (#6077) which the latter then inadvertently fixed. This would have been fine, except that we published a release after merging the bug-creating PR but before merging the bug-fixing PR. Whoops. This patch pulls just the bug-fixing part out of the second PR. It also adds tests to cover the buggy cases, using `it.each` to cover all of the different combinations of outcomes for `shouldCreateSpanForRequest` and `shouldAttachHeaders`. Finally, since I was already in the test file, I reorganized it a little: - `it('does not create span if shouldCreateSpan returns false')` -> absorbed into the `it.each()` - `it('does not create span if there is no fetch data in handler data')` -> added header check, became `it('adds neither fetch request spans nor fetch request headers if there is no fetch data in handler data')` - `it('does not add fetch request spans if tracing is disabled')` and `it('does not add fetch request headers if tracing is disabled` -> combined into `it('adds neither fetch request spans nor fetch request headers if tracing is disabled')` - `it('adds sentry-trace header to fetch requests')` -> absorbed into the `it.each()` - Similar changes made to XHR tests Co-authored-by: Tim Fish <[email protected]>
Ap per Katie's summary here, tracing origins should not be considered when creating spans.
Current span creation
tracingOrigins
matchtracingOrigins
matchshouldCreateSpanForRequest
returnstrue
shouldCreateSpanForRequest
returnsfalse
shouldCreateSpanForRequest
is undefinedtracingOrigins
does not matter.After this PR
shouldCreateSpanForRequest
returnstrue
shouldCreateSpanForRequest
returnsfalse
shouldCreateSpanForRequest
is undefined