rpc/server: register ws calls in Prometheus

They were completely missing.
This commit is contained in:
Roman Khimov 2022-03-21 23:18:00 +03:00
parent 13999252c6
commit 0a338ea94b

View file

@ -16,8 +16,7 @@ func incCounter(name string) {
}
}
func init() {
for call := range rpcHandlers {
func regCounter(call string) {
ctr := prometheus.NewCounter(
prometheus.CounterOpts{
Help: fmt.Sprintf("Number of calls to %s rpc endpoint", call),
@ -28,4 +27,12 @@ func init() {
prometheus.MustRegister(ctr)
rpcCounter[call] = ctr
}
func init() {
for call := range rpcHandlers {
regCounter(call)
}
for call := range rpcWsHandlers {
regCounter(call)
}
}