Skip to content

Commit dba59a3

Browse files
committed
feat(om1.1): relax the acceptance rules around unit and total suffixes
This proposal only relaxes the rules on what is acceptable by ingestors. This allows non Prometheus systems to expose names without suffixes and still get processed. Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
1 parent aea54d3 commit dba59a3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/specs/om/open_metrics_spec_1_1.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ A MetricFamily MAY have zero or more Metrics. A MetricFamily MUST have a name, H
118118

119119
MetricFamily names are a string and MUST be unique within a MetricSet. Names SHOULD be in snake_case. Metric names MUST follow the restrictions in the ABNF section.
120120

121+
Ingestors MAY accept duplicate MetricFamily names, provided that there is a mechanism to distinguish the resulting MetricPoints.
122+
121123
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.
122124

123125
MetricFamily names beginning with underscores are RESERVED and MUST NOT be used unless specified by this standard.
@@ -126,6 +128,8 @@ MetricFamily names beginning with underscores are RESERVED and MUST NOT be used
126128

127129
The name of a MetricFamily MUST NOT result in a potential clash for sample metric names as per the ABNF with another MetricFamily in the Text Format within a MetricSet. An example would be a gauge called "foo_created" as a counter called "foo" could create a "foo_created" in the text format.
128130

131+
Ingestors MAY accept conflicting MetricFamily names, provided that there is a mechanism to distinguish the resulting MetricPoints. It follows that ingestors MAY accept MetricFamily name without the type specific suffix.
132+
129133
Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.
130134

131135
* Suffixes for the respective types are:
@@ -146,6 +150,8 @@ Type specifies the MetricFamily type. Valid values are "unknown", "gauge", "coun
146150

147151
Unit specifies MetricFamily units. If non-empty, it MUST be a suffix of the MetricFamily name separated by an underscore. Be aware that further generation rules might make it an infix in the text format.
148152

153+
Ingestors MAY accept MetricFamily name without unit suffix.
154+
149155
##### Help
150156

151157
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.
@@ -488,7 +494,7 @@ A valid example for a foo_seconds metric with a unit of "seconds":
488494
# UNIT foo_seconds seconds
489495
```
490496

491-
An invalid example, where the unit is not a suffix on the name:
497+
An invalid example (which MAY still be accepted by ingestors), where the unit is not a suffix on the name:
492498

493499
```
494500
# TYPE foo counter
@@ -635,6 +641,8 @@ foo 18.0 456
635641

636642
The MetricPoint's Total Value Sample MetricName MUST have the suffix `_total`. If present the MetricPoint's Created Value Sample MetricName MUST have the suffix `_created`.
637643

644+
Ingestors MAY accept MetricPoint Total Value name without the `_total` suffix.
645+
638646
An example with a Metric with no labels, and a MetricPoint with no timestamp and no created:
639647

640648
```openmetrics-add-eof

0 commit comments

Comments
 (0)