WardrikCore.Span (wardrik_core v0.1.0-rc.3)

Copy Markdown

A span in a turn's trace. The turn is the root, and each step a child.

Summary

Functions

Starts a span beneath parent. With :key, the ID is the same each time for that key.

Starts a new trace.

Returns the span as a W3C traceparent header, for OpenTelemetry.

Types

t()

@type t() :: %WardrikCore.Span{
  id: String.t(),
  parent: String.t() | nil,
  trace: String.t()
}

Functions

child(parent, opts \\ [])

@spec child(t(), keyword()) :: t()

Starts a span beneath parent. With :key, the ID is the same each time for that key.

root()

@spec root() :: t()

Starts a new trace.

traceparent(span)

@spec traceparent(t()) :: String.t()

Returns the span as a W3C traceparent header, for OpenTelemetry.

WardrikCore.Span.traceparent(span)
#=> "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"