passage.
Copyright © 2017 Takeru Ohta <phjgt308@gmail.com>
Process Dictionary version of passage.
The functions in this module operate on the span which stored in the process dictionary of the calling process.
%% Registers `tracer'
Context = passage_span_context_null,
Sampler = passage_sampler_all:new(),
Reporter = passage_reporter_process:new(self(), span),
ok = passage_tracer_registry:register(tracer, Context, Sampler, Reporter),
%% Starts a root span
ok = passage_pd:start_span(example_root, [{tracer, tracer}]),
%% Starts a child span
ok = passage_pd:start_span(example_child),
%% Finishes spans
passage_pd:finish_span(), % child
passage_pd:finish_span(), % root
%% Receives the finished spans
receive {span, FinishedChildSpan} -> ok end,
receive {span, FinishedRootSpan} -> ok end.
| current_span/0 | Returns the current span stored in the process dictionary of the calling process. |
| finish_span/0 | Equivalent to finish_span([]). |
| finish_span/1 | Pops the current span from process dictionary and finishes the span. |
| get_baggage_items/0 | Returns the baggage items carried by the current span. |
| log/1 | Equivalent to log(Fields, []). |
| log/2 | Logs the Fields to the current span. |
| set_baggage_items/1 | Sets the baggage items of the current span to Items. |
| set_operation_name/1 | Sets the operation name of the current span to OperationName. |
| set_tags/1 | Sets the tags of the current span to Tags. |
| start_span/1 | Equivalent to start_span(OperationName, []). |
| start_span/2 | Starts a span. |
| with_span/2 | Equivalent to with_span(OperationName, [], Fun). |
| with_span/3 | Starts a span enclosing Fun. |
current_span() -> passage:maybe_span()
Returns the current span stored in the process dictionary of the calling process.
finish_span() -> ok
Equivalent to finish_span([]).
finish_span(Options::passage:finish_span_options()) -> ok
Pops the current span from process dictionary and finishes the span.
The finished span will be sent an external observer via the reporter associated with the tracer of the span.get_baggage_items() -> passage:baggage_items()
Returns the baggage items carried by the current span.
log(Fields::passage:log_fields()) -> ok
Equivalent to log(Fields, []).
log(Fields::passage:log_fields(), Options::passage:log_options()) -> ok
Logs the Fields to the current span.
set_baggage_items(Items::passage:baggage_items()) -> ok
Sets the baggage items of the current span to Items.
Note that the existing items which have different keys with Items are preserved.
set_operation_name(OperationName::passage:operation_name()) -> ok
Sets the operation name of the current span to OperationName.
set_tags(Tags::passage:tags()) -> ok
Sets the tags of the current span to Tags.
Tags are preserved.
start_span(OperationName::passage:operation_name()) -> ok
Equivalent to start_span(OperationName, []).
start_span(OperationName::passage:operation_name(), Options::passage:start_span_options()) -> ok
Starts a span.
The started span will be pushed to the process dictionary of the calling process.
If there is no sampled span references, the value of span will beundefined.
with_span(OperationName::passage:operation_name(), Fun) -> Result
Equivalent to with_span(OperationName, [], Fun).
with_span(OperationName::passage:operation_name(), Options::passage:start_span_options(), Fun) -> Result
Starts a span enclosing Fun.
Generated by EDoc, Oct 28 2017, 05:08:05.