PromQL 从入门到精通画一个饼图。这里有个难点:接入层这个 Pod 没有 version 标签, version 信息只是出现在 kube_pod_labels 中,如何让二者联动呢?上答案: sum( rate(http_request_count{code=~"^(?:5..)$"}[5m])) by (pod) * on (pod) group_left(label_version) kube_pod_labels 我们来掰开揉碎这个 stdvar (calculate population standard variance over dimensions) count (count number of elements in the vector) count_values (count number of elements with the same value) bottomk (smallest k elements VictoriaMetrics,则可以使用这些扩展函数) 中的扩展函数。 count_gt_over_time 假设原始需求:某个指标( 假设指标名字是 interface_status )每分钟上报一次,如果 5 分钟 内有 3 次大于 10,就报警。使用 PromQL 比较难写,使用 MetricsQL 就非常简单: count_gt_over_time(interface_status[5m]0 码力 | 16 页 | 2.77 MB | 1 年前3
Intro to Prometheus - With a dash of operations & observability@fredbrancz Intro to Prometheus Introduction Background Operations & observability Outro Time split 1 1/3 Prometheus 2 1/3 Observability 3 1/3 Questions Richard Hartmann & Frederic Branczyk @TwitchiH0 码力 | 19 页 | 63.73 KB | 1 年前3
OpenMetrics - Standing on the shoulders of Titansrobustperception.io/checking-openmetrics-output-is-valid Google and Uber want to create another reference parser to weed out bugs Richard Hartmann, RichiH@{freenode,OFTC,IRCnet}, richih@{fosdem,debian0 码力 | 21 页 | 84.83 KB | 1 年前3
共 3 条
- 1













