Skip to content

Commit 6317f09

Browse files
committed
om2: pre rc.0 changes from WG
Signed-off-by: bwplotka <bwplotka@gmail.com> tmp Signed-off-by: bwplotka <bwplotka@gmail.com> tmp Signed-off-by: bwplotka <bwplotka@gmail.com> update Signed-off-by: bwplotka <bwplotka@gmail.com>
1 parent 32aba1e commit 6317f09

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Time series are a record of changing information over time. Common examples of m
6464

6565
## Data Model
6666

67+
// TODO: High level diagram to put here.
6768
This section MUST be read together with the ABNF section. In case of disagreements between the two, the ABNF's restrictions MUST take precedence.
6869

6970
### Data Types
@@ -74,14 +75,19 @@ Metric values in OpenMetrics MUST be either Number or CompositeValue.
7475

7576
##### Number
7677

78+
// MAYBE: Clarify floating point exactly / link to where we do this instead of float64
79+
// MAYBE: "ut it MAY be used to signal a division by zero" -> add or any result of the math operations that would result it in.
7780
Number value MUST be either floating point or integer. Note that ingestors of the format MAY only support float64. The non-real values NaN, +Inf and -Inf MUST be supported. NaN value MUST NOT be considered a missing value, but it MAY be used to signal a division by zero.
7881

7982
Booleans MUST be represented as a Number value where `1` is true and `0` is false.
8083

8184
##### CompositeValue
8285

86+
// TODO(dashpole): Fix on Data model redefinition "Sample value"
87+
// * Sample = value + timestamp + st + exemplars
8388
CompositeValue MUST contain all information necessary to recreate a sample value for Metric within the MetricFamily.
8489

90+
// TODO(dashpole): Fix on Data model redefinition "Metric Values" -> maybe "Sample Values"
8591
The following MetricFamily Types MUST use CompositeValue for Metric Values:
8692

8793
* [Histogram](#histogram) MetricFamily Type.
@@ -92,6 +98,7 @@ Other MetricFamily Types MUST use Numbers.
9298

9399
#### Timestamps
94100

101+
// MAYBE: Mention its float?
95102
Timestamps MUST be Unix Epoch in seconds. Negative timestamps MAY be used.
96103

97104
#### Strings
@@ -104,6 +111,7 @@ Labels are key-value pairs consisting of strings.
104111

105112
Label names beginning with two underscores are RESERVED and MUST NOT be used unless specified by this standard. Such Label names MAY be used in place of TYPE and UNIT metadata in cases where MetricFamilies' metadata might otherwise be conflicting, such as metric federation cases.
106113

114+
// MAYBE: Link to where we explain "UTF-8 metrics may reduce usability"
107115
Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics may reduce usability.
108116

109117
Empty label values SHOULD be treated as if the label was not present.
@@ -124,6 +132,7 @@ When an exemplar references a [Trace Context](https://www.w3.org/TR/trace-contex
124132

125133
While there's no [hard limit](#size-limits) specified, Exemplar's LabelSet SHOULD NOT be used to transport large data like tracing span details or other event logging.
126134

135+
// TODO: "If you truncate data try to preserve trace id and span id"
127136
Ingestors MAY truncate the Exemplar's LabelSet or discard Exemplars.
128137

129138
#### Sample
@@ -147,6 +156,7 @@ A MetricFamily MAY have zero or more Metrics. Every Metric within a MetricFamily
147156
MetricFamily name:
148157

149158
* MUST be string.
159+
// TODO give example of unknown metadata? No meta exposed, two differently name metric families.
150160
* MUST be unique within a MetricSet.
151161
* MUST be the same as every Metric's Name in the family.
152162

@@ -156,10 +166,12 @@ Names SHOULD be in snake_case. Names SHOULD follow the restrictions in the ABNF
156166

157167
Colons in MetricFamily names are RESERVED to signal that the MetricFamily is the result of a calculation or aggregation of a general purpose monitoring system.
158168

169+
// CHECK: RESERVED in RFC?
159170
MetricFamily names beginning with underscores are RESERVED and MUST NOT be used unless specified by this standard.
160171

161172
###### Discouraged Suffixes
162173

174+
// TODO: Double check scrape failure modes e.g. rejection MetricSet vs Sample/MetricFamily.
163175
MetricFamily name SHOULD NOT end with `_count`, `_sum`, `_gcount`, `_gsum`, `_bucket`. Specifically, a name SHOULD NOT create a MetricName collision when converted to [the OpenMetrics 1.0 Text](https://prometheus.io/docs/specs/om/open_metrics_spec). Ingestors MAY reject such MetricFamily.
164176

165177
A non-compliant example would be a gauge called `foo_bucket` and a histogram called `foo`. Exposers negotiating the older OpenMetrics or Text formats, or ingestors which support only the older data model could end up storing the `foo` histogram in the classic representation (`foo_bucket`, `foo_count`, `foo_sum`), which would clash with the gauge and cause a scrape rejection or dropped data.
@@ -174,6 +186,8 @@ Type specifies the MetricFamily type. Valid values are "unknown", "gauge", "coun
174186

175187
Unit specifies MetricFamily units. If non-empty, it SHOULD be a suffix of the MetricFamily name separated by an underscore. Further type specific suffixes come after the unit suffix. Exposing metrics without the unit being a suffix of the MetricFamily name directly to end-users may reduce the usability due to confusion about what the metric's unit is.
176188

189+
// TODO: Add link to unit value semantics?
190+
177191
##### Help
178192

179193
Help is a string and SHOULD be non-empty. It is used to give a brief description of the MetricFamily for human consumption and SHOULD be short enough to be used as a tooltip.
@@ -186,6 +200,7 @@ Each MetricFamily name MUST be unique. The same label name and value SHOULD NOT
186200

187201
There is no specific ordering of MetricFamilies required within a MetricSet. An exposer MAY make an exposition easier to read for humans, for example sort alphabetically if the performance tradeoff makes sense.
188202

203+
// MAYBE: What about other info metrics?
189204
If present, an Info MetricFamily called "target_info" per the [Supporting target metadata in both push-based and pull-based systems](#supporting-target-metadata-in-both-push-based-and-pull-based-systems) section below SHOULD be first.
190205

191206
### MetricFamily Types
@@ -206,6 +221,7 @@ The MetricFamily name for Counters SHOULD end in `_total`. Exposing metrics with
206221

207222
A Sample in a Metric with the Type Counter SHOULD have a Timestamp value called Start Timestamp. This can help ingestors discern between new metrics and long-running ones it did not see before.
208223

224+
// DISCUSSION: If you reset you must set ST?
209225
A Sample in a Metric with the Type Counter MUST have a Number value which is non-NaN. The value MUST be monotonically non-decreasing over time, unless it is reset to 0, and start from 0. The value MAY reset its value to 0. If present, the corresponding Start Timestamp MUST also be set to the timestamp of the reset.
210226

211227
A Sample in a Metric with the type Counter MAY have exemplars.
@@ -232,6 +248,7 @@ Info metrics are used to expose textual information which SHOULD NOT change duri
232248

233249
The MetricFamily name for Info metrics MUST end in `_info`.
234250

251+
// TODO: adjust as per https://github.com/prometheus/docs/pull/2894/changes#r2940458234
235252
Info MAY be used to encode ENUMs whose values do not change over time, such as the type of a network interface.
236253

237254
MetricFamilies of Type Info MUST have an empty Unit string.

0 commit comments

Comments
 (0)