Polish
This commit is contained in:
@@ -20,7 +20,6 @@ package org.springframework.cloud.sleuth;
|
||||
* Span reporter that does nothing
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class NoOpSpanReporter implements SpanReporter {
|
||||
|
||||
@@ -22,7 +22,6 @@ package org.springframework.cloud.sleuth;
|
||||
* </a>OpenTracing</a>
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SpanExtractor<T> {
|
||||
|
||||
@@ -22,7 +22,6 @@ package org.springframework.cloud.sleuth;
|
||||
* </a>OpenTracing</a>
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SpanInjector<T> {
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.springframework.cloud.sleuth;
|
||||
* Contract for reporting Sleuth spans for collection. For example to Zipkin.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SpanReporter {
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.cloud.sleuth.Tracer;
|
||||
* the span is not closed - it gets {@link Tracer#detach(Span) detached}.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TraceContinuingCallable<V> extends TraceCallable<V> implements Callable<V> {
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.netflix.hystrix.HystrixCommand;
|
||||
* @author Tomasz Nurkiewicz, 4financeIT
|
||||
* @author Marcin Grzejszczak, 4financeIT
|
||||
* @author Spencer Gibb
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public abstract class TraceCommand<R> extends HystrixCommand<R> {
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.springframework.messaging.Message;
|
||||
* Creates a {@link SpanBuilder} from {@link Message}
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class MessagingSpanExtractor implements SpanExtractor<Message<?>> {
|
||||
|
||||
@@ -33,8 +33,6 @@ import org.springframework.util.StringUtils;
|
||||
* Creates a {@link Span.SpanBuilder} from {@link Message}
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class MessagingSpanInjector implements SpanInjector<MessageBuilder<?>> {
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
* by Messaging and WebSockets
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -36,9 +36,9 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
*
|
||||
* @author Michal Chmielarz, 4financeIT
|
||||
* @author Spencer Gibb
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see TraceSchedulingAspect
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAspectJAutoProxy
|
||||
|
||||
@@ -56,12 +56,11 @@ import static org.springframework.util.StringUtils.hasText;
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see Tracer
|
||||
* @see TraceKeys
|
||||
* @see TraceWebAutoConfiguration#traceFilter
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE + 5)
|
||||
public class TraceFilter extends OncePerRequestFilter {
|
||||
|
||||
@@ -54,7 +54,6 @@ import org.springframework.web.context.request.async.WebAsyncTask;
|
||||
* @author Michal Chmielarz, 4financeIT
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@@ -50,7 +50,6 @@ import org.springframework.util.StringUtils;
|
||||
* @author Michal Chmielarz, 4financeIT
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TraceAsyncClientHttpRequestFactoryWrapper extends AbstractTraceHttpRequestInterceptor
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.springframework.http.client.ClientHttpResponse;
|
||||
* {@link TraceRestTemplateInterceptor#finish() closes the span}
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TraceHttpResponse implements ClientHttpResponse {
|
||||
|
||||
@@ -31,10 +31,9 @@ import org.springframework.http.client.ClientHttpResponse;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Spencer Gibb
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see org.springframework.web.client.RestTemplate
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TraceRestTemplateInterceptor extends AbstractTraceHttpRequestInterceptor
|
||||
implements ClientHttpRequestInterceptor {
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.springframework.web.client.AsyncRestTemplate;
|
||||
* {@link AsyncRestTemplate}
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -42,7 +42,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
* enables span information propagation when using {@link RestTemplate}
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -54,7 +54,6 @@ import feign.codec.Decoder;
|
||||
* Auto-configuration} enables span information propagation when using Feign.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.netflix.zuul.ZuulFilter;
|
||||
* A post request {@link ZuulFilter} that publishes an event upon start of the filtering
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TracePostZuulFilter extends ZuulFilter {
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.netflix.zuul.context.RequestContext;
|
||||
* from the current span. We're doing so to ensure tracing propagates to the next hop.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TracePreZuulFilter extends ZuulFilter {
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.netflix.niws.client.http.RestClient;
|
||||
* Propagates traces downstream via http headers that contain trace metadata.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TraceRestClientRibbonCommandFactory extends RestClientRibbonCommandFactory {
|
||||
|
||||
@@ -39,7 +39,6 @@ import com.netflix.zuul.context.RequestContext;
|
||||
* enables span information propagation when using Zuul.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* Logger of Spans that does nothing
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class NoOpSpanLogger implements SpanLogger {
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* Note: this is only available for Slf4j
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* started / stopped / continued.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class Slf4jSpanLogger implements SpanLogger {
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* Contract for implementations responsible for logging Spans
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SpanLogger {
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.springframework.boot.actuate.metrics.CounterService;
|
||||
* Operates on a {@link CounterService} underneath
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class CounterServiceBasedSpanMetricReporter implements SpanMetricReporter {
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.springframework.cloud.sleuth.metric;
|
||||
* {@link SpanMetricReporter} that does nothing
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class NoOpSpanMetricReporter implements SpanMetricReporter {
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* Configuration properties for Sleuth related metrics
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.sleuth.metric")
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.springframework.cloud.sleuth.metric;
|
||||
* Contract for a service that measures the number of accepted / dropped spans.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SpanMetricReporter {
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* enables Sleuth related metrics reporting
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* {@link Sampler} that traces each action
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class AlwaysSampler implements Sampler {
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.springframework.cloud.sleuth.SpanAccessor;
|
||||
* {@link Sampler} that traces only if there is already some tracing going on.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see SpanAccessor#isTracing()
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* {@link Sampler} that never traces
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class NeverSampler implements Sampler {
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Adrian Cole
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class PercentageBasedSampler implements Sampler {
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Adrian Cole
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.sleuth.sampler")
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.springframework.cloud.sleuth.util.ExceptionUtils;
|
||||
* Default implementation of {@link Tracer}
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class DefaultTracer implements Tracer {
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.springframework.core.NamedThreadLocal;
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class SpanContextHolder {
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.apache.commons.logging.Log;
|
||||
* when there are some issues with tracing.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public final class ExceptionUtils {
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.springframework.util.Assert;
|
||||
* {@link DiscoveryClient}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class DiscoveryClientHostLocator implements HostLocator {
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
* Represents the host from which the span was sent
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
* environment properties might be available).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface HostLocator {
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.util.Assert;
|
||||
* </ul>
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class ServerPropertiesHostLocator implements HostLocator {
|
||||
|
||||
@@ -24,11 +24,10 @@ import org.springframework.messaging.SubscribableChannel;
|
||||
* instrumented applications. Span data comes into the channel in the form of
|
||||
* {@link Spans}, buffering multiple actual spans into a single payload.
|
||||
*
|
||||
* @see SleuthSource
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see SleuthSource
|
||||
*/
|
||||
public interface SleuthSink {
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.messaging.MessageChannel;
|
||||
* spans, and if it does it should attempt to account for and report the number dropped.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see SleuthSink
|
||||
|
||||
@@ -48,7 +48,6 @@ import org.springframework.messaging.support.ChannelInterceptor;
|
||||
* is no additional configuration to do by default).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* Properties related to Sleuth Stream
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.sleuth.stream")
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
* Data transfer object for a collection of spans from a given host.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.springframework.core.io.support.PropertiesLoaderUtils;
|
||||
* Sleuth Stream.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class StreamEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.springframework.integration.annotation.MessageEndpoint;
|
||||
* A message source for spans. Also handles RPC flavoured annotations.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@MessageEndpoint
|
||||
|
||||
@@ -30,7 +30,6 @@ import zipkin.server.EnableZipkinServer;
|
||||
* Spring Cloud Stream, for example RabbitMQ.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see ZipkinMessageListener
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.springframework.core.env.PropertySource;
|
||||
* Stream.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class StreamEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
||||
@@ -47,7 +47,6 @@ import zipkin.SpanStore;
|
||||
* Asynchronously stores the received spans in a {@link SpanStore}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see NotSleuthStreamClient
|
||||
|
||||
@@ -27,7 +27,6 @@ import zipkin.Endpoint;
|
||||
* {@link DiscoveryClient}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class DiscoveryClientEndpointLocator implements EndpointLocator {
|
||||
|
||||
@@ -22,7 +22,6 @@ import zipkin.Endpoint;
|
||||
* Strategy for locating a zipkin {@linkplain Endpoint} for the current process.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface EndpointLocator {
|
||||
|
||||
@@ -28,7 +28,6 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
* Submits spans using Zipkin's {@code POST /spans} endpoint.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public final class HttpZipkinSpanReporter
|
||||
|
||||
@@ -32,7 +32,6 @@ import zipkin.Endpoint;
|
||||
* </ul>
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class ServerPropertiesEndpointLocator implements EndpointLocator {
|
||||
|
||||
@@ -42,7 +42,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* {@link PercentageBasedSampler}.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* Zipkin settings
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.zipkin")
|
||||
|
||||
@@ -35,7 +35,6 @@ import zipkin.Endpoint;
|
||||
* Listener of Sleuth events. Reports to Zipkin via {@link ZipkinSpanReporter}.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class ZipkinSpanListener implements SpanReporter {
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.springframework.cloud.sleuth.zipkin;
|
||||
* Contract for reporting Zipkin spans to Zipkin.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface ZipkinSpanReporter {
|
||||
|
||||
Reference in New Issue
Block a user