[fix] prometheus config may be nil
This commit is contained in:
parent
e1ae270db6
commit
21940fd7f5
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
func (a *Agent) startPrometheusScrape() {
|
||||
if coreconfig.Config == nil ||
|
||||
coreconfig.Config.Prometheus == nil ||
|
||||
!coreconfig.Config.Prometheus.Enable {
|
||||
return
|
||||
}
|
||||
|
@ -18,6 +19,7 @@ func (a *Agent) startPrometheusScrape() {
|
|||
|
||||
func (a *Agent) stopPrometheusScrape() {
|
||||
if coreconfig.Config == nil ||
|
||||
coreconfig.Config.Prometheus == nil ||
|
||||
!coreconfig.Config.Prometheus.Enable {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue