Skip to content

Commit

Permalink
Set up Prometheus alerting on Netcup
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed May 4, 2024
1 parent d803e0f commit deae3a4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ansible/roles/prometheus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ prometheus_configuration:

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
- "rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
Expand All @@ -43,3 +42,6 @@ prometheus_configuration:
# machine by default.
static_configs:
- targets: ['localhost:9100']

prometheus_rules:
groups: []
14 changes: 14 additions & 0 deletions ansible/roles/prometheus/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@
- role::prometheus
notify:
- Reload the prometheus service

- name: Configure prometheus rules
copy:
content: |
# Ansible managed
{{ prometheus_rules | to_nice_yaml }}
dest: /etc/prometheus/rules.yml
owner: prometheus
group: prometheus
mode: "0400"
tags:
- role::prometheus
notify:
- Reload the prometheus service

0 comments on commit deae3a4

Please sign in to comment.