Pitch
Automate Better Stack maintenance windows during Ansible deployments to:
- avoid false downtime alerts
- keep clean uptime stats
- keep deployment traceability
- remove manual maintenance actions
Deployment Flow
- Start short maintenance window ( YY min -> to be defined, and might depend on the service)
- Deploy new image/version
- Wait for healthcheck (
/health) ?
- End maintenance early or let it expire automatically
Better Stack Targeting
Deployment must notify the correct Better Stack monitor depending on (as an example)
| Service |
Environment |
Target |
| frontend |
prod |
prod frontend monitor |
| backend |
prod |
prod backend monitor |
| frontend |
dev |
dev frontend monitor |
| backend |
dev |
dev backend monitor |
Use Ansible variables/inventory, no hardcoded IDs.
Example:
service_name: frontend
environment: prod
betterstack_monitor_id: xxx
betterstack_api_token: vault_secret
Specs suggestion
Failure Handling
If deploy fails:
- maintenance stays active until expiry
- playbook fails normally
- optional notification later
Security
API token stored in Ansible Vault / CI secrets
ansible ideas
pre_tasks:
- include_role:
name: betterstack_maintenance
vars:
state: start
roles:
- deploy_app
post_tasks:
- include_role:
name: betterstack_maintenance
vars:
state: stop
- maintenance windows instead choice over pause/unpause because they suppress false alerts while preserving a clear audit trail and deployment history
Pitch
Automate Better Stack maintenance windows during Ansible deployments to:
Deployment Flow
/health) ?Better Stack Targeting
Deployment must notify the correct Better Stack monitor depending on (as an example)
Use Ansible variables/inventory, no hardcoded IDs.
Example:
Specs suggestion
Failure Handling
If deploy fails:
Security
API token stored in Ansible Vault / CI secrets
ansible ideas
Reusable role:
roles/betterstack_maintenanceusage