Class: Labkit::Tracing::ExternalHttp::RequestInstrumenter Private

Inherits:
AbstractInstrumenter show all
Defined in:
lib/labkit/tracing/external_http/request_instrumenter.rb

Overview

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.

For more information on the payloads: lib/labkit/net_http_publisher.rb

Instance Method Summary collapse

Methods inherited from AbstractInstrumenter

#finish, #scope_stack, #start

Instance Method Details

#span_name(_payload) ⇒ Object

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.



8
9
10
# File 'lib/labkit/tracing/external_http/request_instrumenter.rb', line 8

def span_name(_payload)
  "external_http:request"
end

#tags(payload) ⇒ Object

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.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/labkit/tracing/external_http/request_instrumenter.rb', line 12

def tags(payload)
  # Duration is calculated by start and end time
  # Exception is already captured in lib/labkit/tracing/tracing_utils.rb
  tags = payload.slice(:method, :code, :host, :port, :path, :scheme, :proxy_host, :proxy_port)
  tags.transform_keys!(&:name)
  tags["component"] = "external_http"

  tags.compact!

  tags
end