forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
29 lines (26 loc) · 820 Bytes
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package querier
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
type Metrics struct {
tailsActive prometheus.Gauge
tailedStreamsActive prometheus.Gauge
tailedBytesTotal prometheus.Counter
}
func NewMetrics(r prometheus.Registerer) *Metrics {
return &Metrics{
tailsActive: promauto.With(r).NewGauge(prometheus.GaugeOpts{
Name: "loki_querier_tail_active",
Help: "Number of active tailers",
}),
tailedStreamsActive: promauto.With(r).NewGauge(prometheus.GaugeOpts{
Name: "loki_querier_tail_active_streams",
Help: "Number of active streams being tailed",
}),
tailedBytesTotal: promauto.With(r).NewCounter(prometheus.CounterOpts{
Name: "loki_querier_tail_bytes_total",
Help: "total bytes tailed",
}),
}
}