Copyright © 2017 Takeru Ohta <phjgt308@gmail.com>
Behaviours: gen_server, passage_reporter.
A reporter that sends the spans to an jaeger agent
%% Starts `example_reporter' {ok, Reporter} = jaeger_passage_reporter:start(example_reporter). [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 agent on the localhost
reporter_id() = atom()
Reporter identifier.
start_option() = {thrift_format, thrift_protocol:format()} | {agent_host, inet:hostname()} | {agent_port, inet:port_number()} | {default_service_name, atom()} | {process_tags, passage:tags()}
compact
."127.0.0.1"
.compact
and binary
are 6831
and 6832
respectively.location.application
tag, the value is used as the service name instead of this. The default value is ReporterId
.#{}
.start_options() = [start_option()]
Options for start/2
.
get_id/1 | Returns the identifier of Reporter . |
start/1 | Equivalent to start(ReporterId, []). |
start/2 | Starts a reporter process. |
stop/1 | Stops the reporter process. |
which_reporters/0 | Returns the list of the running reporters. |
get_id(Reporter::passage_reporter:reporter()) -> reporter_id()
Returns the identifier of Reporter
.
Reporter
is one which has not been created by start/2
,
this function will crash.
start(ReporterId::reporter_id()) -> {ok, passage_reporter:reporter()} | {error, Reason}
Equivalent to start(ReporterId, []).
start(ReporterId::reporter_id(), Options::start_options()) -> {ok, Reporter} | {error, Reason}
Starts a reporter process.
stop(ReporterId::reporter_id()) -> ok
Stops the reporter process.
If the reporter which has the identifierReporterId
has not been started,
it will be simply ignored.
which_reporters() -> [reporter_id()]
Returns the list of the running reporters.
Generated by EDoc