...
1 package plank
2
3 import (
4 "github.com/prometheus/client_golang/prometheus"
5 "github.com/prometheus/client_golang/prometheus/collectors"
6
7 "edge-infra.dev/pkg/lib/runtime/metrics"
8 )
9
10 func init() {
11 metrics.Registry.MustRegister(
12 StorageConnectionStatus,
13 StorageInserts,
14 StorageInsertErrors,
15 SlackErrors,
16
17 collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
18
19 collectors.NewGoCollector(),
20 )
21 }
22
23 var (
24 nolabels []string
25
26 StorageConnectionStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{
27 Name: "plank_storage_connection_status",
28 Help: "The current status of plank's storage component",
29 }, nolabels)
30 StorageInserts = prometheus.NewCounterVec(prometheus.CounterOpts{
31 Name: "plank_storage_inserts",
32 Help: "Total number of storage inserts",
33 }, nolabels)
34 StorageInsertErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
35 Name: "plank_storage_insert_errors",
36 Help: "Total number of storage insert errors",
37 }, nolabels)
38 SlackErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
39 Name: "plank_slack_http_errors",
40 Help: "Total http errors from slack",
41 }, nolabels)
42 )
43
View as plain text