Skip to main content
.NETFramework4.6.2net8.0net9.0

Extensions to the Polly libraries to enrich telemetry with metadata and exception summaries.

Published
Mar 12, 2024
2y ago
Total Downloads
160.8M
160,756,035

Install

dotnet add package Microsoft.Extensions.Resilience --version 9.0.0-preview.2.24157.4
ProductVersions
.NET
net8.0net9.0
Other
.NETFramework4.6.2

README

Microsoft.Extensions.Resilience

Extensions to the Polly libraries to enrich telemetry with metadata and exception summaries.

Install the package

From the command-line:

dotnet add package Microsoft.Extensions.Resilience

Or directly in the C# project file:

<ItemGroup>
  <PackageReference Include="Microsoft.Extensions.Resilience" Version="[CURRENTVERSION]" />
</ItemGroup>

Usage Examples

The services can be registered using the following method:

public static IServiceCollection AddResilienceEnricher(this IServiceCollection services)

This will optionally consume the IExceptionSummarizer service if it has been registered and add that data to Polly's telemetry. It will also include RequestMetadata that can be set or retrieved with these extensions:

public static void SetRequestMetadata(this ResilienceContext context, RequestMetadata requestMetadata)
public static RequestMetadata? GetRequestMetadata(this ResilienceContext context)

See the Polly docs for details about working with ResilienceContext.

Feedback & Contributing

We welcome feedback and contributions in our GitHub repo.

Changes from Previous Version

No structural changes between v9.0.0-preview.1.24108.1 and v9.0.0-preview.2.24157.4.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.The published metadata declares 23 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.