otel_span_processor behaviour (opentelemetry v1.6.0)

View Source

Behaviour each Span Processor must implement.

Summary

Functions

Starts a span processor.

Types

processor_config/0

-type processor_config() :: term().

Callbacks

force_flush/1

-callback force_flush(processor_config()) -> ok | {error, term()}.

on_end/2

-callback on_end(opentelemetry:span(), processor_config()) ->
                    true | dropped | {error, invalid_span} | {error, no_export_buffer}.

on_start/3

-callback on_start(otel_ctx:t(), opentelemetry:span(), processor_config()) -> opentelemetry:span().

processor_init/2

(optional)
-callback processor_init(pid(), processor_config()) -> processor_config().

Functions

start_link(Module, Config)

-spec start_link(module(), Config) -> {ok, pid(), Config} | {error, term()}
                    when Config :: processor_config().

Starts a span processor.

Module must implement the otel_span_processor behaviour. This function calls Module:start_link/1 with Config as the argument.