Module opentelemetry

The types defined here, and referencing records in opentelemetry.hrl are used to store trace information while being collected on the Erlang node.

Description

The types defined here, and referencing records in opentelemetry.hrl are used to store trace information while being collected on the Erlang node.

Thus, while the types are based on protos found in the opentelemetry-proto repo: src/opentelemetry/proto/trace/v1/trace.proto, they are not exact translations because further processing is done after the span has finished and can be vendor specific. For example, there is no count of the number of dropped attributes in the span record. And an attribute's value can be a function to only evaluate the value if it is actually used (at the time of exporting). And the stacktrace is a regular Erlang stack trace.

Data Types

attribute()

attribute() = {attribute_key(), attribute_value()}

attribute_key()

attribute_key() = unicode:unicode_binary() | atom()

attribute_value()

attribute_value() = any()

attributes()

attributes() = [attribute()]

event()

event() = #event{}

event_name()

event_name() = unicode:unicode_binary() | atom()

events()

events() = [#event{}]

hex_span_id()

hex_span_id() = binary()

hex_trace_id()

hex_trace_id() = binary()

instrumentation_library()

instrumentation_library() = #instrumentation_library{}

link()

link() = #link{}

links()

links() = [#link{}]

resource()

resource() = #{unicode:unicode_binary() => unicode:unicode_binary()}

span()

span() = term()

span_ctx()

span_ctx() = #span_ctx{}

span_id()

span_id() = non_neg_integer()

span_kind()

span_kind() = '?SPAN_KIND_INTERNAL' | '?SPAN_KIND_SERVER' | '?SPAN_KIND_CLIENT' | '?SPAN_KIND_PRODUCER' | '?SPAN_KIND_CONSUMER'

span_name()

span_name() = unicode:unicode_binary() | atom()

status()

status() = #status{}

status_code()

status_code() = '?OTEL_STATUS_UNSET' | '?OTEL_STATUS_OK' | '?OTEL_STATUS_ERROR'

text_map()

text_map() = [{unicode:unicode_binary(), unicode:unicode_binary()}]

timestamp()

timestamp() = integer()

trace_flags()

trace_flags() = non_neg_integer()

trace_id()

trace_id() = non_neg_integer()

tracer()

tracer() = {module(), term()}

tracestate()

tracestate() = [{unicode:latin1_chardata(), unicode:latin1_chardata()}]

Function Index

convert_timestamp/2Convert a native monotonic timestamp to POSIX time of any erlang:time_unit().
event/2
event/3
events/1
generate_span_id/0 Generates a 64 bit random integer to use as a span id.
generate_trace_id/0 Generates a 128 bit random integer to use as a trace id.
get_application_tracer/1
get_text_map_extractor/0
get_text_map_injector/0
get_tracer/0
get_tracer/1
instrumentation_library/2
link/1
link/2
link/4
links/1
register_application_tracers/1
register_tracer/2
set_default_tracer/1
set_text_map_extractor/1
set_text_map_injector/1
set_text_map_propagator/1
set_tracer/2
status/2
timestamp/0A monotonically increasing time provided by the Erlang runtime system in the native time unit.
timestamp_to_nano/1Convert a native monotonic timestamp to nanosecond POSIX time.
verify_and_set_term/3

Function Details

convert_timestamp/2

convert_timestamp(Timestamp::timestamp(), Unit::erlang:time_unit()) -> integer()

Convert a native monotonic timestamp to POSIX time of any erlang:time_unit(). Meaning the time since Epoch. Epoch is defined to be 00:00:00 UTC, 1970-01-01.

event/2

event(Name, Attributes) -> event() | undefined

event/3

event(Timestamp, Name, Attributes) -> event() | undefined

events/1

events(List) -> any()

generate_span_id/0

generate_span_id() -> span_id()

Generates a 64 bit random integer to use as a span id.

generate_trace_id/0

generate_trace_id() -> trace_id()

Generates a 128 bit random integer to use as a trace id.

get_application_tracer/1

get_application_tracer(ModuleName::atom()) -> tracer()

get_text_map_extractor/0

get_text_map_extractor() -> any()

get_text_map_injector/0

get_text_map_injector() -> any()

get_tracer/0

get_tracer() -> tracer()

get_tracer/1

get_tracer(Name::atom()) -> tracer()

instrumentation_library/2

instrumentation_library(Name, Vsn) -> any()

link/1

link(SpanCtx::span_ctx() | undefined) -> link()

link/2

link(Span_ctx::span_ctx() | undefined, Attributes::attributes()) -> link()

link/4

link(TraceId, SpanId, Attributes, TraceState) -> link() | undefined

links/1

links(List::[{TraceId, SpanId, Attributes, TraceState} | span_ctx() | {span_ctx(), Attributes}]) -> links()

register_application_tracers/1

register_application_tracers(Applications::[atom()]) -> ok

register_tracer/2

register_tracer(Name::atom(), Vsn::string() | binary()) -> boolean()

set_default_tracer/1

set_default_tracer(Tracer::tracer()) -> boolean()

set_text_map_extractor/1

set_text_map_extractor(Propagator) -> any()

set_text_map_injector/1

set_text_map_injector(Propagator) -> any()

set_text_map_propagator/1

set_text_map_propagator(Propagator) -> any()

set_tracer/2

set_tracer(Name::atom(), Tracer::tracer()) -> boolean()

status/2

status(Code, Message) -> status() | undefined

timestamp/0

timestamp() -> integer()

A monotonically increasing time provided by the Erlang runtime system in the native time unit. This value is the most accurate and precise timestamp available from the Erlang runtime and should be used for finding durations or any timestamp that can be converted to a system time before being sent to another system.

timestamp_to_nano/1

timestamp_to_nano(Timestamp::timestamp()) -> integer()

Convert a native monotonic timestamp to nanosecond POSIX time. Meaning the time since Epoch. Epoch is defined to be 00:00:00 UTC, 1970-01-01.

verify_and_set_term/3

verify_and_set_term(Module::module() | {module(), term()}, TermKey::term(), Behaviour::atom()) -> boolean()


Generated by EDoc