Module otel_sampler

A sampler is a function run on each started span that returns whether to record and propagate, only record or not record the span.

This module defines the otel_sampler behaviour.
Required callback functions: setup/2.

Description

A sampler is a function run on each started span that returns whether to record and propagate, only record or not record the span.

Data Types

description()

description() = unicode:unicode_binary()

sampler()

sampler() = {fun((otel_ctx:t(), opentelemetry:trace_id(), opentelemetry:links(), opentelemetry:span_name(), opentelemetry:kind(), opentelemetry:attributes(), term()) -> sampling_result()), description(), term()}

sampling_decision()

sampling_decision() = '?DROP' | '?RECORD_ONLY' | '?RECORD_AND_SAMPLE'

sampling_result()

sampling_result() = {sampling_decision(), opentelemetry:attributes(), opentelemetry:tracestate()}

t()

abstract datatype: t()

Function Index

always_off/7
always_on/7
get_description/1
parent_based/7
setup/2
trace_id_ratio_based/7

Function Details

always_off/7

always_off(Ctx, TraceId, Links, SpanName, Kind, Attributes, Opts) -> any()

always_on/7

always_on(Ctx, TraceId, Links, SpanName, Kind, Attributes, Opts) -> any()

get_description/1

get_description(X1::sampler()) -> description()

parent_based/7

parent_based(Ctx, TraceId, Links, SpanName, Kind, Attributes, Opts) -> any()

setup/2

setup(Sampler::atom() | module(), Opts::map()) -> t()

trace_id_ratio_based/7

trace_id_ratio_based(Ctx, TraceId, X3, X4, X5, X6, IdUpperBound) -> any()


Generated by EDoc