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`


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

def self.build_opts(method, _scheme, host, _port, _path, _query)
  { category: "api.http.#{method.downcase}",
    title:    "#{method.upcase} #{host}",
    meta:     { host: host } }
end