Skip to content

Conversation

@rohan-b99
Copy link
Contributor

@rohan-b99 rohan-b99 commented Feb 3, 2026

Adds two new span attributes that indicate why a streaming response (subscription or defer) ended:

  • apollo.subscription.end_reason: Records the reason a subscription was terminated. Possible values are server_close, stream_end, heartbeat_delivery_failed, client_disconnect, schema_reload, and config_reload.
  • apollo.defer.end_reason: Records the reason a deferred query ended. Possible values are completed (all deferred chunks were delivered successfully) and client_disconnect (the client disconnected before all deferred data was delivered).

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@apollo-librarian
Copy link

apollo-librarian bot commented Feb 3, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* graphos/routing/(latest)/operations/subscriptions/configuration.mdx

Build ID: 98b9389ce2d3655a982c7563
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/98b9389ce2d3655a982c7563

@github-actions

This comment has been minimized.

@rohan-b99 rohan-b99 changed the title Rohan b99/subscription observability heartbeat payload errors Add apollo.subscription.end_reason attribute to subscription spans Feb 3, 2026
@rohan-b99 rohan-b99 force-pushed the rohan-b99/subscription-observability-heartbeat-payload-errors branch from a5c8dad to b9ce87b Compare February 4, 2026 15:21
Copy link
Contributor

@carodewig carodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! One comment/question below


impl Drop for Multipart {
fn drop(&mut self) {
if !self.is_terminated {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this drop approach to setting the span attributes. How would you feel about moving the other cases (where self.is_terminated == true) into this function, rather than having them throughout the rest of the codebase here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants