O11y.Event (O11y v0.2.10)

Struct version of the erlang record definition for an event.

The record is defined here: https://github.com/open-telemetry/opentelemetry-erlang/blob/main/apps/opentelemetry/include/otel_span.hrl#L81

Summary

Functions

Builds an event struct from the given record.

Types

event_record()

@type event_record() ::
  {:event, system_time_native :: integer(), name :: String.t() | atom(),
   attributes :: O11y.Attributes.attributes_record()}

t()

@type t() :: %O11y.Event{
  attributes: O11y.Attributes.t(),
  name: String.t(),
  native_time: integer()
}

Functions

from_record(arg)

@spec from_record(event_record()) :: t()

Builds an event struct from the given record.

Examples

iex> O11y.Event.from_record({:event, 1, "event_name", {:attributes, 128, :infinity, 0, %{key: "value"}}})
%O11y.Event{
  name: "event_name",
  native_time: 1,
  attributes: %{key: "value"}
}