Uptime Monitors
Uptime monitors proactively check your services from 9n9s infrastructure by making requests to your endpoints and validating responses. They provide external monitoring to ensure your services are accessible and functioning correctly from your users’ perspective.
How Uptime Monitors Work
Section titled “How Uptime Monitors Work”- Configure Target: Specify the URL or endpoint to monitor
- Set Frequency: Choose how often to check (every 30 seconds to 1 hour)
- Define Assertions: Set criteria for what constitutes a successful check
- Monitor Results: 9n9s tracks response times, status codes, and validation results
- Get Alerts: Receive notifications when checks fail or assertions don’t pass
Perfect For
Section titled “Perfect For”- Website Monitoring: Ensure your website is accessible and loading correctly
- API Health Checks: Monitor REST APIs, GraphQL endpoints, and microservices
- Service Endpoints: Check databases, caches, and internal services
- SSL Certificate Monitoring: Track certificate expiration dates
- Third-Party Dependencies: Monitor external services your application depends on
- CDN and Load Balancer Health: Ensure global infrastructure is responding
Key Benefits
Section titled “Key Benefits”External Perspective
Section titled “External Perspective”- Monitor from outside your infrastructure
- Detect issues before your users do
- Validate end-to-end functionality
- Test from multiple geographic regions (coming soon)
Comprehensive Validation
Section titled “Comprehensive Validation”- Status code checking (200, 404, 5xx ranges)
- Response time monitoring with thresholds
- Content validation with regex patterns
- JSON/XML response structure validation
- HTTP header verification
- SSL/TLS certificate monitoring
Flexible Configuration
Section titled “Flexible Configuration”- Custom HTTP methods (GET, POST, PUT, DELETE)
- Custom headers and authentication
- Request body for POST/PUT requests
- Timeout configuration
- User-agent customization
Performance Insights
Section titled “Performance Insights”- Response time tracking and trends
- Uptime percentage calculations
- Historical performance data
- SLA compliance reporting
Monitor States
Section titled “Monitor States”| State | Description |
|---|---|
| Up | All assertions passing, service responding correctly |
| Down | One or more assertions failing or service unreachable |
| Paused | Monitoring temporarily disabled |
Getting Started
Section titled “Getting Started”Quick Setup
Section titled “Quick Setup”- Create Monitor: Use the web interface to create your first uptime monitor
- Enter URL: Specify the endpoint to monitor (e.g.,
https://api.example.com/health) - Set Frequency: Choose check interval (e.g., every 1 minute)
- Configure Assertions: Define success criteria (status code, response time, content)
- Start Monitoring: Activate the monitor and begin receiving checks
Basic Website Monitor
Section titled “Basic Website Monitor”# Example configurationname: "Company Homepage"url: "https://company.com"frequency: "1m"timeout: "10s"assertions: - type: "STATUS_CODE" operator: "EQUALS" value: "200" - type: "RESPONSE_TIME" operator: "LESS_THAN" value: "2000" # 2 seconds - type: "RESPONSE_BODY" operator: "CONTAINS" value: "Welcome"API Health Check
Section titled “API Health Check”name: "API Health Endpoint"url: "https://api.example.com/health"method: "GET"headers: Authorization: "Bearer token123" Content-Type: "application/json"frequency: "30s"assertions: - type: "STATUS_CODE" operator: "EQUALS" value: "200" - type: "JSON_CONTENT" path: "$.status" operator: "EQUALS" value: "healthy" - type: "RESPONSE_TIME" operator: "LESS_THAN" value: "1000"Assertion Types
Section titled “Assertion Types”Status Code Assertions
Section titled “Status Code Assertions”Validate HTTP response status codes:
# Exact match- type: "STATUS_CODE" operator: "EQUALS" value: "200"
# Range matching- type: "STATUS_CODE" operator: "IN" value: "2xx" # Any 2xx status code
# Multiple acceptable codes- type: "STATUS_CODE" operator: "IN" value: ["200", "201", "202"]Response Time Assertions
Section titled “Response Time Assertions”Monitor performance and set SLA thresholds:
# Maximum response time- type: "RESPONSE_TIME" operator: "LESS_THAN" value: "1500" # milliseconds
# Minimum response time (detect cache issues)- type: "RESPONSE_TIME" operator: "GREATER_THAN" value: "10"Content Assertions
Section titled “Content Assertions”Validate response body content:
# Text contains- type: "RESPONSE_BODY" operator: "CONTAINS" value: "success"
# Text does not contain- type: "RESPONSE_BODY" operator: "NOT_CONTAINS" value: "error"
# Regex pattern matching- type: "RESPONSE_BODY" operator: "MATCHES_REGEX" value: "User ID: \\d+"JSON Content Assertions
Section titled “JSON Content Assertions”Validate structured JSON responses:
# JSONPath validation- type: "JSON_CONTENT" path: "$.status" operator: "EQUALS" value: "ok"
# Nested object validation- type: "JSON_CONTENT" path: "$.data.users[0].active" operator: "EQUALS" value: true
# Array length validation- type: "JSON_CONTENT" path: "$.items.length()" operator: "GREATER_THAN" value: 0Header Assertions
Section titled “Header Assertions”Validate HTTP response headers:
# Header exists and contains value- type: "RESPONSE_HEADER" header: "Content-Type" operator: "CONTAINS" value: "application/json"
# Security header validation- type: "RESPONSE_HEADER" header: "X-Frame-Options" operator: "EQUALS" value: "DENY"SSL Certificate Assertions
Section titled “SSL Certificate Assertions”Monitor certificate expiration:
# Certificate expires in more than 14 days- type: "TLS_CERT_EXPIRY" operator: "MORE_THAN_DAYS" value: "14"
# Certificate is valid- type: "TLS_CERT_VALID" operator: "EQUALS" value: trueAdvanced Configuration
Section titled “Advanced Configuration”Custom HTTP Methods
Section titled “Custom HTTP Methods”Monitor POST/PUT endpoints with custom payloads:
name: "User Registration API"url: "https://api.example.com/users"method: "POST"headers: Content-Type: "application/json" Authorization: "Bearer test-token"body: | { "username": "test-user", "email": "[email protected]", "test": true }assertions: - type: "STATUS_CODE" operator: "EQUALS" value: "201" - type: "JSON_CONTENT" path: "$.user.id" operator: "EXISTS"Authentication Methods
Section titled “Authentication Methods”Support various authentication schemes:
# Bearer tokenheaders: Authorization: "Bearer {{env.API_TOKEN}}"
# Basic authenticationheaders: Authorization: "Basic {{base64(username:password)}}"
# API key in headerheaders: X-API-Key: "{{env.API_KEY}}"
# API key in query parameterurl: "https://api.example.com/data?api_key={{env.API_KEY}}"Environment Variables
Section titled “Environment Variables”Use environment variables for sensitive data:
headers: Authorization: "Bearer {{env.PRODUCTION_API_TOKEN}}" X-Client-ID: "{{env.CLIENT_ID}}"Complex Validation Examples
Section titled “Complex Validation Examples”E-commerce Product API:
name: "Product Catalog API"url: "https://store.example.com/api/products/featured"assertions: - type: "STATUS_CODE" operator: "EQUALS" value: "200" - type: "JSON_CONTENT" path: "$.products.length()" operator: "GREATER_THAN" value: 5 - type: "JSON_CONTENT" path: "$.products[0].price" operator: "EXISTS" - type: "RESPONSE_TIME" operator: "LESS_THAN" value: "800"Payment Gateway Health:
name: "Payment Gateway Status"url: "https://payments.example.com/v1/status"headers: Authorization: "Bearer {{env.PAYMENT_API_KEY}}"assertions: - type: "STATUS_CODE" operator: "EQUALS" value: "200" - type: "JSON_CONTENT" path: "$.services.payment_processing" operator: "EQUALS" value: "operational" - type: "JSON_CONTENT" path: "$.services.fraud_detection" operator: "EQUALS" value: "operational" - type: "TLS_CERT_EXPIRY" operator: "MORE_THAN_DAYS" value: "30"Performance Monitoring
Section titled “Performance Monitoring”Response Time Tracking
Section titled “Response Time Tracking”Monitor and track response times over time:
- Real-time Alerts: Get notified when response times exceed thresholds
- Historical Trends: View performance trends and identify degradation
- Percentile Analysis: Track 95th and 99th percentile response times
- SLA Reporting: Monitor compliance with performance SLAs
Uptime Calculations
Section titled “Uptime Calculations”Understand how uptime is calculated:
- Success Rate: Percentage of successful checks over time period
- Availability Windows: Different calculations for business hours vs 24/7
- Maintenance Exclusions: Exclude planned maintenance from calculations
- Custom SLA Periods: Define your own measurement windows
Best Practices
Section titled “Best Practices”Monitor Configuration
Section titled “Monitor Configuration”Set Appropriate Frequencies:
- Critical APIs: Every 30 seconds to 1 minute
- Websites: Every 1-2 minutes
- Internal services: Every 2-5 minutes
- Background services: Every 5-15 minutes
Use Realistic Timeouts:
- Fast APIs: 5-10 seconds
- Complex queries: 15-30 seconds
- File uploads/downloads: 60+ seconds
- Consider worst-case scenarios
Configure Meaningful Assertions:
- Always check status codes
- Set reasonable response time thresholds
- Validate critical content or data structure
- Monitor SSL certificate expiration
Security Considerations
Section titled “Security Considerations”Protect Sensitive Data:
- Use environment variables for API keys and tokens
- Avoid hardcoding credentials in configurations
- Rotate API keys regularly
- Use read-only or limited-scope tokens when possible
Monitor Endpoints Safely:
- Use dedicated health check endpoints when available
- Avoid monitoring endpoints that modify data
- Consider rate limiting implications
- Use appropriate User-Agent headers
Alert Strategy
Section titled “Alert Strategy”Gradual Escalation:
- Start with email/Slack for initial alerts
- Escalate to SMS/PagerDuty for sustained issues
- Use different thresholds for different severity levels
- Consider business hours vs. after-hours alerting
Reduce False Positives:
- Set grace periods for temporary network issues
- Use multiple assertions to confirm real problems
- Consider maintenance windows and scheduled downtime
- Monitor trends rather than just individual failures
Common Patterns
Section titled “Common Patterns”Multi-Environment Monitoring
Section titled “Multi-Environment Monitoring”# Productionname: "API - Production"url: "https://api.example.com/health"frequency: "30s"tags: ["production", "api", "critical"]
# Stagingname: "API - Staging"url: "https://staging-api.example.com/health"frequency: "2m"tags: ["staging", "api"]
# Developmentname: "API - Development"url: "https://dev-api.example.com/health"frequency: "5m"tags: ["development", "api"]Microservices Health Checks
Section titled “Microservices Health Checks”# User Servicename: "User Service Health"url: "https://users.api.example.com/health"assertions: - type: "JSON_CONTENT" path: "$.database.status" value: "connected"
# Order Servicename: "Order Service Health"url: "https://orders.api.example.com/health"assertions: - type: "JSON_CONTENT" path: "$.dependencies.payment_gateway" value: "healthy"Progressive Web App Monitoring
Section titled “Progressive Web App Monitoring”# Main Applicationname: "PWA - Main App"url: "https://app.example.com"assertions: - type: "STATUS_CODE" value: "200" - type: "RESPONSE_BODY" operator: "CONTAINS" value: "manifest.json"
# Service Workername: "PWA - Service Worker"url: "https://app.example.com/sw.js"assertions: - type: "STATUS_CODE" value: "200" - type: "RESPONSE_HEADER" header: "Content-Type" operator: "CONTAINS" value: "javascript"Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”High Response Times:
- Check server resource utilization
- Analyze database query performance
- Review network latency and routing
- Consider CDN configuration
Intermittent Failures:
- Look for patterns in failure timing
- Check for rate limiting or throttling
- Review load balancer health checks
- Investigate DNS resolution issues
SSL Certificate Warnings:
- Verify certificate chain completeness
- Check certificate expiration dates
- Ensure proper domain name matching
- Validate certificate authority trust
Debugging Failed Checks
Section titled “Debugging Failed Checks”Review check details for failed assertions:
- Response Details: Status code, headers, body content
- Timing Information: DNS lookup, connection, response times
- Error Messages: Specific assertion failures and reasons
- Network Path: Trace route and connection details
Next Steps
Section titled “Next Steps”- Create your first uptime monitor
- Set up comprehensive assertions for validation
- Configure alerts for downtime notifications
- Monitor SSL certificates for expiration tracking
- See monitoring examples for different service types