Skip to content

Commit

Permalink
[fix] prometheus config may be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Jul 13, 2022
1 parent e1ae270 commit 21940fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agent/prometheus_scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

func (a *Agent) startPrometheusScrape() {
if coreconfig.Config == nil ||
coreconfig.Config.Prometheus == nil ||
!coreconfig.Config.Prometheus.Enable {
return
}
Expand All @@ -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
}
Expand Down

0 comments on commit 21940fd

Please sign in to comment.