Sha256: 78775f97c2fb96f6631ed7319ba54676f3cd73e5ad262e55d008647f96555feb

Contents?: true

Size: 989 Bytes

Versions: 28

Compression:

Stored size: 989 Bytes

Contents

module Skylight
  module Normalizers
    module Coach
      class MiddlewareFinish < Normalizer
        begin
          require "coach/version"
          version = Gem::Version.new(::Coach::VERSION)
        rescue LoadError # rubocop:disable Lint/SuppressedException
        end

        if version && version < Gem::Version.new("1.0")
          register "coach.middleware.finish"
        else
          register "finish_middleware.coach"
        end

        CAT = "app.coach.middleware".freeze

        # See information on the events Coach emits here:
        # https://github.com/gocardless/coach#instrumentation

        # Called whenever a new middleware is executed. We can expect this to happen
        # within a Coach::Handler.
        #
        # We can expect the payload to have the :middleware key.
        def normalize(trace, _name, payload)
          trace.endpoint = payload[:middleware]
          [CAT, payload[:middleware], nil]
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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