Module: Skylight::Core::Formatters::HTTP

Defined in:
lib/skylight/core/formatters/http.rb

Class Method Summary collapse

Class Method Details

.build_opts(method, scheme, host, port, path, query) ⇒ Hash

Build instrumentation options for HTTP queries

Parameters:

  • method (String)

    HTTP method, e.g. get, post

  • scheme (String)

    HTTP scheme, e.g. http, https

  • host (String)

    Request host, e.g. example.com

  • port (String, Integer)

    Request port

  • path (String)

    Request path

  • query (String)

    Request query string

Returns:

  • (Hash)

    a hash containing ‘:category`, `:title`, and `:annotations`



15
16
17
18
19
# File 'lib/skylight/core/formatters/http.rb', line 15

def self.build_opts(method, scheme, host, port, path, query)
  { category: "api.http.#{method.downcase}",
    title:    "#{method.upcase} #{host}",
    meta:     { host: host } }
end