Copyright © 2017 Takeru Ohta <phjgt308@gmail.com>
start_tracer_option() = {reporter_id, jaeger_passage_reporter:reporter_id()} | {max_queue_len, non_neg_integer() | infinity} | jaeger_passage_reporter:start_option()
reporter_id: In start_tracer/3 function, it starts a reporter with this identifier. The default value is Tracer.max_queue_len: While the queue length of the reporter process exceeds this value, all new spans are rejected by the sampler. The default value is 1024. Note that this value only affects the root spans (e.g., the child spans never be discarded by this limitation).start_tracer_options() = [start_tracer_option()]
Options for start_tracer/3.
| start_tracer/2 | Equivalent to start_tracer(TracerId, Sampler, []). |
| start_tracer/3 | Starts a tracer for Jaeger. |
| stop_tracer/1 | Stops the tracer which has been started by start_tracer/3. |
start_tracer(Tracer, Sampler) -> ok | {error, Reason::term()}
Equivalent to start_tracer(TracerId, Sampler, []).
start_tracer(Tracer, Sampler, Options) -> ok | {error, Reason::term()}
Starts a tracer for Jaeger.
This function also starts a reporter for the jaeger agent.
Conceptually this is equivalent to the following code:
ReporterId = proplists:get_value(reporter_id, Options, Tracer),
Context = jaeger_passage_span_context,
{ok, Reporter} = jaeger_passage_reporter:start(ReporterId, Options),
passage_tracer_registry:register(Tracer, Context, Sampler, Reporter).
%% Starts `test_tracer'
Sampler = passage_sampler_all:new().
ok = jaeger_passage:start_tracer(example_tracer, Sampler).
[example_tracer] = passage_tracer_registry:which_tracers().
[example_tracer] = jaeger_passage_reporter:which_reporters().
%% Starts and finishes spans
passage_pd:start_span(example_span, [{tracer, example_tracer}]).
passage_pd:log(#{message => "something wrong"}, [error]).
passage_pd:finish_span().
%% Stops `example_tracer'
ok = jaeger_passage:stop_tracer(example_tracer).
[] = passage_tracer_registry:which_tracers().
[] = jaeger_passage_reporter:which_reporters().
stop_tracer(Tracer::passage:tracer_id()) -> ok
Stops the tracer which has been started by start_tracer/3.
Generated by EDoc, Jan 23 2020, 22:32:01.