diff --git a/rpc/handler.go b/rpc/handler.go index c8571ad795..5a5a045963 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -340,6 +340,7 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage successfulRequestGauge.Inc(1) } rpcServingTimer.UpdateSince(start) + newRPCRequestGauge(msg.Method).Inc(1) newRPCServingTimer(msg.Method, answer.Error == nil).UpdateSince(start) } return answer diff --git a/rpc/metrics.go b/rpc/metrics.go index 7fb6fc0a17..d162433bf8 100644 --- a/rpc/metrics.go +++ b/rpc/metrics.go @@ -37,3 +37,8 @@ func newRPCServingTimer(method string, valid bool) metrics.Timer { m := fmt.Sprintf("rpc/duration/%s/%s", method, flag) return metrics.GetOrRegisterTimer(m, nil) } + +func newRPCRequestGauge(method string) metrics.Gauge { + m := fmt.Sprintf("rpc/count/%s", method) + return metrics.GetOrRegisterGauge(m, nil) +}