mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	AlertingNG: Fix dispatcher metrics in notifier (#32434)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
		@@ -51,7 +51,8 @@ type Alertmanager struct {
 | 
				
			|||||||
	dispatcher   *dispatch.Dispatcher
 | 
						dispatcher   *dispatch.Dispatcher
 | 
				
			||||||
	dispatcherWG sync.WaitGroup
 | 
						dispatcherWG sync.WaitGroup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	stageMetrics *notify.Metrics
 | 
						stageMetrics      *notify.Metrics
 | 
				
			||||||
 | 
						dispatcherMetrics *dispatch.DispatcherMetrics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	reloadConfigMtx sync.Mutex
 | 
						reloadConfigMtx sync.Mutex
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -69,6 +70,7 @@ func (am *Alertmanager) Init() (err error) {
 | 
				
			|||||||
	r := prometheus.NewRegistry()
 | 
						r := prometheus.NewRegistry()
 | 
				
			||||||
	am.marker = types.NewMarker(r)
 | 
						am.marker = types.NewMarker(r)
 | 
				
			||||||
	am.stageMetrics = notify.NewMetrics(r)
 | 
						am.stageMetrics = notify.NewMetrics(r)
 | 
				
			||||||
 | 
						am.dispatcherMetrics = dispatch.NewDispatcherMetrics(r)
 | 
				
			||||||
	am.Store = store.DBstore{SQLStore: am.SQLStore}
 | 
						am.Store = store.DBstore{SQLStore: am.SQLStore}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	am.notificationLog, err = nflog.New(
 | 
						am.notificationLog, err = nflog.New(
 | 
				
			||||||
@@ -196,8 +198,7 @@ func (am *Alertmanager) applyConfig(cfg *api.PostableUserConfig) error {
 | 
				
			|||||||
	am.StopAndWait()
 | 
						am.StopAndWait()
 | 
				
			||||||
	//TODO: Verify this is correct
 | 
						//TODO: Verify this is correct
 | 
				
			||||||
	route := dispatch.NewRoute(cfg.AlertmanagerConfig.Route, nil)
 | 
						route := dispatch.NewRoute(cfg.AlertmanagerConfig.Route, nil)
 | 
				
			||||||
	//TODO: This needs the metrics
 | 
						am.dispatcher = dispatch.NewDispatcher(am.alerts, route, routingStage, am.marker, timeoutFunc, gokit_log.NewNopLogger(), am.dispatcherMetrics)
 | 
				
			||||||
	am.dispatcher = dispatch.NewDispatcher(am.alerts, route, routingStage, am.marker, timeoutFunc, gokit_log.NewNopLogger(), nil)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	am.dispatcherWG.Add(1)
 | 
						am.dispatcherWG.Add(1)
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user