Skip to content

Log cgroup_path on successful requests

Steve Xuereb requested to merge feat/always-log-cgroup-path into master

What

  • Update gitlab.com/gitlab-org/gitaly/v15/internal/command.Stats.registry to resource to indicate it's a system resource.
  • Add metadata to gitlab.com/gitlab-org/gitaly/v15/internal/command.Stats so we can add metadata to the command stats. Keep using the term stats because it's about command stats not resource stats.
  • Add command.cgroup_path to stats to always log it in requests with gitlab.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

Merge request reports