Skip to content

Add distributed tracing with LabKit

Andrew Newdigate requested to merge an-labkit-dtrace into master

See labkit!2 (merged) for details

Gitaly Companion MR: gitaly!976 (merged)

GitLab-CE companion MRs: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21280 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24186

Adds distributed tracing via LabKit.

Description

This change adds distributed tracing support through LabKit using OpenTracing APIs.

By default, no tracing implementation is linked into the Workhorse binary, but different OpenTracing providers can be linked in using build tags/build constraints. This can be done by setting the BUILD_TAGS make variable.

For more details of the supported providers, see LabKit, but as an example, for Jaeger tracing support, include the tags: BUILD_TAGS="tracer_static tracer_static_jaeger".

make BUILD_TAGS="tracer_static tracer_static_jaeger"

Once Workhorse is compiled with an opentracing provider, the tracing configuration is configured via the GITLAB_TRACING environment variable.

For example:

GITLAB_TRACING=opentracing://jaeger ./gitlab-workhorse

Testing

The best way to get a feel for how this works is to test it end-to-end. You can find detailed instructions of how to do this in the How to Test section here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21280#how-to-test

Edited by Andrew Newdigate

Merge request reports