prometheus basic concepts

prometheus basic concepts

No matter what the situation, we need to make adequate preparations. Foundations needed to build a house, the foundation of instability shaking of the ground. We learn, too, so we want to learn a thing must be to lay a solid foundation. Well ado, let's lay the foundation of prometheus.
## data model
prometheus series data is stored (time-series), i.e. the same o'clock (the same names and labels) to store the set of consecutive time dimension data.

Timing Index

The timing (time series) is the name (metrice), and a set of key/valuelabels as defined, with the same name and the same time sequence tag belongs.
The timing of the name has ASCLL characters, numbers, underscores, colons and composed, it must meet the regular expression [a-zA-Z_:][a-zA-Z0-9_:]*, has its name because of the semantics (see to know the name of this grab what value), generally represents a measurable indicators, such as: http_requset_totalis the total number of http requests.
The timing can make the data tag prometheus richer, it is possible to distinguish between different specific examples, for example http_requests_total{method="POST"}, it may represent all POST requests.
Label names are ASCLL characters, numbers, and underscores, which _begins with belonging prometheus reserves the label can only be of any ubicode character, support Chinese

Timing sample

The data Moge timing acquisition in the time dimension, called a sample, which values ​​comprising:

  • A value float64
  • A millisecond timestamp unix

format

prometheus timing format similar OPenTSDB
<metric name> {<label name > = <label value>, ....}
label contains the name of timing and timing.

Metrice types

counter counter

Obtaining values ​​only increase (decrease), the ideal state is not reduced (increased). The total amount of requests we often use it to record services, total number of errors

Gauge instantaneous value

The simplest metrics, only a simple return value, or called transient state, such as: monitor hard disk or memory usage, only one value at the current time, because the capacity of the hard disk and memory usage over time of constantly changing, no rules to follow

Histogram

Distribution statistics, such as maximum, minimum, median value as well as the median, 75 percentile, which is a special type of data metrics, a representative of the approximate percentage of

summary

summary histogram and the like, a &lt;basename&gt;{quantile="&lt;&gt;"}, &lt;basename&gt;_sum, &lt;basename&gt;_count, mainly for representing the results data sampling period of time (usually a duration request or response size), quantile data is stored directly, rather than the interval calculated based on the statistical

Guess you like

Origin blog.51cto.com/13447608/2446963