如何自定义 Zipkin 消息发布者?
How to Customize the Zipkin message publisher?
我创建了一个 spring-boot 应用程序,它向 zipkin 消费者发布 zipkin 日志。但是 Zipkin 消费者(另一个 spring 引导应用程序)在一些身份验证过滤器的后面,这些过滤器在允许之前检查请求中的几个 parameters/headers。在这种情况下,如何使用我自己的自定义 HttpClient 发布来自生产者的消息?
您必须实现自己的 ZipkinSpanReporter,它看起来或多或少类似于 https://github.com/spring-cloud/spring-cloud-sleuth/blob/v1.0.8.RELEASE/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/HttpZipkinSpanReporter.java . In the next version of Sleuth you will be able to register a bean of ZipkinSpanReporter that can you a custom version of a publisher - https://github.com/spring-cloud/spring-cloud-sleuth/blob/1.0.x/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/HttpZipkinSpanReporter.java
我创建了一个 spring-boot 应用程序,它向 zipkin 消费者发布 zipkin 日志。但是 Zipkin 消费者(另一个 spring 引导应用程序)在一些身份验证过滤器的后面,这些过滤器在允许之前检查请求中的几个 parameters/headers。在这种情况下,如何使用我自己的自定义 HttpClient 发布来自生产者的消息?
您必须实现自己的 ZipkinSpanReporter,它看起来或多或少类似于 https://github.com/spring-cloud/spring-cloud-sleuth/blob/v1.0.8.RELEASE/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/HttpZipkinSpanReporter.java . In the next version of Sleuth you will be able to register a bean of ZipkinSpanReporter that can you a custom version of a publisher - https://github.com/spring-cloud/spring-cloud-sleuth/blob/1.0.x/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/HttpZipkinSpanReporter.java