-
Notifications
You must be signed in to change notification settings - Fork 12
/
monitoring.go
75 lines (66 loc) · 2.47 KB
/
monitoring.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
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
MetricServiceTimeHistogramVec = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "tonstatus_functions_time",
Help: "Service functions execution duration distribution in seconds",
Buckets: []float64{0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 2.5, 5, 10},
},
[]string{"service"},
)
MetricServiceIndexingLatencyHistogramVec = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "tonstatus_indexing_latency",
Help: "difference between current time and last transaction on electror",
Buckets: []float64{0.5, 1, 5, 7.5, 10, 12.5, 15, 17.5, 20, 25, 30, 60, 120, 300, 600, 1200, 3600},
},
[]string{"service"},
)
MetricServiceRequest = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "tonstatus_http_api",
Help: "availability of http api",
}, []string{"service"})
)
var (
MetricDAppTimeHistogramVec = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "tonstatus_dapp_functions_time",
Help: "DApp functions execution duration distribution in seconds",
Buckets: []float64{0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 2.5, 5, 10},
},
[]string{"dapp"})
MetricDAppMainPageLatency = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "tonstatus_dapp_main_page_time",
Buckets: []float64{0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 2.5, 5, 10},
},
[]string{"dapp"})
MetricDAppIndexingLatencyHistogramVec = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "tonstatus_dapp_indexing_latency",
Help: "difference between current time and last transaction on electror",
Buckets: []float64{0.5, 1, 5, 7.5, 10, 12.5, 15, 17.5, 20, 25, 30, 60, 120, 300, 600, 1200, 3600},
},
[]string{"dapp"},
)
MetricDAppAvailability = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "tonstatus_dapp_availability",
Help: "availability of http api",
}, []string{"dapp"})
)
var (
metricBridgeAvailability = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "tonconnect_bridge_availability",
}, []string{"bridge"})
metricBridgeLatencyHistogramVec = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "tonconnect_bridge_latency",
Buckets: []float64{0.01, 0.05, 0.1, 0.25, 0.5, 1,2, 5, 10},
}, []string{"bridge"})
metricBridgeReconnects = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "tonconnect_bridge_reconnects",
}, []string{"bridge"})
)