Praefect: Use millisecond precision for JSON logs time field
Problem to solve
A customer reported that times in Praefect logs are not standardized. Some items have millisecond precision (thanks to !1887 (merged)), but others don't.
From the customer:
We are trying to ingest logs on Datalog and are facing dates on logs that aren't standardized. Example on the same file (/var/log/gitlab/praefect/current):
{"gitaly":15927,"level":"warning","msg":"forwarding signal","signal":23,"time":"2020-12-09T15:24:49Z","wrapper":15937}
{"correlation_id":"M2qIAurFTg7","grpc.code":"OK","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-web","grpc.meta.deadline_type":"regular","grpc.method":"FindCommit","grpc.request.deadline":"2020-12-09T14:39:10Z","grpc.request.fullMethod":"/gitaly.CommitService/FindCommit","grpc.service":"gitaly.CommitService","grpc.start_time":"2020-12-09T14:38:41Z","grpc.time_ms":4.497,"level":"info","msg":"finished streaming call with code OK","peer.address":"REDACTED:11670","pid":15927,"relative_path":"@hashed/e7/f6/REDACTED.git","span.kind":"server","system":"grpc","time":"2020-12-09T14:38:41.010Z","virtual_storage":"distributed"}
Notice that the first time
does not have millisecond precision, but the last time
does.
Proposal
Praefect log entries should have times with millisecond precision (ISO 8601.3).
Edited by Dan Jensen