Grafana分2系列

问题描述 投票:2回答:2

我试图将2系列分开以获得他们的比例。例如,我有网站(a.com,b.com,c.com)为*(所有网站)每个网站都有总计部分计数和错误发生统计数据。我想显示为条形错误/部分,每个网站的部分>错误,每个网站的错误。在这里,我想要3个酒吧。 所以: 解析器。*。sections.total B解析器。*。errors.total

X轴模式:系列 显示:DrawMode:Bars

当我尝试使用divideSeries时,我总是得到VallueError(divideSeries第二个参数必须正好引用1个系列)

graphite grafana divide
2个回答
0
投票

您可以使用带有divideSeries的mapSeries来对Graphite中的系列进行矢量匹配(或者可能是asPercent,具体取决于您使用的石墨版本)。

一个示例查询:

aliasByNode(reduceSeries(mapSeries(groupByNodes(parser.*.{sections,errors}.total, 'maxSeries', 1, 2), 0), 'asPercent', 1, 'sections', 'errors'), 0)

我不确定你正在使用什么聚合函数,所以用maxSeries代替你需要的函数。

看看这个blog post有关使用mapSeries和divideSeries的更多解释。

以下是我们在Grafana查询编辑器中的系统示例:

enter image description here


0
投票

divideSeriesLists中引入了一个新功能Graphite 1.0.2,用于将一个系列与另一个系列分开。两个系列的长度应相同。

© www.soinside.com 2019 - 2024. All rights reserved.