Allow logging of all IssuableExportCsvWorker parameters
What does this MR do and why?
Previously only the current_user_id
and project_id
were logged since they are integers. However, type
and params
fields are
not sensitive, so log them too to aid debugging.
How to set up and validate locally
- From the Rails console, run the following on
master
:
IssuableExportCsvWorker.perform_async(:issue, User.first.id, Project.first.id, { state: :opened })
- In
gitlab/log/sidekiq.log
, previously you would see:
{
"severity": "INFO",
"time": "2023-04-13T17:26:46.032Z",
"retry": 3,
"queue": "default",
"backtrace": true,
"version": 0,
"args": [
"[FILTERED]",
"1",
"1",
"[FILTERED]"
],
"class": "IssuableExportCsvWorker",
"jid": "ac1c27e629787569afba5954",
"created_at": "2023-04-13T17:26:46.024Z",
"meta.feature_category": "team_planning",
"correlation_id": "482b341f5ed35da0ee0e538d4318972e",
"worker_data_consistency": "always",
"idempotency_key": "resque:gitlab:duplicate:default:4cc0fe875801fb9cb40571eb3cccadad20846d13a8f18eb3f647ce1cbbb3a5e8",
"size_limiter": "validated",
"enqueued_at": "2023-04-13T17:26:46.031Z",
"job_size_bytes": 32,
"pid": 51741,
"message": "IssuableExportCsvWorker JID-ac1c27e629787569afba5954: start",
"job_status": "start",
"scheduling_latency_s": 0.000918
}
- Check out this branch.
-
gdk restart rails-background-jobs
. - Repeat step 1.
- Now you should see something like:
{
"severity": "INFO",
"time": "2023-04-13T17:28:04.453Z",
"retry": 3,
"queue": "default",
"backtrace": true,
"version": 0,
"args": [
"issue",
"1",
"1",
"{\"state\"=>\"opened\"}"
],
"class": "IssuableExportCsvWorker",
"jid": "95c2b7aa3cab9b15211143d2",
"created_at": "2023-04-13T17:28:04.430Z",
"meta.feature_category": "team_planning",
"correlation_id": "b1e2c356082d33cb101810f079488a33",
"worker_data_consistency": "always",
"idempotency_key": "resque:gitlab:duplicate:default:4cc0fe875801fb9cb40571eb3cccadad20846d13a8f18eb3f647ce1cbbb3a5e8",
"size_limiter": "validated",
"enqueued_at": "2023-04-13T17:28:04.450Z",
"job_size_bytes": 32,
"pid": 99213,
"message": "IssuableExportCsvWorker JID-95c2b7aa3cab9b15211143d2: start",
"job_status": "start",
"scheduling_latency_s": 0.002978
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Stan Hu