WIP: Save http header sidekiq profile option to redis
What does this MR do?
Issue #30286 (closed) is to allow profiling of Sidekiq jobs
We propose the solution to be:
- use HTTP Header through
admin area
, same as how we usestack-profile
andmemory-profile
today(https://docs.gitlab.com/ee/administration/monitoring/performance/request_profiling.html).- extend the mode
HTTP_X_PROFILE_MODE
to have two new values:sidekiq_execution
,sidekiq_memory
- add a new header
HTTP_X_PROFILE_SIDEKIQ_WORKER
to tell which Worker to profile (this can be extended in future) - Limitation: it only works for tasks trigger through GUI, like
project import
,project export
.
- extend the mode
- use SafeRequestStore to pass the profile options from controller to WorkerClass
- Worker class method
perform_async/bulk_perform_async/bulk_perform_in
will write sidekiq profile options to Redis - Add sidekiq middleware to run profile, based on sidekiq profile options for the JID, from Redis
This MR is to implement step 1 to step 3.
We will have seperate MR for step 4.
Conformity
Edited by 🤖 GitLab Bot 🤖