Enable/Disable internal metrics (#2899)

Basically enables us to use `test.WithAllDatabases` when testing
internal HTTP APIs, as this would otherwise result in Prometheus
complaining about already registered metric names.
This commit is contained in:
Till 2022-12-05 13:53:36 +01:00 committed by GitHub
parent b65f89e61e
commit e245a26f6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 164 additions and 154 deletions

View file

@ -25,7 +25,7 @@ func KeyServer(base *basepkg.BaseDendrite, cfg *config.Dendrite) {
intAPI := keyserver.NewInternalAPI(base, &base.Cfg.KeyServer, fsAPI)
intAPI.SetUserAPI(base.UserAPIClient())
keyserver.AddInternalRoutes(base.InternalAPIMux, intAPI)
keyserver.AddInternalRoutes(base.InternalAPIMux, intAPI, base.EnableMetrics)
base.SetupAndServeHTTP(
base.Cfg.KeyServer.InternalAPI.Listen, // internal listener