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: docs/specs/om/open_metrics_spec_2_0.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,15 +134,17 @@ Ingestors MAY truncate the Exemplar's LabelSet or discard Exemplars.
134
134
135
135
#### Sample
136
136
137
-
A Sample is a single data point within a Metric. It consists of a Value, an optional timestamp, and may include Exemplars or a start timestamp depending on the MetricFamily Type.
137
+
A Sample is a single data point within a Metric. It MUST have a Value, MAY have a Timestamp. It MAY include Exemplars and MAY have a start timestamp, depending on the MetricFamily Type.
138
138
139
139
Samples SHOULD NOT have explicit timestamps.
140
140
141
141
If more than one Sample is exposed for a Metric, then its Samples MUST have monotonically increasing timestamps.
142
142
143
143
#### Metric
144
144
145
-
Metrics are defined by a unique LabelSet within a MetricFamily. Metrics MUST contain a list of one or more Samples. Metrics with the same name for a given MetricFamily SHOULD have the same set of label names in their LabelSet.
145
+
Metrics are defined by a unique LabelSet within a MetricFamily. Metrics MUST contain a list of one or more Samples. If more than one Sample is exposed for a Metric, then its Samples MUST have monotonically increasing Timestamps.
146
+
147
+
Metrics with the same name for a given MetricFamily SHOULD have the same set of label names in their LabelSet.
146
148
147
149
#### MetricFamily
148
150
@@ -226,11 +228,11 @@ A Sample in a Metric with the type Counter MAY have exemplars.
226
228
227
229
StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet.
228
230
229
-
A StateSet is structured as a set of Metrics, one for each State, called a StateSet MetricGroup.
231
+
A StateSet is structured as a set of Metrics, one for each state, called a StateSet MetricGroup.
230
232
231
-
> NOTE: In OpenMetrics 1.0, Metrics are composed of MetricPoints (e.g. A Histogram metric has a MetricPoint representing each Bucket with a special "le" label), which is no longer the case in OpenMetrics 2.0. An OpenMetrics 1.0 StateSet Metric is equivalent to an OpenMetrics 2.0 StateSet MetricGroup, and an OpenMetrics 1.0 StateSet MetricPoint is equivalent to an OpenMetrics 2.0 StateSet Metric.
233
+
> NOTE: In OpenMetrics 1.0, Metrics are composed of MetricPoints (e.g. a Histogram metric has a MetricPoint representing each Bucket with a special "le" label), which is no longer the case in OpenMetrics 2.0. An OpenMetrics 1.0 StateSet Metric is equivalent to an OpenMetrics 2.0 StateSet MetricGroup, and an OpenMetrics 1.0 StateSet MetricPoint is equivalent to an OpenMetrics 2.0 StateSet Metric.
232
234
233
-
A StateSet MetricGroup contains one or more states and MUST contain one boolean per State. States have a name which is a String.
235
+
A StateSet MetricGroup contains one or more states and MUST contain one boolean per state. States have a name which is a String.
234
236
235
237
If encoded as a StateSet, ENUMs MUST have exactly one Sample which is `1` (true) within a MetricGroup.
236
238
@@ -252,7 +254,7 @@ MetricFamilies of Type Info MUST have an empty Unit string.
252
254
253
255
Histograms measure distributions of discrete events. Common examples are the latency of HTTP requests, function runtimes, or I/O request sizes.
254
256
255
-
A Histogram Sample's Composite Value MUST contain Count and Sum values.
257
+
A Histogram SampleMUST contain Count and Sum.
256
258
257
259
The Count value MUST be equal to the number of measurements taken by the Histogram. The Count is a counter semantically. The Count SHOULD be an integer. The Count MUST NOT be negative. The Count SHOULD NOT be +Inf, NaN.
258
260
@@ -834,7 +836,7 @@ There are no recommended suffixes for the MetricFamily name for a MetricFamily o
834
836
835
837
StateSet MetricGroups MUST NOT be interleaved.
836
838
837
-
StateSets MUST have one Metric per State in the StateSet MetricGroup. Each State's Metric MUST have a label with the MetricFamily name as the label name and the State name as the label value. The Metric Sample's Value MUST be 1 if the State is true and MUST be 0 if the State is false.
839
+
StateSets MUST have one Metric per state in the StateSet MetricGroup. Each state's Metric MUST have a label with the MetricFamily name as the label name and the state name as the label value. The Metric Sample's Value MUST be 1 if the state is true and MUST be 0 if the state is false.
838
840
839
841
An example with the states "a", "bb", and "ccc" in which only the value bb is enabled and the metric name is foo:
840
842
@@ -1110,7 +1112,7 @@ Metrics and samples SHOULD NOT appear and disappear from exposition to expositio
1110
1112
1111
1113
In general changing a MetricFamily's Type, or adding or removing a label from its Metrics will be breaking to ingestors.
1112
1114
1113
-
A notable exception is that adding a label to the value of an Info Metric is not breaking. This is so that you can add additional information to an existing Info MetricFamily where it makes sense to be, rather than being forced to create a brand new info metric with an additional label value. ingestor systems should ensure that they are resilient to such additions.
1115
+
A notable exception is that adding a label to an Info Metric is not breaking. This is so that you can add additional information to an existing Info MetricFamily where it makes sense to be, rather than being forced to create a brand new info metric with an additional label value. Ingestor systems should ensure that they are resilient to such additions.
1114
1116
1115
1117
Changing a MetricFamily's Help is not breaking. For values where it is possible, switching between floats and ints is not breaking. Adding a new state to a stateset is not breaking. Adding unit metadata where it doesn't change the metric name is not breaking.
0 commit comments