Measure AI gateway queue duration
Related to &12224 (comment 1770963792)
Currently there is no metric to measure time spent by code completions request between Rails and AI gateway (latency added by sending request from Rails to AI gateway). We could use same approach as with rails queue duration: add timestamp to request headers and then calculate difference on AI gateway side similar to https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/middleware/rails_queue_duration.rb#L16
This assumes that time is accurate both on Rails and AI gateway server (in case of self-managed servers this may not be true).
Edited by Jan Provaznik