commit | c4edcbf558e939e3279dc88fc7beb528befa2be0 | [log] [tgz] |
---|---|---|
author | ILYA Khlopotov <iilyak@apache.org> | Wed Jan 15 08:13:07 2020 -0800 |
committer | ILYA Khlopotov <iilyak@apache.org> | Tue Jan 21 03:41:53 2020 -0800 |
tree | 8119587925804fdc5f25521a8b841799f9aab94f | |
parent | 076192ba899dbd9b635948d7ba47ed3fb261bc78 [diff] |
Add HTTP reporter The reporter can be configured using the following: ``` % Define http client callback Client = fun(Url, Method, Headers, Body, ReporterOptions) -> ibrowse:send_req(Url, Headers, Method, Body, []) end. [ {protocol, http}, {endpoint, "http://127.0.0.1:14268"}, {http_client, HttpClient} ] ```
Jaeger client library for Erlang.
This is an extension library of passage.
Starts Jaeger in the background:
$ docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest
Starts Erlang Shell:
$ rebar3 shell % Starts `example_tracer` > Sampler = passage_sampler_all:new(). > ok = jaeger_passage:start_tracer(example_tracer, Sampler). % Starts a root span. > RootSpan = passage:start_span(example_root, [{tracer, example_tracer}]). % Starts a child span. > ChildSpan = passage:start_span(example_child, [{child_of, RootSpan}]). % Finishes the spans > passage:finish_span(ChildSpan). > passage:finish_span(RootSpan).
Browses the tracing result:
$ firefox http://localhost:16686/
By default ‘compact’ jaeger.thrift over UDP reporter is used. However it is possible to select different reporter. Bellow is a configuration matrics for available options:
protocol | thrift_protocol | jaeger port | description |
---|---|---|---|
udp | compact | 6831 | accept jaeger.thrift over compact thrift protocol (default) |
udp | binary | 6832 | accept jaeger.thrift over binary thrift protocol |
http | N/A | 14268 | accept jaeger.thrift directly from clients |
The HTTP version is beneficial if you don't have jaeger agents deployed or your spans are greater than max udp packet size (65Kb). Otherwise it is better to use default.