From 2ae3e82f0751f117914706866d1fdf0c4778392f Mon Sep 17 00:00:00 2001 From: Chao Chen Date: Mon, 8 Feb 2021 17:06:38 -0800 Subject: [PATCH] etcdserver/api/etcdhttp: log successful etcd server side health check in debug level When we have an external component that checks /health periodically, the etcd server logs can be quite verbose (e.g., DDOS-ing against insure etcd health check can lead to disk space full due to large log files). This change was introduced in #11704. While we keep the warning logs for etcd health check failures, the success (or OK) log level should be set to DEBUG. Fixes #12676 --- server/etcdserver/api/etcdhttp/metrics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/etcdserver/api/etcdhttp/metrics.go b/server/etcdserver/api/etcdhttp/metrics.go index 827efbefe..595956863 100644 --- a/server/etcdserver/api/etcdhttp/metrics.go +++ b/server/etcdserver/api/etcdhttp/metrics.go @@ -79,7 +79,7 @@ func NewHealthHandler(lg *zap.Logger, hfunc func() Health) http.HandlerFunc { } w.WriteHeader(http.StatusOK) w.Write(d) - lg.Info("/health OK", zap.Int("status-code", http.StatusOK)) + lg.Debug("/health OK", zap.Int("status-code", http.StatusOK)) } } @@ -154,7 +154,7 @@ func checkV2Health(lg *zap.Logger, srv etcdserver.ServerV2) (h Health) { lg.Warn("serving /health false; QGET fails", zap.Error(err)) return } - lg.Info("serving /health true") + lg.Debug("serving /health true") return } @@ -171,6 +171,6 @@ func checkV3Health(lg *zap.Logger, srv *etcdserver.EtcdServer) (h Health) { lg.Warn("serving /health false; Range fails", zap.Error(err)) return } - lg.Info("serving /health true") + lg.Debug("serving /health true") return }