ref(replay): Hide internal replay tracing behind experiments flag#6487
Merged
ref(replay): Hide internal replay tracing behind experiments flag#6487
Conversation
Contributor
size-limit report 📦
|
billyvg
approved these changes
Dec 9, 2022
Member
billyvg
left a comment
There was a problem hiding this comment.
Looks good, how do we turn on experiments?
| @@ -1,18 +0,0 @@ | |||
| import { getCurrentHub } from '@sentry/core'; | |||
|
|
|||
| import { isInternal } from './isInternal'; | |||
Member
There was a problem hiding this comment.
Is this still used elsewhere? Can the file be removed too?
Member
Author
There was a problem hiding this comment.
Oops, you're right, completely forgot this!
| exc?.value || 'n/a' | ||
| }`, | ||
| }); | ||
| if (__DEBUG_BUILD__ && replay.getOptions()._experiments?.traceInternals) { |
Member
There was a problem hiding this comment.
__DEBUG_BUILD__ is turned on by debug: true in init() right?
Member
Author
There was a problem hiding this comment.
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 :)
Member
Author
Just pass this in as configuration: new Replay({
_experiments: {
captureExceptions: true,
traceInternals: true,
}
}); |
362cec5 to
a982365
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a follow up to #6482, this adds a
traceInternalsexperiment 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).