-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuiltins.go
142 lines (139 loc) · 5.24 KB
/
builtins.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
const (
Namespace = "gatewayd"
)
var (
ClientConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: Namespace,
Name: "client_connections",
Help: "Number of client connections",
}, []string{"group", "block"})
ServerConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: Namespace,
Name: "server_connections",
Help: "Number of server connections",
}, []string{"group", "block"})
TLSConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: Namespace,
Name: "tls_connections",
Help: "Number of TLS connections",
}, []string{"group", "block"})
ServerTicksFired = promauto.NewCounter(prometheus.CounterOpts{
Namespace: Namespace,
Name: "server_ticks_fired_total",
Help: "Total number of server ticks fired",
})
BytesReceivedFromClient = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: Namespace,
Name: "bytes_received_from_client",
Help: "Number of bytes received from client",
}, []string{"group", "block"})
BytesSentToServer = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: Namespace,
Name: "bytes_sent_to_server",
Help: "Number of bytes sent to server",
}, []string{"group", "block"})
BytesReceivedFromServer = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: Namespace,
Name: "bytes_received_from_server",
Help: "Number of bytes received from server",
}, []string{"group", "block"})
BytesSentToClient = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: Namespace,
Name: "bytes_sent_to_client",
Help: "Number of bytes sent to client",
}, []string{"group", "block"})
TotalTrafficBytes = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: Namespace,
Name: "traffic_bytes",
Help: "Number of total bytes passed through GatewayD via client or server",
}, []string{"group", "block"})
PluginsLoaded = promauto.NewCounter(prometheus.CounterOpts{
Namespace: Namespace,
Name: "plugins_loaded_total",
Help: "Number of plugins loaded",
})
PluginHooksRegistered = promauto.NewCounter(prometheus.CounterOpts{
Namespace: Namespace,
Name: "plugin_hooks_registered_total",
Help: "Number of plugin hooks registered",
})
PluginHooksExecuted = promauto.NewCounter(prometheus.CounterOpts{
Namespace: Namespace,
Name: "plugin_hooks_executed_total",
Help: "Number of plugin hooks executed",
})
ProxyHealthChecks = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "proxy_health_checks_total",
Help: "Number of proxy health checks",
}, []string{"group", "block"})
ProxiedConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: Namespace,
Name: "proxied_connections",
Help: "Number of proxy connects",
}, []string{"group", "block"})
ProxyPassThroughsToClient = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "proxy_passthroughs_to_client_total",
Help: "Number of successful proxy passthroughs from server to client",
}, []string{"group", "block"})
ProxyPassThroughsToServer = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "proxy_passthroughs_to_server_total",
Help: "Number of successful proxy passthroughs from client to server",
}, []string{"group", "block"})
ProxyPassThroughTerminations = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "proxy_passthrough_terminations_total",
Help: "Number of proxy passthrough terminations by plugins",
}, []string{"group", "block"})
APIRequests = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "api_requests_total",
Help: "Number of API requests",
}, []string{"method", "endpoint"})
APIRequestsErrors = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Name: "api_requests_errors_total",
Help: "Number of API request errors",
}, []string{"method", "endpoint", "error"})
RaftHealthStatus = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "gatewayd",
Name: "raft_health_status",
Help: "Current health status of the Raft node (1 if healthy, 0 if unhealthy)",
},
[]string{"node_id"},
)
RaftLeaderStatus = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "gatewayd",
Name: "raft_leader_status",
Help: "Indicates if this node is the current Raft leader (1) or follower (0)",
},
[]string{"node_id"},
)
RaftLastContactLatency = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "gatewayd",
Name: "raft_last_contact_seconds",
Help: "Time since last contact with the Raft leader in seconds",
},
[]string{"node_id"},
)
RaftPeerRemovals = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "gatewayd",
Name: "raft_peer_removals_total",
Help: "Number of Raft peer removals",
}, []string{"node_id"})
RaftPeerAdditions = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "gatewayd",
Name: "raft_peer_additions_total",
Help: "Number of Raft peer additions",
}, []string{"node_id"})
)