satellite/metrics: join for monitoring

We don't want metrics to trigger the metaloop on it's own.

Change-Id: I648272a0e3043173b0a377697db1f172712bdda5
This commit is contained in:
Egon Elbre 2021-04-10 12:34:22 +03:00
parent c1fbecb96b
commit dd5eb2616b
3 changed files with 6 additions and 11 deletions

View File

@ -603,9 +603,7 @@ func (planet *Planet) newSatellite(ctx context.Context, prefix string, index int
MaxOrderLimitSendCount: 3,
NodeMinAgeInMonths: 0,
},
Metrics: metrics.Config{
ChoreInterval: defaultInterval,
},
Metrics: metrics.Config{},
}
if planet.config.Reconfigure.Satellite != nil {

View File

@ -23,7 +23,6 @@ var (
// Config contains configurable values for metrics collection.
type Config struct {
ChoreInterval time.Duration `help:"the time between each metrics chore run" releaseDefault:"15m" devDefault:"15m"`
}
// Chore implements the metrics chore.
@ -40,9 +39,10 @@ type Chore struct {
// NewChore creates a new instance of the metrics chore.
func NewChore(log *zap.Logger, config Config, loop *metaloop.Service) *Chore {
return &Chore{
log: log,
config: config,
Loop: sync2.NewCycle(config.ChoreInterval),
log: log,
config: config,
// This chore monitors metainfo loop, so it's fine to use very small cycle time.
Loop: sync2.NewCycle(time.Nanosecond),
metainfoLoop: loop,
}
}
@ -56,7 +56,7 @@ func (chore *Chore) Run(ctx context.Context) (err error) {
chore.Counter = NewCounter()
err = chore.metainfoLoop.Join(ctx, chore.Counter)
err = chore.metainfoLoop.Monitor(ctx, chore.Counter)
if err != nil {
chore.log.Error("error joining metainfoloop", zap.Error(err))
return nil

View File

@ -415,9 +415,6 @@ identity.key-path: /root/.local/share/storj/identity/satellite/identity.key
# application suffix
# metrics.app-suffix: -release
# the time between each metrics chore run
# metrics.chore-interval: 15m0s
# instance id prefix
# metrics.instance-prefix: ""