- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我希望我的服务使用者将 TraceId 作为 header 参数传递,名称为 X-B3-TraceId 和有效的 128 位十六进制字符串,该字符串将在进一步的路径中传播,并且服务实际上会将相同的 Sleuth Trace Id 返回给调用者。我已经使用 Spring Cloud Sleuth 添加了自定义过滤器和跨度提取器,以便放入服务响应中。
当应用程序部署在嵌入式 tomcat 中时,整个设置在我的本地运行良好,但是当相同的应用程序部署在 Bluemix 中时,响应不具有在请求中传递的相同 Sleuth Trace Id。
在 IBM Bluemix Cloud Foundry 中使用 Sleuth 时是否存在任何已知的此类缺陷和解决方法?
如果是,请您告知如何进行。
我在以下位置创建了演示项目:https://github.com/imram/sleuthHeaderIssue
Please Run the Micro Service locally.
URL: localhost:9090/hello?name=Ram
Header:
X-B3-TraceId:d61436368bae3c12ce5f844337f3ee52
Service will return:
HELLORam
Header:
Content-Length →8
Content-Type →text/plain;charset=UTF-8
Date →Thu, 11 Jan 2018 01:38:48 GMT
X-Application-Context →application:9090
X-B3-TraceId →d61436368bae3c12ce5f844337f3ee52
Note Trace Id is same in RQ and RS.
Deploy Same Service in IBM Bluemix:
URL: https://sleuth-header-demo.mybluemix.net/hello?name=Ram .
Header
X-B3-TraceId:d61436368bae3c12ce5f844337f3ee52
Response:
HELLORam
Header:
Connection →Keep-Alive
Content-Type →text/plain;charset=UTF-8
Date →Thu, 11 Jan 2018 01:38:30 GMT
Transfer-Encoding →chunked
X-Application-Context →sleuth-header-demo:bluemix:0
X-B3-Traceid →b896d05d9f0ae105
X-Backside-Transport →OK OK
X-Global-Transaction-ID →2714561407
See the Trace Id(X-B3-Traceid) got ignore what was present in
Request and got Regenerated as b896d05d9f0ae105
最佳答案
需要满足以下2个条件:
@GetMapping("/async")
public String helloSleuthAsync() throws InterruptedException {
return "success, traceId:" + MDC.get("X-B3-TraceId");
}
例如
条件2匹配:
curl --location --request GET 'http://localhost:8080/async' \
--header 'X-B3-TraceId: d61436368bae3c12' \
--header 'X-B3-SpanId: ce5f844337f3ee88'
response: success, traceId:d61436368bae3c12
条件2不匹配:
curl --location --request GET 'http://localhost:8080/async' \
--header 'X-B3-TraceId: marius' \
--header 'X-B3-SpanId: marius'
response:success, traceId:4faae9c09822cf72
关于java - 即使在 Bluemix 中作为 header 传递到服务请求,Sleuth header X-B3-TraceId 值也会重新生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48198849/
Spring 的 sleuth 添加到 MDC X-B3-SpanId 和 SpanId。 (TraceId 相同) {X-B3-SpanId=0000000000000001, X-B3-Trace
我们有一个遵循微服务架构的分布式应用程序。在我们的一项微服务中,我们遵循生产者-消费者模式。 生产者接收请求,将其保存到数据库,将请求推送到 BlockingQueue 并将响应发送回客户端。在单独线
我一直在尝试将跟踪 ID 添加到我的微服务日志中。我试过使用 sleuth 和 spring cloud,它正在工作。但我不想加载 spring cloud 只是为了将 trace id 添加到我的日
我尝试在我的微服务中添加分布式跟踪(在 Azure 中的 Kubernetes 下)。 我在父 pom.xml 中添加了依赖项: org.springframework.boot s
我正在使用 zipkin-go-opentracing , 这是 opentracing 的实现用于 zipkin 的 API。 出于(原因)我需要从跨度中获取 traceId。所以问题是:给定一个
我知道我们要使用上下文传播来获取创建为彼此子项的父 traceid 和跨度,但我的发布者使用的是 header (nats 而不是 http) 我的消息代理使用 header ,我在出站请求中将 tr
我正在使用 Sleuth,我想知道是否可以获取当前的 traceId? 我不需要添加任何回复或任何东西。我只想要在某些情况下提醒开发团队的电子邮件的 traceId。 最佳答案 前任 import b
我正在使用 grpc-java 并有 3 个服务,A、B 和 C。我调用服务 A,然后服务 A 调用 B 和 C。我在对 B 和 C 的调用中使用 Hystrix。C 依次产生另一个调用另一个服务的线
我已经开始学习 Sleuth,但我陷入了日志配置。 我有这个配置:
所以我正在使用 Jaeger 和 OpenTracing 来跟踪我的 Spring Boot 微服务之间的请求。我已经设置了所有必要的配置并添加了依赖项: io.opentracing.co
我正在维护几个用 ASP.NET 4.8(完整框架)和 ASP.NET Core 编写的应用程序。 .NET Core 实现 https://www.w3.org/TR/trace-context/这
我有一些 Spring 服务可以提交一些 AWS 批处理作业。这是一个简单的 spring 批处理作业,它调用外部服务的请求。我想通过将“org.springframework.cloud:sprin
有什么方法可以将具有不同跟踪 ID 的多个跟踪连接到单个跟踪中吗?就我而言,我有类似以下内容的内容,我想将其连接到单个跟踪中。 |--- UI Trace ----------------------
我需要生成带有跟踪 ID 的日志。目前我们正在使用winston 进行日志记录 我使用 winston 容器如下 var fs = require('fs'); var os = require('o
使用 MassTransit.RabbitMQ v5.3.2 和 OpenTracing.Contrib.NetCore v0.5.0。 我可以使用 MassTransit 向 RabbitMQ 发布
我正在研究多个微服务架构,其中入口点来自 Kafka。例如,假设我们有三个微服务micro1、micro2和micro3,micro1中的请求来自kafka消息队列,并通过Rest客户端进一步与mic
我想跟踪到达我的网络服务并发送 sns 通知的请求,该通知将触发 aws lambda 函数。在我的 lambda 函数中创建具有相同跟踪 ID 的新跨度的任何方法。 最佳答案 最好的方法是使用像 S
我需要将具有现有 ID 的 traceId(我们已经从主要来源应用程序创建了某种关联 ID)设置到 brave tracer 中。 我不想使用 Spring Sleuth/brave 创建的一个,因为
我有一个现有的 Spring boot (2.2.0) 应用程序,并尝试集成 Spring cloud sleuth 以获取自动跟踪和跨度 ID。 logback文件如下-
我希望我的服务使用者将 TraceId 作为 header 参数传递,名称为 X-B3-TraceId 和有效的 128 位十六进制字符串,该字符串将在进一步的路径中传播,并且服务实际上会将相同的 S
我是一名优秀的程序员,十分优秀!