【发布时间】:2021-10-23 11:57:09
【问题描述】:
我确实有一个带有以下样本的 Prometheus 时间序列:
a_metric{band="1", state="A"} 1
a_metric{band="2", state="C"} 1
a_metric{band="1", state="A"} 1
a_metric{band="2", state="C"} 1
a_metric{band="1", state="B"} 1
a_metric{band="1", state="B"} 1
...
我想在state timeline 面板中可视化这个时间序列,使bands 成为水平带,states 成为这些带内的离散状态。为此,我必须从标签 state 中提取值(并使用它们而不是值 1)。
这可能吗?能实现这样的可视化吗?
如果我理解正确,Prometheus 的label_values() 不能在此处提供服务,因为它仅限于templating。我怀疑 Grafana 转换可能会起作用,但我还没有这些经验。复杂性也出现了,因为 Prometheus 没有string type metrics。
更新这是@JanGaray 要求的基本图片。
【问题讨论】:
-
我会在问题中添加基本图像,因为我不确定您想要实现什么。
-
state_timeline 的链接向我显示空白页面。对我有用的是grafana.com/docs/grafana/next/visualizations/state-timeline
-
@JanVlcinsky 很奇怪。当我打开帖子时,帖子中的链接会重定向到您的网址。
标签: prometheus grafana