有没有办法从痕迹生命周期中任何地方的起点获取请求的完整跟踪?

发布于 2025-01-17 09:09:19 字数 241 浏览 4 评论 0原文

有没有办法从跟踪生命周期的任何地方获取完整的跟踪请求?

基本上,如果我有跟踪的中间点或终点,我可以使用这些点来获取请求的完整跟踪吗?

我想构建一个跟踪服务(在 Golang 中),只要用户在请求跟踪期间随时提供点/跨度,该服务就可以返回请求的完整跟踪。

我尝试过搜索并查看是否有任何项目提到了向后追踪或类似的内容。

目前,使用 Datadog 等其他跟踪器,在给定任何非开始点的情况下,不可能获取完整请求的跟踪。

Is there a way to get the full trace request given a starting point from anywhere in the lifecycle of the trace?

Basically, if I have a middle point or an end point of a trace, can I use those points to obtain the full trace of a request?

I want to build a tracing service (in Golang) where the service can return the full trace of a request given that a user supplies a point/span at any time during the trace of the request.

I have tried searching and looking to see if any projects have mentioned backwards tracing or something similar to that.

Currently, with other tracers like Datadog, its not possible to get the trace of a full request given any starting point that is not the beginning.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑依然 2025-01-24 09:09:20

在 OpenTelemetry 中,跟踪 ID 是不可变的 并意图相同整个逻辑请求(假设W3C 标头)。跟踪是有向无环图,这意味着可以通过查找具有相同跟踪 ID 的所有跨度,然后按其边(由跨度 ID 和父跨度 ID 字段确定)对它们进行排序来确定排序。这意味着只要您拥有所有可用的跨度,您就可以非常轻松地“回顾” - 您只需查找与您拥有的跨度具有相同跟踪 ID 的所有内容,然后创建图形。

In OpenTelemetry, the Trace ID is immutable and intended to be the same for the entire logical request (assuming W3C Headers). A trace is a directed acyclic graph, which means the ordering can be determined by finding all spans with the same trace ID and then sorting them by their edges (which would be determined by the span ID and parent span ID fields). This means that you can 'look back' very easily as long as you have all of the spans available - you just look for everything with the same trace ID as the span you have, and create the graph.

悟红尘 2025-01-24 09:09:20

这取决于您记录的内容。如果您可以访问完整的原始日志,并且您在每个服务器,客户端和中间件请求的开头都记录了整个上下文,则可以使用类似的

It depends on what you've logged. If you have access to the full raw logs, and you've logged the entire context at the beginning of every server, client, and middleware request, you can perhaps look for all the logs with a similar traceID in their context. Again, based on your instrumentation, you might not HAVE this log.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文