committed by
Marcin Grzejszczak
parent
be1b986bec
commit
3000a4f37d
@@ -29,6 +29,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class DiscoveryClientHostLocator implements HostLocator {
|
||||
|
||||
|
||||
@@ -23,8 +23,11 @@ import java.nio.ByteBuffer;
|
||||
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)
|
||||
public class Host {
|
||||
|
||||
@@ -19,11 +19,12 @@ package org.springframework.cloud.sleuth.stream;
|
||||
import org.springframework.cloud.sleuth.Span;
|
||||
|
||||
/**
|
||||
* Strategy for locating a "host" from a Spring Cloud Span (and whatever other
|
||||
* Strategy for locating a {@link Host "host"} from a Spring Cloud Span (and whatever other
|
||||
* environment properties might be available).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface HostLocator {
|
||||
|
||||
|
||||
@@ -23,8 +23,17 @@ import org.springframework.context.event.EventListener;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* A {@link HostLocator} that retrieves:
|
||||
*
|
||||
* <ul>
|
||||
* <li><b>service name</b> - either from {@link span#getProcessId()} or current application name</li>
|
||||
* <li><b>address</b> - from {@link ServerProperties}</li>
|
||||
* <li><b>port</b> - from lazily assigned port or {@link ServerProperties}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class ServerPropertiesHostLocator implements HostLocator {
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.messaging.SubscribableChannel;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SleuthSink {
|
||||
|
||||
|
||||
@@ -21,14 +21,15 @@ import org.springframework.messaging.MessageChannel;
|
||||
|
||||
/**
|
||||
* Defines a message channel for instrumented applications to use to send span data to a
|
||||
* message broker. The channel accepts data in the form of {@link Spans} to buffer
|
||||
* multiple actual Span instances in a single message. A client app may occasionally drop
|
||||
* message broker. The channel accepts data in the form of {@link spans} to buffer
|
||||
* multiple actual span instances in a single message. A client app may occasionally drop
|
||||
* spans, and if it does it should attempt to account for and report the number dropped.
|
||||
*
|
||||
* @see SleuthSink
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @see SleuthSink
|
||||
*/
|
||||
public interface SleuthSource {
|
||||
|
||||
|
||||
@@ -44,12 +44,15 @@ import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.messaging.support.ChannelInterceptorAdapter;
|
||||
|
||||
/**
|
||||
* Autoconfiguration for sending Spans over Spring Cloud Stream. This is for the producer
|
||||
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration Auto-configuration}
|
||||
* for sending spans over Spring Cloud Stream. This is for the producer
|
||||
* (via {@link SleuthSource}). A consumer can enable binding to {@link SleuthSink} and
|
||||
* receive the messages coming from the source (they have the same channel name so there
|
||||
* is no additional configuration to do by default).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({SleuthStreamProperties.class, SamplerProperties.class})
|
||||
|
||||
@@ -19,7 +19,11 @@ package org.springframework.cloud.sleuth.stream;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties related to Sleuth Stream
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.sleuth.stream")
|
||||
public class SleuthStreamProperties {
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
|
||||
public class Spans {
|
||||
|
||||
@@ -37,8 +37,12 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.io.support.PropertiesLoaderUtils;
|
||||
|
||||
/**
|
||||
* {@link EnvironmentPostProcessor} that sets the default properties for
|
||||
* Sleuth Stream.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class StreamEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ import org.springframework.integration.annotation.MessageEndpoint;
|
||||
* A message source for spans. Also handles RPC flavoured annotations.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@MessageEndpoint
|
||||
public class StreamSpanListener {
|
||||
|
||||
Reference in New Issue
Block a user