mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 11:11:24 +01:00
fix: livestream: disable compression in promhttp handler (#27999)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/labstack/echo-contrib/echoprometheus"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -103,7 +104,11 @@ func main() {
|
||||
// Routes
|
||||
e.GET("/", index)
|
||||
|
||||
e.GET("/metrics", echo.WrapHandler(promhttp.Handler()))
|
||||
// For details why promhttp.Handler won't work: https://github.com/prometheus/client_golang/issues/622
|
||||
e.GET("/metrics", echo.WrapHandler(promhttp.InstrumentMetricHandler(
|
||||
prometheus.DefaultRegisterer,
|
||||
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{DisableCompression: true}),
|
||||
)))
|
||||
|
||||
e.GET("/served", servedHandler(stats))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user