问题标签 [spring-cloud-sleuth]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
790 浏览

spring-security-oauth2 - 如何使用 spring-cloud-sleuth 来跟踪 spring-security-oauth 活动?

我正在尝试使用 spring-cloud-sleuth 来跟踪由 spring-security-oauth 发起的 https 请求。

但我坚持认为 spring-security-oauth 过滤器 OAuth2AuthenticationProcessingFilter 在 spring-cloud-sleuth 过滤器 TraceFilter 之前执行。

可以更改此设置,以便在 spring-security-oauth 过滤器之前处理 spring-cloud-sleuth 过滤器吗?

版本信息:

  • 弹簧启动:1.3.5
  • 弹簧云:Brixton.SR3
  • 春天云侦探:1.0.3
  • spring-security-oauth2:2.0.9

更新: 根据下面的建议,我可以通过将自己的 FilterRegistrationBean 定义为:

0 投票
4 回答
2348 浏览

spring-cloud-sleuth - Apache Camel 的 Spring Sleuth 集成

Apache Camel 在野外有任何 Sleuth 集成吗?(不仅支持相关 ID,还支持 Span 内容)

0 投票
1 回答
2076 浏览

java - spring cloud sleuth中每个新的http请求都有不同的traceId

最近开始用spring cloud sleuth跟踪应用中的请求,写了样例项目来测试这个特性,但是应用运行时,日志显示每一个新的http请求都有不同的trace id。

这是可能的代码:Config.java

控制器.java

这是日志:

0 投票
0 回答
126 浏览

spring-boot - Spring Cloud Sleuth 的跟踪 ID 中的前导“0”在某些跨度中被截断

我正在使用 spring-cloud-starter-sleuth 的 1.1.2.RELEASE 版本以及 Spring Boot 1.4.2.RELEASE 和 spring-cloud-dependencies CAMDEN-SR3。我发现有时当生成的跟踪 ID 有一个前导 0(例如“096ad8c3ed8d4a20”)时,一些后续跨度会记录一个没有前导零的跟踪 ID(在本例中为“96ad8c3ed8d4a20”)。

这是一个已知的错误?它并不总是可复制的,但我绝对可以断断续续地检测到这一点。而且也不是很一致。例如,我的一个 REST API 调用一共生成了 6 个跨度,而这个问题只发生在其中一个跨度上。

0 投票
1 回答
329 浏览

spring-integration - MessageDeliveryException thrown when using AMQP backed channel with Brixton.SR7 and Camden

I am using an AMQP backed channel with Spring Boot 1.4.4.RELEASE and spring-cloud-dependencies. Up to Brixton.SR6, everything is working fine. The only thing I change in my project is Brixton.SR6 to Brixton.SR7 (note that I tried all Camden versions as well and I experienced the same issue) and I start getting:

My payload is a serializable object and with debug on (in both cases, ie Brixton.SR6 and Brixton.SR7, I can see:

Has anyone experienced a similar issue and found a way to upgrade to Brixton.SR7 or Camden.

The message I am trying to send to Action.FieldBackup can be seen below:

And just before the exception ListenerExecutionFailedException is thrown I can see: o.s.messaging.MessageHeaders : Ignoring non-serializable message headers: [currentSpan, X-Current-Span]

My xml configuration is below:

0 投票
0 回答
598 浏览

spring-boot - Spring Cloud 侦探打破 DelegatingSecurityContextExecutor

我有一个 Spring Boot 应用程序版本 1.3.3.RELEASE,并且我添加了 Spring Cloud Sleuth 来获取那些跟踪好东西。添加 spring-cloud-sleuth 后,我看到我的一些异步 API 正在中断,因为传入的org.springframework.security.concurrent.DelegatingSecurityContextExecutor.是 null。简短的故事,我使用org.springframework.security.concurrent.DelegatingSecurityContextExecutorspring security 来传递不同执行者的安全上下文。为此,我只是org.springframework.security.concurrent.DelegatingSecurityContextExecutor在应用程序启动期间将这些执行程序包装到实例中。我不确定为什么 Spring Sleuth 在这里成为一个问题。我们使用异步处理的方式是,我们创建了一个自定义注释,然后围绕它创建了一个切入点来注入异步行为。

例子:

}

我正在使用 spring boot 1.3.3.RELEASE,请放心,spring-security 4.0.3.RELEASE,spring-cloud-sleuth 1.0.12.RELEASE

0 投票
2 回答
1018 浏览

spring - 无法使用 spring-cloud-sleuth 跟踪 spring-cloud-stream 侦听器

我有 2 个非常简单的 spring-cloud-stream 应用程序。消息生产者 Service3 通过 binder-kafka 向消费者 Service4 发送消息。

我使用 spring-cloud-sleuth 来追踪它们之间的跨度。但是 zipkin 服务器中只有 Service3 中的 span 可用。Service4 没有跨度显示。

  1. 服务3

    /li>
  2. 服务4

    /li>

未跟踪 Servic4(消息使用者)

我错过了什么?

0 投票
2 回答
9515 浏览

spring-boot - 添加 sleuth 和 zipkin 时应用程序无法启动

我有一个要更新到 1.5.1 的 Spring Boot 应用程序。效果很好,直到我将 Sleuth 和 Zipkin 添加到类路径

当这些线出现时,我得到

这是我的部门。管理

我尝试更改为 Dalston

但错误变得更加陌生

我错过了什么我还没有注意到的东西吗?

0 投票
1 回答
1304 浏览

java - 与 restTemplate 的集成测试侦探

我有一个运行代码,带有 spring boot 和 spring cloud,使用 sleuth 来记录 TraceId。但是我在 integrationTest 中从另一个控制器调用一个控制器时遇到问题

第一次在测试中运行,我注意到 url 上的端口在测试中采用了正确的值,但是它在控制器上的值为零。硬编码端口并没有解决问题。

0 投票
1 回答
3543 浏览

spring-boot - 将 Spring Boot Profile 添加到 Sleuth/Zipkin 日志

我正在使用这些依赖项:

是否有可能将当前活动配置文件添加到每个日志行?这样就可以根据 Splunk/ELK/... 中的配置文件过滤日志

所以而不是

它应该记录

编辑: 根据 Marcin 的回答,我将其实现如下:

应用程序.yml

ProfileLogger.java

日志配置.java

这将打印如下日志:

这已经很好了,但还不是我想要的。我想从头开始添加配置文件->即使“启动的应用程序”也应该包含配置文件-如果可能的话。其次,我想在profiles两者之间移动INFO在and22481移动。

在实现过程中又出现了一个问题:在链接的实现中有这样的声明:

这是否意味着您仅在日志级别设置为 TRACE 时才发送跟踪信息?如果是这样,我如何使用这种方法改进对标准输出的日志记录(给定日志级别的调试/信息/警告)?我认为日志模式在导入依赖项时被 Sleuth/Zipkin 覆盖,因此,本地日志记录看起来与跟踪相同。最终,我有兴趣在本地标准输出和 Zipkin 中显示配置文件。

编辑 2:在 Marcin 的帮助下,我通过引入resources/logback-spring.xml包含以下行的文件来更改模式:

请注意,您必须添加一个bootstrap.yml文件才能正确显示应用程序名称。如果没有bootstrap.yml文件,上面的日志模式只会打印“bootstrap”作为应用程序名称。

刚刚bootstrap.yml包含

就我而言。其他一切都在 application-[profile].yml 中配置

现在一切都按预期工作: