@@ -26,9 +26,12 @@ import (
26
26
"github.com/weaveworks/mesh"
27
27
)
28
28
29
+ const notificationLogMaintenancePeriod = 15 * time .Minute
30
+
29
31
// Config configures an Alertmanager.
30
32
type Config struct {
31
- UserID string
33
+ UserID string
34
+ // Used to persist notification logs and silences on disk.
32
35
DataDir string
33
36
Logger log.Logger
34
37
MeshRouter * mesh.Router
@@ -69,8 +72,8 @@ func New(cfg *Config) (*Alertmanager, error) {
69
72
}),
70
73
nflog .WithRetention (cfg .Retention ),
71
74
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.
74
77
// For now, these metrics are ignored, as we can't register the same
75
78
// metric twice with a single registry.
76
79
nflog .WithMetrics (prometheus .NewRegistry ()),
@@ -87,7 +90,7 @@ func New(cfg *Config) (*Alertmanager, error) {
87
90
SnapshotFile : filepath .Join (cfg .DataDir , silencesID ),
88
91
Retention : cfg .Retention ,
89
92
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.
91
94
// For now, these metrics are ignored, as we can't register the same
92
95
// metric twice with a single registry.
93
96
Metrics : prometheus .NewRegistry (),
@@ -143,7 +146,7 @@ func (am *Alertmanager) ApplyConfig(conf *config.Config) error {
143
146
pipeline notify.Stage
144
147
)
145
148
146
- // TODO: How to support template files?
149
+ // TODO(cortex) : How to support template files?
147
150
if len (conf .Templates ) != 0 {
148
151
return fmt .Errorf ("template files are not yet supported" )
149
152
}
0 commit comments