Class: Honeybadger::ActiveSupportCacheMultiSubscriber

Inherits:
NotificationSubscriber show all
Defined in:
lib/honeybadger/notification_subscriber.rb

Instance Method Summary collapse

Methods inherited from NotificationSubscriber

#finish, #process?, #record, #record_metrics, #start

Methods included from InstrumentationHelper

#decrement_counter, #extract_attributes, #extract_callable, #gauge, #histogram, #increment_counter, #metric_agent, #metric_attributes, #metric_instrumentation, #metric_source, #monotonic_timer, #time

Instance Method Details

#expand_cache_keys_from_payload(data) ⇒ Object



87
88
89
90
91
92
93
94
95
# File 'lib/honeybadger/notification_subscriber.rb', line 87

def expand_cache_keys_from_payload(data)
  return unless data

  data = data.keys if data.is_a?(Hash)

  Array(data).map do |k|
    ::ActiveSupport::Cache.expand_cache_key(k)
  end
end

#format_payload(payload) ⇒ Object



81
82
83
84
85
# File 'lib/honeybadger/notification_subscriber.rb', line 81

def format_payload(payload)
  payload[:key] = expand_cache_keys_from_payload(payload[:key])
  payload[:hits] = expand_cache_keys_from_payload(payload[:hits])
  payload
end