Sha256: bb1eddcd18b878458a8adacc6d793bc69495c66015959c7abf32b287f4e48bbb

Contents?: true

Size: 756 Bytes

Versions: 8

Compression:

Stored size: 756 Bytes

Contents

module Sentry
  module Rails
    module Tracing
      class ActionViewSubscriber < AbstractSubscriber
        EVENT_NAMES = ["render_template.action_view", "render_partial.action_view", "render_collection.action_view"]

        def self.subscribe!
          EVENT_NAMES.each do |event_name|
            subscribe_to_event(event_name) do |event_name, duration, payload|
              record_on_current_span(op: event_name, start_timestamp: payload[:start_timestamp], description: payload[:identifier], duration: duration)
            end
          end
        end

        def self.unsubscribe!
          EVENT_NAMES.each do |event_name|
            ActiveSupport::Notifications.unsubscribe(event_name)
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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