Skip to content

Commit

Permalink
Merge pull request #91 from kongfei605/prometheus_panic_fix
Browse files Browse the repository at this point in the history
[fix] prometheus config may be nil
  • Loading branch information
kongfei605 committed Jul 13, 2022
2 parents e1ae270 + 21940fd commit 0c369d9
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 0c369d9

Please sign in to comment.