Sha256: 50464ecd4e39244cb7484bf97aefb0cb9a046e0bbf48f67577fc1eae4811d637

Contents?: true

Size: 1022 Bytes

Versions: 3

Compression:

Stored size: 1022 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module ActionView
      # The Instrumentation class contains logic to detect and install the ActionView instrumentation
      class Instrumentation < OpenTelemetry::Instrumentation::Base
        MINIMUM_VERSION = Gem::Version.new('5.2.0')
        install do |_config|
          require_dependencies
        end

        present do
          defined?(::ActionView)
        end

        compatible do
          Gem.loaded_specs['actionview'].version >= MINIMUM_VERSION
        end

        option :disallowed_notification_payload_keys, default: [],  validate: :array
        option :notification_payload_transform,       default: nil, validate: :callable

        private

        def require_dependencies
          require_relative 'fanout'
          require_relative 'span_subscriber'
          require_relative 'railtie'
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-action_view-0.1.2 lib/opentelemetry/instrumentation/action_view/instrumentation.rb
opentelemetry-instrumentation-action_view-0.1.1 lib/opentelemetry/instrumentation/action_view/instrumentation.rb
opentelemetry-instrumentation-action_view-0.1.0 lib/opentelemetry/instrumentation/action_view/instrumentation.rb