Grafana 系列文章(七):Grafana Explore 中的 Tracing

grafana,系列,文章,explore,tracing · 浏览次数 : 177

小编点评

**Trace Integration in ExploreExplore** ExploreExplore 支持将 tracing 数据源的痕迹可视化。这在 Grafana v7.0+ 中可用。支持的数据源包括 JaegerTempoX-RayZipkin。 **配置** 1. 打开数据源的 ExploreExplore 页面。 2. 在查询框中输入搜索文本。 3. 选择数据源。 4. 在配置中设置查询。 5. 点击文档图标,从数据源中获取配置信息。 **视图** * **Minimap:**显示浓缩的视图或跟踪时间线。 * **Timeline(时间线):**显示 trace 中的 span 列表。 * **Span 细节:**展开子 span 按钮,显示详细信息。 * **Service graph:**根据数据源显示 trace 的节点。 * **Node graph:**可视化 trace 的子节点。 **元数据** * **span 持续时间:**显示操作持续时间的可视化。 * **日志:**显示跨度的日志信息。

正文

👉️URL: https://grafana.com/docs/grafana/latest/explore/trace-integration/

📝Description:

Tracing in Explore

Explore 允许你将 tracing 数据源的痕迹可视化。这在 Grafana v7.0+中可用。

支持的数据源有。

关于如何为上述数据源配置查询的信息,请参考特定数据源的文档。

trace 视图的截图

trace 视图 header 的截图

  • 标题。显示根 span 的名称和 trace ID。
  • 搜索。突出包含搜索文本的 span。
  • 元数据。关于追踪的各种元数据。
Minimap

trace view minimap 截图

显示浓缩的视图或跟踪时间线。在最小地图上拖动你的鼠标可以放大到更小的时间范围。缩放也将更新主时间线,所以很容易看到较短的时间跨度。当放大时,将鼠标悬停在最小地图上,将显示重置选择按钮,以重置缩放。

Timeline(时间线)

Screenshot of the trace view timeline

显示 trace 中的 span 列表。每个 span 行由这些组件组成。

  • 展开子 span 按钮。展开或折叠选定 span 的所有子 span。
  • 服务名称:记录该 span 的服务的名称。
  • 操作名称:该 span 所代表的操作的名称。
  • span 持续时间栏。trace 中操作持续时间的可视化表示。

在 span 行的任何地方点击,显示跨度的细节。

Span 细节

Screenshot of the trace view span details

  • 操作名称
  • span 元数据
  • Tags。与此 span 相关的任何标签。
  • 进程元数据。关于记录此跨度的进程的元数据。
  • 日志。此 span 所记录的日志列表和相关的键值。如果是 Zipkin 日志,则显示 Zipkin 的注释。
Node graph

你可以选择为所显示的 trace 展开节点图 (node graph)。根据数据源的不同,这可以将 trace 的 span 显示为图中的节点,或者显示一些额外的上下文,如基于当前 trace 的 service graph。

Node graph

Trace to logs

Note: 在 Grafana 7.4 及更高版本中可用。

你可以从 trace 视图中的 span 直接导航到与该 span 相关的日志。目前,这对 Tempo、Jaeger 和 Zipkin 数据源是可用的。关于如何配置这个功能,请参考他们的相关文档。

Screenshot of the trace view in Explore with icon next to the spans

点击文档图标,在 Explore 中用配置的数据源打开一个分割视图,并查询 span 的相关日志。

Data API

这个可视化需要从数据源返回一个特定的数据结构,以便正确显示它。

数据源需要返回数据框架并设置frame.meta.preferredVisualisationType = 'trace'。.

Data frame structure(数据框架结构)

必备字段:

字段名 类型 描述
traceID string 整个 trace 的标识符。数据框中应该只有一个跟踪。
spanID string 当前 span 的标识符。SpanIDs 应该在每个 trace 中是唯一的。
parentSpanID string 父 span 的 SpanID,用于在 trace 视图中创建子 span 关系。对于没有父级的根 span,可以是 undefined
serviceName string 这个 span 的服务名称。
serviceTags TraceKeyValuePair[] 与该服务有关的标签列表。
startTime number span 的开始时间,以毫秒为单位的纪元时间 (epoch time)。
duration number span 的持续时间,以毫秒计。

可选字段

字段名 类型 描述
logs TraceLog[] 与当前 span 相关的日志列表。
tags TraceKeyValuePair[] 与当前 span 相关的标签列表。
warnings string[] 与当前 span 相关的警告列表。
stackTraces string[] 与当前 span 相关的堆栈 trace 的列表。
errorIconColor string 如果 span 被标记为error: true,错误图标的颜色。

有关类型的详细信息,请参阅 TraceSpanRowTraceKeyValuePairTraceLog

Grafana 系列文章

Grafana 系列文章

三人行, 必有我师; 知识共享, 天下为公. 本文由东风微鸣技术博客 EWhisper.cn 编写.

与Grafana 系列文章(七):Grafana Explore 中的 Tracing相似的内容:

Grafana 系列文章(七):Grafana Explore 中的 Tracing

👉️URL: https://grafana.com/docs/grafana/latest/explore/trace-integration/ 📝Description: Tracing in Explore Explore 允许你将 tracing 数据源的痕迹可视化。这在 Grafana

Grafana 系列文章(一):基于 Grafana 的全栈可观察性 Demo

📚️Reference: https://github.com/grafana/intro-to-mlt 这是关于 Grafana 中可观察性的三个支柱的一系列演讲的配套资源库。 它以一个自我封闭的 Docker 沙盒的形式出现,包括在本地机器上运行和实验所提供的服务所需的所有组件。 Grafan

Grafana 系列文章(二):使用 Grafana Agent 和 Grafana Tempo 进行 Tracing

👉️URL: https://grafana.com/blog/2020/11/17/tracing-with-the-grafana-cloud-agent-and-grafana-tempo/ ✍Author: Robert Fratto • 17 Nov 2020 📝Description

Grafana 系列文章(三):Tempo-使用 HTTP 推送 Spans

👉️URL: https://grafana.com/docs/tempo/latest/api_docs/pushing-spans-with-http/ 📝Description: 有时,使用追踪系统是令人生畏的,因为它似乎需要复杂的应用程序仪器或 span 摄取管道,以便 ... 有时,使

Grafana 系列文章(四):Grafana Explore

👉️URL: https://grafana.com/docs/grafana/latest/explore/ 📝Description: Explore Grafana 的仪表盘 UI 是关于构建可视化的仪表盘。Explore 剥离了仪表盘和面板选项,这样你就可以。.. Grafana 的仪表

Grafana 系列文章(五):Grafana Explore 查询管理

👉️URL: https://grafana.com/docs/grafana/latest/explore/query-management/ 📝Description: Explore 中的查询管理 为了帮助调试查询,Explore 允许你调查查询请求和响应,以及查询统计数据,... Exp

Grafana 系列文章(六):Grafana Explore 中的日志

👉️URL: https://grafana.com/docs/grafana/latest/explore/logs-integration/#labels-and-detected-fields 📝Description: Explore 中的日志 除了指标之外,Explore 还允许你在以

Grafana 系列文章(八):Grafana Explore 中的 Inspector

👉️URL: https://grafana.com/docs/grafana/latest/explore/explore-inspector/ 📝Description: Explore 中的检查器 (Inspector). 检查器可以帮助你理解你的查询并排除故障。你可以检查原始数据,把这些

Grafana 系列文章(九):开源云原生日志解决方案 Loki 简介

简介 Grafana Labs 简介 Grafana 是用于时序数据的事实上的仪表盘解决方案。它支持近百个数据源。 Grafana Labs 想从一个仪表盘解决方案转变成一个可观察性 (observability) 平台,成为你需要对系统进行调试时的首选之地。 完整的可观察性 可观察性。关于这意味着

Grafana 系列文章(十):为什么应该使用 Loki

👉️URL: https://grafana.com/blog/2020/09/09/all-the-non-technical-advantages-of-loki-reduce-costs-streamline-operations-build-better-teams/ 📝Descript