Sha256: c12b3b8b6ccda81968143dc0e663986cd3c952250290b2a65688b2bcc7cfebb7

Contents?: true

Size: 1013 Bytes

Versions: 27

Compression:

Stored size: 1013 Bytes

Contents

# frozen_string_literal: true

module Labkit
  module Tracing
    module ExternalHttp
      # For more information on the payloads: lib/labkit/net_http_publisher.rb
      class RequestInstrumenter < Labkit::Tracing::AbstractInstrumenter
        def span_name(_payload)
          "external_http:request"
        end

        def tags(payload)
          # Duration is calculated by start and end time
          # Exception is already captured in lib/labkit/tracing/tracing_utils.rb
          tags = {
            "component" => "external_http",
            "method" => payload[:method],
            "code" => payload[:code],
            "host" => payload[:host],
            "port" => payload[:port],
            "path" => payload[:path],
            "scheme" => payload[:scheme],
          }

          unless payload[:proxy_host].nil?
            tags["proxy_host"] = payload[:proxy_host]
            tags["proxy_port"] = payload[:proxy_port]
          end

          tags
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gitlab-labkit-0.36.1 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.36.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.35.1 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.35.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.34.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.33.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.32.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.31.1 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.31.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.30.1 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.30.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.29.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.28.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.27.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.26.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.25.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.24.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.23.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.22.0 lib/labkit/tracing/external_http/request_instrumenter.rb
gitlab-labkit-0.21.3 lib/labkit/tracing/external_http/request_instrumenter.rb