瀏覽代碼

no default metric (#199)

Co-authored-by: zhoushuguang <zhoushuguang@xiaoheiban.cn>
zhoushuguang 4 年之前
父節點
當前提交
f8da301e57
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      core/prometheus/config.go
  2. 3 3
      core/service/serviceconf.go

+ 1 - 1
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"`
 }

+ 3 - 3
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() {