puppet-prometheus
puppet-prometheus copied to clipboard
alertmanager receivers incorrect syntax
How to reproduce (e.g Puppet code you use)
In Debian:
class { 'prometheus::alertmanager':
package_ensure => 'present',
service_ensure => 'running',
install_method => 'package',
init_style => 'none',
user => 'prometheus',
group => 'prometheus',
package_name => 'prometheus-alertmanager',
service_name => 'prometheus-alertmanager',
# disable clustering
extra_options => '--cluster.listen-address=',
}
But I suspect a simple:
include prometheus::alertmanager
would also trigger this.
What are you seeing
Mar 31 18:16:43 hetzner-nbg1-02 prometheus-alertmanager[9316]: level=info ts=2021-03-31T18:16:43.376918397Z caller=main.go:322 msg="Loading configuration file" file=/etc/alertmanager/alertmanager.yaml
Mar 31 18:16:43 hetzner-nbg1-02 prometheus-alertmanager[9316]: level=error ts=2021-03-31T18:16:43.377199383Z caller=main.go:325 msg="Loading configuration file failed" file=/etc/alertmanager/alertmanager.yaml err="missing name in receiver"
Mar 31 18:16:43 hetzner-nbg1-02 systemd[1]: prometheus-alertmanager.service: Main process exited, code=exited, status=1/FAILURE
What behaviour did you expect instead
If I add this to the class, it works:
receivers => [
{
'name' => 'Admin',
'email_configs' => [
'to' => 'root@localhost',
],
}
],
I suspect the syntax of the YAML file is incorrect.