# frozen_string_literal: true ## # This code is inspired by request_store gem by Steve Klabnik: # # https://github.com/steveklabnik/request_store/ # # See LICENSE.txt in the current directory for the license. module PlainApm module Extensions module Context class Railtie < Rails::Railtie initializer "plain_apm.insert_context_middleware" do |app| if defined?(ActionDispatch::RequestId) app.config.middleware.insert_after ActionDispatch::RequestId, PlainApm::Extensions::Context::Middleware else app.config.middleware.insert_after Rack::MethodOverride, PlainApm::Extensions::Context::Middleware end end end end end end