Skip to content

Commit 0a097a9

Browse files
committed
Adapt data model for 3.x
Signed-off-by: Julien Pivotto <[email protected]>
1 parent cbe12c5 commit 0a097a9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

content/docs/concepts/data_model.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ Every time series is uniquely identified by its metric name and optional key-val
1717

1818
***Metric names:***
1919

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"}`.
2524

25+
Note: Colons are reserved for user-defined recording rules. They should not be used by exporters or in direct instrumentation code.
2626

2727
***Metric labels:***
2828

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 Prometheus to 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)`.
3636

3737
See also the [best practices for naming metrics and labels](/docs/practices/naming/).
3838

0 commit comments

Comments
 (0)