Report meta info to opensergo
refer to opensergo-dashboard and run opensergo-dashboard
refer to opensergo-specification and set environment variables
export OPENSERGO_BOOTSTRAP_CONFIG={"endpoint":"127.0.0.1:9090"}
package main
import (
...
"github.com/cloudwego/kitex/server"
"github.com/kitex-contrib/opensergo/metainfo"
...
)
func main() {
...
r, err := metainfo.NewDefaultMetaReporter()
if err != nil {
panic(err)
}
svr := hello.NewServer(
new(HelloImpl),
)
server.RegisterStartHook(func() {
if err = r.ReportMetaInfo(svr.GetServiceInfo()); err != nil {
klog.Error(err)
}
})
...
}
go run example/server/main.go
See example