File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { getSubscriptionSettings } from './subscription';
3131import { ioRedisPool } from './redis' ;
3232import { loadFeatures } from './growthbook' ;
3333import { runInRootSpan } from './telemetry' ;
34+ import { counters } from './telemetry/metrics' ;
3435import { loggerConfig } from './logger' ;
3536import { getTemporalClient } from './temporal/client' ;
3637import { BrokenCircuitError } from 'cockatiel' ;
@@ -244,6 +245,13 @@ export default async function app(
244245 code : 'UNEXPECTED' ,
245246 } ;
246247 }
248+
249+ if ( typeof newError . extensions ?. code === 'string' ) {
250+ counters ?. api ?. graphqlErrors ?. add ( 1 , {
251+ 'graphql.error.code' : newError . extensions . code ,
252+ } ) ;
253+ }
254+
247255 if ( isProd ) {
248256 newError . originalError = undefined ;
249257 }
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ const counterMap = {
3131 description :
3232 'How many graphql operations have been performed, their operation type and name' ,
3333 } ,
34+ graphqlErrors : {
35+ name : 'graphql_errors' ,
36+ description : 'How many graphql errors have been returned, by error code' ,
37+ } ,
3438 rateLimit : {
3539 name : 'rate_limit' ,
3640 description : 'How many times a rate limit has been hit' ,
You can’t perform that action at this time.
0 commit comments