Solr includes a general tracing framework based on OpenTracing that can be used to trace lifecycle of a request for performance monitoring.
Tracing data can be configured to send to arbitrary backend like Jaeger, Zipkin, Datadog, etc. At the moment, only Jaeger is supported out of the box.
A sampled distributed tracing query request on Jaeger looks like this:
TracerConfigurator is a class used to provide an instance of
io.opentracing.Tracer based on configuration in
JaegerTracerConfigurator provides a JaegerTracer instance to a Solr node.
A setup of a
solr.xml looks like this:
<solr> <tracerConfig name="tracerConfig" class="org.apache.solr.jaeger.JaegerTracerConfigurator" /> </solr>
<tracerConfig> is absent,
TracerConfigurator will try to pick up the
Tracer instance that was registered in
By doing this, some backends like DataDog are supported out of the box since
datadog-java-agent uses Javaagent to register a
modules/jagertracer-configurator provides a default implementation for setting up Jaeger Tracer.
Add the solr-jaegertracer JAR file and the other JARs provided with this module to your Solr installation, ideally to each node. GSON is a dependency that is only used by Jaeger’s "remote" sampler, which is the default. Solr doesn’t distribute it, so you’ll need to add GSON yourself or configure a different sampler.
Then Jaeger tracer is configured in
solr.xml like this:
<tracerConfig name="tracerConfig" class="org.apache.solr.jaeger.JaegerTracerConfigurator" />
There are no configuration elements in the XML; instead, this 3rd party system is configured using System Properties or Environment Variables. The full list are listed at Jaeger-README.
For example, to use the probabilistic sampler, you could set this environment variable:
or System property:
bin/solr start -DJAEGER_SAMPLER_TYPE=probabilistic