public class TraceRestTemplateInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
RestTemplate| Modifier and Type | Field and Description |
|---|---|
protected HttpTraceKeysInjector |
keysInjector |
protected static org.apache.commons.logging.Log |
log |
protected HttpSpanInjector |
spanInjector |
protected Tracer |
tracer |
| Constructor and Description |
|---|
TraceRestTemplateInterceptor(Tracer tracer,
HttpSpanInjector spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRequestTags(org.springframework.http.HttpRequest request)
Adds HTTP tags to the client side span
|
protected Span |
currentSpan() |
void |
finish()
Close the current span and log the client received event
|
org.springframework.http.client.ClientHttpResponse |
intercept(org.springframework.http.HttpRequest request,
byte[] body,
org.springframework.http.client.ClientHttpRequestExecution execution) |
protected boolean |
isTracing() |
protected void |
publishStartEvent(org.springframework.http.HttpRequest request)
Enriches the request with proper headers and publishes
the client sent event
|
protected static final org.apache.commons.logging.Log log
protected final Tracer tracer
protected final HttpSpanInjector spanInjector
protected final HttpTraceKeysInjector keysInjector
public TraceRestTemplateInterceptor(Tracer tracer, HttpSpanInjector spanInjector, HttpTraceKeysInjector httpTraceKeysInjector)
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request,
byte[] body,
org.springframework.http.client.ClientHttpRequestExecution execution)
throws IOException
intercept in interface org.springframework.http.client.ClientHttpRequestInterceptorIOExceptionprotected void publishStartEvent(org.springframework.http.HttpRequest request)
protected void addRequestTags(org.springframework.http.HttpRequest request)
public void finish()
protected Span currentSpan()
protected boolean isTracing()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.