spring-cloud-sleuth

Integrating Spring Cloud Sleuth with Spring boot amqp

白昼怎懂夜的黑 提交于 2020-01-03 16:52:08
问题 Looking for an example that shows integrating spring cloud sleuth with spring boot amqp (rabbit) publisher and subscriber. I do see the following messages in the log 2016-10-21 08:35:15.708 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.controllers.MessagingController : Received Request to pulish with Activity OrderShipped 2016-10-21 08:35:15.730 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.service

Zipkin Server giving Whitelabel Error Page

て烟熏妆下的殇ゞ 提交于 2019-12-25 01:16:56
问题 While creating a Zipkin Server with Spring Boot(v2), I am facing Whitelabel Error Page. " Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Oct 30 11:21:35 IST 2019 There was an unexpected error (type=Not Found, status=404). No message available " And also while i run the application in spring boot, i get: " Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration) "

How to log MDC with Spring Sleuth?

拥有回忆 提交于 2019-12-21 19:53:37
问题 I have a Spring boot + sleuth based application. All works as expected. I have for now logs like this: 2017-05-04 17:55:52.226 INFO [alert,692d0eeca479e216,c3c8b680dc29ad02,false] 17292 --- [cTaskExecutor-1] c.k.a.b.s.alert.impl.AlertServiceImpl : Alert state to process: xxx Now, I want to add custom MDC to my log like the contract reference for example. I want to have logs like this: 2017-05-04 17:55:52.226 INFO [alert,692d0eeca479e216,c3c8b680dc29ad02,false] [CONTRACT_REF] 17292 ---

BeanNotOfRequiredTypeException when using spring-statemachine and spring cloud slueth

匆匆过客 提交于 2019-12-13 06:40:19
问题 I am currently developing a microservice using spring-boot.I currently have an issue when using spring-state machine and spring-cloud-sleuth artifacts together. @Validated @RestController @SuppressWarnings({"squid:S00112"}) @RequestMapping() public class StatusController { @Autowired private QuoteService quoteService; @Autowired private StateMachine<StateMachineDefinition.States, StateMachineDefinition.Events> stateMachine; @Autowired private QuoteStateHandler quoteStateHandler; @Value("$

Migrating from RabbitMQ to Kafka and encountering possible issue with Spring Cloud Sleuth

喜欢而已 提交于 2019-12-11 06:47:19
问题 Given the example code, I'm encountering the following exception when I uncomment the spring-cloud-sleuth-stream dependency: org.springframework.messaging.MessageHandlingException: Missing header 'foo' for method parameter type [class java.lang.String] at org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver.handleMissingValue(HeaderMethodArgumentResolver.java:100) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.messaging.handler

Sleuth/Zipkin tracing with @ControllerAdvice

拟墨画扇 提交于 2019-12-11 05:44:47
问题 I recently upgraded my project from Spring Boot 1.4.1, Spring Cloud Sleuth 1.1.0, Spring Cloud Zipkin 1.1.0 to Spring Boot 1.5.3, Spring Cloud Sleuth 1.2.0, Spring Cloud Zipkin 1.2.0. Read that with the latest version of Spring Cloud Sleuth, they had added "error" tags which will get reported to Zipkin automatically in case of any exceptions. I have a @ControllerAdvice class extending ResponseEntityExceptionHandler for custom exception handling. I was able to report errors to the Tracer and

How to implement Sleuth Tracing With Feign.Builder?

筅森魡賤 提交于 2019-12-11 01:48:20
问题 I'm trying to integrate Sleuth into our system. If I use interfaces annotated with @FeignClient , everything works fine. These interfaces get instrumented automatically, and Sleuth headers get propagated with REST calls. But, we have some existing code that uses Feign.Builder directly with Feign annotated interfaces (just not annotated with @FeignClient ). This code adds some custom request interceptors, encoder, proxy, etc. For example: // Feign REST interface public interface MyService {

Spring Cloud Sleuth + log4j2

左心房为你撑大大i 提交于 2019-12-10 03:52:21
问题 Some of my microservices use log4j2 as logger. Spring cloud Sleuth has support for logback. How can I use Sleuth to get distributed tracing in this scenario. I understand to use sleuth with log4j2, I have to implement certain class. I tried this but no luck. Please help 回答1: Please try with the latest 2.0.0.M6 release where we use Brave internally. You can check out the https://github.com/openzipkin/brave/tree/master/context/log4j12 module how to set up the logging mechanism properly. In

How to log MDC with Spring Sleuth 2.0?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 08:40:30
referring to quesition/answer in How to log MDC with Spring Sleuth? I think this has/will change(d) with spring-cloud 2.0 as there is no SpanLogger or Slf4jSpanLogger anymore (or I don't find it) Wouldn't it be nice if application properties spring.sleuth.baggage-keys and spring.sleuth.propagation-keys if set would also be put in MDC I think inside Slf4jCurrentTraceContext (as this class is currently final I cannot subclass it) If not, how could I achieve this with spring-cloud 2.0 accordingly? We don't want to put all entries in MDC (that really doesn't make a lot of sense). You can however

How to log MDC with Spring Sleuth?

淺唱寂寞╮ 提交于 2019-12-04 12:42:49
I have a Spring boot + sleuth based application. All works as expected. I have for now logs like this: 2017-05-04 17:55:52.226 INFO [alert,692d0eeca479e216,c3c8b680dc29ad02,false] 17292 --- [cTaskExecutor-1] c.k.a.b.s.alert.impl.AlertServiceImpl : Alert state to process: xxx Now, I want to add custom MDC to my log like the contract reference for example. I want to have logs like this: 2017-05-04 17:55:52.226 INFO [alert,692d0eeca479e216,c3c8b680dc29ad02,false] [CONTRACT_REF] 17292 --- [cTaskExecutor-1] c.k.a.b.s.alert.impl.AlertServiceImpl : Alert state to process: xxx I tried various things