Introduce Sidekiq middleware to discover CPU-intensive jobs
We should introduce Prometheus metrics/histogram that would measure real-time spend when executing CPU thread, PROCESS_THREAD_CPU_TIME
and extend our existing metrics with it to ask for optimization and prioritization.
Please check https://gitlab.com/gitlab-org/gitlab-ce/issues/64703 for more details, implementation proposal, and the discussion.
The intention is similar to https://gitlab.com/gitlab-org/gitlab-ce/issues/65388, but in this case, we want a similar approach for Sidekiq jobs.