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

[infra] feat: notify Discord role when URLs checks fail #1824

Merged
merged 5 commits into from
Nov 9, 2023
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
8 changes: 8 additions & 0 deletions infra/ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ all:
- https://api.tournesol.app/admin
- https://webanalytics.tournesol.app/login

# ID of the Discord role that will be highlighted when a monitored
# URL is unreachable. (optional)
discord_role_id_urls_checks: 928020834885464086

grafana_domain_name: "grafana.{{domain_name}}"
grafana_scheme: https
plausible_hosting_tag: "2023.09.28"
Expand Down Expand Up @@ -170,6 +174,10 @@ all:
- https://api.staging.tournesol.app/admin
- https://webanalytics.staging.tournesol.app/login

# ID of the Discord role that will be highlighted when a monitored
# URL is unreachable. (optional)
discord_role_id_urls_checks: 928020834885464086

grafana_domain_name: "grafana.{{domain_name}}"
grafana_scheme: https
plausible_hosting_tag: "2023.09.28"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ do
echo "error checking $u"
{% if discord_infra_alert_webhook is defined and discord_infra_alert_webhook != "" %}
wget -qO /dev/null \
--post-data='{"content": "health check of '"$u"' failed"}' \
{% if discord_role_id_urls_checks is defined and discord_role_id_urls_checks %}
--post-data='{"content": "🚨 <@&{{discord_role_id_urls_checks}}> - health check of '"$u"' failed"}' \
{% else %}
--post-data='{"content": "🚨 health check of '"$u"' failed"}' \
{% endif %}
--header='Content-Type:application/json' \
'{{discord_infra_alert_webhook}}?wait=true'
echo "alert sent"
Expand Down