mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix lint errors
Signed-off-by: Mustafain Ali Khan <mustalik@amazon.com>
This commit is contained in:
parent
dfce8e73d4
commit
066d922e72
|
@ -73,9 +73,9 @@ type Group struct {
|
||||||
// Rule group evaluation iteration function,
|
// Rule group evaluation iteration function,
|
||||||
// defaults to DefaultEvalIterationFunc.
|
// defaults to DefaultEvalIterationFunc.
|
||||||
evalIterationFunc GroupEvalIterationFunc
|
evalIterationFunc GroupEvalIterationFunc
|
||||||
|
alertStore AlertStore
|
||||||
|
|
||||||
appOpts *storage.AppendOptions
|
appOpts *storage.AppendOptions
|
||||||
alertStore AlertStore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupEvalIterationFunc is used to implement and extend rule group
|
// GroupEvalIterationFunc is used to implement and extend rule group
|
||||||
|
@ -146,8 +146,8 @@ func NewGroup(o GroupOptions) *Group {
|
||||||
logger: opts.Logger.With("file", o.File, "group", o.Name),
|
logger: opts.Logger.With("file", o.File, "group", o.Name),
|
||||||
metrics: metrics,
|
metrics: metrics,
|
||||||
evalIterationFunc: evalIterationFunc,
|
evalIterationFunc: evalIterationFunc,
|
||||||
appOpts: &storage.AppendOptions{DiscardOutOfOrder: true},
|
|
||||||
alertStore: o.AlertStore,
|
alertStore: o.AlertStore,
|
||||||
|
appOpts: &storage.AppendOptions{DiscardOutOfOrder: true},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,12 +115,12 @@ func (s *FileStore) SetAlerts(key uint64, groupKey string, alerts []*Alert) erro
|
||||||
s.stateMtx.Lock()
|
s.stateMtx.Lock()
|
||||||
defer s.stateMtx.Unlock()
|
defer s.stateMtx.Unlock()
|
||||||
|
|
||||||
// Update in memory
|
if alerts == nil {
|
||||||
if alerts != nil {
|
|
||||||
s.alertsByRule[key] = alerts
|
|
||||||
} else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
// Update in memory
|
||||||
|
s.alertsByRule[key] = alerts
|
||||||
|
|
||||||
// flush in memory state to file storage
|
// flush in memory state to file storage
|
||||||
file, err := os.Create(s.path)
|
file, err := os.Create(s.path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue