Skip to content

Push workhorse queue metric calculation upper in middleware stack

Summary

This MR does 2 logging improvements:

It moves RailsQueueDuration middleware upper in stack so it excludes load balancing from time calculations. LoadBalancing touches database and it can take significant time.

use Gitlab::Metrics::RackMiddleware
use Gitlab::Middleware::RailsQueueDuration # after the change
use Gitlab::Database::LoadBalancing::RackMiddleware
use Gitlab::Middleware::Speedscope
use Gitlab::Middleware::MemoryReport
use Gitlab::Middleware::RailsQueueDuration # before the change
use Gitlab::Metrics::ElasticsearchRackMiddleware
use Flipper::Middleware::Memoizer
use OmniAuth::Strategies::GroupSaml
use Gitlab::Experiment::Middleware
run Gitlab::Application.routes

The MR also refactors QueueDurationLogger to use data from RailsQueueDuration for API instead of calculating it the same. This way the number is unified and always refer to the same points in request lifecycle.

This MR is not user facing. All the changes affect data in logs only.

Merge request reports