We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本 go-chassis V1.76 在https://github.com/go-chassis/go-chassis-examples/blob/master/metrics/server/schema/schema.go 原来是init () 运行会有错的。因为archaius 还没有初始化。 做如下修改,可以运行:
` func (*User) URLPatterns() []restful.Route { Init() return []restful.Route{ {Method: http.MethodPost, Path: "/login", ResourceFuncName: "Login"}, {Method: http.MethodGet, Path: "/sign_out", ResourceFuncName: "SignOut"}, } }
const ( login = "login_total" signOut = "sign_out_total" label = "username" )
// init()改成 Init() 在URLPatterns()中先初始化 func Init() { //metrics.InstallPlugin("metrics", metrics.NewPrometheusExporter) //archaius.Init(archaius.WithENVSource())
//os.Exit(0) val := archaius.GetString("cse.metrics.enableGoRuntimeMetrics", "") openlogging.GetLogger().Errorf("-----------val :%s", val) //openlogging.GetLogger().Errorf("-----------val 1111111111111") metrics.Init() metrics.CreateCounter(metrics.CounterOpts{ Help: "count user login", Name: login, Labels: []string{label}}) metrics.CreateCounter(metrics.CounterOpts{ Help: "user sign out", Name: signOut, Labels: []string{label}})
} `
The text was updated successfully, but these errors were encountered:
我会看下
Sorry, something went wrong.
已经修复,试下
No branches or pull requests
版本 go-chassis V1.76
在https://github.com/go-chassis/go-chassis-examples/blob/master/metrics/server/schema/schema.go
原来是init () 运行会有错的。因为archaius 还没有初始化。
做如下修改,可以运行:
`
func (*User) URLPatterns() []restful.Route {
Init()
return []restful.Route{
{Method: http.MethodPost, Path: "/login", ResourceFuncName: "Login"},
{Method: http.MethodGet, Path: "/sign_out", ResourceFuncName: "SignOut"},
}
}
const (
login = "login_total"
signOut = "sign_out_total"
label = "username"
)
// init()改成 Init() 在URLPatterns()中先初始化
func Init() {
//metrics.InstallPlugin("metrics", metrics.NewPrometheusExporter)
//archaius.Init(archaius.WithENVSource())
}
`
The text was updated successfully, but these errors were encountered: