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

enhancement: Add time_intervals to AlertManager #251

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
enhancement: Add time_intervals to AlertManager
Signed-off-by: Shaun Megaw <shaun.megaw@absa.africa>
  • Loading branch information
rezizter committed Dec 1, 2023
commit c41dd5c63ccf52e90942a5adadb7897da3507cd1
9 changes: 8 additions & 1 deletion roles/alertmanager/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ alertmanager_receivers: []
# slack_configs:
# - send_resolved: true
# channel: '#alerts'

alertmanager_time_intervals:: []
# alertmanager_time_intervals:
# - name: offhours
# time_intervals:
# - times:
# - end_time: "21:00"
# start_time: "24:00"
# location: "Africa/Johannesburg"
alertmanager_inhibit_rules: []
# alertmanager_inhibit_rules:
# - target_match:
Expand Down
3 changes: 3 additions & 0 deletions roles/alertmanager/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ argument_specs:
alertmanager_receivers:
description: "A list of notification receivers. Configuration same as in L(official docs,https://prometheus.io/docs/alerting/configuration/#receiver)"
type: "list"
alertmanager_time_intervals:
description: "A list of time intervals. Configuration same as in L(official docs,https://prometheus.io/docs/alerting/latest/configuration/#time_interval)"
type: "list"
alertmanager_inhibit_rules:
description: "List of inhibition rules. Same as in L(official docs,https://prometheus.io/docs/alerting/configuration/#inhibit_rule)"
type: "list"
Expand Down
4 changes: 4 additions & 0 deletions roles/alertmanager/templates/alertmanager.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ receivers:
inhibit_rules:
{{ alertmanager_inhibit_rules | to_nice_yaml(indent=2) }}
{% endif %}
{% if alertmanager_time_intervals | length %}
time_intervals:
{{ alertmanager_time_intervals | to_nice_yaml(indent=2) }}
{% endif %}
route:
{{ alertmanager_route | to_nice_yaml(indent=2) | indent(2, False) }}