Class: ActionReporter::ScoutApmReporter
- Inherits:
-
Base
- Object
- Base
- ActionReporter::ScoutApmReporter
show all
- Defined in:
- lib/action_reporter/scout_apm_reporter.rb
Instance Method Summary
collapse
Methods inherited from Base
class_accessor, #merge_context_updates, #resolve_check_in_id, #resolve_user_id, #transaction_id=, #transaction_name=, #transform_context
Instance Method Details
#context(args) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/action_reporter/scout_apm_reporter.rb', line 11
def context(args)
context_object = scoutapm_context_class.current
= context_object.instance_variable_get(:@extra).dup
context_object.instance_variable_set(:@extra, merge_context_updates(, args))
end
|
#current_remote_addr=(remote_addr) ⇒ Object
22
23
24
|
# File 'lib/action_reporter/scout_apm_reporter.rb', line 22
def current_remote_addr=(remote_addr)
scoutapm_context_class.add_user(ip: remote_addr)
end
|
#current_user=(user) ⇒ Object
26
27
28
29
|
# File 'lib/action_reporter/scout_apm_reporter.rb', line 26
def current_user=(user)
id = resolve_user_id(user)
scoutapm_context_class.add_user(id: id)
end
|
#ignore_transaction! ⇒ Object
31
32
33
|
# File 'lib/action_reporter/scout_apm_reporter.rb', line 31
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
|
#reset_context ⇒ Object
18
19
20
|
# File 'lib/action_reporter/scout_apm_reporter.rb', line 18
def reset_context
scoutapm_context_class.clear! if scoutapm_context_class.respond_to?(:clear!)
end
|