feat: 支持环境变量控制 Prometheus metrics
All checks were successful
itom-platform auto build image / build (push) Successful in 3m17s
All checks were successful
itom-platform auto build image / build (push) Successful in 3m17s
This commit is contained in:
@@ -43,6 +43,7 @@ type API struct {
|
||||
ListenIP string `mapstructure:"listenIP"`
|
||||
Ports []int `mapstructure:"ports"`
|
||||
} `mapstructure:"api"`
|
||||
Prometheus Prometheus `mapstructure:"prometheus"` // 可选的 Prometheus 配置
|
||||
}
|
||||
|
||||
type APIBot struct {
|
||||
@@ -50,6 +51,7 @@ type APIBot struct {
|
||||
ListenIP string `mapstructure:"listenIP"`
|
||||
Ports []int `mapstructure:"ports"`
|
||||
} `mapstructure:"api"`
|
||||
Prometheus Prometheus `mapstructure:"prometheus"` // 可选的 Prometheus 配置
|
||||
}
|
||||
|
||||
type Mongo struct {
|
||||
@@ -104,6 +106,12 @@ type Discovery struct {
|
||||
RpcService RpcService `mapstructure:"rpcService"`
|
||||
}
|
||||
|
||||
// Prometheus 配置(可选,用于暴露 /metrics 端点)
|
||||
type Prometheus struct {
|
||||
Enable bool `mapstructure:"enable"` // 是否启用 Prometheus metrics,默认 false
|
||||
Path string `mapstructure:"path"` // metrics 路径,默认 /metrics
|
||||
}
|
||||
|
||||
type Kubernetes struct {
|
||||
Namespace string `mapstructure:"namespace"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user