Dear all,

Please find the below my prometheous alert and rules file , but I am not 
able test the alert using promtool.
I not able to understand where is the exact issue.
Please kindly help me.

Alert rule :

groups:
- name: distribution-service.alerts
rules:
- alert: Distribution_Service
expr: changes(process_start_time_seconds{job=~"distribution-service"}[5m]) 
> 1
for: 5m
labels:
severity: critical
annotations:
summary: Distribution-service too many restarts (instance {{ 
$labels.instance }})
description: Distribution-service has restarted more than once in the last 
5 minutes. It might be crashlooping. VALUE = {{ $value }} LABELS = {{ 
$labels }}



Rule_test_File:

rule_files:
- ./distribution-service.yaml

evaluation_interval: 5m


tests:
- interval: 5m
input_series:
- series: 'process_start_time_seconds{job="distribution-service", 
instance="test-host"}'
values: '4'

alert_rule_test:
- eval_time: 5m
alertname: Distribution_Service
exp_alerts:
- exp_labels:
severity: warning
job: distribution-service
instance: test-host
exp_annotations:
summary: "Distribution-service too many restarts (instance test-host)"
description: "Distribution-service has restarted more than once in the last 
5 minutes. It might be crashlooping. VALUE = 4 LABELS = 
map[instance:test-host job:distribution-service]"




-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/b0bc365e-f9de-4d14-b9ad-a11aee74b1cfn%40googlegroups.com.

Attachment: distribution-service.yaml
Description: application/yaml

Attachment: distribution-service-test.yaml
Description: application/yaml

Reply via email to