Skip to content

Commit 315b71d

Browse files
committed
Call attention to usability aspect when conflicts or no suffixes
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
1 parent 13e1484 commit 315b71d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/specs/om/open_metrics_spec_1_1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ 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.
121+
Ingestors MAY accept duplicate MetricFamily names, provided that either of HELP, TYPE, or UNIT is unique within the duplicated MetricFamily names. Notably Exposers MAY duplicate MetricFamilies when aggregating external metrics that have the same MetricFamily name, but come from different sources and have either different HELP, or TYPE, or UNIT. Be aware that exposing such metrics directly to end-users reduces usability due to confusion about which Metric belongs to which MetricFamily.
122122

123123
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.
124124

@@ -128,7 +128,7 @@ MetricFamily names beginning with underscores are RESERVED and MUST NOT be used
128128

129129
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.
130130

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.
131+
Ingestors MAY accept duplicate MetricFamily names, provided that either of HELP, TYPE, or UNIT is unique within the duplicated MetricFamily names. Notably Exposers MAY duplicate MetricFamilies when aggregating external metrics that have the same MetricFamily name, but come from different sources and have either different HELP, or TYPE, or UNIT. Be aware that exposing such metrics directly to end-users reduces usability due to confusion about which Metric belongs to which MetricFamily.
132132

133133
Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.
134134

@@ -150,7 +150,7 @@ Type specifies the MetricFamily type. Valid values are "unknown", "gauge", "coun
150150

151151
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.
152152

153-
Ingestors MAY accept MetricFamily name without unit suffix.
153+
Ingestors MAY accept MetricFamily name without unit suffix. Be aware that exposing such metrics directly to end-users reduces usability due to confusion about what the metric's unit is.
154154

155155
##### Help
156156

@@ -641,7 +641,7 @@ foo 18.0 456
641641

642642
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`.
643643

644-
Ingestors MAY accept MetricPoint Total Value name without the `_total` suffix.
644+
Ingestors MAY accept MetricPoint Total Value name without the `_total` suffix. Be aware that exposing such metrics directly to end-users reduces usability due to confusion about what the metric's type is.
645645

646646
An example with a Metric with no labels, and a MetricPoint with no timestamp and no created:
647647

0 commit comments

Comments
 (0)