add type to prometheus metrics (#2916)
This commit is contained in:
parent
9d1910cb2b
commit
b20dcfd64c
@ -84,6 +84,7 @@ func prometheus(w http.ResponseWriter, r *http.Request) {
|
||||
// (https://prometheus.io/docs/concepts/metric_types/)
|
||||
monkit.Default.Stats(func(name string, val float64) {
|
||||
metric := sanitize(name)
|
||||
_, _ = fmt.Fprintf(w, "%s %g\n", metric, val)
|
||||
_, _ = fmt.Fprintf(w, "# TYPE %s gauge\n%s %g\n",
|
||||
metric, metric, val)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user