From d629acc2b7747cabf693be11d35eaa381e705bdb Mon Sep 17 00:00:00 2001 From: zhoushuguang <15951703783@163.com> Date: Mon, 9 Nov 2020 16:03:07 +0800 Subject: [PATCH] default metric host (#196) Co-authored-by: zhoushuguang --- core/prometheus/config.go | 2 +- core/service/serviceconf.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/prometheus/config.go b/core/prometheus/config.go index 29887bbd..5c1cfc83 100644 --- a/core/prometheus/config.go +++ b/core/prometheus/config.go @@ -1,7 +1,7 @@ package prometheus type Config struct { - Host string `json:",optional"` + Host string `json:",default=127.0.0.1"` Port int `json:",default=9101"` Path string `json:",default=/metrics"` } diff --git a/core/service/serviceconf.go b/core/service/serviceconf.go index f45f05ad..89bdb51f 100644 --- a/core/service/serviceconf.go +++ b/core/service/serviceconf.go @@ -19,9 +19,9 @@ const ( type ServiceConf struct { Name string Log logx.LogConf - Mode string `json:",default=pro,options=dev|test|pre|pro"` - MetricsUrl string `json:",optional"` - Prometheus prometheus.Config `json:",optional"` + Mode string `json:",default=pro,options=dev|test|pre|pro"` + MetricsUrl string `json:",optional"` + Prometheus prometheus.Config } func (sc ServiceConf) MustSetUp() {