Fix Sentry Replay integration
This commit is contained in:
@ -44,7 +44,9 @@ $(document).on('turbolinks:load', function() {
|
|||||||
|
|
||||||
// Initialize Sentry
|
// Initialize Sentry
|
||||||
const sentrySettings = $('meta[name="sentry"]')
|
const sentrySettings = $('meta[name="sentry"]')
|
||||||
if (sentrySettings.data()['enabled']) {
|
|
||||||
|
// Workaround for Turbolinks: We must not re-initialize the Relay object when visiting another page
|
||||||
|
if (sentrySettings.data()['enabled'] && !Sentry.Replay.prototype._isInitialized) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: sentrySettings.data('dsn'),
|
dsn: sentrySettings.data('dsn'),
|
||||||
attachStacktrace: true,
|
attachStacktrace: true,
|
||||||
@ -54,7 +56,7 @@ $(document).on('turbolinks:load', function() {
|
|||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
replaysSessionSampleRate: 0.0,
|
replaysSessionSampleRate: 0.0,
|
||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
integrations: window.SentryIntegrations,
|
integrations: window.SentryIntegrations(),
|
||||||
initialScope: scope =>{
|
initialScope: scope =>{
|
||||||
const user = $('meta[name="current-user"]').attr('content');
|
const user = $('meta[name="current-user"]').attr('content');
|
||||||
|
|
||||||
|
@ -24,13 +24,15 @@ window.bootstrap = bootstrap; // Publish bootstrap in global namespace
|
|||||||
window._ = _; // Publish underscore's `_` in global namespace
|
window._ = _; // Publish underscore's `_` in global namespace
|
||||||
window.d3 = d3; // Publish d3 in global namespace
|
window.d3 = d3; // Publish d3 in global namespace
|
||||||
window.Sentry = Sentry; // Publish sentry in global namespace
|
window.Sentry = Sentry; // Publish sentry in global namespace
|
||||||
window.SentryIntegrations = [ // Publish sentry integration in global namespace
|
window.SentryIntegrations = function() { // Publish sentry integration in global namespace
|
||||||
|
return [
|
||||||
new SentryIntegration.ReportingObserver(),
|
new SentryIntegration.ReportingObserver(),
|
||||||
new SentryIntegration.ExtraErrorData(),
|
new SentryIntegration.ExtraErrorData(),
|
||||||
new SentryIntegration.HttpClient(),
|
new SentryIntegration.HttpClient(),
|
||||||
new Sentry.BrowserTracing(),
|
new Sentry.BrowserTracing(),
|
||||||
new Sentry.Replay(),
|
new Sentry.Replay(),
|
||||||
];
|
]
|
||||||
|
};
|
||||||
window.SentryUtils = { dynamicSamplingContextToSentryBaggageHeader, startIdleTransaction, TRACING_DEFAULTS };
|
window.SentryUtils = { dynamicSamplingContextToSentryBaggageHeader, startIdleTransaction, TRACING_DEFAULTS };
|
||||||
|
|
||||||
// CSS
|
// CSS
|
||||||
|
Reference in New Issue
Block a user