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
@@ -146,27 +146,34 @@ A MetricFamily MAY have zero or more Metrics. A MetricFamily MUST have a name, H
146
146
147
147
##### Name
148
148
149
-
MetricFamily names are a string and MUST be unique within a MetricSet. Names SHOULD be in snake_case. Names SHOULD follow the restrictions in the ABNF section under `metricname`. Metric names MAY be any quoted and escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics is still experimental and may reduce usability, especially when suffixes are not included.
149
+
MetricFamily name:
150
+
151
+
* MUST be string.
152
+
* MUST be unique within a MetricSet.
153
+
* MUST be the same as every MetricPoint's MetricName in the family.
> for MetricName and matching MetricFamily names without such suffixes. To improve parser reliability (i.e. matching
157
+
> [MetricFamily metadata](#metricfamily-metadata)) and future compatibility, this specification requires MetricFamily name to strictly match MetricNames
158
+
> in the same family.
159
+
160
+
Names SHOULD be in snake_case. Names SHOULD follow the restrictions in the ABNF section under `metricname`. Metric names MAY be any quoted and escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics may reduce usability, especially when `_total` or unit suffixes are not included in the names.
150
161
151
162
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.
152
163
153
164
MetricFamily names beginning with underscores are RESERVED and MUST NOT be used unless specified by this standard.
154
165
155
-
###### Suffixes
166
+
###### Reserved Suffixes
156
167
157
-
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_total" as a counter called "foo" could create a "foo_total" in the text format.
168
+
MetricFamily name SHOULD NOT end with `_count`, `_sum`, `_gcount`, `_gsum`, `_bucket`. Specifically name MUST NOT create
169
+
MetricName collision when converted to [the Text OpenMetrics 1.0](https://prometheus.io/docs/specs/om/open_metrics_spec).
158
170
159
-
Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.
171
+
A non-compliant example would be a gauge called `foo_bucket` and a histogram called `foo`. Exposers negotiating the older
172
+
OpenMetrics or Text formats, or ingestors which support only the older data model could end up storing `foo` histogram
173
+
in a classic representation (`foo_bucket`, `foo_count`, `foo_sum`) causing clash with the gauge and scrape rejection or dropped data.
160
174
161
-
* Suffixes for the respective types are:
162
-
* Counter: `_total`
163
-
* Summary: `_count`, `_sum`, `` (empty)
164
-
* Histogram: `_count`, `_sum`, `_bucket`
165
-
* GaugeHistogram: `_gcount`, `_gsum`, `_bucket`
166
-
* Info: `_info`
167
-
* Gauge: `` (empty)
168
-
* StateSet: `` (empty)
169
-
* Unknown: `` (empty)
175
+
> This rule is because this specification is following a shift in Prometheus ecosystem towards [composite values](#compositevalues) instead of [the "classic" representation](https://prometheus.io/docs/specs/om/open_metrics_spec/#histogram-1). However, this transformation will take time.
176
+
> Reserving suffixes improves compatibility with older ingestors and the eventual migration process.
0 commit comments