mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-11 20:45:57 +08:00
feat: Prometheus can auto set port (#2943)
* feat: config * feat: prometheus auto set port
This commit is contained in:
@@ -26,6 +26,10 @@ import (
|
||||
"github.com/openimsdk/tools/errs"
|
||||
)
|
||||
|
||||
const (
|
||||
Etcd = "etcd"
|
||||
)
|
||||
|
||||
// NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type.
|
||||
func NewDiscoveryRegister(discovery *config.Discovery, runtimeEnv string) (discovery.SvcDiscoveryRegistry, error) {
|
||||
if runtimeEnv == "kubernetes" {
|
||||
@@ -35,7 +39,7 @@ func NewDiscoveryRegister(discovery *config.Discovery, runtimeEnv string) (disco
|
||||
switch discovery.Enable {
|
||||
case "kubernetes":
|
||||
return kubernetes.NewKubernetesConnManager(discovery.Kubernetes.Namespace)
|
||||
case "etcd":
|
||||
case Etcd:
|
||||
return etcd.NewSvcDiscoveryRegistry(
|
||||
discovery.Etcd.RootDirectory,
|
||||
discovery.Etcd.Address,
|
||||
|
||||
Reference in New Issue
Block a user