diff --git a/go/daemon/main.go b/go/daemon/main.go index e3469c9336..e220297a88 100644 --- a/go/daemon/main.go +++ b/go/daemon/main.go @@ -219,9 +219,9 @@ func realMain(ctx context.Context) error { "info": service.NewInfoStatusPage(), "config": service.NewConfigStatusPage(globalCfg), "log/level": service.NewLogLevelStatusPage(), - "topology": service.StatusPage{Handler: itopo.TopologyHandler}, + "topology": service.NewTopologyStatusPage(), "digests/config": service.NewConfigDigestStatusPage(&globalCfg), - "digests/topology": service.StatusPage{Handler: itopo.TopologyDigestHandler}, + "digests/topology": service.NewTopologyDigestStatusPage(), } if err := statusPages.Register(http.DefaultServeMux, globalCfg.General.ID); err != nil { return serrors.WrapStr("registering status pages", err) diff --git a/go/pkg/cs/BUILD.bazel b/go/pkg/cs/BUILD.bazel index 5e7a5247d2..1ef5d3b0d3 100644 --- a/go/pkg/cs/BUILD.bazel +++ b/go/pkg/cs/BUILD.bazel @@ -27,7 +27,6 @@ go_library( "//go/lib/ctrl/seg:go_default_library", "//go/lib/env:go_default_library", "//go/lib/infra:go_default_library", - "//go/lib/infra/modules/itopo:go_default_library", "//go/lib/infra/modules/seghandler:go_default_library", "//go/lib/keyconf:go_default_library", "//go/lib/log:go_default_library", diff --git a/go/pkg/cs/observability.go b/go/pkg/cs/observability.go index ed2fd81531..c319b026d7 100644 --- a/go/pkg/cs/observability.go +++ b/go/pkg/cs/observability.go @@ -28,7 +28,6 @@ import ( "github.com/scionproto/scion/go/lib/addr" "github.com/scionproto/scion/go/lib/config" "github.com/scionproto/scion/go/lib/env" - "github.com/scionproto/scion/go/lib/infra/modules/itopo" "github.com/scionproto/scion/go/lib/prom" "github.com/scionproto/scion/go/lib/scrypto" "github.com/scionproto/scion/go/lib/scrypto/cppki" @@ -240,10 +239,10 @@ func StartHTTPEndpoints( "info": service.NewInfoStatusPage(), "config": service.NewConfigStatusPage(cfg), "log/level": service.NewLogLevelStatusPage(), - "topology": service.StatusPage{Handler: itopo.TopologyHandler}, + "topology": service.NewTopologyStatusPage(), "signer": signerStatusPage(signer), "digests/config": service.NewConfigDigestStatusPage(cfg), - "digests/topology": service.StatusPage{Handler: itopo.TopologyDigestHandler}, + "digests/topology": service.NewTopologyDigestStatusPage(), "digests/policies": policyDigestsStatusPage(policyDigests), } if ca != (renewal.ChainBuilder{}) { @@ -306,7 +305,10 @@ func signerStatusPage(signer cstrust.RenewingSigner) service.StatusPage { return } } - return service.StatusPage{Handler: handler} + return service.StatusPage{ + Info: "SCION signer info", + Handler: handler, + } } func caStatusPage(signer renewal.ChainBuilder) service.StatusPage { @@ -357,7 +359,10 @@ func caStatusPage(signer renewal.ChainBuilder) service.StatusPage { return } } - return service.StatusPage{Handler: handler} + return service.StatusPage{ + Info: "CA status", + Handler: handler, + } } func policyDigestsStatusPage(digests map[string][]byte) service.StatusPage { @@ -379,5 +384,8 @@ func policyDigestsStatusPage(digests map[string][]byte) service.StatusPage { return } } - return service.StatusPage{Handler: handler} + return service.StatusPage{ + Info: "sha256 policies digest", + Handler: handler, + } } diff --git a/go/pkg/gateway/gateway.go b/go/pkg/gateway/gateway.go index 81e1db6081..5db5ad2f2c 100644 --- a/go/pkg/gateway/gateway.go +++ b/go/pkg/gateway/gateway.go @@ -588,6 +588,7 @@ func (g *Gateway) Run(ctx context.Context) error { }() logger.Debug("Session configurator started") g.HTTPEndpoints["sessionconfigurator"] = service.StatusPage{ + Info: "session configurator diagnostics", Handler: func(w http.ResponseWriter, _ *http.Request) { sessionConfigurator.DiagnosticsWrite(w) }, @@ -630,27 +631,32 @@ func (g *Gateway) Run(ctx context.Context) error { logger.Debug("Engine controller started") g.HTTPEndpoints["engine"] = service.StatusPage{ + Info: "gateway diagnostics", Handler: func(w http.ResponseWriter, _ *http.Request) { engineController.DiagnosticsWrite(w) }, } g.HTTPEndpoints["status"] = service.StatusPage{ + Info: "gateway status (remote ASes, sessions, paths)", Handler: func(w http.ResponseWriter, _ *http.Request) { engineController.Status(w) }, } g.HTTPEndpoints["diagnostics/prefixwatcher"] = service.StatusPage{ + Info: "IP prefixes incoming via SGRP", Handler: func(w http.ResponseWriter, _ *http.Request) { remoteMonitor.DiagnosticsWrite(w) }, } g.HTTPEndpoints["diagnostics/sgrp"] = service.StatusPage{ + Info: "SGRP diagnostics", Handler: g.diagnosticsSGRP(routePublisherFactory, configPublisher), } // XXX(scrye): Use an empty file here because the server often doesn't have // write access to its configuration folder. g.HTTPEndpoints["ip-routing/policy"] = service.StatusPage{ + Info: "IP routing policy (supports PUT)", Handler: routing.NewPolicyHandler( RoutingPolicyPublisherAdapter{ConfigPublisher: configPublisher}, ""), } diff --git a/go/pkg/service/BUILD.bazel b/go/pkg/service/BUILD.bazel index 4d6b8d7274..625499ebf9 100644 --- a/go/pkg/service/BUILD.bazel +++ b/go/pkg/service/BUILD.bazel @@ -8,6 +8,7 @@ go_library( deps = [ "//go/lib/config:go_default_library", "//go/lib/env:go_default_library", + "//go/lib/infra/modules/itopo:go_default_library", "//go/lib/log:go_default_library", "//go/lib/serrors:go_default_library", "//go/lib/util:go_default_library", diff --git a/go/pkg/service/statuspages.go b/go/pkg/service/statuspages.go index 2632172647..d84b2f5821 100644 --- a/go/pkg/service/statuspages.go +++ b/go/pkg/service/statuspages.go @@ -29,6 +29,7 @@ import ( "github.com/scionproto/scion/go/lib/config" "github.com/scionproto/scion/go/lib/env" + "github.com/scionproto/scion/go/lib/infra/modules/itopo" "github.com/scionproto/scion/go/lib/log" "github.com/scionproto/scion/go/lib/serrors" "github.com/scionproto/scion/go/lib/util" @@ -42,20 +43,29 @@ const mainTmpl = `
[{{ .Endpoint }}] | {{ .Info }} |