feat: add metrics support
This commit is contained in:
14
internal/metrics/server.go
Normal file
14
internal/metrics/server.go
Normal 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"))
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user