Browse Source

1、项目初始化

master
wangjian 4 years ago
parent
commit
6c5432a6ea
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      cmd/main.go
  2. +1
    -1
      discover/discover.go

+ 3
- 3
cmd/main.go View File

@@ -66,14 +66,14 @@ func main() {
fieldKeys := []string{"method"}
requestCount := kitprometheus.NewCounterFrom(stdprometheus.CounterOpts{
Namespace: config.Cfg.Get("name").(string),
Subsystem: "job_risk_third_service",
Subsystem: config.Cfg.Get("name").(string) + "_service",
Name: "request_count",
Help: "收到的请求数",
}, fieldKeys)

requestLatency := kitprometheus.NewSummaryFrom(stdprometheus.SummaryOpts{
Namespace: config.Cfg.Get("name").(string),
Subsystem: "job_risk_third_service",
Subsystem: config.Cfg.Get("name").(string) + "_service",
Name: "request_latency",
Help: "请求的总持续时间(以微秒为单位)",
}, fieldKeys)
@@ -82,7 +82,7 @@ func main() {
var (
err error
hostPort = fmt.Sprintf("%s:%d", zipkinConf.Address, zipkinConf.Port)
serviceName = "insigma_service"
serviceName = config.Cfg.Get("name").(string) + "_service"
useNoopTracer = zipkinConf.ZipkinURL == ""
reporters = zipkinhttp.NewReporter(zipkinConf.ZipkinURL)
)


+ 1
- 1
discover/discover.go View File

@@ -42,7 +42,7 @@ func Register(consulHost, consulPort, svcHost, svcPort, svrId, svrName string, l
Name: "prometheus-" + svrName,
Address: svcHost,
Port: port,
Tags: []string{svrName, "JobRiskBizServices"},
Tags: []string{svrName, "JobRiskThirdServices"},
Check: &check,
}



Loading…
Cancel
Save