에러 로그 추가

This commit is contained in:
2024-09-23 22:23:59 +09:00
parent f174a165fe
commit e5984b3342

View File

@ -8,6 +8,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"repositories.action2quare.com/ayo/gocommon/flagx"
"repositories.action2quare.com/ayo/gocommon/logger"
"repositories.action2quare.com/ayo/houston/client"
"net/http"
@ -23,7 +24,14 @@ func main() {
http.Handle("/metrics", promhttp.Handler())
server := &http.Server{Addr: ":9100", Handler: nil}
go server.ListenAndServe()
go func() {
logger.Println("listen /metrics")
err := server.ListenAndServe()
if err != nil {
logger.Error(err)
}
}()
hc.Start()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)