Current section
Files
Jump to
Current section
Files
README.md
passage================[](https://hex.pm/packages/passage)[](https://travis-ci.org/sile/passage)[](https://codecov.io/gh/sile/passage/branch/master)[](LICENSE)[OpenTraceing](http://opentracing.io/) API for Erlang[Documentation](https://hexdocs.pm/passage/)Examples---------```erlang%% 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 spanRootSpan = passage:start_root_span(example_root, tracer),%% Starts a child spanChildSpan = passage:start_span(example_child, {child_of, RootSpan}),%% Finishes spanspassage:finish_span(ChildSpan),passage:finish_span(RootSpan),%% Receives the finished spansreceive {span, FinishedChildSpan} -> ok end,receive {span, FinishedRootSpan} -> ok end.```Process Dictionary Version:```erlang%% 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 spanok = passage_pd:start_root_span(example_root, tracer),%% Starts a child spanok = passage_pd:start_span(example_child),%% Finishes spanspassage_pd:finish_span(), % childpassage_pd:finish_span(), % root%% Receives the finished spansreceive {span, FinishedChildSpan} -> ok end,receive {span, FinishedRootSpan} -> ok end.```References------------ [The OpenTracing Semantic Specification(v1.1)](https://github.com/opentracing/specification/blob/1.1/specification.md)