MetrixWire.Span (MetrixWire v0.2.2)

Copy Markdown View Source

A single unit of work within a trace (db_query | http_call | custom). Users never build these — instrumentation creates them. Serialized to the exact ingest wire shape.

Summary

Functions

Build a span. type is "db_query" | "http_call" | "custom". started_at is an ISO8601 string. meta is an optional map (e.g. %{"rowCount" => n}).

Serialize to the ingest wire shape (string keys, camelCase).

Types

t()

@type t() :: %MetrixWire.Span{
  description: term(),
  duration_ms: term(),
  meta: term(),
  source_location: term(),
  started_at: term(),
  type: term()
}

Functions

new(type, description, started_at, duration_ms, opts \\ [])

Build a span. type is "db_query" | "http_call" | "custom". started_at is an ISO8601 string. meta is an optional map (e.g. %{"rowCount" => n}).

to_map(span)

Serialize to the ingest wire shape (string keys, camelCase).