Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alertmanager receivers incorrect syntax #539

Closed
anarcat opened this issue Mar 31, 2021 · 0 comments · Fixed by #723
Closed

alertmanager receivers incorrect syntax #539

anarcat opened this issue Mar 31, 2021 · 0 comments · Fixed by #723
Assignees
Labels
bug Something isn't working

Comments

@anarcat
Copy link

anarcat commented Mar 31, 2021

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.

anarcat added a commit to anarcat/puppet-prometheus that referenced this issue Mar 31, 2021
The "name" block is an object. This actually matches the example in
prometheus::alertmanager's documentation:

```
```

I wonder why unit tests didn't catch those...?

Closes: voxpupuli#539
anarcat added a commit to anarcat/puppet-prometheus that referenced this issue Mar 31, 2021
The "name" block is an object. This actually matches the example in
prometheus::alertmanager's documentation:

```
@param receivers
 An array of receivers.
 Example (also default):
 prometheus::alertmanager::receivers:
 - name: 'Admin'
   email_configs:
     - to: 'root@localhost'
```

I wonder why unit tests didn't catch those...?

Closes: voxpupuli#539
@TheMeier TheMeier self-assigned this May 5, 2024
@TheMeier TheMeier added the bug Something isn't working label May 5, 2024
TheMeier added a commit that referenced this issue May 11, 2024
TheMeier added a commit that referenced this issue May 19, 2024
TheMeier added a commit that referenced this issue May 21, 2024
TheMeier added a commit that referenced this issue May 21, 2024
bastelfreak added a commit that referenced this issue May 23, 2024
fix syntax of altermanager::receivers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants