-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetrics.go
107 lines (90 loc) · 2.41 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package main
import (
"net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
//Queued: %d, Processed: %d, Dropped: %d, Queue Size: %d/%d, Workers:
var (
queuedMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_queued_total",
Help: "The total number of queued blocks",
})
)
var (
processedMetrics = promauto.NewCounter(prometheus.CounterOpts{
Name: "whales_watcher_processed_total",
Help: "The total number of processed blocks",
})
)
var (
retriedTasksMetrics = promauto.NewCounter(prometheus.CounterOpts{
Name: "whales_watcher_retries_total",
Help: "The total number of retries blocks",
})
)
var (
inqueueMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_inqueue_total",
Help: "The total number blocks in queue",
})
)
var (
queueSizeMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_queue_size_total",
Help: "Queue size",
})
)
var (
workersMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_workers_total",
Help: "The total number of workers",
})
)
var (
txQueueMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_tx_queue",
Help: "Total number of transactions in queue",
})
)
var (
txQueueWorkersMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_tx_queue_workers",
Help: "Total number of workers for tx queue",
})
)
var (
txQueueSizeMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_tx_queue_size",
Help: "Size tx queue",
})
)
var (
cexQueueMetrics = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_cex_queue",
Help: "Total number of cex messages in queue",
})
)
var (
notificationQueueMetric = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_notification_queue",
Help: "Total number of message to send to telegram/twitter in queue",
})
)
var (
notificationQueueSizeMetric = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_notification_queue_size",
Help: "Size queue to send to telegram/twitter",
})
)
var (
cexQueueSizeMetric = promauto.NewGauge(prometheus.GaugeOpts{
Name: "whales_watcher_cex_queue_size",
Help: "Size queue cex messages",
})
)
func metricsHttp() {
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(":2112", nil)
}