Class: Skylight::Probes::Excon::Probe Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/probes/excon.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.

[View source]

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/skylight/probes/excon.rb', line 5

def install
  if defined?(::Excon::Middleware)
    # Don't require until installation since it depends on Excon being loaded
    require 'skylight/probes/excon/middleware'

    idx = ::Excon.defaults[:middlewares].index(::Excon::Middleware::Instrumentor)

    # TODO: Handle possibility of idx being nil
    ::Excon.defaults[:middlewares].insert(idx, Skylight::Probes::Excon::Middleware)
  else
    # Using $stderr here isn't great, but we don't have a logger accessible
    $stderr.puts "[SKYLIGHT] [#{Skylight::VERSION}] The installed version of Excon doesn't " \
                  "support Middlewares. The Excon probe will be disabled."
  end
end