Behaviours: gen_server.
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
.
%% 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
http_client() = fun((Url::string(), Method::post, Headers::[{string(), string()}], Body::string() | binary(), ReporterOptions::start_options()) -> ok)
Type of HTTP client.
start_option() = {default_service_name, atom()} | {process_tags, passage:tags()} | {endpoint, string()} | {http_client, http_client()} | (HttpClientSpecificOption::any())
location.application
tag, the value is used as the service name instead of this. The default value is ReporterId
.#{}
.http://127.0.0.1:14268
.httpc_client/5
is used by default.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_option()]
Options for jaeger_passage_reporter:start/2
.
httpc_client/5 | The default HTTP client based on the standard httpc module. |
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.