Skip to content

Add response body fields#8024

Closed
Velfi wants to merge 14 commits intodevfrom
ExpediaGroup/add-response-body-fields
Closed

Add response body fields#8024
Velfi wants to merge 14 commits intodevfrom
ExpediaGroup/add-response-body-fields

Conversation

@Velfi
Copy link
Contributor

@Velfi Velfi commented Jul 31, 2025

Introducing the ResponseErrors selector in telemetry configurations to capture router response errors, allowing users to capture and log errors encountered at the router service layer. This new selector enhances logging for the router service, as it allows users the option to only log router errors instead of the entire router response body to reduce noise.

telemetry:
  instrumentation:
    events:
      router:
         router.error:
            attributes:
               "my_attribute":
                   response_errors: "$.[0]"
                   # Examples: "$.[0].message", "$.[0].locations", "$.[0].extensions", etc.

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.

@Velfi Velfi requested a review from a team July 31, 2025 14:20
@Velfi Velfi requested a review from a team as a code owner July 31, 2025 14:20
@apollo-librarian
Copy link

apollo-librarian bot commented Jul 31, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* graphos/routing/(latest)/observability/telemetry/instrumentation/selectors.mdx

Build ID: 05bed93dffdbe8c5f0609e4c
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/05bed93dffdbe8c5f0609e4c

@mergify
Copy link
Contributor

mergify bot commented Jul 31, 2025

⚠️ The sha of the head commit of this PR conflicts with #7882. Mergify cannot evaluate rules on this PR. ⚠️

@Velfi Velfi changed the title Expedia group/add response body fields Add response body fields Jul 31, 2025
Copy link
Contributor

@BrynCooke BrynCooke left a comment

Choose a reason for hiding this comment

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

This needs docs.
Also please can you verify that this has been manually tested in addition to the unit test in the PR.

@Aguilarjaf
Copy link
Contributor

Aguilarjaf commented Aug 7, 2025

Thanks @BrynCooke, I have provided a couple of entries in the selectors docs for the Router response_errors and response_body selectors, but do not have permissions to update this PR:

ExpediaGroup@99a7b8c

@Velfi, can you help me add these entries in this PR if all looks well on your end?

Also please can you verify that this has been manually tested in addition to the unit test in the PR.

Yes, I can confirm that this has been manually tested and works as expected whenever errors are present in the router response (such as GraphQL validation/parsing errors)

@Velfi Velfi closed this Aug 28, 2025
@Velfi Velfi deleted the ExpediaGroup/add-response-body-fields branch August 28, 2025 14:23
@Velfi
Copy link
Contributor Author

Velfi commented Aug 28, 2025

I renamed this branch which required creating a new PR #8158

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.

3 participants