Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
Currently, if you configure retrays using AddTransientHttpErrorPolicy, there will be no traces if the request will retray.
Even if you add the OpenTelemetry.Instrumentation.Http, only the first request will be visible in the traces, and subsequent attempts will not be displayed in any way.
This is because Polly is configured with an extension to retry the SendCoreAsync
method in the PolicyHttpMessageHandler
class.
esponse = await policy.ExecuteAsync((c, ct) => SendCoreAsync(request, c, ct), context, cancellationToken).ConfigureAwait(false);
Whereas right now activities are created at a higher level in the HttpClient class.
Additional context
I propose to extend the PolicyHttpMessageHandler class: add the creation of a span to it when a request is made. And also add the RetryAttempt
property to the Polly.Context class so that we can fill in the tags according to the OpenTelemetry convention.