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
> TL;DR: We propose an updated syntax for handling created timestamps in the OpenMetrics exposition format. This syntax allows for more efficient parsing of created lines and eliminates confusion on naming metrics that support `_created`lines by placing the created timestamp inline with the metric it is attached to.
17
+
> TL;DR: We propose an updated syntax for handling created timestamps in the OpenMetrics exposition format. This syntax allows for more efficient parsing of created lines and eliminates confusion on naming metrics that support `_created` lines by placing the created timestamp inline with the metric it is attached to.
18
18
19
19
## Why
20
20
@@ -26,11 +26,11 @@ Created Timestamps (CTs) were proposed in the summer of 2023 with support for th
26
26
27
27
These characterisitics, specifically the final one means that the parser must search or "peek" ahead to find the `_created` line for a given metric with the same label set and thus, requires additional CPU/memory resources when it can be saved.
28
28
29
-
This search operation can be specifically taxing when the CT lineis the very last line in a large MetricFamily such as that of a histogram.
29
+
This search operation can be specifically taxing when the CT line, if it exists, is the very last line in a large MetricFamily such as that of a histogram with many buckets.
30
30
31
31
### Pitfalls of the current solution
32
32
33
-
As stated above, `_created` lines can appear anywhere after its associated metric line. This means parser must is required to store the current position of the lexer before we start searching for the created timestamp. We arrived at a somewhat acceptable implementation that caches the timestamp and minimizes data stored in memory. Before, we used to make a deep copy of the parser at every line whenever the `CreatedTimestamp` function was called which lead to [Prometheus consuming Gigabytes more memory](https://github.com/prometheus/prometheus/issues/14808) than needed.
33
+
As stated above, `_created` lines can appear anywhere after its associated metric line. This means parser is required to store the current position of the lexer before we start searching for the created timestamp. Currently, we cache the timestamp and minimize data stored in memory. Before, we used to make a deep copy of the parser at every line whenever the `CreatedTimestamp` function was called which lead to [Prometheus consuming Gigabytes more memory](https://github.com/prometheus/prometheus/issues/14808) than needed.
34
34
35
35
## Goals
36
36
@@ -44,7 +44,7 @@ As stated above, `_created` lines can appear anywhere after its associated metr
44
44
45
45
## Non-Goals
46
46
47
-
*Update other aspects of OpenMetrics. While this can be a step towards an OM 2.0 this proposal only deals with created timestamps which is small subset of the specification.
47
+
*Require backwards compatibility. While this can be a step towards an OM 2.0 this proposal only deals with created timestamps which is small subset of the specification.
48
48
* Storing CTs in metadata storage or the WAL (we're only dealing with parsing here).
49
49
* Add CT support to additional metric types like guages.
0 commit comments