Sha256: 9929a7e56c7803c8df43a6456ca135e31d19603896333c37541b52ea2df87577

Contents?: true

Size: 721 Bytes

Versions: 2

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true

require "newrelic_rpm"
require "shoryuken"

module ShoryukenNewrelic
  # This class send transactions trace to newrelic
  class Instrumentation
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation

    def call(worker_instance, _queue, _sqs_msg, _body, &block)
      perform_action_with_newrelic_trace({
                                           name: "perform",
                                           class_name: worker_instance.class.to_s,
                                           category: "OtherTransaction/ShoryukenJob"
                                         }, &block)
    end
  end
end

Shoryuken.server_middleware.add(ShoryukenNewrelic::Instrumentation)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoryuken_newrelic-0.1.1 lib/shoryuken_newrelic/instrumentation.rb
shoryuken_newrelic-0.1.0 lib/shoryuken_newrelic/instrumentation.rb