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

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_key()

attribute_value()

attributes()

event()

event_name()

events()

meter()

resource()

span()

span_ctx()

span_id()

span_kind()

span_name()

status()

status_code()

text_map()

timestamp()

trace_flags()

trace_id()

tracer()

tracestate()

Function Index

Function Details

convert_timestamp/2

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/3

events/1

events(List) -> any()

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_meter/0

get_meter/1

get_text_map_extractors/0

get_text_map_extractors() -> any()

get_text_map_injectors/0

get_text_map_injectors() -> any()

get_tracer/0

get_tracer/1

register_application_meter/1

register_application_tracer/1

register_meter/2

register_tracer/2

set_default_meter/1

set_default_tracer/1

set_meter/2

set_text_map_extractors/1

set_text_map_extractors(List) -> any()

set_text_map_injectors/1

set_text_map_injectors(List) -> any()

set_tracer/2

status/2

timestamp/0

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

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.