Description
This deserves its own proposal, but i'll outline the broad idea here start the discussion and gather high-level feedback.
Idea
The idea is that we could use complex values for fixed bucket histograms, summaries, and counters, similar to what we plan to do for native histograms. In OM 1.0 and in the Prometheus text format, those types are represented using multiple series with suffixes and special labels (e.g. _bucket
suffix, or the le
label for histograms). Counters are included here because they have a "total" and a "start time".
Advantages
- Solves Handle OpenMetrics
..._created
lines prometheus#6541 by supporting the created timestamp in the value. - Prevents collisions between suffixed series names and unsuffixed series names of a different type.
- E.g.
histogram: my_metric
vsgauge: my_metric_bucket
- E.g.
- Removes PromQL differences between querying native and classic histograms: https://grafana.com/docs/mimir/latest/visualize/native-histograms/#query-your-histograms-count-or-sum (couldn't find Prometheus documentation)
- Names in PromQL queries always match names defined in the application.
- This is helpful for metrics defined in other metric libraries, such as OpenTelemetry, where users don't expect suffixes.
Disadvantages
- Breaks existing user expectations and queries. Suffixes are very deeply embedded in the Prometheus ecosystem, and this would be a large change for many users.
- PromQL queries become more complicated because accessing fields requires functions.
- E.g.
sum(request_duration_seconds_count)
->histogram_count(sum(request_duration_seconds))
. - This would happen anyways if the user migrates to native histograms.
- E.g.
- Little benefit for summaries and histograms, as we expect/recommend users adopt native histograms anyways.
- Is there a text format representation that is readable AND easy to generate AND efficient enough to parse, for such a model?
- It would make OM 2.0 text significantly different to 1.0 and Prometheus text, so some education and big change in parsers/generators would be needed. Not a blocker, but something to keep in mind as a con.
Alternatives
We could only use a complex value for counters, to support the start time in addition to the value. For fixed-bucket histograms and summaries, keep the existing suffixes and labels, but use the "complex counter" value for cumulative series. For users that have migrated from summaries and fixed-bucket histograms to native histograms, this has most of the advantages of the above, without many of the disadvantages for users using summaries or fixed-bucket histograms.
Metadata
Metadata
Assignees
Type
Projects
Status