Skip to content

tracing: Improve instrumentation of catfile.Batch

Igor requested to merge tracing-catfile-batch into master

This patch improves the spans created by the catfile cache.

We get one single "catfile.Batch" root span that contains both cat-file --batch as well as cat-file --batch-check.

Batch operations (Info, Tree, Commit, Blob, Tag) now produce spans on two separate traces: the RPC trace and the batch trace.

The two are sampled independently, and this allows us to understand the lifetime of a batch process, as well as correlate batch processes with RPCs via correlation_id.

It's not the prettiest implementation, but it gets the job done.

The hope is that this makes those catfile traces more useful.

Before

Screenshot_2021-07-20_at_17.55.42

After

Screenshot_2021-07-20_at_17.56.06

refs https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13823

Merge request reports