68
68
Help : "Distribution of memcache report sizes" ,
69
69
Buckets : prometheus .ExponentialBuckets (4096 , 2.0 , 10 ),
70
70
})
71
+ reportsPerUser = prometheus .NewCounterVec (prometheus.CounterOpts {
72
+ Namespace : "scope" ,
73
+ Name : "reports_stored_total" ,
74
+ Help : "Total count of stored reports per user." ,
75
+ }, []string {"user" })
76
+ reportSizePerUser = prometheus .NewCounterVec (prometheus.CounterOpts {
77
+ Namespace : "scope" ,
78
+ Name : "reports_bytes_total" ,
79
+ Help : "Total bytes stored in reports per user." ,
80
+ }, []string {"user" })
71
81
72
82
natsRequests = prometheus .NewCounterVec (prometheus.CounterOpts {
73
83
Namespace : "scope" ,
@@ -83,6 +93,8 @@ func init() {
83
93
prometheus .MustRegister (inProcessCacheRequests )
84
94
prometheus .MustRegister (inProcessCacheHits )
85
95
prometheus .MustRegister (reportSizeHistogram )
96
+ prometheus .MustRegister (reportsPerUser )
97
+ prometheus .MustRegister (reportSizePerUser )
86
98
prometheus .MustRegister (natsRequests )
87
99
}
88
100
@@ -434,6 +446,8 @@ func (c *awsCollector) Add(ctx context.Context, rep report.Report, buf []byte) e
434
446
return err
435
447
}
436
448
reportSizeHistogram .Observe (float64 (reportSize ))
449
+ reportSizePerUser .WithLabelValues (userid ).Add (float64 (reportSize ))
450
+ reportsPerUser .WithLabelValues (userid ).Inc ()
437
451
438
452
// third, put it in memcache
439
453
if c .cfg .MemcacheClient != nil {
0 commit comments