Pause Monitoring During Deployments
Prevent false downtime alerts during deployments by pausing monitoring using our API. Perfect for integrating into your CI/CD pipelines like GitHub Actions, GitLab CI, CircleCI, and more.
Why Pause Monitoring?
During deployments, your monitor may be temporarily unavailable. Pausing monitoring prevents false alerts and keeps your incident history clean.
Getting Started
- Generate an API token from User Settings → API Tokens
- Find your monitor ID (visible in the URL when viewing a monitor)
- Add the pause/resume commands to your deployment script
API Endpoints
All endpoints require authentication using a Bearer token.
Pause Monitoring
POST /api/monitors/{monitor_id}/pause
Resume Monitoring
POST /api/monitors/{monitor_id}/resume
POST /api/monitors/{monitor_id}/unpause
Both endpoints work identically.
GitHub Actions Example
- name: Pause Monitoring
run: |
curl -X POST https://sentinel.rootstuff.io/api/monitors/${{ secrets.MONITOR_ID }}/pause \
-H "Authorization: Bearer ${{ secrets.UPTIME_API_TOKEN }}" \
-H "Accept: application/json"
- name: Deploy Application
run: ./deploy.sh
- name: Resume Monitoring
if: always() # Always resume, even if deploy fails
run: |
curl -X POST https://sentinel.rootstuff.io/api/monitors/${{ secrets.MONITOR_ID }}/resume \
-H "Authorization: Bearer ${{ secrets.UPTIME_API_TOKEN }}" \
-H "Accept: application/json"
GitLab CI Example
stages:
- pause
- deploy
- resume
pause_monitoring:
stage: pause
script:
- |
curl -X POST https://sentinel.rootstuff.io/api/monitors/${MONITOR_ID}/pause \
-H "Authorization: Bearer ${UPTIME_API_TOKEN}" \
-H "Accept: application/json"
deploy:
stage: deploy
script:
- ./deploy.sh
resume_monitoring:
stage: resume
when: always
script:
- |
curl -X POST https://sentinel.rootstuff.io/api/monitors/${MONITOR_ID}/resume \
-H "Authorization: Bearer ${UPTIME_API_TOKEN}" \
-H "Accept: application/json"
Buddy.works Example
- pipeline: "Deploy to Production"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "main"
actions:
- action: "Pause Monitoring"
type: "BUILD"
docker_image_name: "library/curl"
docker_image_tag: "latest"
execute_commands:
- "curl -X POST https://sentinel.rootstuff.io/api/monitors/${MONITOR_ID}/pause \\"
- " -H \"Authorization: Bearer ${UPTIME_API_TOKEN}\" \\"
- " -H \"Accept: application/json\""
shell: "SH"
- action: "Deploy Application"
type: "SSH"
# Your deployment commands here
commands:
- "cd /var/www/html"
- "git pull origin main"
- "composer install --no-dev"
- "php artisan migrate --force"
- "php artisan config:cache"
- "sudo systemctl reload php-fpm"
- action: "Resume Monitoring"
type: "BUILD"
docker_image_name: "library/curl"
docker_image_tag: "latest"
execute_commands:
- "curl -X POST https://sentinel.rootstuff.io/api/monitors/${MONITOR_ID}/resume \\"
- " -H \"Authorization: Bearer ${UPTIME_API_TOKEN}\" \\"
- " -H \"Accept: application/json\""
shell: "SH"
run_next_parallel: false
trigger_condition: "ALWAYS"
Buddy.works Configuration
- Add
MONITOR_IDandUPTIME_API_TOKENas pipeline variables - Mark
UPTIME_API_TOKENas encrypted in Buddy settings - Set
trigger_condition: ALWAYSto ensure monitoring resumes even if deployment fails - Use the
curlDocker image for API calls
Simple Bash Script
#!/bin/bash
API_TOKEN="your_api_token_here"
MONITOR_ID="1"
API_URL="https://sentinel.rootstuff.io/api/monitors"
# Ensure monitoring resumes even if deploy fails
trap 'curl -X POST "${API_URL}/${MONITOR_ID}/resume" \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/json"' EXIT
# Pause monitoring
curl -X POST "${API_URL}/${MONITOR_ID}/pause" \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/json"
# Run deployment
./deploy.sh
Best Practices
- Always use
if: always()ortrapto ensure monitoring resumes - Store API tokens as secrets, never commit them to version control
- Test your integration in a staging environment first
- Pause only during actual deployments, not builds
Other CI/CD Platforms
The same curl commands work with any CI/CD platform:
- CircleCI: Use
when: alwaysin run steps - Jenkins: Use
post { always { } }blocks - Bitbucket Pipelines: Use multiple steps with appropriate conditions
- Azure DevOps: Use
condition: always()in tasks - Travis CI: Use
after_failureandafter_successhooks - Codeship: Add resume command to deployment scripts with error handling
Troubleshooting
- 403 Forbidden: Check that your API token is valid and your plan includes API access
- 404 Not Found: Verify the monitor ID is correct
- Token not working: Ensure you're using "Bearer" prefix in the Authorization header
For complete API documentation with examples for all major CI/CD platforms, visit the full API guide.