// Error rate monitoring, SLO detection, and notification webhooks for automated rollback triggers. Use when setting up automated deployment rollback, monitoring error rates, configuring SLO thresholds, implementing deployment safety nets, setting up alerting webhooks, or when user mentions automated rollback, error rate monitoring, SLO violations, deployment safety, or rollback automation.
| name | auto-rollback-triggers |
| description | Error rate monitoring, SLO detection, and notification webhooks for automated rollback triggers. Use when setting up automated deployment rollback, monitoring error rates, configuring SLO thresholds, implementing deployment safety nets, setting up alerting webhooks, or when user mentions automated rollback, error rate monitoring, SLO violations, deployment safety, or rollback automation. |
| allowed-tools | Bash, Read, Write, Edit |
Automated rollback trigger patterns with error rate monitoring, SLO detection, and notification webhooks for deployment safety.
This skill provides functional monitoring scripts, CI/CD workflow templates, and webhook integration examples for automated deployment rollback triggers. All scripts include proper error handling, threshold configuration, and notification patterns for production safety nets.
All scripts are located in scripts/ and are fully functional (not placeholders).
# Monitor error rate (5% threshold over 5 minutes)
bash scripts/monitor-error-rate.sh https://api.example.com/metrics 5.0 300
# Check SLO compliance (99.9% uptime target)
bash scripts/check-slo.sh https://api.example.com/health 99.9
# Trigger rollback to previous version
bash scripts/trigger-rollback.sh vercel my-project previous-deployment-id
# Collect metrics from deployment
bash scripts/collect-metrics.sh https://api.example.com/metrics
# Send webhook notification
bash scripts/notify-webhook.sh "https://hooks.slack.com/services/your_webhook_url_here" "Deployment failed SLO check"
All templates are located in templates/ and provide configuration examples.
# Copy workflow to GitHub Actions
cp templates/github-actions-auto-rollback.yml .github/workflows/auto-rollback.yml
# Configure error thresholds
cp templates/error-threshold-config.json config/error-thresholds.json
# Set up SLO definitions
cp templates/slo-config.json config/slo.json
All examples are located in examples/ and demonstrate real-world usage patterns.
Configure Error Thresholds
# Copy and customize threshold configuration
cp templates/error-threshold-config.json config/error-thresholds.json
# Edit thresholds for your application
# Example: 5% error rate over 5 minutes triggers rollback
Deploy Monitoring Script
# Run monitoring in background or CI/CD pipeline
bash scripts/monitor-error-rate.sh \
https://api.myapp.com/metrics \
5.0 \
300 \
config/error-thresholds.json
Integrate with GitHub Actions
# Copy workflow template
cp templates/github-actions-error-monitoring.yml .github/workflows/monitor-errors.yml
# Configure secrets: DEPLOYMENT_URL, WEBHOOK_URL, ROLLBACK_TOKEN
Define SLO Targets
# Copy SLO configuration template
cp templates/slo-config.json config/slo.json
# Define targets: 99.9% uptime, <500ms p95 latency, <1% error rate
Run SLO Validation
# Check SLO compliance after deployment
bash scripts/check-slo.sh \
https://api.myapp.com/health \
99.9 \
config/slo.json
# Exit code 0 = SLO met, 1 = SLO violated (trigger rollback)
Automate with CI/CD
# Copy complete auto-rollback workflow
cp templates/github-actions-auto-rollback.yml .github/workflows/auto-rollback.yml
# Workflow automatically monitors and rolls back on SLO violations
Slack Webhook Integration
# Set webhook URL (use placeholder, replace with real URL)
export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/your_webhook_url_here"
# Send notification
bash scripts/notify-webhook.sh \
"$SLACK_WEBHOOK_URL" \
"Deployment failed: Error rate 8.5% exceeds threshold 5.0%"
Discord Webhook Integration
# Set webhook URL (use placeholder, replace with real URL)
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/your_webhook_url_here"
# Send notification with custom formatting
bash scripts/notify-webhook.sh \
"$DISCORD_WEBHOOK_URL" \
"Auto-rollback triggered" \
--discord
Vercel Rollback
# Trigger Vercel deployment rollback
bash scripts/trigger-rollback.sh vercel \
my-project \
previous-deployment-id \
"$VERCEL_TOKEN"
DigitalOcean App Platform Rollback
# Trigger DigitalOcean App rollback
bash scripts/trigger-rollback.sh digitalocean \
app-id \
previous-deployment-id \
"$DIGITALOCEAN_TOKEN"
Railway Rollback
# Trigger Railway deployment rollback
bash scripts/trigger-rollback.sh railway \
project-id \
previous-deployment-id \
"$RAILWAY_TOKEN"
Continuous Monitoring Workflow
Post-Deployment Validation
Canary Deployment Protection
Similar patterns available for GitLab CI/CD using templates/gitlab-ci-auto-rollback.yml
Vercel Deployment Protection
templates/vercel-deployment-protection.json for native Vercel checksDigitalOcean App Platform
templates/digitalocean-app-rollback.json for health checksRailway
templates/railway-deployment-check.json for health checkscurl - For HTTP requests to metrics endpointsjq - For JSON parsing and metrics extractionbc - For threshold calculationsdate - For time window calculations (GNU coreutils)Platform CLIs:
vercel - Vercel CLI for deployment managementdoctl - DigitalOcean CLI for App Platform managementrailway - Railway CLI for project managementMonitoring Tools:
datadog-cli - Datadog metrics collectionnewrelic-cli - New Relic APM integrationsentry-cli - Sentry error tracking integrationConfigure these secrets in your GitHub repository:
DEPLOYMENT_URL - Application metrics endpointWEBHOOK_URL - Slack/Discord webhook URL (use placeholder: https://hooks.example.com/your_webhook_url_here)ROLLBACK_TOKEN - Platform API token for rollback operationsVERCEL_TOKEN - Vercel API token (if using Vercel)DIGITALOCEAN_TOKEN - DigitalOcean API token (if using DigitalOcean)RAILWAY_TOKEN - Railway API token (if using Railway)All scripts follow standard exit code conventions:
0 - Metrics within thresholds, SLO met, rollback successful1 - Threshold exceeded, SLO violated, rollback required2 - Invalid arguments or missing dependencies3 - Timeout or network error accessing metrics4 - Platform API error during rollback5 - Webhook notification failedhttps://hooks.example.com/your_webhook_url_here in templatesFalse Positive Rollbacks
Missed Rollback Triggers
Webhook Notifications Not Delivered
Platform Rollback Failures
Location: /home/gotime2022/.claude/plugins/marketplaces/dev-lifecycle-marketplace/plugins/deployment/skills/auto-rollback-triggers/