92
92
Help : "Number of configured receivers." ,
93
93
},
94
94
)
95
+ configuredIntegrations = prometheus .NewGauge (
96
+ prometheus.GaugeOpts {
97
+ Name : "alertmanager_integrations" ,
98
+ Help : "Number of configured integrations." ,
99
+ },
100
+ )
95
101
promlogConfig = promlog.Config {}
96
102
)
97
103
@@ -100,6 +106,7 @@ func init() {
100
106
prometheus .MustRegister (responseSize )
101
107
prometheus .MustRegister (clusterEnabled )
102
108
prometheus .MustRegister (configuredReceivers )
109
+ prometheus .MustRegister (configuredIntegrations )
103
110
prometheus .MustRegister (version .NewCollector ("alertmanager" ))
104
111
}
105
112
@@ -402,6 +409,7 @@ func run() int {
402
409
403
410
// Build the map of receiver to integrations.
404
411
receivers := make (map [string ][]notify.Integration , len (activeReceivers ))
412
+ var integrationsNum int
405
413
for _ , rcv := range conf .Receivers {
406
414
if _ , found := activeReceivers [rcv .Name ]; ! found {
407
415
// No need to build a receiver if no route is using it.
@@ -414,6 +422,7 @@ func run() int {
414
422
}
415
423
// rcv.Name is guaranteed to be unique across all receivers.
416
424
receivers [rcv .Name ] = integrations
425
+ integrationsNum += len (integrations )
417
426
}
418
427
419
428
inhibitor .Stop ()
@@ -430,6 +439,7 @@ func run() int {
430
439
peer ,
431
440
)
432
441
configuredReceivers .Set (float64 (len (activeReceivers )))
442
+ configuredIntegrations .Set (float64 (integrationsNum ))
433
443
434
444
api .Update (conf , func (labels model.LabelSet ) {
435
445
inhibitor .Mutes (labels )
0 commit comments