You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Polly.Core/ResilienceContext.cs
+41-2Lines changed: 41 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ namespace Polly;
9
9
/// </summary>
10
10
/// <remarks>
11
11
/// Do not re-use an instance of <see cref="ResilienceContext"/> across more than one execution. The <see cref="ResilienceContext"/> is retrieved from the pool
12
-
/// by calling the <see cref="Get"/> method. After you are done with it you should return it to the pool by calling the <see cref="Return"/> method.
12
+
/// by calling the <see cref="Get(CancellationToken)"/> method. After you are done with it you should return it to the pool by calling the <see cref="Return"/> method.
13
13
/// </remarks>
14
14
publicsealedclassResilienceContext
15
15
{
@@ -23,6 +23,19 @@ private ResilienceContext()
23
23
{
24
24
}
25
25
26
+
/// <summary>
27
+
/// Gets a key unique to the call site of the current execution.
28
+
/// </summary>
29
+
/// <remarks>
30
+
/// Resilience strategy instances are commonly reused across multiple call sites.
31
+
/// Set an <see cref="OperationKey"/> so that logging and metrics can distinguish usages of policy instances at different call sites.
32
+
/// The operation key value should have a low cardinality (i.e. do not assign values such as <see cref="Guid"/> to this property).
33
+
/// <para>
34
+
/// Defaults to <see langword="null"/>.
35
+
/// </para>
36
+
/// </remarks>
37
+
publicstring?OperationKey{get;privateset;}
38
+
26
39
/// <summary>
27
40
/// Gets or sets the <see cref="CancellationToken"/> associated with the execution.
28
41
/// </summary>
@@ -69,15 +82,40 @@ private ResilienceContext()
69
82
/// <summary>
70
83
/// Gets a <see cref="ResilienceContext"/> instance from the pool.
0 commit comments