tracing: Improve instrumentation of catfile.Batch
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
After
refs https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13823