Fix job duration value when in log format is json
What does this MR do?
Fix job duration value when in log format is json and specify the type of value it is
Why was this MR needed?
When the
log_format
is set to json
the job duration is printed in nano seconds like below
which isn't very clear. Transform the duration into seconds so it's easier to parse and also clear what the unit is.
{"duration":10170885466,"job":2126,"level":"info","msg":"Job succeeded","project":20,"runner":"4B72igtx","time":"2021-03-01T15:03:57+01:00"}
What's the best way to test this MR?
- Start
gitlab-runner
with-log-format=json
:go run main.go -log-format=json run -c $GDKPATH/gitlab-runner-config.toml
- Run job.
log_format | before | after |
---|---|---|
runner | ||
json | ||
text |
What are the relevant issue numbers?
Whilst debugging gitlab-com/gl-infra/production#3800 (closed)
Edited by Steve Xuereb