mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 00:58:36 +00:00
Add the name of graphql client to Sentry context
This commit is contained in:
parent
4a0c68eacb
commit
005c012cfd
1 changed files with 4 additions and 1 deletions
|
|
@ -104,7 +104,9 @@ export const graphqlHandler = (options: GraphQLHandlerOptions): RouteHandlerMeth
|
|||
|
||||
// Reduce the number of transactions to avoid overloading Sentry
|
||||
const ctx = args.contextValue as Context;
|
||||
const graphqlClientName = ctx.headers['graphql-client-name'];
|
||||
const graphqlClientName = Array.isArray(ctx.headers['graphql-client-name'])
|
||||
? ctx.headers['graphql-client-name'][0]
|
||||
: ctx.headers['graphql-client-name'];
|
||||
|
||||
if (transaction && graphqlClientName !== 'Hive CLI' && graphqlClientName !== 'Hive App') {
|
||||
transaction.sampled = false;
|
||||
|
|
@ -115,6 +117,7 @@ export const graphqlHandler = (options: GraphQLHandlerOptions): RouteHandlerMeth
|
|||
operationName: args.operationName,
|
||||
operation: print(args.document),
|
||||
userId: extractUserId(args.contextValue as any),
|
||||
graphqlClientName,
|
||||
});
|
||||
},
|
||||
trackResolvers: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue