MimirAnalytics.Row.Run (mimir_analytics v0.8.1)

Copy Markdown View Source

One captured session mapped onto the run-record correlation columns.

result["session_id"] is authoritative. meta["run_id"] is a fallback for legacy files only; caller-local correlation keys do not define run identity. Other session-fed row builders reuse run_id/2.

Summary

Functions

Build a run row from meta, result and source_file. outcome and error_class are source classifications; raw error terms are not read. Missing measurements and cost remain null.

Resolve a session entry's run id: result["session_id"] (authoritative) else meta["run_id"] (documented legacy-file fallback only — see moduledoc). The centralized resolution other Session-fed Row modules (Row.ToolCall, Row.EventRaw) reuse instead of duplicating.

Types

t()

@type t() :: %MimirAnalytics.Row.Run{
  agent_digest: String.t() | nil,
  agent_name: String.t() | nil,
  agent_version: String.t() | nil,
  cache_creation_input_tokens: non_neg_integer() | nil,
  cache_read_input_tokens: non_neg_integer() | nil,
  cost_microdollars: non_neg_integer() | nil,
  error_class: String.t() | nil,
  finished_at: String.t() | nil,
  in_flight: String.t() | nil,
  input_token_basis: String.t() | nil,
  input_tokens: non_neg_integer() | nil,
  lane: String.t() | nil,
  model: String.t() | nil,
  outcome: String.t() | nil,
  output_tokens: non_neg_integer() | nil,
  parent_step_id: String.t() | nil,
  provider: String.t() | nil,
  run_id: String.t(),
  runtime: String.t() | nil,
  source_file: String.t(),
  started_at: String.t() | nil,
  step_id: String.t() | nil,
  stop_reason: String.t() | nil,
  tenant_id: String.t() | nil,
  terminal: String.t() | nil,
  turns: integer() | nil,
  usage_complete: boolean() | nil,
  workflow_id: String.t() | nil
}

Functions

new(map)

@spec new(map()) :: t()

Build a run row from meta, result and source_file. outcome and error_class are source classifications; raw error terms are not read. Missing measurements and cost remain null.

run_id(meta, result)

Resolve a session entry's run id: result["session_id"] (authoritative) else meta["run_id"] (documented legacy-file fallback only — see moduledoc). The centralized resolution other Session-fed Row modules (Row.ToolCall, Row.EventRaw) reuse instead of duplicating.