标签: zipkin

Istio分布式跟踪仅显示1个跨度

我正在按照这个指南,使用Zipkin.我有3个微服务A -> B -> C,我将标头从A传播到B,从B传播到C.但在Zipkin仪表板中,我只看到条目,A -> BB -> C不是A -> B -> C.

这些是标题:

[
    "x-request-id",
    "x-b3-traceid",
    "x-b3-spanid",
    "x-b3-parentspanid",
    "x-b3-sampled",
    "x-b3-flags",
    "x-ot-span-context"
]
Run Code Online (Sandbox Code Playgroud)

我可以看到在B中x-b3-parentspanid是空的,我猜这是错的,但另一个正在工作我想......怎么可能?

编辑:添加代码片段以显示标头传播

A -> B 传播:

app.post("/job", (req, res) => postJob(req.body, req.headers).then((response) => res.send(response)))
Run Code Online (Sandbox Code Playgroud)

...

const postJob = (job, headers) => rp({
    method: "POST",
    uri: `${API_ENDPOINT}/api/job`,
    json: true,
    body: job,
    headers: Object.keys(headers).filter((key) => TRACING_HEADERS.includes(key)).map((key) => headers[key])
})
Run Code Online (Sandbox Code Playgroud)

B -> C 传播:

@PostMapping("/api/job")
@ResponseBody
fun publish( …
Run Code Online (Sandbox Code Playgroud)

zipkin kubernetes istio

11
推荐指数
1
解决办法
441
查看次数

Zipkin Client不会在Hawkular APM中收到日志

我有一个带有Zipkin库的客户端应用程序,其中包含spring application.properties中的配置.

camel.zipkin.host-name=hawkular-apm-server.com
camel.zipkin.port=443
camel.zipkin.include-message-body-streams=true
Run Code Online (Sandbox Code Playgroud)

Maven依赖

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-zipkin-starter</artifactId>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

可以从本地计算机访问hawkular apm服务器控制台.

但是,当调用客户端应用程序中暴露的其余api时,会记录zipkin跟踪,但不会在hawkular apm服务器上收集它们.

04:31:55.632 [http-nio-0.0.0.0-8080-exec-1] INFO  o.a.c.c.s.CamelHttpTransportServlet - Initialized CamelHttpTransportServlet[name=CamelServlet, contextPath=]
04:31:55.668 [http-nio-0.0.0.0-8080-exec-1] DEBUG org.apache.camel.zipkin.ZipkinTracer - clientRequest [service=MyCamelClient, traceId=-5541987202080201726, spanId=-5541987202080201726]
04:31:55.672 [http-nio-0.0.0.0-8080-exec-1] DEBUG org.apache.camel.zipkin.ZipkinTracer - serverRequest [service=MyCamel, traceId=-5541987202080201726, spanId=-5541987202080201726]
04:31:55.676 [http-nio-0.0.0.0-8080-exec-1] DEBUG org.apache.camel.zipkin.ZipkinTracer - serverResponse[service=MyCamel, traceId=-5541987202080201726, spanId=-5541987202080201726]
04:31:55.677 [http-nio-0.0.0.0-8080-exec-1] DEBUG org.apache.camel.zipkin.ZipkinTracer - clientResponse[service=MyCamelClient, traceId=-5541987202080201726, spanId=-5541987202080201726]
04:31:55.758 [pool-1-thread-1] WARN  o.a.t.transport.TIOStreamTransport - Error closing output stream.
java.net.SocketException: Socket closed
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
    at org.apache.thrift.transport.TIOStreamTransport.close(TIOStreamTransport.java:110) …
Run Code Online (Sandbox Code Playgroud)

apache-camel openshift zipkin hawkular distributed-tracing

10
推荐指数
0
解决办法
160
查看次数

JMS 消息侦听器调用失败,原因:标识符包含无效的 JMS 标识符字符“-”:“x-request-id”

我第一次使用 JMS 和队列(Azure 队列)。我需要创建一个队列,Rubi 服务器将在其中写入一些数据,Java 将从队列中读取它并进行进一步的执行。这个过程在我的机器上本地运行良好。我创建了一个 REST 端点,它在队列中写入数据,一旦数据写入队列,侦听器将接管并读取数据并执行。当我们将它部署到 Azure 时,我在日志中看到的错误是不让队列启动

Setup of JMS message listener invoker failed for destination 'queue' - trying to recover. Cause: Identifier contains invalid JMS identifier character '-': 'x-request-id' 
Run Code Online (Sandbox Code Playgroud)

Zipkin 也作为分布式跟踪系统出现在 Azure 服务器上,我猜这x-request-id与产生问题的 Zipkin 有关。我在谷歌上搜索过这个问题,但不明白为什么会发生。

以下是详细的错误信息:

[36mc.m.s.l.NextGenRequestLoggingFilter     [0;39m [2m:[0;39m 
Before request [uri=/services/deal-service/api/v2/deals/ack;headers= 
[x-request-id:"2d8d86d7-4fbf-9db6-8e95-28813f21a85c", 
x-envoy-internal:"true", x-b3-parentspanid:"a209cdc649b0b890", content- 
length:"575", x-forwarded-proto:"http", postman-token:"ad074595- 
76a5-474b-9711-7e071b12b3b0", x-b3-sampled:"1", x-forwarded- 
for:"10.244.2.1", accept:"*/*", 
authorization: "some-token-YJc4tg--34jPRziJNSACqNQ", x-b3- 
traceid:"6b40ff22781be67ba209cdc649b0b890", x-b3- 
spanid:"702684ddb62cfe6b", 
host:"portal-gateway.52.228.65.225.nip.io", 
cache-control:"no-cache", accept-encoding:"gzip, deflate, br", 
user-agent:"PostmanRuntime/7.22.0", 
Content-Type:"application/xml;charset=UTF-8"]]
2020-02-18T15:19:34.197666458Z [2m2020-02-18 15:19:34.197[0;39m  . 
[32mDEBUG 
[,6b40ff22781be67ba209cdc649b0b890,702684ddb62cfe6b,true][0;39m  . …
Run Code Online (Sandbox Code Playgroud)

java jms azure azure-queues zipkin

9
推荐指数
1
解决办法
601
查看次数

当 spring-cloud-starter-zipkin 使用 zipkin.brave 时,为什么需要 Spring sleuth ?

只需添加 spring-cloud-starter-zipkin 也能够生成 spanId 和 TraceId 那么 Sleuth 需要什么?spring-cloud-starter-zipkin 实际上是自己拉 io.zipkin.brave 而不是 Sleuth。

zipkin spring-boot spring-cloud spring-cloud-sleuth

8
推荐指数
1
解决办法
4635
查看次数

zipkin示例不在Github上

有人知道拉链样品的位置吗?
https://twitter.github.io/zipkin/Quickstart.html#super-quickstart
在下面我可以阅读:

 ./bin/sbt "zipkin-example/run -zipkin.storage.anormdb.install=true -genSampleTraces=true"
Run Code Online (Sandbox Code Playgroud)

我只在Maven Central上找到了zipking-example.不在Github上. 1.2.1-rc24
这仍然是文档中的错误?
文档提到了zipkin-example,它不存在

zipkin

7
推荐指数
1
解决办法
759
查看次数

为什么brave.Tracer没有自动装配?

我们有很多服务使用 Spring Boot 2.0.x 并且io.zipkin.brave.Tracer已经使用并且运行正常。Tracer 用于用 @Component 注解的类中,并且它有一个以 Tracer 作为参数的构造函数。这是一个示例片段:

@Component
public class CrmMessagePublisher {

    private static final Logger LOGGER = LoggerFactory.getLogger(CrmMessagePublisher.class);

    private static final String EVENT_NAME_HEADER = "service.eventName";

    private static final String EXCHANGE_EVENT = "service.event";

    private static String applicationName;

    private RabbitTemplate rabbitTemplate;

    @Autowired
    private Tracer tracer;

    @Autowired
    public CrmMessagePublisher(
            RabbitTemplate rabbitTemplate,
            @Value("${spring.application.name}") final String applicationName,
            Tracer tracer
    ) {
        this.rabbitTemplate = rabbitTemplate;
        CrmMessagePublisher.applicationName = applicationName;
        this.tracer = tracer;
    }
...
Run Code Online (Sandbox Code Playgroud)

现在我想写一个junit测试但我总是得到

Test ignored.

java.lang.IllegalStateException: Failed to load …
Run Code Online (Sandbox Code Playgroud)

zipkin spring-boot brave

7
推荐指数
1
解决办法
1万
查看次数

Node.js中的Spring Cloud Sleuth等自动检测

虽然Zipkin sdk可用于Node.js,但我正在寻找像Node.js应用程序中的Spring Cloud Sleuth这样的自动检测.Node.js中是否有模块或框架?

上面的自动检测我的意思是,在Java中,我不必使用Zipkin来编写servlet/filters/rest客户端的代码.侦探自动做到这一点.虽然Zipkin检测在Node.js中似乎是手动的.

node.js zipkin

6
推荐指数
1
解决办法
506
查看次数

istio 如何将跟踪范围发送到 jaeger?

我想将 istio 与 K8S 中现有的 jaeger 跟踪系统一起使用,我开始按照cassandra 作为后端存储的官方链接安装 jaeger 系统。然后通过helm way安装 istio ,但只启用了一些选定的组件:

helm upgrade istio -i install/kubernetes/helm/istio --namespace istio-system \   
--set security.enabled=true \   
--set ingress.enabled=false \   
--set gateways.istio-ingressgateway.enabled=true \   
--set gateways.istio-egressgateway.enabled=false \   
--set galley.enabled=false \   
--set sidecarInjectorWebhook.enabled=true \  
--set mixer.enabled=false \   
--set prometheus.enabled=false \
--set global.proxy.envoyStatsd.enabled=false \
--set pilot.sidecar=true \ 
--set tracing.enabled=false
Run Code Online (Sandbox Code Playgroud)

Jaeger 和 istio 安装在同一个 namespace istio-sytem,完成后,里面的所有 pods 长这样:

kubectl -n istio-system get pods                           
NAME            READY     STATUS    RESTARTS   AGE 
istio-citadel-5c9544c886-gr4db      1/1       Running   0 …
Run Code Online (Sandbox Code Playgroud)

zipkin kubernetes istio jaeger envoyproxy

6
推荐指数
1
解决办法
2817
查看次数

Zipkin 与 Spring Boot 2.2 和 Hoxton Cloud

我想将我的项目 Zipkin 设置更新为 Spring Boot 2.2.2.RELEASE 和 Spring Cloud Hoxton.RELEASE,但看起来简单的 jars 更新是不够的。

我认为旧的设置(它对 Spring Boot 2.1.5.RELEASE 和 Greenwich.SR2 工作正常)也适用于 Boot 2.2.2.RELEASE 和 Hoxton.RELEASE,但似乎我仍然错过了一些东西。

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        ...
        <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<!--        <zipkin.version>2.12.9</zipkin.version> does not work either-->
        <zipkin.version>2.11.8</zipkin.version>
        ...  
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-server</artifactId>
            <version>${zipkin.version}</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <version>${zipkin.version}</version>
            <scope>runtime</scope>
        </dependency>
        ...
    </dependencies>

Run Code Online (Sandbox Code Playgroud)

我收到以下异常(java.lang.NoClassDefFoundError: zipkin2 /internal/Buffer$Writer):

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name …
Run Code Online (Sandbox Code Playgroud)

zipkin spring-boot spring-cloud

6
推荐指数
1
解决办法
775
查看次数

Zipkin 和 Elastic Stack(ELK) 之间的区别?

Spring Cloud Sleuth 用于创建traceId(跨服务请求时唯一)和spanId(对于一个工作单元来说是相同的)。我的想法是使用 Zipkin 服务器来跨服务获取这些日志的集体可视化。但我知道并且已经使用过 ELK 堆栈,它必然具有相同的功能。我的意思是我们可以使用 ELK 堆栈将具有相同 traceId 的请求分组以进行可视化。但我确实看到人们尝试使用 Sleuth、ELK 以及 Zipkin 来实现分布式跟踪,如这些示例(Link1Link2)中所示。但是如果已经有 ELK 来进行日志收集和可视化,为什么我们还需要 Zipkin呢?我哪里失踪了?

zipkin microservices elastic-stack spring-cloud-sleuth distributed-tracing

6
推荐指数
1
解决办法
5317
查看次数