Skip to content

Prepare context and Sidekiq middleware for caller_id and subscription_plan attributes

Oswaldo Ferreira requested to merge osw-prepare-context-for-new-attributes into master

This MR prepares the labkit side to receive the caller_id and subscription_plan attributes from gitlab-org/gitlab!22792 (merged). The caller_id can be either the Grape route or the Rails controller action. When it reaches the Sidekiq client middleware, we feed a new context setting the caller_id to the job being scheduled.

Here's a sample of what will look like the final sidekiq log:

{"severity":"INFO","time":"2020-01-10T20:11:01.035Z","class":"ProjectExportWorker","args":[1,19,null,{}],"retry":3,"queue":"project_export","backtrace":5,"jid":"c11294507b35bcd00c9eecd9","created_at":"2020-01-10T20:11:00.903Z","meta.user":"root","meta.project":"root/asdf","meta.root_namespace":"root","meta.subscription_plan":"free","meta.caller_id":"ProjectExportWorker","correlation_id":"gUBSHlFHHL7","uber-trace-id":"3a8a4147f7aaeda1:cb8fdc7f81848b94:f24ce07e0ff4f38e:1","enqueued_at":"2020-01-10T20:11:01.026Z","pid":67596,"message":"ProjectExportWorker JID-c11294507b35bcd00c9eecd9: start","job_status":"start","scheduling_latency_s":0.009941}
Edited by Oswaldo Ferreira

Merge request reports