-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(replay): Hide internal replay tracing behind experiments flag #6487
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
Conversation
size-limit report 📦
|
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.
Looks good, how do we turn on experiments?
@@ -1,18 +0,0 @@ | |||
import { getCurrentHub } from '@sentry/core'; | |||
|
|||
import { isInternal } from './isInternal'; |
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.
Is this still used elsewhere? Can the file be removed too?
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.
Oops, you're right, completely forgot this!
exc?.value || 'n/a' | ||
}`, | ||
}); | ||
if (__DEBUG_BUILD__ && replay.getOptions()._experiments?.traceInternals) { |
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.
__DEBUG_BUILD__
is turned on by debug: true
in init()
right?
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.
No, when using npm install
this is always true I believe (unless you set it in your bundler config yourself), but e.g. in CDNs for "non-debug" bundles this will be false, and thus everything else can be stripped because it is statically an analyzable :)
Just pass this in as configuration: new Replay({
_experiments: {
captureExceptions: true,
traceInternals: true,
}
}); |
362cec5
to
a982365
Compare
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.
🚀
As a follow up to #6482, this adds a
traceInternals
experiment to replay which can be set to ensure traces for sentry-internal stuff are added.Also, make sure that the experiments stuff is filtered out when not in debug mode.
Note that one place where we've been checking the sentry DSN has been removed here, namely
createPerformanceEntry
. The reason is that these are already anyhow filtered out when they are of type fetch or xmlhttprequest, and there aren't really any other types of entries there that we could be creating (as far as I can tell - see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/initiatorType).