Prometheus Learning Series (nine) types of metrics

Prometheus client library provides four core metrics type. This distinction only four types currently in the client library and wire protocols. Prometheus service not take advantage of these types. Change will occur in the near future.

Counter (counter)

counter is the accumulated metric represents a single monotonically increasing counter whose value increases only upon reboot or reset to zero. For example, you can use a counter to indicate the number of errors or task request service completed.

Do not use the counter to reduce possible exposure value. For example, do not use a counter to process the number of processes currently running; but the use of the instrument.

The client document uses the counter:

Gauge (gauge)

gauge is a metric that represents a can both increase, but also decreasing value.

The main measure is similar to measure temperature, current memory usage, etc., can also count the number of Goroutines current services running at any time increase or decrease of

The client uses the meter of the document:

Histogram (histogram)

Histogram , observation sampling histogram (usually the size of a request or response duration, etc.), which may be included in the configuration and buckets. It also provides the sum of all observations.

The basic metric name histogram display during a plurality of time series scrape:

  • Exposure observed accumulation counter barrel:<basename>_bucket{le="<upper inclusive bound>"}
  • The sum of all of the observations:<basename>_sum
  • The number of events has been observed: <basename>_countand <basename>_bucket{le="+Inf"}the same

Use histogram_quantile function calculates the histogram is a histogram of the polymerization or quantile thresholds calculated. A histogram calculation Apdex values are also suitable, when operating in the buckets, a cumulative histogram remember. See histograms and summary

Histogram client libraries use the document:

[Summary] summary

Similarly histogram histogram, Summary sampling statistics dotted bitmap (usually in response to the requested duration and size, etc.). Although the sum of the total number of all observations and provided further observation, it can be configured quantile on a sliding window calculation.

The basic metric name <basename>is summaryduring scrape discloses a plurality of time series:

  • Flow φ-quantiles (0 ≤ φ ≤ 1), it is shown as<basename>{quantiles="[φ]"}
  • <basename>_sumSum, refers to all observations
  • <basename>_countEvent count refers to the observed

For detailed instructions on φ- quantile, Summary usage and histogram illustrating the difference, see the histogram and summaries

About the summariesclients use the document:

link

Prometheus official website address: prometheus.io/ my Github: github.com/Alrights/pr...

Reproduced in: https: //juejin.im/post/5d04aa0051882559f04028a2

Guess you like

Origin blog.csdn.net/weixin_34415923/article/details/93182138