From 39979a1a86a211f312ecbc6dad84fcb42c5a632e Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Fri, 4 Aug 2023 18:50:18 -0600 Subject: [PATCH] upadate function call in access/rest --- server/access/rest.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/access/rest.go b/server/access/rest.go index 4a0d76b1..882a13e6 100644 --- a/server/access/rest.go +++ b/server/access/rest.go @@ -22,7 +22,6 @@ import ( "context" "flag" "fmt" - "github.com/onflow/flow-go/module" "net" "net/http" "os" @@ -31,7 +30,9 @@ import ( metricsProm "github.com/slok/go-http-metrics/metrics/prometheus" "github.com/onflow/flow-go/engine/access/rest" + "github.com/onflow/flow-go/engine/access/rest/routes" "github.com/onflow/flow-go/model/flow" + "github.com/onflow/flow-go/module" "github.com/onflow/flow-go/module/metrics" "github.com/rs/zerolog" ) @@ -85,7 +86,11 @@ func NewRestServer(logger *zerolog.Logger, adapter *adapters.AccessAdapter, chai // only collect metrics if not test if flag.Lookup("test.v") == nil { - restCollector = metrics.NewRestCollector(metricsProm.Config{Prefix: "access_rest_api"}) + var err error + restCollector, err = metrics.NewRestCollector(routes.URLToRoute, metricsProm.Config{Prefix: "access_rest_api"}.Registry) + if err != nil { + return nil, err + } } srv, err := rest.NewServer(adapter, fmt.Sprintf("%s:3333", host), debugLogger, chain, restCollector)