Sha256: 5905c798206e8d3a01653a39e183633f4b8af431724510817602a88d2818fb08

Contents?: true

Size: 858 Bytes

Versions: 6

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

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

require 'opentelemetry'

module OpenTelemetry
  module Instrumentation
    module Rails
      # The Instrumentation class contains logic to detect and install the Rails
      # instrumentation
      class Instrumentation < OpenTelemetry::Instrumentation::Base
        MINIMUM_VERSION = Gem::Version.new('5.2.0')

        # This gem requires the instrumentantion gems for the different
        # components of Rails, as a result it does not have any explicit
        # work to do in the install step.
        install { true }
        present { defined?(::Rails) }
        compatible { gem_version >= MINIMUM_VERSION }

        private

        def gem_version
          Gem.loaded_specs['actionpack'].version
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-rails-0.20.0 lib/opentelemetry/instrumentation/rails/instrumentation.rb
opentelemetry-instrumentation-rails-0.19.4 lib/opentelemetry/instrumentation/rails/instrumentation.rb
opentelemetry-instrumentation-rails-0.19.3 lib/opentelemetry/instrumentation/rails/instrumentation.rb
opentelemetry-instrumentation-rails-0.19.2 lib/opentelemetry/instrumentation/rails/instrumentation.rb
opentelemetry-instrumentation-rails-0.19.1 lib/opentelemetry/instrumentation/rails/instrumentation.rb
opentelemetry-instrumentation-rails-0.19.0 lib/opentelemetry/instrumentation/rails/instrumentation.rb