mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-19 00:20:56 -05:00
tweak proxy scalability
This commit is contained in:
@@ -154,6 +154,10 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
Msg("Tracing is not enabled")
|
||||
}
|
||||
|
||||
var (
|
||||
m = metrics.New()
|
||||
)
|
||||
|
||||
stop := make(chan os.Signal, 1)
|
||||
gr := run.Group{}
|
||||
ctx, cancel := func() (context.Context, context.CancelFunc) {
|
||||
@@ -162,7 +166,6 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
return context.WithCancel(cfg.Context)
|
||||
}()
|
||||
m := metrics.New()
|
||||
|
||||
defer cancel()
|
||||
|
||||
@@ -179,7 +182,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
proxyHTTP.Logger(logger),
|
||||
proxyHTTP.Context(ctx),
|
||||
proxyHTTP.Config(cfg),
|
||||
proxyHTTP.Metrics(m),
|
||||
proxyHTTP.Metrics(metrics.New()),
|
||||
proxyHTTP.Middlewares(loadMiddlewares(ctx, logger, cfg)),
|
||||
)
|
||||
|
||||
|
||||
@@ -49,22 +49,10 @@ func New() *Metrics {
|
||||
}, []string{"versions"}),
|
||||
}
|
||||
|
||||
mustNotFail(prometheus.Register(
|
||||
m.Counter,
|
||||
))
|
||||
|
||||
mustNotFail(prometheus.Register(
|
||||
m.Latency,
|
||||
))
|
||||
|
||||
mustNotFail(prometheus.Register(
|
||||
m.Duration,
|
||||
))
|
||||
|
||||
mustNotFail(prometheus.Register(
|
||||
m.BuildInfo,
|
||||
))
|
||||
|
||||
prometheus.Register(m.Counter)
|
||||
prometheus.Register(m.Latency)
|
||||
prometheus.Register(m.Duration)
|
||||
prometheus.Register(m.BuildInfo)
|
||||
return m
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user