|
|
|
@ -18,7 +18,7 @@ import (
|
|
|
|
|
"context"
|
|
|
|
|
"fmt"
|
|
|
|
|
ginProm "github.com/openimsdk/open-im-server/v3/pkg/common/ginPrometheus"
|
|
|
|
|
prom_metrics "github.com/openimsdk/open-im-server/v3/pkg/common/prom_metrics"
|
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/prom_metrics"
|
|
|
|
|
"net"
|
|
|
|
|
_ "net/http/pprof"
|
|
|
|
|
"strconv"
|
|
|
|
@ -85,10 +85,11 @@ func run(port int, proPort int) error {
|
|
|
|
|
log.ZInfo(context.Background(), "api register public config to discov success")
|
|
|
|
|
router := api.NewGinRouter(client, rdb)
|
|
|
|
|
//////////////////////////////
|
|
|
|
|
p := ginProm.NewPrometheus("app", prom_metrics.GetGinCusMetrics("Api"))
|
|
|
|
|
|
|
|
|
|
p.SetListenAddress(fmt.Sprintf(":%d", proPort))
|
|
|
|
|
p.Use(router)
|
|
|
|
|
if config.Config.Prometheus.Enable {
|
|
|
|
|
p := ginProm.NewPrometheus("app", prom_metrics.GetGinCusMetrics("Api"))
|
|
|
|
|
p.SetListenAddress(fmt.Sprintf(":%d", proPort))
|
|
|
|
|
p.Use(router)
|
|
|
|
|
}
|
|
|
|
|
/////////////////////////////////
|
|
|
|
|
log.ZInfo(context.Background(), "api init router success")
|
|
|
|
|
var address string
|
|
|
|
|