opentelemetry_honeycomb v0.5.0-rc.1 OpenTelemetry.Honeycomb.Http behaviour View Source

HTTP back end.

The OpenTelemetry Honeycomb Exporter uses a Hackney-style HTTP client via a behaviour so you can adapt it to your preferred HTTP client. We supply 2-3 clients:

Link to this section Summary

Types

Request body

Configuration option for request!/5

HTTP headers

HTTP method

Client response

HTTP status code

URL

Functions

Return the default configuration for request!/5.

Make an HTTP request using the configured back end and options.

Link to this section Types

Request body

Link to this type

config_opt()

View Source
config_opt() :: {:http_module, module()} | {:http_options, Keyword.t()}

Configuration option for request!/5:

  • http_module: the HTTP back end module
  • http_options: options to pass to the HTTP back end
Link to this type

headers()

View Source
headers() :: [{String.t(), String.t()}]

HTTP headers

Link to this type

method()

View Source
method() :: :post

HTTP method

Link to this type

response()

View Source
response() ::
  {:ok, status(), headers(), body()}
  | {:ok, status(), headers()}
  | {:error, term()}

Client response

HTTP status code

URL

Link to this section Functions

Return the default configuration for request!/5.

Link to this function

request(config, method, url, headers, body, opts)

View Source
request(
  config :: [config_opt()],
  method :: method(),
  url :: url(),
  headers :: headers(),
  body :: body(),
  opts :: keyword()
) :: response()

Make an HTTP request using the configured back end and options.

Heavy on guards to limit the exporter's use of the API to the back end's documented subset of :hackney.request/5.

Link to this section Callbacks

Link to this callback

request(method, url, headers, body, opts)

View Source
request(
  method :: method(),
  url :: url(),
  headers :: headers(),
  body :: body(),
  opts :: keyword()
) :: response()

Make an HTTP request.

See :hackney.request/5.