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

bug: alert rules are still 1.0 syntax for Prometheus 2 #120

Closed
knackjax opened this issue Nov 29, 2017 · 5 comments
Closed

bug: alert rules are still 1.0 syntax for Prometheus 2 #120

knackjax opened this issue Nov 29, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@knackjax
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
  • Ruby:
  • Distribution:
  • Module version:

How to reproduce (e.g Puppet code you use)

See templates/alert.epp

What are you seeing

1.0 syntax

What behaviour did you expect instead

2.0 yaml syntax

Output log

Any additional information you'd like to impart

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Nov 29, 2017
@tuxmea
Copy link
Member

tuxmea commented Nov 30, 2017

@knackjax can you provide an example how the alert rules must be for prometheus2? Can you also provide a PR?

@costela
Copy link

costela commented Nov 30, 2017

@tuxmea https://prometheus.io/blog/2017/06/21/prometheus-20-alpha3-new-rule-format/

I'm also taking a look at this, but if someone beats me to a PR, all the better! 😉

@costela
Copy link

costela commented Nov 30, 2017

Ideally, we'd support both formats, and maybe also take the chance and fix #69 while we're at it.

@knackjax
Copy link
Author

I have a hack for this, which basically uses promtool to update to 2.0 syntax. We are just evaluating prometheus for our needs right now if we adopt it we will try to submit a cleaner solution

    exec { "promtool update ${alertfile_name}":
        user        => $user,
        group       => $group,
        command     => "${bin_dir}/promtool update rules ${config_dir}/${alertfile_name}",
        require     => [
            Package[$package_name],
            File["${config_dir}/${alertfile_name}"]
        ],
        unless      => "/usr/bin/test -f ${config_dir}/${alertfile_name}.yml",
        subscribe   => File["${config_dir}/${alertfile_name}"]
    }
    # ensure file was created
    file { "${config_dir}/${alertfile_name}.yml":
        ensure       => 'file',
        owner        => $user,
        group        => $group,
        validate_cmd => "${bin_dir}/promtool check rules ${config_dir}/${alertfile_name}.yml",
    }

@igalic
Copy link

igalic commented Feb 7, 2018

thanks @jhooyberghs for providing the fix!

@igalic igalic closed this as completed Feb 7, 2018
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
Development

No branches or pull requests

5 participants