Skip to content

RunRecord

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

Summary of a run. It acts as the header of the event stream.

public sealed record RunRecord : IEquatable<RunRecord>

objectRunRecord

IEquatable<RunRecord>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

public RunRecord()

Gets the name of the agent that ran. For workflow runs this is the workflow name: the existing lists, statistics and user interface read this column, and leaving it empty would show workflow rows without a name.

public required string AgentName { get; init; }

string

Gets the definition version this run measured, or null when unknown.

public int? AgentVersion { get; init; }

int?

Gets the number of direct child runs.

public int ChildRunCount { get; init; }

int

Gets the completion time (UTC), or null while the run is in flight.

public DateTimeOffset? CompletedAt { get; init; }

DateTimeOffset?

Gets the run’s own cost. null when the model is unknown; when the model is known the value is populated even if the price is not.

public RunCost? Cost { get; init; }

RunCost?

Gets the depth in the tree. The root run is 0.

public int Depth { get; init; }

int

Gets the error information. Populated only for RunStatus.Failed.

public RunError? Error { get; init; }

RunError?

Gets the number of events written for this run.

public long EventCount { get; init; }

long

Gets the experiment this run belongs to, or null outside an experiment.

public Guid? ExperimentId { get; init; }

Guid?

Gets the run id. A time-ordered UUID (v7).

public required Guid Id { get; init; }

Guid

Gets whether the run streamed.

public bool IsStreaming { get; init; }

bool

Gets whether this row records an agent or a workflow.

public RunKind Kind { get; init; }

RunKind

Gets the labels the run carries, or null when it carries none.

public IReadOnlyDictionary<string, string>? Labels { get; init; }

IReadOnlyDictionary<string, string>?

A query dimension only. Labels never become metric tags — see IRunAttributionContext.Labels.

Gets the model used by the run. Cost and per-model reports need it. It is null when the agent definition carries no model.

public string? ModelId { get; init; }

string?

Gets the id of the run that started this one, or null for a root run.

public Guid? ParentRunId { get; init; }

Guid?

Gets the source run id when this run is a replay, otherwise null.

public Guid? ReplayOfRunId { get; init; }

Guid?

The lineage is one-way: the source run is immutable and does not know which runs replay it. Every replay of a source is found through this column.

Gets the id of the run at the root of the tree. null for a root run and always populated for a child run.

public Guid? RootRunId { get; init; }

Guid?

Denormalized on purpose: a whole tree is fetched with a single indexed query on this column, with no recursive CTE over RunRecord.ParentRunId.

Gets the id of the session that was used.

public string? SessionId { get; init; }

string?

Gets the start time (UTC).

public required DateTimeOffset StartedAt { get; init; }

DateTimeOffset

Gets the current status of the run.

public required RunStatus Status { get; init; }

RunStatus

Gets the tenant the run belongs to.

public string? TenantId { get; init; }

string?

Gets the total cost of this run and every run below it.

public RunTreeCost? TreeCost { get; init; }

RunTreeCost?

This must not be added to RunRecord.Cost: the value already includes the run’s own cost, for the same reason as RunRecord.TreeUsage. For a run without children the two are equivalent.

Gets the total token usage of this run and every run below it.

public RunUsage? TreeUsage { get; init; }

RunUsage?

This must not be added to RunRecord.Usage: the value already includes RunRecord.Usage. For a run without children the two are equal. The user interface shows them in separate columns, because “what did this run spend” and “what did this request spend in total” are different questions.

Gets the token usage, or null when the provider reported none.

public RunUsage? Usage { get; init; }

RunUsage?

Gets the user the run belongs to, or null when it was not known.

public string? UserId { get; init; }

string?

The value is opaque and comes from IRunAttributionContext, never from the request body. Rows written before the column existed hold null; they are not backfilled.

Gets the experiment variant this run was assigned to, or null outside an experiment.

public string? Variant { get; init; }

string?

Gets the name of the workflow. Populated only on RunKind.Workflow rows.

public string? WorkflowName { get; init; }

string?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(RunRecord? other)

other RunRecord?

bool

public override int GetHashCode()

int

public override string ToString()

string

public static bool operator ==(RunRecord? left, RunRecord? right)

left RunRecord?

right RunRecord?

bool

public static bool operator !=(RunRecord? left, RunRecord? right)

left RunRecord?

right RunRecord?

bool