DefaultRunAttributionContext
AgentPrism.Core.dllThe built-in IRunAttributionContext. It reports whatever AmbientRunAttributionScope carries, and nothing otherwise.
public sealed class DefaultRunAttributionContext : IRunAttributionContextInheritance
Section titled “Inheritance”object ← DefaultRunAttributionContext
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”An application that registers nothing gets exactly its previous behaviour:
both members are null, the user_id and
labels columns stay NULL, and no other behaviour changes. This is the
the no-surprises rule “no surprises” default.
The ambient scope is still honoured here so that a queued job, a scheduled
run or a direct.NET call can attribute itself without the consumer having
to write an implementation first — the same courtesy
HttpTenantContext extends to AmbientTenantScope.
The registration uses TryAdd, so a consumer implementation that binds
the interface to a real identity pipeline always wins.
Constructors
Section titled “Constructors”DefaultRunAttributionContext()
Section titled “ DefaultRunAttributionContext()”public DefaultRunAttributionContext()Properties
Section titled “Properties”Labels
Section titled “ Labels”Gets the labels of the current run, or null when there are none.
public IReadOnlyDictionary<string, string>? Labels { get; }Property Value
Section titled “Property Value”IReadOnlyDictionary<string, string>?
Remarks
Section titled “Remarks”Labels are a query dimension, not a metric dimension.
They live in the runs table and are never added to
agentprism.tokens or agentprism.run.cost: turning a free
label set into a metric dimension blows up time-series cardinality. The
same rule applies to IRunAttributionContext.UserId.
The limits are on RunLabels.
UserId
Section titled “ UserId”Gets the user the current run belongs to, or null when it is unknown.
public string? UserId { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The value is an opaque string. AgentPrism neither
resolves nor validates its meaning, and stores no personal detail of
its own; the consumer decides what the identifier means. This is the
same stance IDataSubjectResolver takes, and the data
subject erasure flow covers this column too.