mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 09:18:51 +02:00
api: move prometheus handler inside api handler /v1/metrics
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/yusing/go-proxy/internal/entrypoint"
|
||||
E "github.com/yusing/go-proxy/internal/error"
|
||||
"github.com/yusing/go-proxy/internal/logging"
|
||||
"github.com/yusing/go-proxy/internal/metrics"
|
||||
"github.com/yusing/go-proxy/internal/net/http/server"
|
||||
"github.com/yusing/go-proxy/internal/notif"
|
||||
proxy "github.com/yusing/go-proxy/internal/route/provider"
|
||||
@@ -182,7 +181,7 @@ func (cfg *Config) StartProxyProviders() {
|
||||
}
|
||||
|
||||
type StartServersOptions struct {
|
||||
Proxy, API, Metrics bool
|
||||
Proxy, API bool
|
||||
}
|
||||
|
||||
func (cfg *Config) StartServers(opts ...*StartServersOptions) {
|
||||
@@ -207,14 +206,6 @@ func (cfg *Config) StartServers(opts ...*StartServersOptions) {
|
||||
Handler: api.NewHandler(cfg),
|
||||
})
|
||||
}
|
||||
if opt.Metrics && common.PrometheusEnabled {
|
||||
server.StartServer(cfg.task, server.Options{
|
||||
Name: "metrics",
|
||||
CertProvider: cfg.AutoCertProvider(),
|
||||
HTTPAddr: common.MetricsHTTPAddr,
|
||||
Handler: metrics.NewHandler(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (cfg *Config) load() E.Error {
|
||||
|
||||
Reference in New Issue
Block a user