Log cgroup_path on successful requests
What
- Update
gitlab.com/gitlab-org/gitaly/v15/internal/command.Stats.registry
toresource
to indicate it's a system resource. - Add
metadata
togitlab.com/gitlab-org/gitaly/v15/internal/command.Stats
so we can add metadata to the command stats. Keep using the termstats
because it's about command stats not resource stats. - Add
command.cgroup_path
to stats to always log it in requests withgitlab.com/gitlab-org/gitaly/v15/internal/middleware/commandstatshandler.FieldsProducer
. Not just on failed commands
One possible problem with using a string
to store the
command.cgroup_path
is if git commands run in multiple cgroups we'll
only see the last used cgroup, we can make it a slice of strings but
this feels more of an edge case that we might not want to support.
Why
Logging the cgroup
that is used for a request will give us the
ability to correlate the cgroup
metrics from cadvisor to specific Git
repositories, which can aid in finding out why a certain cgroup is getting
oom killed and what repository caused that to happen.
Reference: https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/16456
Edited by Steve Xuereb