Skip to content

Commit e232218

Browse files
committed
Some more review feedback cleanups
1 parent 1a52083 commit e232218

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

alertmanager/alertmanager.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ import (
2626
"github.com/weaveworks/mesh"
2727
)
2828

29+
const notificationLogMaintenancePeriod = 15 * time.Minute
30+
2931
// Config configures an Alertmanager.
3032
type Config struct {
31-
UserID string
33+
UserID string
34+
// Used to persist notification logs and silences on disk.
3235
DataDir string
3336
Logger log.Logger
3437
MeshRouter *mesh.Router
@@ -69,8 +72,8 @@ func New(cfg *Config) (*Alertmanager, error) {
6972
}),
7073
nflog.WithRetention(cfg.Retention),
7174
nflog.WithSnapshot(filepath.Join(cfg.DataDir, nflogID)),
72-
nflog.WithMaintenance(15*time.Minute, am.stop, am.wg.Done),
73-
// TODO: Build a registry that can merge metrics from multiple users.
75+
nflog.WithMaintenance(notificationLogMaintenancePeriod, am.stop, am.wg.Done),
76+
// TODO(cortex): Build a registry that can merge metrics from multiple users.
7477
// For now, these metrics are ignored, as we can't register the same
7578
// metric twice with a single registry.
7679
nflog.WithMetrics(prometheus.NewRegistry()),
@@ -87,7 +90,7 @@ func New(cfg *Config) (*Alertmanager, error) {
8790
SnapshotFile: filepath.Join(cfg.DataDir, silencesID),
8891
Retention: cfg.Retention,
8992
Logger: am.logger.With("component", "silences"),
90-
// TODO: Build a registry that can merge metrics from multiple users.
93+
// TODO(cortex): Build a registry that can merge metrics from multiple users.
9194
// For now, these metrics are ignored, as we can't register the same
9295
// metric twice with a single registry.
9396
Metrics: prometheus.NewRegistry(),
@@ -143,7 +146,7 @@ func (am *Alertmanager) ApplyConfig(conf *config.Config) error {
143146
pipeline notify.Stage
144147
)
145148

146-
// TODO: How to support template files?
149+
// TODO(cortex): How to support template files?
147150
if len(conf.Templates) != 0 {
148151
return fmt.Errorf("template files are not yet supported")
149152
}

0 commit comments

Comments
 (0)