Class: ActionReporter::ScoutApmReporter

Inherits:
Base
  • Object
show all
Defined in:
lib/action_reporter/scout_apm_reporter.rb

Instance Method Summary collapse

Methods inherited from Base

class_accessor, #reset_context, #resolve_check_in_id, #transform_context

Instance Method Details

#context(args) ⇒ Object



11
12
13
14
# File 'lib/action_reporter/scout_apm_reporter.rb', line 11

def context(args)
  new_context = transform_context(args)
  scoutapm_context_class.add(new_context)
end

#current_user=(user) ⇒ Object



16
17
18
# File 'lib/action_reporter/scout_apm_reporter.rb', line 16

def current_user=(user)
  scoutapm_context_class.add_user(user_global_id: user&.to_global_id&.to_s)
end

#ignore_transaction!Object



20
21
22
# File 'lib/action_reporter/scout_apm_reporter.rb', line 20

def ignore_transaction!
  scoutapm_context_class.ignore_transaction!
end

#notify(error, context: {}) ⇒ Object



6
7
8
9
# File 'lib/action_reporter/scout_apm_reporter.rb', line 6

def notify(error, context: {})
  self.context(context)
  scoutapm_error_class.capture(error)
end