Accept properties prefix spring.sleuth.messaging instead of spring.sleuth.messaging.messaging. Fixes gh-1813 (#1821)
This commit is contained in:
@@ -19,17 +19,14 @@
|
||||
|spring.sleuth.integration.enabled | `true` | Enable Spring Integration sleuth instrumentation.
|
||||
|spring.sleuth.integration.patterns | `[!hystrixStreamOutput*, *, !channel*]` | An array of patterns against which channel names will be matched. @see org.springframework.integration.config.GlobalChannelInterceptor#patterns() Defaults to any channel name not matching the Hystrix Stream and functional Stream channel names.
|
||||
|spring.sleuth.integration.websockets.enabled | `true` | Enable tracing for WebSockets.
|
||||
|spring.sleuth.messaging.jms.enabled | `true` | Enable tracing of JMS.
|
||||
|spring.sleuth.messaging.kafka.enabled | `true` | Enable tracing of Kafka.
|
||||
|spring.sleuth.messaging.kafka.mapper.enabled | `true` | Enable DefaultKafkaHeaderMapper tracing for Kafka.
|
||||
|spring.sleuth.messaging.messaging.enabled | `false` | Should messaging be turned on.
|
||||
|spring.sleuth.messaging.messaging.jms.enabled | `false` |
|
||||
|spring.sleuth.messaging.messaging.jms.remote-service-name | `jms` |
|
||||
|spring.sleuth.messaging.messaging.kafka.enabled | `false` |
|
||||
|spring.sleuth.messaging.messaging.kafka.remote-service-name | `kafka` |
|
||||
|spring.sleuth.messaging.messaging.rabbit.enabled | `false` |
|
||||
|spring.sleuth.messaging.messaging.rabbit.remote-service-name | `rabbitmq` |
|
||||
|spring.sleuth.messaging.rabbit.enabled | `true` | Enable tracing of RabbitMQ.
|
||||
|spring.sleuth.messaging.enabled | `false` | Should messaging be turned on.
|
||||
|spring.sleuth.messaging.jms.enabled | `false` | Enable tracing of JMS.
|
||||
|spring.sleuth.messaging.jms.remote-service-name | `jms` | JMS remote service name.
|
||||
|spring.sleuth.messaging.kafka.enabled | `false` | Enable tracing of Kafka.
|
||||
|spring.sleuth.messaging.kafka.remote-service-name | `kafka` | Kafka remote service name.
|
||||
|spring.sleuth.messaging.kafka.streams.enabled | `false` | Enable tracing of Kafka Streams.
|
||||
|spring.sleuth.messaging.rabbit.enabled | `false` | Enable tracing of RabbitMQ.
|
||||
|spring.sleuth.messaging.rabbit.remote-service-name | `rabbitmq` | Rabbit remote service name.
|
||||
|spring.sleuth.mongodb.enabled | `true` | Enable tracing for MongoDb.
|
||||
|spring.sleuth.opentracing.enabled | `true` | Enables OpenTracing support.
|
||||
|spring.sleuth.propagation.type | | Tracing context propagation types.
|
||||
|
||||
@@ -107,7 +107,7 @@ public class BraveMessagingAutoConfiguration {
|
||||
SpringRabbitTracing springRabbitTracing(MessagingTracing messagingTracing,
|
||||
SleuthMessagingProperties properties) {
|
||||
return SpringRabbitTracing.newBuilder(messagingTracing)
|
||||
.remoteServiceName(properties.getMessaging().getRabbit().getRemoteServiceName()).build();
|
||||
.remoteServiceName(properties.getRabbit().getRemoteServiceName()).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class BraveMessagingAutoConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
KafkaTracing kafkaTracing(MessagingTracing messagingTracing, SleuthMessagingProperties properties) {
|
||||
return KafkaTracing.newBuilder(messagingTracing)
|
||||
.remoteServiceName(properties.getMessaging().getKafka().getRemoteServiceName()).build();
|
||||
.remoteServiceName(properties.getKafka().getRemoteServiceName()).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -149,7 +149,7 @@ public class BraveMessagingAutoConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
JmsTracing jmsTracing(MessagingTracing messagingTracing, SleuthMessagingProperties properties) {
|
||||
return JmsTracing.newBuilder(messagingTracing)
|
||||
.remoteServiceName(properties.getMessaging().getJms().getRemoteServiceName()).build();
|
||||
.remoteServiceName(properties.getJms().getRemoteServiceName()).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -27,75 +27,56 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("spring.sleuth.messaging")
|
||||
public class SleuthMessagingProperties {
|
||||
|
||||
private Messaging messaging = new Messaging();
|
||||
|
||||
public Messaging getMessaging() {
|
||||
return this.messaging;
|
||||
}
|
||||
|
||||
public void setMessaging(Messaging messaging) {
|
||||
this.messaging = messaging;
|
||||
}
|
||||
/**
|
||||
* Should messaging be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* Generic messaging properties.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* Rabbit related properties.
|
||||
*/
|
||||
public static class Messaging {
|
||||
private Rabbit rabbit = new Rabbit();
|
||||
|
||||
/**
|
||||
* Should messaging be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
/**
|
||||
* Kafka related properties.
|
||||
*/
|
||||
private Kafka kafka = new Kafka();
|
||||
|
||||
/**
|
||||
* Rabbit related properties.
|
||||
*/
|
||||
private Rabbit rabbit = new Rabbit();
|
||||
/**
|
||||
* JMS related properties.
|
||||
*/
|
||||
private Jms jms = new Jms();
|
||||
|
||||
/**
|
||||
* Kafka related properties.
|
||||
*/
|
||||
private Kafka kafka = new Kafka();
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* JMS related properties.
|
||||
*/
|
||||
private Jms jms = new Jms();
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
public Rabbit getRabbit() {
|
||||
return this.rabbit;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
public void setRabbit(Rabbit rabbit) {
|
||||
this.rabbit = rabbit;
|
||||
}
|
||||
|
||||
public Rabbit getRabbit() {
|
||||
return this.rabbit;
|
||||
}
|
||||
public Kafka getKafka() {
|
||||
return this.kafka;
|
||||
}
|
||||
|
||||
public void setRabbit(Rabbit rabbit) {
|
||||
this.rabbit = rabbit;
|
||||
}
|
||||
public void setKafka(Kafka kafka) {
|
||||
this.kafka = kafka;
|
||||
}
|
||||
|
||||
public Kafka getKafka() {
|
||||
return this.kafka;
|
||||
}
|
||||
|
||||
public void setKafka(Kafka kafka) {
|
||||
this.kafka = kafka;
|
||||
}
|
||||
|
||||
public Jms getJms() {
|
||||
return this.jms;
|
||||
}
|
||||
|
||||
public void setJms(Jms jms) {
|
||||
this.jms = jms;
|
||||
}
|
||||
public Jms getJms() {
|
||||
return this.jms;
|
||||
}
|
||||
|
||||
public void setJms(Jms jms) {
|
||||
this.jms = jms;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,8 +84,14 @@ public class SleuthMessagingProperties {
|
||||
*/
|
||||
public static class Rabbit {
|
||||
|
||||
/**
|
||||
* Should Rabbit be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* Rabbit remote service name.
|
||||
*/
|
||||
private String remoteServiceName = "rabbitmq";
|
||||
|
||||
public boolean isEnabled() {
|
||||
@@ -130,10 +117,21 @@ public class SleuthMessagingProperties {
|
||||
*/
|
||||
public static class Kafka {
|
||||
|
||||
/**
|
||||
* Should Kafka be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* Kafka remote service name.
|
||||
*/
|
||||
private String remoteServiceName = "kafka";
|
||||
|
||||
/**
|
||||
* Kafka Streams related properties.
|
||||
*/
|
||||
private Streams streams = new Streams();
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
@@ -150,6 +148,34 @@ public class SleuthMessagingProperties {
|
||||
this.remoteServiceName = remoteServiceName;
|
||||
}
|
||||
|
||||
public Streams getStreams() {
|
||||
return streams;
|
||||
}
|
||||
|
||||
public void setStreams(Streams streams) {
|
||||
this.streams = streams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kafka streams configuration.
|
||||
*/
|
||||
public static class Streams {
|
||||
|
||||
/**
|
||||
* Should Kafka Streams be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,8 +183,14 @@ public class SleuthMessagingProperties {
|
||||
*/
|
||||
public static class Jms {
|
||||
|
||||
/**
|
||||
* Should JMS be turned on.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* JMS remote service name.
|
||||
*/
|
||||
private String remoteServiceName = "jms";
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
||||
@@ -92,10 +92,10 @@ public class TraceSpringIntegrationAutoConfiguration {
|
||||
return null;
|
||||
}
|
||||
if (s.startsWith("amqp") || s.startsWith("rabbit")) {
|
||||
return properties.getMessaging().getRabbit().getRemoteServiceName();
|
||||
return properties.getRabbit().getRemoteServiceName();
|
||||
}
|
||||
else if (s.startsWith("kafka")) {
|
||||
return properties.getMessaging().getKafka().getRemoteServiceName();
|
||||
return properties.getKafka().getRemoteServiceName();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -64,10 +64,10 @@ public abstract class TracingChannelInterceptorTest implements TestTracingAwareS
|
||||
return null;
|
||||
}
|
||||
if (s.startsWith("amqp") || s.startsWith("rabbit")) {
|
||||
return properties.getMessaging().getRabbit().getRemoteServiceName();
|
||||
return properties.getRabbit().getRemoteServiceName();
|
||||
}
|
||||
else if (s.startsWith("kafka")) {
|
||||
return properties.getMessaging().getKafka().getRemoteServiceName();
|
||||
return properties.getKafka().getRemoteServiceName();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user