Harmonize duration_s across GraphQL tracers
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Discussion
In Fix GraphQL tracer deprecation (!152034 - merged) we had to update some GraphQL tracers to each calculate their own duration_s
. It'd be nice to have 1 tracer that's the SSOT for how long a thing took.
Investigation
Maybe we could have 1 tracer that reads/writes to Gitlab::ApplicationContext.current
?
Context
The following discussion from !152034 (merged) should be addressed:
-
@pslaughter started a discussion: (+5 comments) So it's not straightforward to inject a new param. We'll have to call
super
with the extra param and then the last tracer must callsuper
without the param. And this won't be compatible with other tracers too since we will be breaking the method signature.question: I think this makes sense... Do we want to consider writing values like
duration_s
to thequery.context
? It seems like this can house arbitrary data https://graphql-ruby.org/api-doc/2.3.2/GraphQL/Query.htmlI don't feel strongly one way or another... I'm just a little curious if there's a way for us to make a SSOT for
duration_s
. I think it's possible to run across some weird scenarios where 2 tracers report a differentduration_s
(even if they are just slightly off).