Browse Source

Adds dummy prom metrics for alerting

Stephen McQuay 1 year ago
parent
commit
b8491e384d
Signed by: stephen mcquay <stephen@mcquay.me> GPG Key ID: C383C74875475AC8
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      control.go

+ 4
- 0
control.go View File

@@ -68,6 +68,7 @@ func NewController(conf Config, mprof, pprof, staticFiles string) *http.ServeMux
68 68
 		"bandwidth": "/api/v0/game/bw/",
69 69
 		"fsu":       "/api/v0/fsu/",
70 70
 		"info":      "/api/v0/info/",
71
+		"metrics":   "/metrics",
71 72
 	}
72 73
 
73 74
 	sm := http.NewServeMux()
@@ -108,6 +109,9 @@ func NewController(conf Config, mprof, pprof, staticFiles string) *http.ServeMux
108 109
 	sm.Handle(prefix["bandwidth"], JsonHandler(c.BW))
109 110
 	sm.HandleFunc(prefix["fsu"], c.KillServer)
110 111
 	sm.HandleFunc(prefix["info"], c.Info)
112
+	sm.HandleFunc(prefix["metrics"], func(w http.ResponseWriter, req *http.Request) {
113
+		fmt.Fprintf(w, "up 1\n")
114
+	})
111 115
 
112 116
 	return sm
113 117
 }

Loading…
Cancel
Save