-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Alert rule validation error #143
Comments
Many thanks for the report. Can you check that the promtool check command works without errors on the new alert file? |
Hi @tuxmea , After getting above described error, I did ssh to vagrant box and added some simple alert.rules file to check promtool command . below copy of terminal . [root@prometheus ~]# prometheus --version
prometheus, version 2.0.0 (branch: HEAD, revision: 0a74f98628a0463dddc90528220c94de5032d1a0)
build user: root@615b82cb36b6
build date: 20171108-07:11:59
go version: go1.9.2
[root@prometheus ~]# cat /etc/prometheus/alert.rules
groups:
- name: example
rules:
- alert: HighErrorRate
expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
for: 10m
labels:
severity: page
annotations:
summary: High request latency
[root@prometheus ~]# /usr/local/bin/promtool check rules /etc/prometheus/alert.rules
Checking /etc/prometheus/alert.rules
SUCCESS: 1 rules found
[root@prometheus ~]# echo $?
0
[root@prometheus ~]# BR |
definitely something wrong with alert.rules files . including '::prometheus' should work out of box . I`m wondering that something is wrong here |
|
Found issue . As Far as alert.rule has no default value Validation of empty yaml file is giving above error . so either we should add some default alert.rules to module to get |
Empty hashes seem to work, while empty arrays don't:
So we can just change the default to |
This should fix `promtool` parsing problems for prometheus 2.* and empty alert files. Behaviour for 1.* should remain unchanged. Fixes voxpupuli#143
Hi @costela , |
This should fix `promtool` parsing problems for prometheus 2.* and empty alert files. Behaviour for 1.* should remain unchanged. Fixes voxpupuli#143
This should fix `promtool` parsing problems for prometheus 2.* and empty alert files. Behaviour for 1.* should remain unchanged. Fixes voxpupuli#143
Hi,
Getting error while using puppet-prometheus
init.pp
Error shown below
probably something wrong here: https://github.com/voxpupuli/puppet-prometheus/blob/master/manifests/alerts.pp#L36
BR
Karen
The text was updated successfully, but these errors were encountered: