Skip to content

Commit 3753db7

Browse files
authored
feat: adjust metric to include multicall in rpc_requests_total metric (#216)
1 parent fd01136 commit 3753db7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proxyd/backend.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -780,15 +780,15 @@ func (bg *BackendGroup) Forward(ctx context.Context, rpcReqs []*RPCReq, isBatch
780780
rpcReqs, overriddenResponses = bg.OverwriteConsensusResponses(rpcReqs, overriddenResponses, rewrittenReqs)
781781
}
782782

783+
rpcRequestsTotal.Inc()
784+
783785
// When routing_strategy is set to 'multicall' the request will be forward to all backends
784786
// and return the first successful response
785787
if bg.GetRoutingStrategy() == MulticallRoutingStrategy && isValidMulticallTx(rpcReqs) && !isBatch {
786788
backendResp := bg.ExecuteMulticall(ctx, rpcReqs)
787789
return backendResp.RPCRes, backendResp.ServedBy, backendResp.error
788790
}
789791

790-
rpcRequestsTotal.Inc()
791-
792792
ch := make(chan BackendGroupRPCResponse)
793793
go func() {
794794
defer close(ch)

0 commit comments

Comments
 (0)