mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
committed by
Cuong Manh Le
parent
44352f8006
commit
71f26a6d81
@@ -348,6 +348,13 @@ func (p *prog) run(reload bool, reloadCh chan struct{}) {
|
||||
p.checkDnsLoopTicker(ctx)
|
||||
}()
|
||||
|
||||
wg.Add(1)
|
||||
// Prometheus exporter goroutine.
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
p.runMetricsServer(ctx, reloadCh)
|
||||
}()
|
||||
|
||||
if !reload {
|
||||
// Stop writing log to unix socket.
|
||||
consoleWriter.Out = os.Stdout
|
||||
@@ -365,6 +372,11 @@ func (p *prog) run(reload bool, reloadCh chan struct{}) {
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
// metricsEnabled reports whether prometheus exporter is enabled/disabled.
|
||||
func (p *prog) metricsEnabled() bool {
|
||||
return p.cfg.Service.MetricsQueryStats || p.cfg.Service.MetricsListener != ""
|
||||
}
|
||||
|
||||
func (p *prog) Stop(s service.Service) error {
|
||||
mainLog.Load().Info().Msg("Service stopped")
|
||||
close(p.stopCh)
|
||||
|
||||
Reference in New Issue
Block a user