Merge pull request #91 from kongfei605/prometheus_panic_fix
[fix] prometheus config may be nil
This commit is contained in:
commit
0c369d9f36
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
func (a *Agent) startPrometheusScrape() {
|
func (a *Agent) startPrometheusScrape() {
|
||||||
if coreconfig.Config == nil ||
|
if coreconfig.Config == nil ||
|
||||||
|
coreconfig.Config.Prometheus == nil ||
|
||||||
!coreconfig.Config.Prometheus.Enable {
|
!coreconfig.Config.Prometheus.Enable {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -18,6 +19,7 @@ func (a *Agent) startPrometheusScrape() {
|
||||||
|
|
||||||
func (a *Agent) stopPrometheusScrape() {
|
func (a *Agent) stopPrometheusScrape() {
|
||||||
if coreconfig.Config == nil ||
|
if coreconfig.Config == nil ||
|
||||||
|
coreconfig.Config.Prometheus == nil ||
|
||||||
!coreconfig.Config.Prometheus.Enable {
|
!coreconfig.Config.Prometheus.Enable {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue