tsweb: add float64 to logged metrics

A previously added metric which was float64 was being ignored in tsweb, because it previously
only accepted int64 and ints. It can be handled in the same way as ints.

Signed-off-by: julianknodt <julianknodt@gmail.com>
This commit is contained in:
julianknodt 2021-07-23 12:42:54 -07:00 committed by Julian Knodt
parent 53a2f63658
commit 3377089583
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ func VarzHandler(w http.ResponseWriter, r *http.Request) {
case expvar.Func:
val := v()
switch val.(type) {
case int64, int:
case float64, int64, int:
fmt.Fprintf(w, "# TYPE %s %s\n%s %v\n", name, typ, name, val)
default:
fmt.Fprintf(w, "# skipping expvar func %q returning unknown type %T\n", name, val)