Prometheus

PromQL to graph number of Kubernetes PODs created per Hour

﹥>﹥吖頭↗ 提交于 2020-08-24 10:21:07
问题 I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster. Now I'd like to Graph how many new PODs have been created per Hour over Time. The Metric kube_pod_created contains the Creation-Timestamp as Value but since there is a Value in each Time-Slot, the following Query also returns Results >0 for Time-Slots where no new PODs have been created: count(rate(kube_pod_created[1h])) by(namespace) Can I use the Value in some sort of

PromQL to graph number of Kubernetes PODs created per Hour

倾然丶 夕夏残阳落幕 提交于 2020-08-24 10:21:03
问题 I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster. Now I'd like to Graph how many new PODs have been created per Hour over Time. The Metric kube_pod_created contains the Creation-Timestamp as Value but since there is a Value in each Time-Slot, the following Query also returns Results >0 for Time-Slots where no new PODs have been created: count(rate(kube_pod_created[1h])) by(namespace) Can I use the Value in some sort of

PromQL to graph number of Kubernetes PODs created per Hour

限于喜欢 提交于 2020-08-24 10:20:54
问题 I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster. Now I'd like to Graph how many new PODs have been created per Hour over Time. The Metric kube_pod_created contains the Creation-Timestamp as Value but since there is a Value in each Time-Slot, the following Query also returns Results >0 for Time-Slots where no new PODs have been created: count(rate(kube_pod_created[1h])) by(namespace) Can I use the Value in some sort of

prometheus rule: check for expression value in range

馋奶兔 提交于 2020-08-24 09:43:11
问题 In a prometheus alert rule, how do I check for a value to be in a certain range? for eg., (x > 80 && x <= 100); when x is a complex expression it feels unnecessary to evaluate it twice. is there another way to represent this expression? 回答1: You can do x < 100 > 80 to chain them. 来源: https://stackoverflow.com/questions/45766533/prometheus-rule-check-for-expression-value-in-range

prometheus rule: check for expression value in range

家住魔仙堡 提交于 2020-08-24 09:38:09
问题 In a prometheus alert rule, how do I check for a value to be in a certain range? for eg., (x > 80 && x <= 100); when x is a complex expression it feels unnecessary to evaluate it twice. is there another way to represent this expression? 回答1: You can do x < 100 > 80 to chain them. 来源: https://stackoverflow.com/questions/45766533/prometheus-rule-check-for-expression-value-in-range

Prometheus query to count unique label values

徘徊边缘 提交于 2020-08-22 01:55:15
问题 I want to count number of unique label values. Kind of like select count (distinct a) from hello_info For example if my metric 'hello_info' has labels a and b. I want to count number of unique a's. Here the count would be 3 for a = "1", "2", "3". hello_info(a="1", b="ddd") hello_info(a="2", b="eee") hello_info(a="1", b="fff") hello_info(a="3", b="ggg") 回答1: count(count by (a) (hello_info)) First you want an aggregator with a result per value of a , and then you can count them. 回答2: Other