Class: Skylight::Core::Probes::ActionDispatch::RequestId::Probe Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/core/probes/action_dispatch/request_id.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/skylight/core/probes/action_dispatch/request_id.rb', line 6

def install
  ::ActionDispatch::RequestId.class_eval do
    alias_method :call_without_sk, :call

    def call(env)
      @skylight_request_id = env["skylight.request_id"]
      call_without_sk(env)
    end

    private

      alias_method :internal_request_id_without_sk, :internal_request_id

      def internal_request_id
        @skylight_request_id || internal_request_id_without_sk
      end
  end
end