Prometheus:如何使用probe_http_duration_seconds从黑盒导出器创建SLI / SLO?

时间:2019-09-15 21:20:10

标签: prometheus promql prometheus-blackbox-exporter

由于几天以来,基于到http端点的延迟创建SLI,我尝试失败。我有一个黑盒导出器和3天的数据。

我尝试了很多类似的事情:count_over_time(probe_http_duration_seconds {target_url =“ xxxx”,phase =“ connect”} [7d]> 0.01) 我知道:二进制表达式必须仅包含标量和即时矢量类型” 我了解错误消息的内容,但实际上不了解如何获取所需的信息。

我的平均“ probe_http_duration_seconds”请求大约为10ms,所以我想每次计算一次,黑匣子得到的响应超过10ms。假设超过10毫秒的请求失败。我需要衡量这些失败。

1 个答案:

答案 0 :(得分:1)

刚刚找到了处理方法:

quantile_over_time(0.90,probe_http_duration_seconds{app="myapp",env="prd",instance="https://probe-target",job="blackbox",phase="connect"}[15d])

非常适合与黑盒导出程序一起测量延迟SLO