Table of Contents

Struct EnrichmentContext<TResult, TArgs>

Namespace
Polly.Telemetry
Assembly
Polly.Extensions.dll

Enrichment context used when reporting resilience events.

public readonly struct EnrichmentContext<TResult, TArgs>

Type Parameters

TResult

The type of the result.

TArgs

The type of the arguments attached to the resilience event.

Inherited Members

Remarks

This context is passed to enrichers in MeteringEnrichers. Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility.

Constructors

EnrichmentContext(in TelemetryEventArguments<TResult, TArgs>, IList<KeyValuePair<string, object?>>)

Initializes a new instance of the EnrichmentContext<TResult, TArgs> struct.

public EnrichmentContext(in TelemetryEventArguments<TResult, TArgs> telemetryEvent, IList<KeyValuePair<string, object?>> tags)

Parameters

telemetryEvent TelemetryEventArguments<TResult, TArgs>

The telemetry event info.

tags IList<KeyValuePair<string, object>>

Tags associated with the resilience event.

Properties

Tags

Gets the tags associated with the resilience event.

public IList<KeyValuePair<string, object?>> Tags { get; }

Property Value

IList<KeyValuePair<string, object>>

Remarks

Custom enricher can add tags to this collection.

TelemetryEvent

Gets the info about the telemetry event.

public TelemetryEventArguments<TResult, TArgs> TelemetryEvent { get; }

Property Value

TelemetryEventArguments<TResult, TArgs>