Class: Lamian::SidekiqSentryMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/lamian/sidekiq_sentry_middleware.rb

Overview

A sidekiq middleware

Instance Method Summary collapse

Instance Method Details

#callObject

Adds current lamian log to the extra part of raven events generated inside sidekiq jobs



6
7
8
9
10
11
12
13
14
15
# File 'lib/lamian/sidekiq_sentry_middleware.rb', line 6

def call(*)
  Lamian.run do
    yield
  rescue Exception # rubocop:disable Lint/RescueException
    # Save current log
    log = Lamian.dump_limited
    Sentry.set_extras(Lamian::SENTRY_EXTRA_KEY => log) if log
    raise
  end
end