Sha256: 22f8254442f81bd3d540292ba1eee1e0955f9db1937fcb319a00bc4d4e471167

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

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."
        SPAN_ORIGIN = "auto.template.rails"

        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

5 entries across 5 versions & 1 rubygems

Version Path
sentry-rails-5.22.3 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.22.2 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.22.1 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.22.0 lib/sentry/rails/tracing/action_view_subscriber.rb
sentry-rails-5.21.0 lib/sentry/rails/tracing/action_view_subscriber.rb