You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/concepts/data_model.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -17,22 +17,22 @@ Every time series is uniquely identified by its metric name and optional key-val
17
17
18
18
***Metric names:***
19
19
20
-
* Specify the general feature of a system that is measured (e.g. `http_requests_total` - the total number of HTTP requests received).
21
-
* Metric names may contain ASCII letters, digits, underscores, and colons. It must match the regex `[a-zA-Z_:][a-zA-Z0-9_:]*`.
22
-
23
-
Note: The colons are reserved for user defined recording rules. They should not be used by exporters or direct instrumentation.
24
-
20
+
* Specify the general feature of a system that is measured (e.g. `http_requests_total` - the total number of HTTP requests received).
21
+
* In Prometheus 2.x, metric names must contain only ASCII letters, digits, underscores, and colons, matching `[a-zA-Z_:][a-zA-Z0-9_:]*`.
22
+
* In Prometheus 3.x, it is still recommended to use ASCII, but Unicode letters and special characters are also allowed in metric names. That include dashes `-` and dots `.`.
23
+
* To use metric names with Unicode characters or special characters in Prometheus 3.0 queries, you can reference the metric name between double quotes in curly braces. For example, to query a metric named `foo-bar`, use `{"foo-bar"}`. Other labels must be specified in the same curly braces: `{"goo-bar", foo="bar"}`.
25
24
25
+
Note: Colons are reserved for user-defined recording rules. They should not be used by exporters or in direct instrumentation code.
26
26
27
27
***Metric labels:***
28
28
29
-
*Enable Prometheus's dimensional data model to identify any given combination of labels for the same metric name. It identifies a particular dimensional instantiation of that metric (for example: all HTTP requests that used the method `POST`to the `/api/tracks` handler). The query language allows filtering and aggregation based on these dimensions.
30
-
*The change of any label's value, including adding or removing labels, will create a new time series.
31
-
*Labels may contain ASCII letters, numbers, as well as underscores. They must match the regex `[a-zA-Z_][a-zA-Z0-9_]*`.
32
-
*Label names beginning with `__` (two "_") are reserved for internal use.
33
-
* Label values may contain any Unicode characters.
34
-
*Labels with an empty label value are considered equivalent to labels that do not exist.
35
-
29
+
*Labels allow Prometheusto track different dimensions for the same metric name(for example, all HTTP POST requests to `/api/tracks`).
30
+
*A new time series is created whenever you add, remove, or change any label values.
31
+
*In Prometheus 2.x, label names use the regex `[a-zA-Z_][a-zA-Z0-9_]*`.
32
+
*In Prometheus 3.x, Unicode characters and special characters are also allowed. That include dashes `-` and dots `.`.
33
+
* Label names starting with `__` (two underscores) remain reserved for internal usage.
34
+
*Label values may contain any Unicode characters in both Prometheus 2.x and 3.0.
35
+
* To query label names with Unicode and special characters in Prometheus 3.0, simply specify them between double quotes: `sum by ("my-instance") (my_metric)`.
36
36
37
37
See also the [best practices for naming metrics and labels](/docs/practices/naming/).
0 commit comments