Sha256: ae71ea065e628788243efa39232869dcddc808f3c6f361c15d2b84854cb772a6

Contents?: true

Size: 879 Bytes

Versions: 20

Compression:

Stored size: 879 Bytes

Contents

module Skylight
  module Probes
    module Excon
      # Probe for instrumenting Excon requests. Installs {Excon::Middleware} to achieve this.
      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, Probes::Excon::Middleware)
          else
            Skylight.error "The installed version of Excon doesn't support Middlewares. " \
                             "The Excon probe will be disabled."
          end
        end
      end
    end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
skylight-6.1.0.beta lib/skylight/probes/excon.rb
skylight-6.0.4 lib/skylight/probes/excon.rb
skylight-6.0.3 lib/skylight/probes/excon.rb
skylight-5.3.5 lib/skylight/probes/excon.rb
skylight-6.0.2 lib/skylight/probes/excon.rb
skylight-6.0.1 lib/skylight/probes/excon.rb
skylight-6.0.0 lib/skylight/probes/excon.rb
skylight-6.0.0.beta2 lib/skylight/probes/excon.rb
skylight-6.0.0.beta lib/skylight/probes/excon.rb
skylight-5.3.4 lib/skylight/probes/excon.rb
skylight-5.3.3 lib/skylight/probes/excon.rb
skylight-5.3.2 lib/skylight/probes/excon.rb
skylight-5.3.1 lib/skylight/probes/excon.rb
skylight-5.3.0 lib/skylight/probes/excon.rb
skylight-5.2.0 lib/skylight/probes/excon.rb
skylight-5.2.0.beta2 lib/skylight/probes/excon.rb
skylight-5.2.0.beta lib/skylight/probes/excon.rb
skylight-5.1.1 lib/skylight/probes/excon.rb
skylight-5.1.0.beta3 lib/skylight/probes/excon.rb
skylight-5.1.0.beta2 lib/skylight/probes/excon.rb