Sha256: 1f1ad0dd39a81c8c17c3a63bcb7d13894e2ae8c9e210dfbf5fe1f5fa98affcb7

Contents?: true

Size: 775 Bytes

Versions: 6

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module Instrumentation
    module Rails
      # The Instrumentation class contains logic to detect and install the Rails
      # instrumentation, while this Railtie is used to conventionally instrument
      # the Rails application through its initialization hooks
      class Railtie < ::Rails::Railtie
        config.before_initialize do |app|
          OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.install({})

          app.middleware.insert_after(
            ActionDispatch::RequestId,
            OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
          )
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-rails-0.16.0 lib/opentelemetry/instrumentation/rails/railtie.rb
opentelemetry-instrumentation-rails-0.15.0 lib/opentelemetry/instrumentation/rails/railtie.rb
opentelemetry-instrumentation-rails-0.14.0 lib/opentelemetry/instrumentation/rails/railtie.rb
opentelemetry-instrumentation-rails-0.13.0 lib/opentelemetry/instrumentation/rails/railtie.rb
opentelemetry-instrumentation-rails-0.12.0 lib/opentelemetry/instrumentation/rails/railtie.rb
opentelemetry-instrumentation-rails-0.11.0 lib/opentelemetry/instrumentation/rails/railtie.rb