diff --git a/services/horizon/internal/app.go b/services/horizon/internal/app.go index 7f98cb8dce..fab0f5c08f 100644 --- a/services/horizon/internal/app.go +++ b/services/horizon/internal/app.go @@ -476,9 +476,6 @@ func (a *App) init() { // This parameter will be removed soon. a.web.mustInstallMiddlewares(a, a.config.ConnectionTimeout) - // web.actions - a.web.mustInstallActions(a.config, a.paths, a.historyQ.Session, a.metrics) - // metrics and log.metrics a.metrics = metrics.NewRegistry() for level, meter := range *logmetrics.DefaultMetrics { @@ -488,6 +485,9 @@ func (a *App) init() { // db-metrics initDbMetrics(a) + // web.actions + a.web.mustInstallActions(a.config, a.paths, a.historyQ.Session, a.metrics) + // ingest.metrics initIngestMetrics(a) diff --git a/services/horizon/internal/app_test.go b/services/horizon/internal/app_test.go index d46223874b..871093ffcd 100644 --- a/services/horizon/internal/app_test.go +++ b/services/horizon/internal/app_test.go @@ -3,6 +3,8 @@ package horizon import ( "net/http" "testing" + + "github.com/stellar/go/services/horizon/internal/test" ) func TestGenericHTTPFeatures(t *testing.T) { @@ -37,6 +39,10 @@ func TestMetrics(t *testing.T) { ht := StartHTTPTest(t, "base") defer ht.Finish() + adminRouterRH := test.NewRequestHelper(ht.App.web.internalRouter) + w := adminRouterRH.Get("/metrics") + ht.Assert.Equal(200, w.Code) + hl := ht.App.historyLatestLedgerGauge he := ht.App.historyElderLedgerGauge cl := ht.App.coreLatestLedgerGauge