Module jaeger_passage_reporter

A reporter that sends the spans to an jaeger agent.

Copyright © 2017 Takeru Ohta <phjgt308@gmail.com>

Behaviours: gen_server, passage_reporter.

Description

A reporter that sends the spans to an jaeger agent

Examples

  %% 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

Refereces

Data Types

reporter_id()

reporter_id() = atom()

Reporter identifier.

start_option()

start_option() = {thrift_format, thrift_protocol:format()} | {agent_host, inet:hostname()} | {agent_port, inet:port_number()} | {default_service_name, atom()} | {process_tags, passage:tags()}

start_options()

start_options() = [start_option()]

Options for start/2.

Function Index

get_id/1Returns the identifier of Reporter.
start/1Equivalent to start(ReporterId, []).
start/2Starts a reporter process.
stop/1Stops the reporter process.
which_reporters/0Returns the list of the running reporters.

Function Details

get_id/1

get_id(Reporter::passage_reporter:reporter()) -> reporter_id()

Returns the identifier of Reporter.

Note that if Reporter is one which has not been created by start/2, this function will crash.

start/1

start(ReporterId::reporter_id()) -> {ok, passage_reporter:reporter()} | {error, Reason}

Equivalent to start(ReporterId, []).

start/2

start(ReporterId::reporter_id(), Options::start_options()) -> {ok, Reporter} | {error, Reason}

Starts a reporter process.

stop/1

stop(ReporterId::reporter_id()) -> ok

Stops the reporter process.

If the reporter which has the identifier ReporterId has not been started, it will be simply ignored.

which_reporters/0

which_reporters() -> [reporter_id()]

Returns the list of the running reporters.


Generated by EDoc