Module jaeger_passage_reporter_http

A reporter that sends the spans to an jaeger collector using HTTP.

Behaviours: gen_server.

Description

A reporter that sends the spans to an jaeger collector using HTTP.

To start a reporter process, please use jaeger_passage_reporter:start/1 or jaeger_passage_reporter:start/2.

Examples

  %% Starts `example_reporter'
  {ok, Reporter} = jaeger_passage_reporter:start(example_reporter, [{protocol, http}]).
  [example_reporter] = jaeger_passage_reporter:which_reporters().
 
  %% Registers `example_tracer'
  Context = jaeger_passage_span_context.
  Sampler = passage_sampler_all:new().
  ok = passage_tracer_registry:register(example_tracer, Context, Sampler, Reporter).
 
  %% Starts and finishes a span
  Span = passage:start_span(example, [{tracer, example_tracer}]).
 
  passage:finish_span(Span). % The span will send to the jaeger collector on the localhost

Data Types

http_client()

http_client() = fun((Url::string(), Method::post, Headers::[{string(), string()}], Body::string() | binary(), ReporterOptions::start_options()) -> ok)

Type of HTTP client.

start_option()

start_option() = {default_service_name, atom()} | {process_tags, passage:tags()} | {endpoint, string()} | {http_client, http_client()} | (HttpClientSpecificOption::any())

Example of a http_client calback:
  Client = fun(Url, Method, Headers, Body, ReporterOptions) ->
     User = proplists:get_value(user, ReporterOptions),
     Password = proplists:get_value(password, ReporterOptions),
     ibrowse:send_req(Url, Headers, Method, Body, [{basic_auth, {User,  Password}}])
  end.

start_options()

start_options() = [start_option()]

Options for jaeger_passage_reporter:start/2.

Function Index

httpc_client/5The default HTTP client based on the standard httpc module.

Function Details

httpc_client/5

httpc_client(Url, Method, Headers, Body, ReporterOptions) -> any()

The default HTTP client based on the standard httpc module.


Generated by EDoc, Jan 23 2020, 22:32:01.