【发布时间】:2018-12-13 03:43:21
【问题描述】:
我有关于写入 InfluxDB 的错误数据(示例已简化)。
time | error | some_unique_data
--------|---------|--------------------
<time> | hello 1 | some unique data...
<time> | hello 2 | some unique data...
<time> | hello 2 | some unique data...
<time> | hello 3 | some unique data...
我可以编写以下查询来查看 Grafana 中最常见错误的排序列表:
SELECT COUNT("some_unique_data") FROM "my_measument" WHERE $timeFilter GROUP BY error
给出:
| error | count
|---------|-------
| hello 2 | 2
| hello 1 | 1
| hello 3 | 1
我缺少的是可以向我展示每个错误的影响的列,如下所示:
| error | count | impact
|---------|----------------
| hello 2 | 2 | 50%
| hello 1 | 1 | 25%
| hello 3 | 1 | 25%
我应该在我的查询中添加什么才能让这个 impact 字段正常工作?
【问题讨论】: