From d672b5dd90ec2572c9a01adf25ec143b56370a3a Mon Sep 17 00:00:00 2001 From: mountain Date: Thu, 23 Nov 2023 20:08:57 +0900 Subject: [PATCH] metric exception --- metric/metric.go | 1 + server.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/metric/metric.go b/metric/metric.go index 82b4cf3..29ed231 100644 --- a/metric/metric.go +++ b/metric/metric.go @@ -155,6 +155,7 @@ func newMetricImpl(mt MetricType, name string, help string, constLabels map[stri }) writer = &metric_int64{ + valptr: new(int64), key: key, writerChan: mc.writerChan, } diff --git a/server.go b/server.go index d49abcc..9a4860c 100644 --- a/server.go +++ b/server.go @@ -117,6 +117,7 @@ func NewHTTPServerWithPort(serveMux *http.ServeMux, port int) *Server { addr := fmt.Sprintf(":%d", port) serveMux.HandleFunc(MakeHttpHandlerPattern("welcome"), welcomeHandler) serveMux.HandleFunc(MakeHttpHandlerPattern("lb_health_chceck"), healthCheckHandler) + serveMux.HandleFunc(MakeHttpHandlerPattern("lb_health_check"), healthCheckHandler) server := &Server{ httpserver: &http.Server{Addr: addr, Handler: serveMux}, @@ -127,6 +128,7 @@ func NewHTTPServerWithPort(serveMux *http.ServeMux, port int) *Server { } func NewHTTPServer(serveMux *http.ServeMux) *Server { + // 시작시 자동으로 enable됨 if len(*tls) > 0 && *portptr == 80 { *portptr = 443