Module passage_sampler

Span Sampler.

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

This module defines the passage_sampler behaviour.
Required callback functions: is_sampled/3.

Description

Span Sampler.

Note that this component has not been described in the OpenTracing Specification.

Callbacks

This module requires following callback:

  %% @doc Determines to sample the next span which has the given name and tags.
  -callback is_sampled(state(), passage:operation_name(), passage:tags()) -> boolean().

Data Types

sampler()

abstract datatype: sampler()

Sampler.

state()

state() = term()

Implementation-dependent state.

Function Index

get_module/1Returns the module of Sampler.
get_state/1Returns the state of Sampler.
is_sampled/3Determines to sample the next span which has the given name and tags.
is_sampler/1Returns true if X is a sampler, otherwise false.
new/2Makes a new sampler.

Function Details

get_module/1

get_module(Sampler::sampler()) -> module()

Returns the module of Sampler.

get_state/1

get_state(Sampler::sampler()) -> state()

Returns the state of Sampler.

is_sampled/3

is_sampled(Passage_sampler::sampler(), Name::passage:operation_name(), Tags::passage:tags()) -> boolean()

Determines to sample the next span which has the given name and tags.

is_sampler/1

is_sampler(X::sampler() | term()) -> boolean()

Returns true if X is a sampler, otherwise false.

new/2

new(Module::module(), State::state()) -> sampler()

Makes a new sampler.

Note that Module must be a implementation module of passage_sampler behaviour.


Generated by EDoc