Table of Contents

Class MailExtractionBackfillTelemetry

Namespace
MailFathom.Infrastructure.Observability
Assembly
MailFathom.Infrastructure.dll

Reports how fast the extraction backfill is working and how much of the mailbox is still ahead of it.

public sealed class MailExtractionBackfillTelemetry
Inheritance
MailExtractionBackfillTelemetry
Inherited Members

Remarks

The pass already opens a span, which says what one run did and how long it took. What a span cannot answer is the question an operator actually has about a backfill — will this finish — because that needs a rate and a remaining amount side by side, over runs rather than within one. Without both, the only way to ask is a query against the database by hand.

The backlog is a gauge fed once per run rather than measured when a collector asks. It is a count over every message the walk still owes work on, so answering it inside the meter's callback would put that scan on whatever interval a collector happened to be configured with; a figure that is one run old is what somebody watching a backfill needs, and the counters beside it are what move in between. A backlog that stops falling while the extracted counter keeps rising is a walk finding new work as fast as it does old — which is a mailbox still synchronizing rather than a backfill that has stalled, and the two are only separable because both figures are published.

Nothing here is derived from a message. The values are counts and a duration, and the one dimension is the outcome, which is a closed set of MailFathom's own words.

Constructors

MailExtractionBackfillTelemetry()

Initializes the instruments every bounded pass reports through.

Fields

DeferredOutcomeName

Names a pass a competing writer deferred, which the next interval resumes from.

FailedOutcomeName

Names a pass that failed, which the next interval also resumes from the committed position.

InterruptedOutcomeName

Names a pass the host stopped, which is shutdown rather than a failure.

OutcomeTagName

The dimension every pass is broken down by, which the worker's span carries under the same name.

SucceededOutcomeName

Names a pass that ran to the end of its batch budget without anything stopping it.

Methods

RecordCompleted(StoredEmailExtractionBackfillResult, TimeSpan)

Records a pass that completed, what it moved, and the backlog it found ahead of it.

RecordDeferred(TimeSpan)

Records a pass a competing writer deferred, which moved nothing this interval.

RecordFailed(TimeSpan)

Records a pass that failed, which the next interval resumes from the committed position.

RecordInterrupted(TimeSpan)

Records a pass the host stopped, which is shutdown rather than a failure.