1

嗨,我强迫 histogram_quantile 出现问题。如果我将我的变量设置为多值,那么我可以重复面板。然后我收到错误消息

在字符 21 处解析错误:意外字符:'\'

我的要求是:

histogram_quantile($percentile, avg((rate(http_server_requests_seconds_bucket{instance=~"$server"}[1m]))) by (le, application))

$Percentile变量以自定义方式启动,其值如下并选择了多值

0.9, 0.5, 0.99
4

2 回答 2

2

变量的默认格式.用反斜杠转义,所以0.5变成0\.5.

为了不逃逸.,您可以在变量上使用另一种格式,如下所示:${percentile:raw}.

有关格式选项的更多信息,请点击此处

于 2021-12-09T10:30:30.827 回答
1

histogram_quantile 函数需要单个浮点数作为输入,而 Grafana 的多值特性会产生类似0\.9|0\.5|0\.99which is not a floating point number 之类的东西。为此,您将需要使用多个表达式。

于 2018-08-10T05:36:45.773 回答