에러 로그 추가
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"repositories.action2quare.com/ayo/gocommon/flagx"
|
"repositories.action2quare.com/ayo/gocommon/flagx"
|
||||||
|
"repositories.action2quare.com/ayo/gocommon/logger"
|
||||||
"repositories.action2quare.com/ayo/houston/client"
|
"repositories.action2quare.com/ayo/houston/client"
|
||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -23,7 +24,14 @@ func main() {
|
|||||||
|
|
||||||
http.Handle("/metrics", promhttp.Handler())
|
http.Handle("/metrics", promhttp.Handler())
|
||||||
server := &http.Server{Addr: ":9100", Handler: nil}
|
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()
|
hc.Start()
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
|||||||
Reference in New Issue
Block a user