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
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,15 +224,15 @@ A Sample in a Metric with the type Counter MAY have exemplars.
224
224
225
225
#### StateSet
226
226
227
-
// TODO: UPDATE!!!!
228
-
229
227
StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet.
230
228
231
-
A point of a StateSet metric MAY contain multiple states and MUST contain one boolean per State. States have a name which are Strings.
229
+
A StateSet is structured as a set of Metrics, one for each State, called a StateSet MetricGroup.
230
+
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.
232
232
233
-
A StateSet Metric's LabelSet MUST NOT have a label name which is the same as the name of its MetricFamily.
233
+
A StateSet MetricGroup contains one or more states and MUST contain one boolean per State. States have a name which is a String.
234
234
235
-
If encoded as a StateSet, ENUMs MUST have exactly one Boolean which is true within a MetricPoint.
235
+
If encoded as a StateSet, ENUMs MUST have exactly one Sample which is `1` (true) within a MetricGroup.
236
236
237
237
This is suitable where the enum value changes over time, and the number of States isn't much more than a handful.
// TODO: Update to use Samples instead of MetricPoints
834
-
835
833
There are no recommended suffixes for the MetricFamily name for a MetricFamily of Type StateSet.
836
834
837
-
StateSets MUST have one sample per State in the MetricPoint. Each State's sample MUST have a label with the MetricFamily name as the label name and the State name as the label value. The State sample's value MUST be 1 if the State is true and MUST be 0 if the State is false.
835
+
StateSet MetricGroups MUST NOT be interleaved.
836
+
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.
838
838
839
839
An example with the states "a", "bb", and "ccc" in which only the value bb is enabled and the metric name is foo:
0 commit comments