Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic concepts of prometheus

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Basic concepts of prometheus

No matter what we do, we need to be well prepared. To build a house, the foundation needs to be laid, and the foundation is shaky. We study the same way, so if we want to learn something well, we must lay a solid foundation. All right, enough nonsense, let's lay the foundation for prometheus.

# # data Model

Prometheus storage is time series data (time-series), that is, a collection of consecutive data stored in a time dimension according to the same time (same name and label).

Time series index

The time series is defined by the name (metrice) and a set of key/value tags that have the same name and the tags belong to the same time series.

The name of the time series consists of ASCLL characters, numbers, underscores, and colons, and it must satisfy the regular expression [a-zA-Z0-9 characters:] *, its name should be semantic (see the name to know what the crawled value is), generally represents a measurable indicator, such as: http_requset_total, represents the total number of requests of http.

Timing tags can enrich prometheus data and distinguish between specific instances, such as http_requests_total {method= "POST"}, which can represent all POST requests.

The tag name consists of ASCLL characters, numbers, and underscores. The one that begins with _ belongs to prometheus, and the tag can only be any ubicode character. Chinese characters are supported.

Time series sample

The data collected in the time dimension according to the Morgo time series is called a sample, and its values include:

A float64 value of a millisecond unix timestamp format

The timing format of prometheus is similar to that of OPenTSDB

{=,.}

It contains the timing name and the timing label.

Metrice typescounter counter

The value obtained only increases (decreases) and ideally does not decrease (increase). We often use it to record the total number of service requests and the total number of errors

Gauge instantaneous value

The simplest metric has only a simple return value, or instantaneous state, for example, monitoring hard disk or memory usage has only one value at the current time, because the capacity of the hard disk and the amount of memory used are constantly changing over time, and there are no rules to follow.

Histogram

The distribution of statistics, such as maximum, minimum, median, and the median, 75 percentile, is a special metrics data type that represents an approximate percentage.

Summary

Summary, similar to histogram, consists of {quantile= ""}, _ sum,_count, which is mainly used to represent the result of data sampling over a period of time (usually request duration or response size). It stores quantile data directly rather than based on statistical intervals.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report