diff --git a/docker-compose.yaml b/docker-compose.yaml index e9b87f5ec..5b2c15712 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -171,4 +171,4 @@ services: restart: always ports: - "9100:9100" - command: --collector.ENTER-THE-NAME-OF-COLLECTOR + # command: --collector.ENTER-THE-NAME-OF-COLLECTOR diff --git a/docker-compose_cfg/prometheus-compose.yml b/docker-compose_cfg/prometheus-compose.yml index c8069a6d2..8a2d6c3ab 100644 --- a/docker-compose_cfg/prometheus-compose.yml +++ b/docker-compose_cfg/prometheus-compose.yml @@ -11,13 +11,12 @@ scrape_configs: - targets: ['localhost:9091'] - job_name: 'openIM-server' + metrics_path: /metrics static_configs: - targets: ['localhost:10006'] - metrics_path: /cms/prometheus/metrics labels: group: 'cms-api' - targets: ['localhost:21400'] - metrics_path: /metrics labels: group: 'msg-transfer' diff --git a/internal/cms_api/router.go b/internal/cms_api/router.go index 496cd7d8b..1811fc2a7 100644 --- a/internal/cms_api/router.go +++ b/internal/cms_api/router.go @@ -17,14 +17,11 @@ import ( func NewGinRouter() *gin.Engine { gin.SetMode(gin.ReleaseMode) baseRouter := gin.Default() - router := baseRouter.Group("/cms") - router.Use(middleware.CorsHandler()) if config.Config.Prometheus.Enable { - prometheusRouterGroup := router.Group("/prometheus") - { - prometheusRouterGroup.GET("/metrics", prometheusHandler()) - } + baseRouter.GET("/metrics", prometheusHandler()) } + router := baseRouter.Group("/cms") + router.Use(middleware.CorsHandler()) adminRouterGroup := router.Group("/admin") { adminRouterGroup.POST("/login", admin.AdminLogin) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index b7b819081..b2222d6c2 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -139,15 +139,15 @@ type config struct { OpenImRealTimeCommPort []int `yaml:"openImRealTimeCommPort"` } RpcRegisterName struct { - OpenImStatisticsName string `yaml:"openImStatisticsName"` - OpenImUserName string `yaml:"openImUserName"` - OpenImFriendName string `yaml:"openImFriendName"` + OpenImUserName string `yaml:"openImUserName"` + OpenImFriendName string `yaml:"openImFriendName"` // OpenImOfflineMessageName string `yaml:"openImOfflineMessageName"` OpenImMsgName string `yaml:"openImMsgName"` OpenImPushName string `yaml:"openImPushName"` OpenImRelayName string `yaml:"openImRelayName"` OpenImGroupName string `yaml:"openImGroupName"` OpenImAuthName string `yaml:"openImAuthName"` + OpenImAdminCMSName string `yaml:"openImAdminCMSName"` OpenImOfficeName string `yaml:"openImOfficeName"` OpenImOrganizationName string `yaml:"openImOrganizationName"` OpenImConversationName string `yaml:"openImConversationName"`