Skip to content

Set Apollo spans to CANCELLED when requests are cancelled #6193

Description

@lbloder

Description

The Apollo 3, 4, and 5 HTTP interceptors currently handle CancellationException as a generic failure and set the span status to SpanStatus.INTERNAL_ERROR.

Cancellation is an expected control-flow outcome rather than an internal error. Detect CancellationException explicitly and set the span status to SpanStatus.CANCELLED.

The original exception must still be rethrown so coroutine cancellation semantics remain unchanged.

Acceptance criteria

  • Apollo 3, 4, and 5 interceptors set SpanStatus.CANCELLED when request execution throws CancellationException.
  • The original exception is rethrown unchanged.
  • Existing ApolloHttpException status handling remains unchanged.
  • Unit tests cover cancellation behavior in all three integrations.

Source: #6074 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions