feat: add IM service health and metrics endpoints

This commit is contained in:
richjohnrambo
2026-09-09 14:24:40 +08:00
parent 4c9bdd64e0
commit 9159ec7fc7
11 changed files with 616 additions and 6 deletions
+3 -1
View File
@@ -847,6 +847,8 @@ func main() {
logs.Info.Printf("Server status is available at '%s'", sspath)
mux.HandleFunc(sspath, serveStatus)
}
mux.HandleFunc("/healthz", serveHealthz)
mux.HandleFunc("/metrics", serveMetrics)
// Handle websocket clients.
mux.HandleFunc(config.ApiPath+"v0/channels", serveWebSocket)
@@ -946,7 +948,7 @@ func main() {
mux.HandleFunc("/", serve404)
}
if err = listenAndServe(config.Listen, withIMHTTPProtocol(config.ApiPath+"v1/im/", mux), tlsConfig, signalHandler()); err != nil {
if err = listenAndServe(config.Listen, monitorHTTP(withIMHTTPProtocol(config.ApiPath+"v1/im/", mux)), tlsConfig, signalHandler()); err != nil {
logs.Err.Fatal(err)
}
}