Enable selective tracing with Jaeger and update Jaeger site config schema
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: beyang
Addresses #9300 (closed)
From the updated CHANGELOG:
The site configuration field "tracing.distributedTracing": { "sampling" }
allows a site admin to control which requests generate tracing data.
"all"
will trace all requests."selective"
will trace all requests initiated from an end-user URL with
?trace=1
. Non-end-user-initiated requests can set a HTTP header X-Sourcegraph-Should-Trace: true
. This is the recommended setting, as "all"
can generate large amounts of tracing data that may cause network and memory resource contention in the Sourcegraph instance."none"
turns off tracing.Jaeger is now the officially supported distributed tracer. The following is the recommended site configuration to connect Sourcegraph to a Jaeger agent (which must be deployed on the same host and listening on the default ports):
"tracing.distributedTracing": {
"type": "jaeger",
"sampling": "selective"
}
The site configuration field, useJaeger
, is deprecated in favor of "tracing.distributedTracing": { "type": "jaeger" }
.
The site configuration field "experimentalFeatures": { "debug.log": { "opentracing" } }
toggles debug logging that logs every call initiated from the opentracing (Jaeger) client.
Support for configuring Lightstep as a distributed tracer is deprecated and will be removed in a subsequent release. Because most Sourcegraph instances are deployed on-prem and Lightstep is only available "in the Cloud", usage of Lightstep was very low or non-existent. If you are a paying customer and would like us to maintain support, please email support@sourcegraph.com.
Other notes:
"selective"
setting and toggle on ?trace=1
in the URL to notice Jaeger trace collection turn on/off for the given request tree.internal/trace/ot
package (which implements the "selective" tracing behavior described in the CHANGELOG).tracing.distributedTracing
was made, because I anticipate wanting to add tracing.nettrace
shortly. If anyone prefers a different naming scheme or site config structure, please comment.TODO
debug
(toggle doesn't work)Following merge, I will do the following:
Push commits to the source branch or add previously merged commits to review them.