-
Notifications
You must be signed in to change notification settings - Fork 53
/
metrics.go
34 lines (31 loc) · 1.04 KB
/
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
30
31
32
33
34
package cortex
import (
"github.com/prometheus/client_golang/prometheus"
)
var (
mIngestBytesTotal = prometheus.NewCounter(prometheus.CounterOpts{
Namespace: "opni",
Subsystem: "gateway",
Name: "remote_write_ingest_bytes_total",
Help: "Total number of (compressed) bytes received from remote write requests",
})
mIngestBytesByID = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "opni",
Subsystem: "gateway",
Name: "remote_write_cluster_ingest_bytes",
Help: "Total number of (compressed) bytes received from remote write requests by cluster ID",
}, []string{"cluster_id"})
mRemoteWriteRequests = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "opni",
Subsystem: "gateway",
Name: "remote_write_requests_total",
Help: "Total number of remote write requests forwarded to Cortex",
}, []string{"cluster_id", "code", "code_text"})
)
func Collectors() []prometheus.Collector {
return []prometheus.Collector{
mIngestBytesTotal,
mIngestBytesByID,
mRemoteWriteRequests,
}
}