Created
June 6, 2017 13:42
-
-
Save justlooks/d5c13848015f29fa32214ce6ec0acaee to your computer and use it in GitHub Desktop.
t1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tar xvf prometheus-1.6.3.linux-amd64.tar | |
# cd prometheus-1.6.3.linux-amd64 | |
prometheus表达式使用 | |
获取特定名字的job的http请求数目 | |
http_requests_total{job=~"server$"} | |
获取返回状态不为4xx的请求 | |
http_requests_total{status!~"^4..$"} | |
以5分钟为窗口,获取指标的增长速度 | |
rate(http_requests_total[5m]) | |
通过job纬度做聚合处理 | |
sum(rate(http_requests_total[5m])) by (job) | |
或者 | |
sum by (job) (rate(http_requests_total[5m])) | |
topk(10, sum(mysql_info_schema_table_size{instance="$host", component!="data_free"}) by (schema, table)) > 0 | |
topk(5, sum(mysql_info_schema_table_size{instance="$host", component="data_free"}) by (schema, table)) > 0 | |
https://www.howtoing.com/how-to-query-prometheus-on-ubuntu-14-04-part-1/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment