feat: add metrics support

This commit is contained in:
d3m0k1d
2026-02-22 19:45:47 +03:00
parent 7bba444522
commit 3ac1250bfc
6 changed files with 113 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
package metrics
import (
"net/http"
)
func Handler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
for k, v := range metrics {
w.Write([]byte(k + " " + string(v) + "\n"))
}
})
}