Sha256: 9179cdbb5a6ec04a1d5ffe99b04123a5d7d2fb5d7758e30bde20ab9032948620

Contents?: true

Size: 766 Bytes

Versions: 7

Compression:

Stored size: 766 Bytes

Contents

module Sentry
  module Rails
    module Tracing
      class ActionControllerSubscriber < AbstractSubscriber
        EVENT_NAME = "process_action.action_controller".freeze

        def self.subscribe!
          subscribe_to_event(EVENT_NAME) do |event_name, duration, payload|
            controller = payload[:controller]
            action = payload[:action]

            record_on_current_span(
              op: event_name,
              start_timestamp: payload[:start_timestamp],
              description: "#{controller}##{action}",
              duration: duration
            ) do |span|
              span.set_data(:payload, payload)
              span.set_http_status(payload[:status])
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sentry-rails-4.1.3 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.1.2 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.1.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.1.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.0.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-0.3.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-0.2.0 lib/sentry/rails/tracing/action_controller_subscriber.rb