mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-03 02:21:58 +00:00
tsweb: make VarzHandler support untyped expvar.Maps for compatibility
Updates #2635 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -363,6 +363,18 @@ func TestVarzHandler(t *testing.T) {
|
||||
},
|
||||
"# TYPE s_bar counter\ns_bar 2\n# TYPE s_foo counter\ns_foo 1\n",
|
||||
},
|
||||
{
|
||||
"expvar_map_untyped",
|
||||
"api_status_code",
|
||||
func() *expvar.Map {
|
||||
m := new(expvar.Map)
|
||||
m.Init()
|
||||
m.Add("2xx", 100)
|
||||
m.Add("5xx", 2)
|
||||
return m
|
||||
}(),
|
||||
"api_status_code_2xx 100\napi_status_code_5xx 2\n",
|
||||
},
|
||||
{
|
||||
"func_float64",
|
||||
"counter_x",
|
||||
@@ -420,16 +432,6 @@ func TestVarzHandler(t *testing.T) {
|
||||
}(),
|
||||
"# TYPE m counter\nm{keyname=\"bar\"} 2\nm{keyname=\"foo\"} 1\n",
|
||||
},
|
||||
{
|
||||
"expvar_label_map_malformed",
|
||||
"counter_labelmap_lackslabel",
|
||||
func() *expvar.Map {
|
||||
m := new(expvar.Map)
|
||||
m.Init()
|
||||
return m
|
||||
}(),
|
||||
"# skipping expvar.Map \"lackslabel\" with incomplete metadata: label \"\", Prometheus type \"counter\"\n",
|
||||
},
|
||||
{
|
||||
"struct_reflect",
|
||||
"foo",
|
||||
|
||||
Reference in New Issue
Block a user