Enable Sentry browser profiling
This commit is contained in:
@ -57,6 +57,7 @@ $(document).on('turbolinks:load', function() {
|
||||
replaysSessionSampleRate: 0.0,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
integrations: window.SentryIntegrations(),
|
||||
profilesSampleRate: 1.0,
|
||||
initialScope: scope =>{
|
||||
const user = $('meta[name="current-user"]').attr('content');
|
||||
|
||||
|
@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base
|
||||
after_action :verify_authorized, except: %i[welcome]
|
||||
around_action :mnemosyne_trace
|
||||
around_action :switch_locale
|
||||
before_action :set_sentry_context, :load_embed_options
|
||||
before_action :set_sentry_context, :load_embed_options, :set_document_policy
|
||||
protect_from_forgery(with: :exception, prepend: true)
|
||||
rescue_from Pundit::NotAuthorizedError, with: :render_not_authorized
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
|
||||
@ -72,6 +72,12 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def set_document_policy
|
||||
# Instruct browsers to capture profiling data
|
||||
response.set_header('Document-Policy', 'js-profiling')
|
||||
end
|
||||
private :set_document_policy
|
||||
|
||||
def set_sentry_context
|
||||
return if current_user.blank?
|
||||
|
||||
|
@ -29,6 +29,7 @@ window.SentryIntegrations = function() { // Publish sentry integration in global
|
||||
new SentryIntegration.ReportingObserver(),
|
||||
new SentryIntegration.ExtraErrorData(),
|
||||
new SentryIntegration.HttpClient(),
|
||||
new Sentry.BrowserProfilingIntegration(),
|
||||
new Sentry.BrowserTracing(),
|
||||
new Sentry.Replay(),
|
||||
]
|
||||
|
Reference in New Issue
Block a user