Extend `sidekiq` Prometheus metrics to measure `user` job duration
Following the: https://gitlab.com/gitlab-org/gitlab-ee/issues/31887.
We should extend lib/gitlab/sidekiq_middleware/metrics.rb
to measure execution time
of different workers in sidekiq and build a histogram of user_s
.
Currently we measure only wall clock time
. This is useful, but our durations are inflated
by noisy environment.
Having user
execution time (time spend in thread) will allow us to see which workers cause
severe performance impact (a lot of time spend in Ruby thread) and cause contention on Sidekiq
multi-threaded model.
Edited by Kamil Trzciński