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

testutil/compose: add basic prometheus alerts #719

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions testutil/compose/docker-compose.template
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ services:
networks: [compose]
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/rules.yml:/etc/prometheus/rules.yml

grafana:
image: grafana/grafana:latest
Expand Down
3 changes: 3 additions & 0 deletions testutil/compose/static/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ scrape_configs:
- job_name: 'node3'
static_configs:
- targets: ['node3:16001']

rule_files:
- /etc/prometheus/rules.yml
44 changes: 44 additions & 0 deletions testutil/compose/static/prometheus/rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
groups:
- name: charon
rules:
- alert: Charon Down
expr: up == 0
for: 15s
annotations:
description: "Ensures charon node(s) are available"

- alert: Error Log Rate
expr: app_log_error_total > 0
for: 15s
annotations:
description: "Ensures no error logs"

- alert: Warn Log Rate
expr: increase(app_log_warn_total[30s]) > 2
for: 15s
annotations:
description: "Ensures warning log rate is low"

- alert: Validator API Error Rate
expr: increase(core_validatorapi_request_error_total{endpoint!="proxy"}[30s]) > 1
for: 15s
annotations:
description: "Ensures validator api error rate is very low"

- alert: Proxy API Error Rate
expr: increase(core_validatorapi_request_error_total{endpoint="proxy"}[30s]) > 5
for: 15s
annotations:
description: "Ensures proxy api error rate is low"

- alert: Broadcast Duty Rate
expr: increase(core_bcast_broadcast_total[30s]) < 0.5
for: 15s
annotations:
description: "Ensures broadcast duty rate is not low / is high"

- alert: Outstanding Duty Rate
expr: core_bcast_broadcast_total - core_scheduler_duty_total > 50
for: 15s
annotations:
description: "Ensures outstanding duties remain low"
1 change: 1 addition & 0 deletions testutil/compose/testdata/TestDockerCompose_run_yml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ services:
networks: [compose]
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/rules.yml:/etc/prometheus/rules.yml

grafana:
image: grafana/grafana:latest
Expand Down