Myluzh Blog

PromQL基础语法

2024-10-22 myluzh Kubernetes

0x01 瞬时向量与区间向量 瞬时向量:单一时间点的数据,如当前的HTTP请求总数。 http_requests_total 区间向量:在一段时间内的多个样本,如过去5分钟的请求总数。 http_requests_total[5m] 0x02 offset 查询过去5分钟的数据,但使用30分钟前的数据。 http_requests_total[5m] offset 30m 0x03 Label 过滤 精确匹配:过滤处理器为 /login 的数据。 http_requests_total{handler="/login"} 正则匹配:过滤处理器中包含 “login” 的数据。 http_requests_total{handler=~~".*login.*"} 剔除匹配:过滤处理器不包含 “login” 的数据。 http_requests_total{handler!~~".*login.*"} 多值匹配:过滤处理器为 /login 或 /password 的数据。 http_requests_total{handler=~"/login|/password"} 0x04 数学运...

阅读全文>>

标签: Prometheus PromQL TSDB

评论(0) (12)