Module passage_reporter_process

Process Reporter.

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

Behaviours: passage_reporter.

Description

Process Reporter.

This reporter will send the finished spans to a process.

Examples

  %% 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 and finishes a span
  Span = passage:start_span(example, tracer),
  passage:finish_span(Span),
 
  %% Receives the finish span
  receive
      {span, Span} ->
          example = passage_span:get_operation_name(Span)
  end.

Function Index

new/2Makes a new reporter.

Function Details

new/2

new(DestinationPid::pid(), Tag::term()) -> passage_reporter:reporter()

Makes a new reporter.

This reporter will send the finished spans to DestinationPid by the message {Tag, Span}.


Generated by EDoc