You can use debugging tools that are available for Golang. But for starters, you can take a look at the log file.
For source installs, use this:
/home/git/gitaly/
For Omnibus installations, use this:
/var/log/gitlab/gitaly/current
The following is an example of a log line:
2018-09-26_13:23:40.57373 lrv162w2 gitaly: time="2018-09-26T13:23:40Z" level=info msg="finished streaming call" grpc.code=OK grpc.method=SSHUploadPack grpc.request.glRepository=project111111 grpc.request.repoPath=namespace/project-bl.git grpc.request.repoStorage=default grpc.request.topLevelGroup=hb-backend grpc.service=gitaly.SSHService grpc.time_ms=150 peer.address=@ span.kind=server system=grpc
You can see the log level is info and this is a log event that captures a Git SSH command (method=SSHUploadPack). It started a Git pack command on the server, which means it rearranged and compressed data in a repository.
To generate more verbose logging, you can set the log level to a debug in the configuration file. It is configured via a Tom's Obvious Minimal Language (TOML) configuration file. This file is documented in the Gitaly source code repository mentioned previously.
For source installations, look here:
/home/git/gitaly/config.toml
You can change the following section and change the level:
# # Optional: Set log level to only log entries with that severity or above
# # One of, in order: debug, info, warn, error, fatal, panic
# # Defaults to "info"
# level = "warn"
For Omnibus installs, the following directives can be added to gitlab.rb to influence the level of monitoring of Gitaly. Set it to debug to enable debug-level logging:
gitaly['log_directory'] = "/var/log/gitlab/gitaly"
gitaly['logging_level'] = "debug"