support env var for prom instances
This commit is contained in:
parent
6fa7e57294
commit
aaf201b9d2
|
@ -57,6 +57,11 @@ func (ins *Instance) Init() error {
|
|||
} else if len(ins.URLs) == 0 {
|
||||
return types.ErrInstancesEmpty
|
||||
}
|
||||
for i, u := range ins.URLs {
|
||||
ins.URLs[i] = strings.Replace(u, "$hostname", config.Config.GetHostname(), -1)
|
||||
ins.URLs[i] = strings.Replace(u, "$ip", config.Config.Global.IP, -1)
|
||||
ins.URLs[i] = os.Expand(u, config.GetEnv)
|
||||
}
|
||||
|
||||
if ins.Timeout <= 0 {
|
||||
ins.Timeout = config.Duration(time.Second * 3)
|
||||
|
|
Loading…
Reference in New Issue