mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
config: add sanity check for undefined prometheus conns
previously existed only for StatSConns, added also for CoreSConns and CacheSConns
This commit is contained in:
committed by
Dan Christian Bogos
parent
bb7e7572df
commit
f46ea874ba
@@ -1354,6 +1354,16 @@ func (cfg *CGRConfig) checkConfigSanity() error {
|
||||
return fmt.Errorf("<%s> connection with id: <%s> not defined", utils.PrometheusAgent, connID)
|
||||
}
|
||||
}
|
||||
for _, connID := range cfg.prometheusAgentCfg.CacheSConns {
|
||||
if _, has := cfg.rpcConns[connID]; !has && !strings.HasPrefix(connID, utils.MetaInternal) {
|
||||
return fmt.Errorf("<%s> connection with id: <%s> not defined", utils.PrometheusAgent, connID)
|
||||
}
|
||||
}
|
||||
for _, connID := range cfg.prometheusAgentCfg.CoreSConns {
|
||||
if _, has := cfg.rpcConns[connID]; !has && !strings.HasPrefix(connID, utils.MetaInternal) {
|
||||
return fmt.Errorf("<%s> connection with id: <%s> not defined", utils.PrometheusAgent, connID)
|
||||
}
|
||||
}
|
||||
for _, connID := range cfg.prometheusAgentCfg.StatSConns {
|
||||
if strings.HasPrefix(connID, utils.MetaInternal) && !cfg.statsCfg.Enabled {
|
||||
return fmt.Errorf("<%s> not enabled but requested by <%s> component", utils.StatService, utils.PrometheusAgent)
|
||||
|
||||
Reference in New Issue
Block a user