@@ -36,9 +36,11 @@ const (
36
36
ProtoType = `application/vnd.google.protobuf`
37
37
ProtoProtocol = `io.prometheus.client.MetricFamily`
38
38
// Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
39
- ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
40
- OpenMetricsType = `application/openmetrics-text`
39
+ ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
40
+ OpenMetricsType = `application/openmetrics-text`
41
+ //nolint:revive // Allow for underscores.
41
42
OpenMetricsVersion_0_0_1 = "0.0.1"
43
+ //nolint:revive // Allow for underscores.
42
44
OpenMetricsVersion_1_0_0 = "1.0.0"
43
45
44
46
// The Content-Type values for the different wire protocols. Do not do direct
@@ -54,8 +56,10 @@ const (
54
56
// Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
55
57
FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
56
58
// Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
59
+ //nolint:revive // Allow for underscores.
57
60
FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
58
61
// Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
62
+ //nolint:revive // Allow for underscores.
59
63
FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
60
64
)
61
65
@@ -188,8 +192,8 @@ func (f Format) FormatType() FormatType {
188
192
// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid
189
193
// "escaping" term exists, that will be used. Otherwise, the global default will
190
194
// be returned.
191
- func (format Format ) ToEscapingScheme () model.EscapingScheme {
192
- for _ , p := range strings .Split (string (format ), ";" ) {
195
+ func (f Format ) ToEscapingScheme () model.EscapingScheme {
196
+ for _ , p := range strings .Split (string (f ), ";" ) {
193
197
toks := strings .Split (p , "=" )
194
198
if len (toks ) != 2 {
195
199
continue
0 commit comments