mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
metrics: revert changes to MultiLabelMap's String method
This breaks its ability to be used as an expvar and is blocking a trunkd deploy. Revert for now, and add a test to ensure that we don't break it in a future change. Updates #13550 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I1f1221c257c1de47b4bff0597c12f8530736116d
This commit is contained in:
@@ -97,12 +97,8 @@ type KeyValue[T comparable] struct {
|
||||
}
|
||||
|
||||
func (v *MultiLabelMap[T]) String() string {
|
||||
var sb strings.Builder
|
||||
sb.WriteString("MultiLabelMap:\n")
|
||||
v.Do(func(kv KeyValue[T]) {
|
||||
fmt.Fprintf(&sb, "\t%v: %v\n", kv.Key, kv.Value)
|
||||
})
|
||||
return sb.String()
|
||||
// NOTE: This has to be valid JSON because it's used by expvar.
|
||||
return `"MultiLabelMap"`
|
||||
}
|
||||
|
||||
// WritePrometheus writes v to w in Prometheus exposition format.
|
||||
|
Reference in New Issue
Block a user