Skip to content

Add logging to gitaly-git2go

James Fargher requested to merge git2go_logging into master

Fixes #3229 (closed)

Example output from GDK during a merge:

2022-03-23_02:20:03.47096 gitaly                : {"command.name":"gitaly-git2go-v14","correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","level":"info","msg":"starting merge command","pid":2075157,"subcommand":"merge","time":"2022-03-23T02:20:03.470Z"}
2022-03-23_02:20:03.47445 gitaly                : {"command.name":"gitaly-git2go-v14","correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","level":"info","msg":"finished merge command","pid":2075157,"subcommand":"merge","time":"2022-03-23T02:20:03.474Z"}
2022-03-23_02:20:03.79250 gitaly                : {"content_length_bytes":712,"correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","duration_ms":303,"level":"info","method":"POST","msg":"Finished HTTP request","status":200,"time":"2022-03-23T02:20:03.792Z","url":"http://127.0.0.1:3000/api/v4/internal/allowed"}
2022-03-23_02:20:03.89098 gitaly                : {"content_length_bytes":36,"correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","duration_ms":98,"level":"info","method":"POST","msg":"Finished HTTP request","status":200,"time":"2022-03-23T02:20:03.890Z","url":"http://127.0.0.1:3000/api/v4/internal/pre_receive"}
2022-03-23_02:20:04.01777 gitaly                : {"content_length_bytes":50,"correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","duration_ms":124,"level":"info","method":"POST","msg":"Finished HTTP request","status":200,"time":"2022-03-23T02:20:04.017Z","url":"http://127.0.0.1:3000/api/v4/internal/post_receive"}
2022-03-23_02:20:04.02024 gitaly                : {"correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","diskcache":"22f34af0-f22b-4986-b71d-a89362d55e9a","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-sidekiq","grpc.meta.deadline_type":"unknown","grpc.meta.method_type":"bidi_stream","grpc.method":"UserMergeBranch","grpc.request.deadline":"2022-03-23T21:20:03.438","grpc.request.fullMethod":"/gitaly.OperationService/UserMergeBranch","grpc.request.glProjectPath":"gitlab-org/gitlab-shell","grpc.request.glRepository":"project-2","grpc.request.repoPath":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git","grpc.request.repoStorage":"default","grpc.service":"gitaly.OperationService","grpc.start_time":"2022-03-23T15:20:03.438","level":"info","msg":"diskcache state change","peer.address":"@","pid":2074216,"remote_ip":"127.0.0.1","span.kind":"server","system":"grpc","time":"2022-03-23T02:20:04.020Z","username":"root"}
2022-03-23_02:20:04.02034 gitaly                : {"command.count":3,"command.cpu_time_ms":19,"command.inblock":0,"command.majflt":0,"command.maxrss":139128,"command.minflt":3146,"command.oublock":16,"command.real_time_ms":13,"command.system_time_ms":4,"command.user_time_ms":14,"correlation_id":"01FYT95VSAJX2ZBB6E07GWZJA3","grpc.code":"OK","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-sidekiq","grpc.meta.deadline_type":"unknown","grpc.meta.method_type":"bidi_stream","grpc.method":"UserMergeBranch","grpc.request.deadline":"2022-03-23T21:20:03.438","grpc.request.fullMethod":"/gitaly.OperationService/UserMergeBranch","grpc.request.glProjectPath":"gitlab-org/gitlab-shell","grpc.request.glRepository":"project-2","grpc.request.payload_bytes":348,"grpc.request.repoPath":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git","grpc.request.repoStorage":"default","grpc.response.payload_bytes":86,"grpc.service":"gitaly.OperationService","grpc.start_time":"2022-03-23T15:20:03.438","grpc.time_ms":581.744,"level":"info","msg":"finished streaming call with code OK","peer.address":"@","pid":2074216,"remote_ip":"127.0.0.1","span.kind":"server","system":"grpc","time":"2022-03-23T02:20:04.020Z","username":"root"}
Edited by James Fargher

Merge request reports