Prometheus Learning Series (eight) of the data model

Prometheus all data are stored from the root in time series : a data stream having a time stamp belongs to a plurality of tags in a single dimension of the metrics and metric. In addition to storing the time-series data, Prometheus may also generate a time series derived as a temporary result of the query.

metrics and labels (metric names and labels)

Each of the time series data and its metric metrics name tag labels to uniquely identify a set of key values.

This metric metric specify the name of the monitoring target measurement system characteristics (such as: http_requests_total- the total number of received http request). metric metrics may contain ASCII letters, numbers, underscores and colons, he must be provided with regular expressions [a-zA-Z_:][a-zA-Z0-9_:]*.

Note: colon reserved for recording user-defined rules. They should not be used directly or exporter meter.

Open label Prometheus the multidimensional data model: For the name of the same measure, by combining different tag list, it will form a particular measure dimension instance. (Example: all contain a measure for the name /api/trackshttp request, marked with method=POSTa label, the formation of specific http request). This query language filter and aggregate on the basis of these measures and the list of labels. Any label values change on any measure, new time series will form in FIG.

Label label name can contain ASCII letters, numbers and underscores. They must match the regular expression [a-zA-Z_][a-zA-Z0-9_]*. With the _label name underscore are reserved for internal use.

Tag labels comprise any Unicode code value.

Specific detailed metrics and labels naming best practices .

sample

Forming a sample time-series data of the actual list. Each sample value comprises:

  • A 64-bit floating point value
  • Accurate to a millisecond timestamp

Notation (symbol)

It represents a set of metrics and key label, use the following symbols:

[metric name]{[label name]=[label value], ...}

For example, metrics name api_http_requests_total, label method="POST", handler="/messages"the example is shown below:

api_http_requests_total{method="POST", handler="/messages"}

The naming and OpenTSDB use is the same.

link

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

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

Guess you like

Origin blog.csdn.net/weixin_34112208/article/details/93182134