A serverless status monitoring service built on Cloudflare Workers, D1, and R2. Inspired by StatusPage but designed for simplicity and cost-effectiveness.
Statusflare automatically monitors your services using multiple monitor types and displays their availability on a beautiful status page. It runs entirely on Cloudflare's edge infrastructure with scheduled health checks and static page generation.
- π Serverless: Built on Cloudflare Workers with zero server management
- π Real-time Monitoring: Multiple monitor types with checks every minute
- πΎ Persistent Storage: Uses Cloudflare D1 for configuration and time series data
- β‘ Fast Loading: Static pages cached on Cloudflare R2
- π§ Easy Management: Web-based admin panel for service configuration
- π Historical Data: Track uptime percentages and response times with visual latency bars
- π¨ Incident Management: Create and manage incidents with timeline updates
- π·οΈ Service Categories: Organise services into logical groups
- π Dynamic Status: Page title and favicon change based on overall system status
- π― SLO Monitoring: Define and monitor Service Level Objectives with automated burn rate detection
- π’ Smart Notifications: Webhook-based alerts for SLO violations and incident updates
- π‘ RSS Feeds: Subscribe to incident updates via RSS/Atom feeds
- π API Endpoints: RESTful API for programmatic access
- Node.js 18+
pnpm- Cloudflare account with Workers enabled
- Cloudflare account with D1 enabled
- Cloudflare account with R2 enabled
- Cloudflare account with Hyperdrive enabled, if you plan to monitor databases
-
Clone and Install
git clone https://github.com/krzko/statusflare.git cd statusflare pnpm install -
Set Up Cloudflare Resources
# Create D1 database pnpm dlx wrangler d1 create statusflare-db # Create R2 bucket pnpm dlx wrangler r2 bucket create statusflare-pages
-
Configure Database
# Update wrangler.jsonc with your database ID # Apply schema (for new deployments) pnpm dlx wrangler d1 execute statusflare-db --remote --file=db/schema-v4.sql # For existing installations, run migration for monitor types support pnpm dlx wrangler d1 execute statusflare-db --remote --file=db/migrate-v4-to-v5.sql
-
Create Admin Secret
pnpm dlx wrangler secret put STATUSFLARE_ADMIN_PASSWORD
-
Deploy
pnpm run deploy
-
Access Your Status Page
- Public status page:
https://your-worker.your-subdomain.workers.dev/ - Admin panel:
https://your-worker.your-subdomain.workers.dev/admin
NOTE: You can add a worker to Custom Domains to make it accessible from a custom domain.
- Public status page:
- Runtime: Cloudflare Workers
- Database: Cloudflare D1 (SQLite)
- Storage: Cloudflare R2 (Object Storage)
- Language: TypeScript
- Testing: Vitest
- Deployment: Wrangler CLI
Services are configured through the admin UI with the following options:
Choose from four monitor types to suit your monitoring needs:
- HTTP/HTTPS Monitor: Checks your URLs for specific HTTP status codes (default: 200 for success)
- Keyword Monitor: Searches for a specified keyword or phrase in the page response (case-insensitive lookup)
- API Monitor: Monitors APIs with support for request bodies, custom headers, and Bearer token authentication (expects 2xx status codes)
- Database Monitor: Monitors PostgreSQL and MySQL databases by executing SQL queries and checking connection health (requires Hyperdrive configuration)
- Name: Display name for the service
- URL: Endpoint to monitor
- Monitor Type: HTTP/HTTPS, Keyword, or API monitoring
- Method: HTTP method (GET, POST, HEAD, PUT, DELETE)
- Expected Status: HTTP status code to expect (HTTP monitor only)
- Keyword: Specific keyword to search for (Keyword monitor only)
- Request Body: JSON body for API requests (API monitor only)
- Request Headers: Custom headers as JSON (API monitor only)
- Bearer Token: Authentication token (API monitor only)
- Hyperdrive ID: Hyperdrive configuration ID for database monitoring (Database monitor only)
- Database Query: SQL query to execute for health check (Database monitor only)
- Expected Content: Optional content to verify in response (HTTP monitor legacy support)
- Timeout: Request timeout in milliseconds
- Category: Logical grouping for services
- Enabled: Whether monitoring is active
Customise your status page through the admin interface:
- Page Title: Custom name for your status page
- Banner Message: Custom status banner (e.g., "All Systems Operational")
The service provides a comprehensive RESTful API for programmatic access to all features including services, SLOs, notifications, incidents, and monitoring configurations.
Key API Features:
- Complete CRUD operations for all resources
- SLO monitoring and metrics endpoints
- Webhook notification management
- Real-time status check data access
- RSS feeds for incident updates
For complete API documentation, request/response examples, and integration guides, see the API Reference.
The service automatically:
- Performs health checks every minute via cron triggers for all monitor types
- Records response times and status codes
- Validates HTTP status codes, searches for keywords, or checks API responses based on monitor type
- Calculates uptime percentages for individual services and categories
- Generates visual latency bars showing 24-hour performance history
- Updates page title and favicon based on overall system status
- Generates and caches status pages on R2
- Stores historical data for trend analysis
- Preserves critical status changes (outages/degradation) in history sampling
When using the Cloudflare Workers free plan, be aware of Wall Time limitations:
- Wall Time: The total execution time from start to end of a Worker invocation, including
ctx.waitUntil - Free Plan Limit: 5 seconds of wall time per invocation
- Practical Impact: You can monitor approximately 4-5 services maximum before hitting this limit
- Depends on: Individual check duration (HTTP request timeout + processing time)
If you need to monitor more services, consider:
- Upgrading to Cloudflare Workers Paid plan for higher wall time limits
- Reducing individual service timeout values to fit more checks within 5 seconds
- Splitting services across multiple Workers for distributed monitoring
Learn more about Cloudflare Workers pricing and limits.
For detailed documentation, see the docs folder:
# Start local development
pnpm run dev
# Run tests
pnpm run test
# Type checking
pnpm run cf-typegen- Fork the repository
- Create a feature branch
- Make your changes following the existing patterns
- Add tests for new functionality
- Submit a pull request
