This change is a fairly straightforward refactor to extract the tracing
and correlation-id code from the gitlab rails codebase into the new
LabKit-Ruby project.
The corresponding import into LabKit-Ruby was in
https://gitlab.com/gitlab-org/labkit-ruby/merge_requests/1
The code itself remains very similar for now.
Extracting it allows us to reuse it in other projects, such as
Gitaly-Ruby. This will give us the advantages of correlation-ids and
distributed tracing in that project too.
Jaeger is a distributed tracing tool. This change adds a "Tracing" link
to the performance bar to directly link to a current request in Jaeger.
This is useful for two reasons: 1 - it provides affordance to developers
that the distributed tracing tool is available, so that it can quickly
be discovered. 2 - it allows developers to quickly find a specific trace
without having to manually navigate to a second user-interface.
But first, rewrite the performance bar in Vue:
1. Remove the peek-host gem and replace it with existing code. This also allows
us to include the host in the JSON response, rather than in the page HTML.
2. Leave the line profiler parts as here-be-dragons: nicer would be a separate
endpoint for these, so we could use them on Ajax requests too.
3. The performance bar is too fiddly to rewrite right now, so apply the same
logic to that.
Then, add features! All requests made through Axios are able to be tracked. To
keep a lid on memory usage, only the first two requests for a given URL are
tracked, though. Each request that's tracked has the same data as the initial
page load, with the exception of the performance bar and the line profiler, as
explained above.