@@ -22,11 +22,11 @@ type quarantineItem struct {
2222func (quarantine Quarantine ) Provide (api mailcowApi.MailcowApiClient ) ([]prometheus.Collector , error ) {
2323 countGauge := * prometheus .NewGaugeVec (prometheus.GaugeOpts {
2424 Name : "mailcow_quarantine_count" ,
25- }, []string {"recipient" , "is_virus" })
25+ }, []string {"host" , " recipient" , "is_virus" })
2626 scoreHist := * prometheus .NewHistogramVec (prometheus.HistogramOpts {
2727 Name : "mailcow_quarantine_score" ,
2828 Buckets : []float64 {0 , 10 , 20 , 40 , 60 , 80 , 100 },
29- }, []string {"recipient" })
29+ }, []string {"host" , " recipient" })
3030 ageHist := * prometheus .NewHistogramVec (prometheus.HistogramOpts {
3131 Name : "mailcow_quarantine_age" ,
3232 Help : "Age of quarantined items in seconds" ,
@@ -39,7 +39,7 @@ func (quarantine Quarantine) Provide(api mailcowApi.MailcowApiClient) ([]prometh
3939 (14 * 60 * 60 * 24 ), // 14 days
4040 (30 * 60 * 60 * 24 ), // 30 days
4141 },
42- }, []string {"recipient" })
42+ }, []string {"host" , " recipient" })
4343
4444 body := make ([]quarantineItem , 0 )
4545 err := api .Get ("api/v1/get/quarantine/all" , & body )
@@ -64,15 +64,15 @@ func (quarantine Quarantine) Provide(api mailcowApi.MailcowApiClient) ([]prometh
6464 }
6565
6666 age := time .Now ().Unix () - q .Created
67- ageHist .WithLabelValues (q .Recipient ).Observe (float64 (age ))
68- scoreHist .WithLabelValues (q .Recipient ).Observe (float64 (q .Score ))
67+ ageHist .WithLabelValues (api . Host , q .Recipient ).Observe (float64 (age ))
68+ scoreHist .WithLabelValues (api . Host , q .Recipient ).Observe (float64 (q .Score ))
6969 }
7070
7171 for recipient , count := range virus {
72- countGauge .WithLabelValues (recipient , "1" ).Set (float64 (count ))
72+ countGauge .WithLabelValues (api . Host , recipient , "1" ).Set (float64 (count ))
7373 }
7474 for recipient , count := range notVirus {
75- countGauge .WithLabelValues (recipient , "0" ).Set (float64 (count ))
75+ countGauge .WithLabelValues (api . Host , recipient , "0" ).Set (float64 (count ))
7676 }
7777
7878 return []prometheus.Collector {
0 commit comments