Lightstep: 子跨度的界面不准确

huangapple go评论180阅读模式
英文:

Lightstep: Inaccurate UI for child span

问题

背景

我有一个Java服务器,它正在向一个Go服务器发起RPC调用。Java RPC客户端和Go RPC服务器都使用了LightStep进行仪表化。关于跟踪的一切看起来都正常,除了在LightStep UI中,Go RPC服务器的跨度(span)的位置。

Java跨度的时间戳是1493929521325,就在请求发送到Go服务器之前。Go RPC服务器有两个时间戳:1493929521326是它接收请求并开始跨度的时间,1493929521336是它响应并完成跨度的时间。

问题

我期望UI上的Go跨度与Java跨度水平对齐,紧挨着它的右侧。但实际上,它距离Java跨度很远。

我能想到的唯一可能原因是Java代码使用的是v0.10.1,而Go代码使用的是v0.9.1,它们之间存在不兼容性。这种可能性存在吗?你对可能的原因有什么想法?

Go代码的示例:

import (
    lightstep "github.com/lightstep/lightstep-tracer-go"
    opentracing "github.com/opentracing/opentracing-go"
)

tracer := lightstep.NewTracer(lightstep.Options{
    AccessToken: ls.AccessToken,
    Collector:   lightstep.Endpoint{ls.Host, ls.Port, true},
    Tags:        map[string]interface{}{lightstep.ComponentNameKey: component},
})

spanContext, err := tracer.Extract(opentracing.TextMap, opentracing.TextMapCarrier(req.GetLightstepData()))
span = tracer.StartSpan(
    endpoint,
    opentracing.ChildOf(spanContext))
}

// 处理请求

span.Finish()

Lightstep: 子跨度的界面不准确

英文:

Background

I have a java server that is making an RPC call to a go server. The java rpc client and go rpc server are instrumented with lightstep. Everything about the trace looks normal except for where in the lightstep UI, the go rpc server span is placed.

The java span has ts 1493929521325 which is right before the request is sent to the go server. The go rpc server has 2 timestamps: 1493929521326 is when it received the request and started the span, 1493929521336 is after it responded and finished the span.

Problem

I would expect the UI to have the go span horizontally to the immediate right of the java span. Instead, it is far to the right.

The only possible cause I can think of is an incompatibility between v0.10.1 which java code is using and v0.9.1 which go is using. Is this a possibility? Do you have any thoughts on a possible cause?

The go code is essentially:

import (
    lightstep "github.com/lightstep/lightstep-tracer-go"
    opentracing "github.com/opentracing/opentracing-go"
)

tracer := lightstep.NewTracer(lightstep.Options{
    AccessToken: ls.AccessToken,
    Collector:   lightstep.Endpoint{ls.Host, ls.Port, true},
    Tags:        map[string]interface{}{lightstep.ComponentNameKey: component},
})

spanContext, err := tracer.Extract(opentracing.TextMap, opentracing.TextMapCarrier(req.GetLightstepData()))
span = tracer.StartSpan(
    endpoint,
    opentracing.ChildOf(spanContext))
}

// handle the request

span.Finish()

Lightstep: 子跨度的界面不准确

答案1

得分: 1

抱歉,你在将Java和Go协同工作方面遇到了问题。我怀疑这是由于Java启用了时间校正,而Go没有使用导致的。

你可以在Java中使用withClockSkewCorrection(boolean clockCorrection)选项来禁用时间校正,当将选项传递给LightStep跟踪器时关闭clockCorrection。

这是更新后的README和一个链接到选项代码

如果你通过LightStep中的[支持]按钮与我们联系,我们应该能够帮助你解决问题。请给我们发送一条消息,以便我们确认问题是否已解决。

我们将更加仔细地监控SO,以便更早地发现这些问题。

谢谢,祝你愉快的跟踪!

Will

英文:

[Disclaimer: I work at LightStep]

Sorry you're having trouble getting Java and Go to play well together. I suspect this is caused by time-correction being enabled in Java but not being used in Go.

You can disable time correction in Java using the withClockSkewCorrection(boolean clockCorrection)
option to turn off clockCorrection when passing in options to the LightStep tracer

Here is the updated README and a link to the option code

If you contact us via the [Support] button in LightStep, we should be able to get you sorted out. Please send us a note so that we can confirm that this is solved for you.

We'll start monitoring SO more carefully so that we catch these things earlier.

Thanks and happy tracing!

Will

huangapple
  • 本文由 发表于 2017年5月5日 12:05:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/43796314.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定