chore: remove prometheus router metrics and related initialization code

This commit is contained in:
yusing 2025-03-29 02:53:57 +08:00
parent 36f13c61bb
commit 366c89164f
2 changed files with 0 additions and 33 deletions

View file

@ -1,26 +0,0 @@
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/yusing/go-proxy/internal/common"
)
func InitRouterMetrics(getRPsCount func() int, getStreamsCount func() int) {
if !common.PrometheusEnabled {
return
}
prometheus.MustRegister(prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "entrypoint",
Name: "num_reverse_proxies",
Help: "The number of reverse proxies",
}, func() float64 {
return float64(getRPsCount())
}))
prometheus.MustRegister(prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "entrypoint",
Name: "num_streams",
Help: "The number of streams",
}, func() float64 {
return float64(getStreamsCount())
}))
}

View file

@ -1,7 +0,0 @@
package routes
import "github.com/yusing/go-proxy/internal/metrics"
func init() {
metrics.InitRouterMetrics(httpRoutes.Size, streamRoutes.Size)
}