In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use Prometheus grammar". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian to study and learn "how to use Prometheus grammar" together.
For example, for the metric jvm_gc_memory_allocated_bytes_total
sum(jvm_gc_memory_allocated_bytes_total)
sum_over_time(jvm_gc_memory_allocated_bytes_total[5m]) //Find the cumulative value over 5 minutes
jvm_gc_memory_allocated_bytes_total[5m] offset 10m //Find the sequence of values for the 5-minute interval 10 minutes ago
sum(http_requests_total) without (instance)sum(http_requests_total) by (application, group)
http_requests_total is grouped according to application and group statistics sum!
Prometheus divides indicators into four metric types according to different target functions and contents: Counter, Gauge, Histogram and Summary; however, they are essentially indicators, time series, and are simply classified for easier understanding and communication.
Counter-type indicators work the same way as counters, only increasing and not decreasing (unless a system reset occurs). Common monitoring metrics, such as http_requests_total and node_cpu, are all Counter-type monitoring metrics.
Gauge-type indicators focus on the current state of the reaction system. Therefore, the sample data of such indicators can be increased or decreased. Common metrics such as node_memory_MemFree (the size of the host's currently free content) and node_memory_MemAvailable (the size of available memory) are Gauge-type monitoring metrics.
Gauge indicator allows users to directly view the current state of the system: node_memory_MemFree
For Gauge-type monitoring metrics, the PromQL built-in function delta() can be used to obtain the change of samples within a period of time. For example, calculate the difference in CPU temperature over two hours:
delta(cpu_temp_celsius{host="zeus"}[2h])
Histogram and Summary: Data Distribution
In addition to the Counter and Gauge types of monitoring metrics, Prometheus also defines metric types that define Histogram and Summary, respectively, mainly for statistics and analysis of sample distribution.
Thank you for reading, the above is the content of "how to use Prometheus grammar". After studying this article, I believe everyone has a deeper understanding of how to use Prometheus grammar. The specific use situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.