summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-11-23 19:10:51 +0100
committerLibravatar GitHub <noreply@github.com>2023-11-23 19:10:51 +0100
commit2b9cf56f565517b947b0eb71d2086764e9edf2be (patch)
tree4e4d1e50001f93e64a624caeae6a7200ae317716 /cmd
parent[documentation] add poll and poll vote details to gotosocial federating doc (... (diff)
downloadgotosocial-2b9cf56f565517b947b0eb71d2086764e9edf2be.tar.xz
[chore/bugfix] Fix double gzip on prometheus endpoint (#2383)
* [chore] Move "/metrics" into separate API module * use our own gzip middleware for prom
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/server/server.go2
-rw-r--r--cmd/gotosocial/action/testrig/testrig.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index a9896a81c..3a8965f1e 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -293,6 +293,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
var (
authModule = api.NewAuth(dbService, processor, idp, routerSession, sessionName) // auth/oauth paths
clientModule = api.NewClient(dbService, processor) // api client endpoints
+ metricsModule = api.NewMetrics() // Metrics endpoints
fileserverModule = api.NewFileserver(processor) // fileserver endpoints
wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints
nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint
@@ -322,6 +323,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
// apply throttling *after* rate limiting
authModule.Route(router, clLimit, clThrottle, gzip)
clientModule.Route(router, clLimit, clThrottle, gzip)
+ metricsModule.Route(router, clLimit, clThrottle, gzip)
fileserverModule.Route(router, fsLimit, fsThrottle)
wellKnownModule.Route(router, gzip, s2sLimit, s2sThrottle)
nodeInfoModule.Route(router, s2sLimit, s2sThrottle, gzip)
diff --git a/cmd/gotosocial/action/testrig/testrig.go b/cmd/gotosocial/action/testrig/testrig.go
index f08bec609..d6bc92215 100644
--- a/cmd/gotosocial/action/testrig/testrig.go
+++ b/cmd/gotosocial/action/testrig/testrig.go
@@ -212,6 +212,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
var (
authModule = api.NewAuth(state.DB, processor, idp, routerSession, sessionName) // auth/oauth paths
clientModule = api.NewClient(state.DB, processor) // api client endpoints
+ metricsModule = api.NewMetrics() // Metrics endpoints
fileserverModule = api.NewFileserver(processor) // fileserver endpoints
wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints
nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint
@@ -222,6 +223,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
// these should be routed in order
authModule.Route(router)
clientModule.Route(router)
+ metricsModule.Route(router)
fileserverModule.Route(router)
wellKnownModule.Route(router)
nodeInfoModule.Route(router)