Skip to content

Commit 7ca1285

Browse files
authored
OM2: Add unknown metadata example (#2937)
* OM2: Add unknown metadata example Signed-off-by: bwplotka <bwplotka@gmail.com> * Update docs/specs/om/open_metrics_spec_2_0.md Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com> --------- Signed-off-by: bwplotka <bwplotka@gmail.com> Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
1 parent f140aaa commit 7ca1285

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ If a unit is specified it MUST be provided in a UNIT metadata line. In addition,
705705

706706
Be aware that exposing metrics without the unit being a suffix (or infix) of the MetricFamily name directly to end-users may reduce the usability due to confusion about what the metric's unit is.
707707

708-
A valid example for a foo_seconds metric with a unit of "seconds":
708+
A valid example for a `foo_seconds_total` metric with a unit of "seconds":
709709

710710
```openmetrics-add-eof
711711
# TYPE foo_seconds_total counter
@@ -743,6 +743,19 @@ There MUST NOT be more than one of each type of metadata line for a MetricFamily
743743

744744
Aside from this metadata and the EOF line at the end of the message, you MUST NOT expose lines beginning with a #.
745745

746+
##### Unknown metadata
747+
748+
Ingestors MUST support Metric Families without metadata lines.
749+
750+
A valid, but discouraged example, for `foo_seconds_total` counter and a set of unrelated, unknown type metrics without metadata lines:
751+
752+
```openmetrics-add-eof
753+
# TYPE foo_seconds_total counter
754+
foo_seconds_total 1
755+
foo_milliseconds_total 2
756+
foo_count 3
757+
```
758+
746759
#### Metric
747760

748761
Metrics MUST NOT be interleaved. See the StateSet example below.

0 commit comments

Comments
 (0)