Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ResilienceTelemetryFactory #1073

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Mar 21, 2023

The issue or feature being addressed

#1066

Details on the issue fix or feature implementation

This API exposes simple ResilienceTelemetry API that the ResilienceStrategy authors can use to report important events in a unified way. For example:

ResilienceTelemetry telemetry = ...;

telemetry.Report("OnTimeout", resilienceContext);
 
telemetry.Report("OnRetry", failedResult, resilienceContext);
 
telemetry.ReportException("OnRetry", failedException, resilienceContext);

The consumers of ResilienceStrategy can provide their own implementation of ResilienceTelemetryFactory to provide additional telemetry with each event (extracted from ResilienceContext or from reported result or exception).

By default, we use NullResilienceTelemetryFactory that does nothing. At later stages we might consider introducing Polly.Telemetry package that implements ResilienceTelemetryFactory and does logging using ILoggerFactory and metering with the new Meter API.

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@martintmk martintmk self-assigned this Mar 21, 2023
@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Mar 21, 2023
@martintmk martintmk added this to the v8.0.0 milestone Mar 21, 2023
@martintmk martintmk merged commit 4c1cd6e into main Mar 21, 2023
@martincostello martincostello deleted the mtomka/ResilienceMeterFactory branch March 21, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants