forked from TrueCloudLab/neoneo-go
rpc/server: register ws calls in Prometheus
They were completely missing.
This commit is contained in:
parent
13999252c6
commit
0a338ea94b
1 changed files with 16 additions and 9 deletions
|
@ -16,8 +16,7 @@ func incCounter(name string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func regCounter(call string) {
|
||||||
for call := range rpcHandlers {
|
|
||||||
ctr := prometheus.NewCounter(
|
ctr := prometheus.NewCounter(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
Help: fmt.Sprintf("Number of calls to %s rpc endpoint", call),
|
Help: fmt.Sprintf("Number of calls to %s rpc endpoint", call),
|
||||||
|
@ -27,5 +26,13 @@ func init() {
|
||||||
)
|
)
|
||||||
prometheus.MustRegister(ctr)
|
prometheus.MustRegister(ctr)
|
||||||
rpcCounter[call] = ctr
|
rpcCounter[call] = ctr
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
for call := range rpcHandlers {
|
||||||
|
regCounter(call)
|
||||||
|
}
|
||||||
|
for call := range rpcWsHandlers {
|
||||||
|
regCounter(call)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue