The OpenTelemetry spans created in RedirectHandler.send ("RedirectHandler_send - redirect N") and HttpxRequestAdapter.retry_cae_response_if_required are not ended on the normal (non-error) code paths. In trace viewers, these spans appear to run indefinitely, making requests look “hung” even when the underlying HTTP call completes.
To Reproduce: make any request using a kiota-generate client ?
Expected behavior: Spans for redirect attempts and CAE retry decision should end when the operation finishes, so durations reflect real time spent.
Suggested fix
- Ensure
_redirect_span.end() is called for each redirect attempt, e.g. in a finally: around the loop body.
- Ensure the span started in
retry_cae_response_if_required is ended on all return paths (including when it triggers a retry).