Skip to content

Commit

Permalink
Scout APM Instrument React SSR methods (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 authored Aug 15, 2021
1 parent 64b3b14 commit edd6330
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/react_on_rails/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ def in_mailer?

controller.is_a?(ActionMailer::Base)
end

if defined?(ScoutApm)
include ScoutApm::Tracer
instrument_method :react_component, type: "ReactOnRails", name: "react_component"
instrument_method :react_component_hash, type: "ReactOnRails", name: "react_component_hash"
end
end
end
# rubocop:enable Metrics/ModuleLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ def console_polyfill
JS
end

if defined?(ScoutApm)
include ScoutApm::Tracer
instrument_method :exec_server_render_js, type: "ReactOnRails", name: "ExecJs React Server Rendering"
end

private

def file_url_to_string(url)
Expand Down

0 comments on commit edd6330

Please sign in to comment.