Skip to content

Commit

Permalink
handle prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperspencer committed Jan 4, 2024
1 parent f187dab commit 57b1ea6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ func main() {
Msgf("this is a %s", types.Blue("dry run"))
}

init := true
for {
reload := false
confs := []*types.Conf{}
Expand Down Expand Up @@ -685,11 +686,13 @@ func main() {
if confs[0].HasAllPrometheusConf() {
prometheus.CountSourcesConfigured.Add(float64(sourcecount))
prometheus.CountDestinationsConfigured.Add(float64(destinationcount))
prometheus.Serve(confs[0].Metrics.Prometheus)
} else {
reload = playsForever(c, cli.Configfiles)
log.Info().Msg("reloading config...")
if init {
go prometheus.Serve(confs[0].Metrics.Prometheus)
init = false
}
}
reload = playsForever(c, cli.Configfiles)
log.Info().Msg("reloading config...")
}
if !reload {
break
Expand Down

0 comments on commit 57b1ea6

Please sign in to comment.