-func (s *statsTicker) setupPrometheus(drv string, reg *prometheus.Registry, lbl prometheus.Labels) {
- metrics := map[string][]interface{}{
- "errors": []interface{}{string("errors"), s.Errors},
- "in_bytes": []interface{}{string("input bytes"), s.InBytes},
- "out_bytes": []interface{}{string("output bytes"), s.OutBytes},
- }
- for mName, data := range metrics {
- mHelp := data[0].(string)
- mVal := data[1].(uint64)
- reg.Register(prometheus.NewGaugeFunc(
- prometheus.GaugeOpts{
- Namespace: "arvados",
- Subsystem: "keepstore",
- Name: fmt.Sprintf("%s_%s", drv, mName),
- Help: fmt.Sprintf("Number of %s backend %s", drv, mHelp),
- ConstLabels: lbl,
- },
- func() float64 { return float64(mVal) },
- ))
- }
+ opsCounters *prometheus.CounterVec
+ errCounters *prometheus.CounterVec
+ ioBytes *prometheus.CounterVec