Skip to content

httpx: OpenTelemetry spans never end for RedirectHandler_send and retry_cae_response_if_required #508

Description

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).

Activity

  1. moved this to Needs Triage 🔍 in Kiotaon Feb 2, 2026
  2. added a commit that references this issue on Sep 16, 2026
    ee1682a
  3. moved this from Needs Triage 🔍 to Done ✔️ in Kiotaon Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions