Module: Appsignal::Integrations::ActiveSupportNotificationsIntegration::StartFinishHandlerIntegration

Defined in:
lib/appsignal/integrations/active_support_notifications.rb

Instance Method Summary collapse

Instance Method Details

#finish_with_values(name, id, payload = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/appsignal/integrations/active_support_notifications.rb', line 65

def finish_with_values(name, id, payload = {})
  # Events that start with a bang are internal to Rails
  instrument_this = name[0] != ActiveSupportNotificationsIntegration::BANG

  if instrument_this
    title, body, body_format = Appsignal::EventFormatter.format(name, payload)
    Appsignal::Transaction.current.finish_event(
      name.to_s,
      title,
      body,
      body_format
    )
  end

  super
end

#startObject



58
59
60
61
62
63
# File 'lib/appsignal/integrations/active_support_notifications.rb', line 58

def start
  instrument_this = @name[0] != ActiveSupportNotificationsIntegration::BANG

  Appsignal::Transaction.current.start_event if instrument_this
  super
end