github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/docs/guides/tracing.md (about) 1 --- 2 title: "Tracing" 3 linkTitle: "Tracing" 4 weight: 10 5 slug: tracing 6 --- 7 8 Cortex uses [Jaeger](https://www.jaegertracing.io/) to implement distributed 9 tracing. We have found Jaeger invaluable for troubleshooting the behavior of 10 Cortex in production. 11 12 ## Dependencies 13 14 In order to send traces you will need to set up a Jaeger deployment. A 15 deployment includes either the jaeger all-in-one binary, or else a distributed 16 system of agents, collectors, and queriers. If running on Kubernetes, [Jaeger 17 Kubernetes](https://github.com/jaegertracing/jaeger-kubernetes) is an excellent 18 resource. 19 20 ## Configuration 21 22 In order to configure Cortex to send traces you must do two things: 23 1. Set the `JAEGER_AGENT_HOST` environment variable in all components to point 24 to your Jaeger agent. This defaults to `localhost`. 25 1. Enable sampling in the appropriate components: 26 * The Ingester and Ruler self-initiate traces and should have sampling 27 explicitly enabled. 28 * Sampling for the Distributor and Query Frontend can be enabled in Cortex 29 or in an upstream service such as your frontdoor. 30 31 To enable sampling in Cortex components you can specify either 32 `JAEGER_SAMPLER_MANAGER_HOST_PORT` for remote sampling, or 33 `JAEGER_SAMPLER_TYPE` and `JAEGER_SAMPLER_PARAM` to manually set sampling 34 configuration. See the [Jaeger Client Go 35 documentation](https://github.com/jaegertracing/jaeger-client-go#environment-variables) 36 for the full list of environment variables you can configure. 37 38 Note that you must specify one of `JAEGER_AGENT_HOST` or 39 `JAEGER_SAMPLER_MANAGER_HOST_PORT` in each component for Jaeger to be enabled, 40 even if you plan to use the default values.