Table of Contents

Class JobTraceContext

Namespace
MailFathom.Application.Jobs
Assembly
MailFathom.Application.dll

The trace an execution was enqueued inside, written down so the attempt hours later can point back at it.

public sealed record JobTraceContext : IEquatable<JobTraceContext>
Inheritance
JobTraceContext
Implements
Inherited Members

Remarks

A durable queue is a break in a trace rather than a tree. The work that enqueued a job has ended long before a worker claims it, so an attempt cannot be that work's child — a span store would be asked to hold a trace open for as long as a queue is deep. What survives instead is this: the W3C context of whatever was running at the enqueue, kept on the job's own row and turned back into a link on the attempt's span.

It carries the two propagation values and nothing else. There is no place here for the job's payload, its key, or its account — a trace identifier is a random number this process minted, which is the whole reason it is safe to store beside work that points at mail.

Absence is ordinary. Every row written before this was recorded carries none, and so does every job enqueued by a pass that no trace was being recorded for. An attempt at such a job opens the same span with no link on it.

Fields

MaximumTraceParentLength

The longest a W3C traceparent can be, which is the fixed form the specification defines.

MaximumTraceStateLength

The longest a tracestate this stores may be, which is the size the specification asks a system to accept.

Properties

TraceParent

Gets the W3C traceparent of whatever enqueued the job.

TraceState

Gets the W3C tracestate that accompanied it, or null when there was none.

Methods

FromTraceParent(string?, string?)

Reads a stored or propagated pair of values as a context, or reports that there is none to link to.