From 8c55b6341a1cb59c6b641623a8f3527295e45bdc Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Fri, 23 Dec 2022 14:07:24 -0600 Subject: [PATCH] 211: ipld-eth-server http counters don't work (#212) * 211: ipld-eth-server http counters don't work * On one line is fine --- pkg/rpc/http.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/rpc/http.go b/pkg/rpc/http.go index 9e1b2b86..6cac14c1 100644 --- a/pkg/rpc/http.go +++ b/pkg/rpc/http.go @@ -23,6 +23,8 @@ import ( "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" log "github.com/sirupsen/logrus" + + "github.com/cerc-io/ipld-eth-server/v4/pkg/prom" ) // StartHTTPEndpoint starts the HTTP RPC endpoint, configured with cors/vhosts/modules. @@ -33,7 +35,7 @@ func StartHTTPEndpoint(endpoint string, apis []rpc.API, modules []string, cors [ if err != nil { utils.Fatalf("Could not register HTTP API: %w", err) } - handler := node.NewHTTPHandlerStack(srv, cors, vhosts, nil) + handler := prom.HTTPMiddleware(node.NewHTTPHandlerStack(srv, cors, vhosts, nil)) // start http server _, addr, err := node.StartHTTPEndpoint(endpoint, rpc.DefaultHTTPTimeouts, handler)