Sha256: 9198ab3f32b7e04a10caa82bbdd0f5e2a97c2d82da437c8ae7e59de2b86a666d

Contents?: true

Size: 740 Bytes

Versions: 6

Compression:

Stored size: 740 Bytes

Contents

require "sentry/rails/tracing/abstract_subscriber"

module Sentry
  module Rails
    module Tracing
      class ActionViewSubscriber < AbstractSubscriber
        EVENT_NAMES = ["render_template.action_view"].freeze
        SPAN_PREFIX = "template.".freeze
        SPAN_ORIGIN = "auto.template.rails".freeze

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sentry-rails-5.20.1 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.20.0 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.19.0 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.18.2 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.18.1 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.18.0 lib/sentry/rails/tracing/action_view_subscriber.rb