public class TracingInterceptor extends Object implements okhttp3.Interceptor
TracingCallFactory is not possible to use. This
instrumentation fails to properly infer parent span when doing simultaneously asynchronous calls.
Initialization via addTracing(OkHttpClient.Builder, Tracer, List)
or instantiate the interceptor and add it to OkHttpClient.Builder#addInterceptor(Interceptor) and
OkHttpClient.Builder#addNetworkInterceptor(Interceptor).
| Constructor and Description |
|---|
TracingInterceptor(io.opentracing.Tracer tracer)
Create tracing interceptor.
|
TracingInterceptor(io.opentracing.Tracer tracer,
List<OkHttpClientSpanDecorator> decorators)
Create tracing interceptor.
|
| Modifier and Type | Method and Description |
|---|---|
static okhttp3.OkHttpClient |
addTracing(okhttp3.OkHttpClient.Builder builder,
io.opentracing.Tracer tracer) |
static okhttp3.OkHttpClient |
addTracing(okhttp3.OkHttpClient.Builder builder,
io.opentracing.Tracer tracer,
List<OkHttpClientSpanDecorator> decorators) |
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
public TracingInterceptor(io.opentracing.Tracer tracer)
OkHttpClient.Builder#addInterceptor(Interceptor)
and OkHttpClient.Builder#addNetworkInterceptor(Interceptor).tracer - tracerpublic TracingInterceptor(io.opentracing.Tracer tracer,
List<OkHttpClientSpanDecorator> decorators)
OkHttpClient.Builder#addInterceptor(Interceptor)
and OkHttpClient.Builder#addNetworkInterceptor(Interceptor).tracer - tracerdecorators - decoratorspublic static okhttp3.OkHttpClient addTracing(okhttp3.OkHttpClient.Builder builder,
io.opentracing.Tracer tracer)
public static okhttp3.OkHttpClient addTracing(okhttp3.OkHttpClient.Builder builder,
io.opentracing.Tracer tracer,
List<OkHttpClientSpanDecorator> decorators)
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept in interface okhttp3.InterceptorIOExceptionCopyright © 2020. All rights reserved.