Table of Contents

Class MailSynchronizationTelemetry

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

Makes a synchronization cycle readable as work rather than as a sequence of log lines.

public sealed class MailSynchronizationTelemetry
Inheritance
MailSynchronizationTelemetry
Inherited Members

Remarks

No instrumentation package exists for the library this subsystem talks to, so the part of MailFathom that spends the most wall-clock time would otherwise publish nothing at all. What is published here answers the two questions an operator opens a dashboard with: is this account still synchronizing, and if it is slow, which part of it is. The first is the account's schedule, which the gauges carry; the second is the cycle span with one child per folder, which is what attributes a stalled cycle to the folder it stalled in instead of to the account as a whole.

A cycle's span opens once the account holds one of the slots that bound how many accounts run at once, so its duration is the run rather than the run plus its wait. The wait is not lost: it is the queue depth beside it, which is what separates a pipeline that is idle from one whose accounts are all queued behind a bound an operator could raise.

The dimensions are MailFathom's own configured account and folder aliases and closed sets of its own words. Nothing per email, per UID, per address, or per subject appears, and no remote folder path does — every one of those would open a time series per message or per person quite apart from putting mail in a span store. Nothing MailKit reports reaches any of this either: MailFathom attaches no protocol logger to any client it opens, so protocol traffic is written nowhere for a level or a setting to expose.

Constructors

MailSynchronizationTelemetry(TimeProvider)

Initializes the instruments a synchronization cycle is published through.

Methods

BeginAccountRun(MailAccountId)

Opens the span one account's synchronization cycle is reported as, and returns the scope that ends it.

BeginFolderRun(MailAccountId)

Opens the span one folder's turn through a cycle is reported as, beneath the cycle's own span.

EnterRunQueue()

Counts one account run as waiting for a slot until the returned scope is disposed.

RecordScheduledDelay(MailAccountId, TimeSpan, int)

Publishes the wait an account's next run is scheduled behind, and the failure count that produced it.

RecordSupervisionEnded(MailAccountId)

Stops publishing an account's schedule, because nothing is scheduling it any more.