mirror of
https://github.com/google/alertmanager-irc-relay.git
synced 2024-12-25 04:12:46 +01:00
Make alert channel size configurable (and bigger)
Signed-off-by: Filippo Giunchedi <filippo@wikimedia.org>
This commit is contained in:
parent
60b1c5eb64
commit
f03c45406c
@ -63,6 +63,9 @@ msg_template: "Alert {{ .Labels.alertname }} on {{ .Labels.instance }} is {{ .St
|
||||
# Note: When sending only one message per alert group the default
|
||||
# msg_template is set to
|
||||
# "Alert {{ .GroupLabels.alertname }} for {{ .GroupLabels.job }} is {{ .Status }}"
|
||||
|
||||
# Set the internal buffer size for alerts received but not yet sent to IRC.
|
||||
alert_buffer_size: 2048
|
||||
```
|
||||
|
||||
Running the bot (assuming *$GOPATH* and *$PATH* are properly setup for go):
|
||||
|
@ -45,6 +45,7 @@ type Config struct {
|
||||
MsgTemplate string `yaml:"msg_template"`
|
||||
MsgOnce bool `yaml:"msg_once_per_alert_group"`
|
||||
UsePrivmsg bool `yaml:"use_privmsg"`
|
||||
AlertBufferSize int `yaml:"alert_buffer_size"`
|
||||
}
|
||||
|
||||
func LoadConfig(configFile string) (*Config, error) {
|
||||
@ -62,6 +63,7 @@ func LoadConfig(configFile string) (*Config, error) {
|
||||
IRCChannels: []IRCChannel{},
|
||||
MsgOnce: false,
|
||||
UsePrivmsg: false,
|
||||
AlertBufferSize: 2048,
|
||||
}
|
||||
|
||||
if configFile != "" {
|
||||
|
@ -46,6 +46,7 @@ func TestLoadGoodConfig(t *testing.T) {
|
||||
MsgTemplate: defaultMsgTemplate,
|
||||
MsgOnce: false,
|
||||
UsePrivmsg: false,
|
||||
AlertBufferSize: 666,
|
||||
}
|
||||
expectedData, err := yaml.Marshal(expectedConfig)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user