ObservabilityBehavior(ILogger, Histogram, ActivitySource?, ObservabilityRedaction?) Constructor

Definition

Namespace Stunts
Assembly Stunts.Extensions.dll

Logs a call, records its duration in milliseconds, and writes an activity named for the member.

public ObservabilityBehavior(ILogger logger, Histogram<double> duration, ActivitySource? activities = null, ObservabilityRedaction? redact = null)

Parameters

logger
ILogger

Receives one event per settled call.

duration
Histogram<Double>

Duration histogram, in milliseconds. Create it with unit ms.

activities
ActivitySource?

Activity source. Source is used when this is null.

redact
ObservabilityRedaction

Optional projection of arguments before they are logged or tagged.

Remarks

Add this behavior first. The pipeline runs the first behavior outermost, so one activity and one duration cover every behavior added after it. The duration is Elapsed in milliseconds and includes the time until a returned or completes.