ITraceStore
Namespace AgentPrism · Assembly
AgentPrism.Abstractions.dllThe store for persisted spans.
public interface ITraceStoreRemarks
Section titled “Remarks”An error from this store does not stop the run.
Observability must not break functionality; the caller
(RunTraceCollector) catches and logs errors.
The write path is sampled. Writing every span would bottleneck the
database at high volume; the sampling decision belongs to the caller
(AgentPrismObservabilityOptions), not the store.
Methods
Section titled “Methods”GetTraceByRunAsync(Guid, CancellationToken)
Section titled “ GetTraceByRunAsync(Guid, CancellationToken)”Fetches a run’s span tree.
ValueTask<RunTrace?> GetTraceByRunAsync(Guid runId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”runId Guid
The run identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The trace; null if no record exists.
WriteSpansAsync(TraceSpanBatch, CancellationToken)
Section titled “ WriteSpansAsync(TraceSpanBatch, CancellationToken)”Writes a trace’s spans. Can be called multiple times for the same trace; spans are merged by identifier.
ValueTask WriteSpansAsync(TraceSpanBatch batch, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”batch TraceSpanBatch
The span set to write.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The completion task.