How to understand Prometheus query

http_requests_total{environment="testing",method="GET"} = 1
http_requests_total{environment="development",method="GET"} = 2
http_requests_total{environment="staging",method="GET"} = 1

Nếu bạn muốn hiển thị 1 metric là tổng số request GET thì chỉ cần đơn giản thực hiện query sau

sum (http_requests_total{method="GET"}) 


sum (http_requests_total{method="GET"}) without(environment)

sum (http_requests_total{method="GET"}) by(method)















Comments

Popular posts from this blog

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

Amazon Linux 2023 - User data configuration for launch templates to connect to the EKS cluster

How to create ISM policy and rotate logs in opensearch