Table of Contents

Method BeginGuardedOperation

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

BeginGuardedOperation(SensitiveContentEgressPoint, UserId?, MailAccountId?, CancellationToken)

Opens the report of one guarded operation, which is what a caller actually waits on.

public ISensitiveContentGuardScope BeginGuardedOperation(SensitiveContentEgressPoint egressPoint, UserId? user, MailAccountId? account, CancellationToken cancellationToken)

Parameters

egressPoint SensitiveContentEgressPoint

Where the texts this operation guards are going.

user UserId?

The user whose whole mail this operation is publishing, or null where it publishes one mailbox's.

account MailAccountId?

The mailbox this operation is publishing, or null where it publishes a user's whole mail.

cancellationToken CancellationToken

The caller's token, read as the scope is disposed to tell a shutdown from an operation that broke.

Returns

ISensitiveContentGuardScope

The scope, which the caller must dispose exactly once and inside which the scanning happens.

Remarks

The instruments above answer over every guarded text of a deployment; this answers what one operation cost the caller in front of it. Both are needed and neither substitutes for the other: a percentile over values says a scan is quick while a read that ran fifty of them was not.

Exactly one of the two identifiers is given, because that is what the flow resolved: a pass that holds one mailbox names the mailbox, and a read that hands out mail from whichever of a user's accounts matched names the user. Both are here and neither is on the instruments above, because a posture is the mailbox's own and a scan that cannot be attributed to one cannot be read against what was asked for. They are span attributes rather than metric dimensions for the reason every tag above is a closed set: an identifier on a counter incremented per text is an unbounded series, while a span already carries the one operation it describes. Each identifier is an opaque UUID and is not mail.