Sha256: 9f107b72dbed5869277f9f1288e3508af3ffd8313313992f0f75ba7da77de04d

Contents?: true

Size: 1002 Bytes

Versions: 20

Compression:

Stored size: 1002 Bytes

Contents

require "sentry/rails/tracing/abstract_subscriber"
require "sentry/rails/instrument_payload_cleanup_helper"

module Sentry
  module Rails
    module Tracing
      class ActionControllerSubscriber < AbstractSubscriber
        extend InstrumentPayloadCleanupHelper

        EVENT_NAMES = ["process_action.action_controller"].freeze

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

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
sentry-rails-5.5.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.4.2 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.4.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.4.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.3.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.3.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.2.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.2.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.1.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.1.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.0.2 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.0.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-5.0.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.9.2 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.9.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.9.0 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.8.3 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.8.2 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.8.1 lib/sentry/rails/tracing/action_controller_subscriber.rb
sentry-rails-4.8.0 lib/sentry/rails/tracing/action_controller_subscriber.rb