Skip to content

Commit

Permalink
upadate function call in access/rest
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Aug 5, 2023
1 parent b49ffb2 commit 39979a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/access/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"context"
"flag"
"fmt"
"github.com/onflow/flow-go/module"
"net"
"net/http"
"os"
Expand All @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 39979a1

Please sign in to comment.