Alertmanager Global config required but not configurable
Summary
(As described by customer)
I’ve setup alertmanager as shipped with omnibus and it’s been very useful for proactively identifying potential issues. But I have a problem getting the config working with the default omnibus chef recipe.
I’m on gitlab-ee-11.9.10 (but same problem with 11.10.0-ee).
The default gitlab.rb entry for alertmanager, doesn’t mention the alertmanager[‘global’] configuration, but it’s required (at least on Centos 7) to have these entries in alertmanager.xml or it won’t start:
---
global:
smtp_smarthost: localhost:25
smtp_from: alertmanager@gitlab.example.com
smtp_require_tls: false
The default chef recipe appears to support this in gitlab.rb and I’m deducing this is the right format:
alertmanager['global'] = {
'smtp_smarthost' => '127.0.0.1:25',
'smtp_from' => "alertmanager@gitlab.example.com",
'smtp_require_tls' => false
}
But adding that results in an empty global section in alertmanager.yml:
---
global: {}
So I have to keep a copy of a working alertmanager.yml and copy it back after a reconfigure.
The relevant section of the cookbook recipe is:
50 configuration = {
51 'global' => node['gitlab']['alertmanager']['global'],
52 'templates' => node['gitlab']['alertmanager']['templates'],
53 'route' => {
54 'receiver' => node['gitlab']['alertmanager']['default_receiver'],
55 'routes' => node['gitlab']['alertmanager']['routes'],
56 },
57 'receivers' => node['gitlab']['alertmanager']['receivers'],
58 'inhibit_rules' => node['gitlab']['alertmanager']['inhibit_rules'],
59 }
Steps to reproduce
Uncomment Alertmanager lines from gitlab.rb
and try to reconfigure.
What is the current bug behavior?
Reconfigure fails because alertmanager cannot start.
What is the expected correct behavior?
Reconfigure should be successful.