Module passage_tracer_registry

Tracer Registry.

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

Description

Tracer Registry.

Examples

  Context = passage_span_context_null,
  Sampler = passage_sampler_null:new(),
  Reporter = passage_reporter_null:new(),
 
  %% Registers
  ok = passage_tracer_registry:register(foo, Context, Sampler, Reporter),
  [foo] = passage_tracer_registry:which_tracers(),
 
  %% Deregisters
  ok = passage_tracer_registry:deregister(foo),
  [] = passage_tracer_registry:which_tracers()

Function Index

deregister/1Deregisters the tracer.
get_reporter/1Returns the reporter associated with Tracer.
get_sampler/1Returns the sampler associated with Tracer.
get_span_context_module/1Returns the passage_span_context implementation module associated with Tracer.
register/4Registers the tracer.
set_reporter/2Updates the reporter associated with Tracer to Reporter.
set_sampler/2Updates the sampler associated with Tracer to Sampler.
which_tracers/0Returns the list of the registered tracers.

Function Details

deregister/1

deregister(Tracer::passage:tracer_id()) -> ok

Deregisters the tracer.

If Tracer has not been registered, it will be simply ignored.

get_reporter/1

get_reporter(TracerId::passage:tracer_id()) -> {ok, passage_reporter:reporter()} | error

Returns the reporter associated with Tracer.

If Tracer has not been registered, it will return error.

get_sampler/1

get_sampler(Tracer::passage:tracer_id()) -> {ok, passage_sampler:sampler()} | error

Returns the sampler associated with Tracer.

If Tracer has not been registered, it will return error.

get_span_context_module/1

get_span_context_module(Tracer::passage:tracer_id()) -> {ok, Module} | error

Returns the passage_span_context implementation module associated with Tracer.

If Tracer has not been registered, it will return error.

register/4

register(Tracer, Module, Sampler, Reporter) -> ok | {error, Reason}

Registers the tracer.

set_reporter/2

set_reporter(Tracer::passage:tracer_id(), Reporter::passage_reporter:reporter()) -> ok

Updates the reporter associated with Tracer to Reporter.

If Tracer has not been registered, it will be simply ignored.

set_sampler/2

set_sampler(Tracer::passage:tracer_id(), Sampler::passage_sampler:sampler()) -> ok

Updates the sampler associated with Tracer to Sampler.

If Tracer has not been registered, it will be simply ignored.

which_tracers/0

which_tracers() -> [passage:tracer_id()]

Returns the list of the registered tracers.


Generated by EDoc