Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

feat(sentry): add request id (if present) as tag for correlation #222

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

kschelonka
Copy link
Contributor

@kschelonka kschelonka commented Mar 23, 2023

Goal

Help correlate/trace requests to subgraphs to the original client request. Consumes a header passed down to subgraphs from the gateway (x-graph-request-id), and if present, sets a Sentry tag for tracing (following docs)

Depends on https://github.com/Pocket/client-api/pull/357 to actually have an effect.

INFRA-1158

@kschelonka kschelonka requested a review from a team as a code owner March 23, 2023 22:20
@kschelonka kschelonka requested review from cmharlow and katerinachinnappan and removed request for a team March 23, 2023 22:20
@@ -62,7 +64,12 @@ export const sentryPlugin: ApolloServerPlugin = {
// Log query and variables as extras (make sure to strip out sensitive data!)
scope.setExtra('query', ctx.request.query);
scope.setExtra('variables', JSON.stringify(ctx.request.variables));

// If present, add request id from request headers (passed down from gateway/router)
const requestId =
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@kschelonka kschelonka merged commit 4e847ec into main Apr 3, 2023
@kschelonka kschelonka deleted the INFRA-1158/sentry-request-id branch April 3, 2023 17:27
@kschelonka kschelonka changed the title feat(sentry): add request id (if present) as tag for tracing feat(sentry): add request id (if present) as tag for correlation Apr 3, 2023
@pocket-ci
Copy link
Collaborator

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants