From f8da301e571386c609c38b386c523587fb6c3134 Mon Sep 17 00:00:00 2001 From: zhoushuguang <15951703783@163.com> Date: Tue, 10 Nov 2020 11:47:08 +0800 Subject: [PATCH] no default metric (#199) 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 5c1cfc83..29887bbd 100644 --- a/core/prometheus/config.go +++ b/core/prometheus/config.go @@ -1,7 +1,7 @@ package prometheus type Config struct { - Host string `json:",default=127.0.0.1"` + Host string `json:",optional"` Port int `json:",default=9101"` Path string `json:",default=/metrics"` } diff --git a/core/service/serviceconf.go b/core/service/serviceconf.go index 89bdb51f..f45f05ad 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 + Mode string `json:",default=pro,options=dev|test|pre|pro"` + MetricsUrl string `json:",optional"` + Prometheus prometheus.Config `json:",optional"` } func (sc ServiceConf) MustSetUp() {