Sha256: 3531cc06f3b500cc3842c0af68c453e34bdd312d2d5de1d3c4096c468c9e5102

Contents?: true

Size: 899 Bytes

Versions: 51

Compression:

Stored size: 899 Bytes

Contents

module Skylight
  module Probes
    module Excon
      class Probe
        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
      end
    end

    register("Excon", "excon", Excon::Probe.new)
  end
end

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
skylight-0.4.3 lib/skylight/probes/excon.rb
skylight-0.5.0.beta1 lib/skylight/probes/excon.rb
skylight-0.4.2 lib/skylight/probes/excon.rb
skylight-0.4.1 lib/skylight/probes/excon.rb
skylight-0.4.0 lib/skylight/probes/excon.rb
skylight-0.4.0.beta2 lib/skylight/probes/excon.rb
skylight-0.4.0.beta1 lib/skylight/probes/excon.rb
skylight-0.4.0.alpha1 lib/skylight/probes/excon.rb
skylight-0.3.21 lib/skylight/probes/excon.rb
skylight-0.3.20 lib/skylight/probes/excon.rb
skylight-0.3.19 lib/skylight/probes/excon.rb