-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add graphql queries error codes metrics #12833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added GraphQL query error metrics tracking through MetricsService integration with the existing useGraphQLErrorHandlerHook, enabling monitoring of operation outcomes using HTTP status codes.
- Implemented error code metrics tracking in
core-modules/graphql/hooks/use-graphql-error-handler.hook.ts
by mapping GraphQL errors to HTTP status codes (200, 400, 401, etc.) - Added six new metric keys in
metrics-keys.type.ts
following existing naming patterns for tracking different response codes - Modified
MetricsService
to handle optional eventIds, improving flexibility in metrics collection - Integrated MetricsModule across the application through changes in app.module.ts and metadata-related modules
- Maintained existing error handling while adding comprehensive metrics collection for system observability
7 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
metricsService: metricsService, | ||
exceptionHandlerService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: metricsService should be placed after exceptionHandlerService to maintain consistent property ordering with the function parameters
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:65356 This environment will automatically shut down when the PR is closed or after 5 hours. |
## Context Added to the existing useGraphQLErrorHandlerHook yoga hook to increment metrics after all query executions based on their error codes. I originally wanted to create a new useMetrics hook but most of the error handling was done in useGraphQLErrorHandlerHook so we decided to keep it there for now. <img width="1310" alt="Screenshot 2025-06-24 at 15 58 26" src="https://github.com/user-attachments/assets/498d3754-851a-4051-a5c2-23ac8253aa6a" />
Context
Added to the existing useGraphQLErrorHandlerHook yoga hook to increment metrics after all query executions based on their error codes. I originally wanted to create a new useMetrics hook but most of the error handling was done in useGraphQLErrorHandlerHook so we decided to keep it there for now.