dotnet / extensions

This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.
MIT License
2.59k stars 743 forks source link

Allow the Resilience package to access the TelemetryOptions of Polly for easier configuration #5244

Open sander1095 opened 3 months ago

sander1095 commented 3 months ago

The full context can be found here: https://github.com/App-vNext/Polly/issues/2162. In short:

Say we configure Polly to retry a HTTP request 3 times. Each time it fails, it logs an error. Say it would have succeeded the 3rd time. Then the errors (which might have triggered some alerts) were not truly errors, only warnings.

I would like to be able to configure Polly to only treat final attempts that fail as errors, and earlier retries to be configured as Warnings.

This is possible with https://github.com/App-vNext/Polly/pull/2072 but I don't seem to be able to edit this context/telemetry stuff when using the Resilience packages.

I would like to be able to modify Polly's severity levels for events.