OpenTracing Solr Client Instrumentation
OpenTracing instrumentation for Solr Client.
Installation
pom.xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-solr-client</artifactId>
<version>VERSION</version>
</dependency>
Usage
// Instantiate tracer
Tracer tracer = ...
// Optionally register it with GlobalTracer:
GlobalTracer.register(tracer);
HttpSolrClient
// Instantiate HttpSolrClient using TracingHttpSolrClientBuilder
HttpSolrClient client = new TracingHttpSolrClientBuilder(solrUrl, tracer).build();
// If tracer is registered with GlobalTracer:
HttpSolrClient client = new TracingHttpSolrClientBuilder(solrUrl).build();
SolrClient implementations
Usage of other SolrClient
implementations requires providing TracingHttpClient
as HttpClient
e.g.:
CloudSolrClient client = new CloudSolrClient.Builder(urls)
.withHttpClient(new TracingHttpClient(HttpClientUtil.createClient(null), tracer))
.build()