Skip to content

Step 2- Add Graphql LoggerTracer to handle GraphqlLogger writing

Paul Slaughter requested to merge 331697-tracer-2-logger-tracer into master

What does this MR do and why?

This MR uses tracers to dramatically improve our GraphQL logging. It introduces 2 tracers:

  • TimerTracer this measures duration of certain operations and emits custom trace events which will be picked up by other tracers.
  • LoggerTracer this watches for the trace events emitted by TimerTracer and writes to Gitlab::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). Screen_Shot_2021-10-22_at_2.10.54_PM Screen_Shot_2021-10-22_at_1.48.58_PM

How to set up and validate locally

  1. Start GDK
  2. Run tail -f log/graphql_json.log
  3. 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.

Related to #331697 (closed)

Edited by Paul Slaughter

Merge request reports

Loading