grafana - 用通配符划分系列

grafana - divide series with wildcards

我正在尝试在 grafana 中构建百分比列表,但无法使 divideSeries+ 通配符正常工作。

我发现 Grafana dividing 2 series 这似乎是我想要的,但不幸的是我的 grafana 实例(版本 4.6.0-1)中没有 mapSeries 功能。

这是我得到的,但我不想指定 ID“1234”,而是想使用通配符,并将每个 ID 组合在一起。

divideSeries(stats.dhcp.pools.1234.cur,stats.dhcp.pools.1234.max)

从逻辑上讲,我试过:divideSeries(stats.dhcp.pools.*.cur,stats.dhcp.pools.*.max) -- 但那行不通。我尝试使用 asPercent,但它具有与 divideSeries 相同的限制。

我认为 applyByNode 是我想要的,但我似乎无法将示例转化为实际可行的东西。

您使用石墨作为数据源(我认为)。您提到的功能在graphite-web, you can find docs also for applyByNode

中实现
applyByNode(
    stats.dhcp.pools.*.*,
    3,
    'divideSeries(%.cur, %.max)',
    '% pct'
)

请注意,截至 2017 年 11 月,applyByNode 不在默认的 graphite-api 安装中,需要从 github 来源安装:

pip install git+git://github.com/brutasse/graphite-api.git

附带说明 - 您可以使用任何石墨函数,甚至 mapSeries