Skip to content

tracing: Fix disconnected spans in gitaly-hooks

Quang-Minh Nguyen requested to merge qmnguyen0711/fix-git-hook-tracing-2 into master

For #4815 (closed)

gitaly-hooks is a sanitized environment. It does not initialize tracing nor export any tracing spans, even though its process environment variables set includes tracing info. The hook process then triggers RPC call back to Gitaly. Those RPCs are handled, but the corresponding spans are disconnected from the original source. This behavior makes a full flow involving gitaly-hooks broken and scattered all over the place.

This MR fixes this situation by implementing two passthrough gRPC interceptors. They read the tracing info from env and then write into outgoing metadata without modification.

Before

All spans are scattered all over the places. The detail of main operation is not helpful.

Show screenshots Screenshot_2023-02-27_at_16.29.46

Screenshot_2023-02-27_at_16.39.05

After

Relative spans are not well-structured. They are all grouped into the root trace of the full flow.

Show screenshots

Screenshot_2023-02-27_at_16.40.36

Screenshot_2023-02-27_at_11.29.11

Edited by Quang-Minh Nguyen

Merge request reports