Sha256: 605ecc9662443618d35bea89fb4bcd951ba7ef82e4f3b07d091f1088457f61a3

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 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_before(
            0,
            OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
          )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-rails-0.18.1 lib/opentelemetry/instrumentation/rails/railtie.rb