|
|
@ -370,8 +370,8 @@ func writePromExpVar(w io.Writer, prefix string, kv expvar.KeyValue) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if strings.HasPrefix(key, "labelmap_") {
|
|
|
|
if strings.HasPrefix(key, "labelmap_") {
|
|
|
|
key = strings.TrimPrefix(key, "labelmap_")
|
|
|
|
key = strings.TrimPrefix(key, "labelmap_")
|
|
|
|
if i := strings.Index(key, "_"); i != -1 {
|
|
|
|
if a, b, ok := strings.Cut(key, "_"); ok {
|
|
|
|
label, key = key[:i], key[i+1:]
|
|
|
|
label, key = a, b
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
name := prefix + key
|
|
|
|
name := prefix + key
|
|
|
@ -541,9 +541,7 @@ func foreachExportedStructField(rv reflect.Value, f func(fieldOrJSONName, metric
|
|
|
|
sf := t.Field(i)
|
|
|
|
sf := t.Field(i)
|
|
|
|
name := sf.Name
|
|
|
|
name := sf.Name
|
|
|
|
if v := sf.Tag.Get("json"); v != "" {
|
|
|
|
if v := sf.Tag.Get("json"); v != "" {
|
|
|
|
if i := strings.Index(v, ","); i != -1 {
|
|
|
|
v, _, _ = strings.Cut(v, ",")
|
|
|
|
v = v[:i]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if v == "-" {
|
|
|
|
if v == "-" {
|
|
|
|
// Skip it, regardless of its metrictype.
|
|
|
|
// Skip it, regardless of its metrictype.
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|