Step 2- Add Graphql LoggerTracer to handle GraphqlLogger writing
- DRAFT: Full Context MR
- Step 1.1 - Create graphql_known_operations from webpack plugin
- Step 1.2 - Add ApplicationContextTracer to Graphql Schema
- Step 2 - Add LoggerTracer to Graphql Schema
- Step 3 - Add MetricsTracer to Graphql Schema
What does this MR do and why?
This MR uses tracers to dramatically improve our GraphQL logging. It introduces 2 tracers:
-
TimerTracerthis measures duration of certain operations and emits custom trace events which will be picked up by other tracers. -
LoggerTracerthis watches for the trace events emitted byTimerTracerand writes toGitlab::GraphqlLogger
Screenshots or screen recordings
| Description | Before | After |
|---|---|---|
logs written to log/graphql_json.log. Notice that before the duration_s doesn't really mean much (it's actually the duration of the analysis not the execution). |
![]() |
![]() |
How to set up and validate locally
- Start GDK
- Run
tail -f log/graphql_json.log - Visit a page that makes graphql request like the issue show page
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #331697 (closed)
Edited by Paul Slaughter

