From c8981cf1a278a94137ce33240e74e62e3edbbbc1 Mon Sep 17 00:00:00 2001 From: lixin Date: Thu, 4 Dec 2025 09:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dconfig=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/server/server.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/internal/server/server.go b/internal/server/server.go index 120fc4b..e020dce 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -10,7 +10,6 @@ import ( "sync" "time" - "iptables_exporter/config" "iptables_exporter/internal/exporter" _ "iptables_exporter/internal/metrics" "iptables_exporter/pkg/logger" @@ -36,7 +35,9 @@ type Server struct { ExitSignal chan struct{} Error error callback sync.Once - ExporterConfig config.Settings + // ExporterConfig 保留为未来扩展预留,目前未在主流程中使用。 + // 如需启用基于 HTTP 的 scrape,可在此基础上集成 config.Settings。 + ExporterConfig exporter.Config server *http.Server } @@ -86,10 +87,6 @@ func (s *Server) SetUp() error { logrus.Error("Failed to unpack config: ", err) logrus.Info("Use default config") } - if config.ScrapeUrl != nil { - logrus.Info("Using command-line parameters to override configuration parameters") - s.ExporterConfig.ScrapeUri = *config.ScrapeUrl - } return nil } @@ -105,10 +102,6 @@ func (s *Server) setupLog() error { } func (s *Server) setupCmdArg() { - if config.ScrapeUrl != nil { - logrus.Info("Using command-line parameters to override configuration parameters") - s.ExporterConfig.ScrapeUri = *config.ScrapeUrl - } } func (s *Server) healthzHandler(w http.ResponseWriter, r *http.Request) { -- Gitee