Running the Scheduler
Start the scheduler service:- Load all monitor configurations from
pongo/monitors/ - Start the HTTP API server (default port
3001) - Schedule monitors based on their
intervalsettings - Execute monitors with retry logic on failures
- Evaluate alert conditions after each check
- Dispatch webhooks to configured channels
Environment Variables
SCHEDULER_PORT
Type:numberDefault:
3001
HTTP API port for the scheduler service.
SCHEDULER_MAX_CONCURRENCY
Type:numberDefault:
10
Maximum number of monitors that can run concurrently.
SCHEDULER_MAX_RETRIES
Type:numberDefault:
3
Maximum number of retry attempts for failed monitor checks.
SCHEDULER_RETRY_DELAY_MS.
Example:
SCHEDULER_RETRY_DELAY_MS
Type:numberDefault:
5000
Base delay in milliseconds between retry attempts. Uses exponential backoff.
- Retry 1:
5000ms(5 seconds) - Retry 2:
10000ms(10 seconds) - Retry 3:
20000ms(20 seconds)
SCHEDULER_URL
Type:stringDefault: (none) Scheduler service URL for manual trigger operations from the dashboard.
- Testing new monitors without waiting for the next scheduled run
- Re-checking after fixing an issue
- Bulk triggering monitors from the UI
This must be accessible from the Next.js app server, not the browser. Use internal network URLs for security.
SCHEDULER_ENABLED
Type:booleanDefault:
false
Auto-start the scheduler when running in Docker.
true, the Docker entrypoint will automatically start the scheduler service alongside the Next.js app. This is useful for single-container deployments where you want both services in one process.
Docker Compose example:
ENABLE_MANUAL_RUN
Type:booleanDefault:
false
Show the manual run button in the dashboard UI.
SCHEDULER_URL, users will see a “Run Now” button next to each monitor in the dashboard. This sends a POST request to /monitors/:id/trigger on the scheduler service.
Example configuration:
Region Configuration
The scheduler automatically detects its region from environment variables:"default".
Multi-Region Deployment
Deploy multiple schedulers pointing at the same database:- Runs all monitors independently
- Stores results with region tags
- Contributes to alert evaluation
regionThreshold to control when they fire:
"any"- Fire if any region reports the condition"all"- Fire only if all regions report the condition"majority"- Fire if more than 50% of regions report the condition2(number) - Fire if at least 2 regions report the condition
Retry Behavior
The scheduler implements exponential backoff for failed checks:- Monitor handler executes
- If it fails (exception, timeout, or error status):
- Wait
SCHEDULER_RETRY_DELAY_MS * (2 ^ attemptNumber) - Retry up to
SCHEDULER_MAX_RETRIEStimes
- Wait
- After all retries are exhausted:
- Mark check as failed
- Record result in database
- Evaluate alert conditions
Graceful Shutdown
The scheduler handlesSIGINT and SIGTERM signals:
- Stop accepting new monitor executions
- Wait for in-flight checks to complete
- Clean up resources
- Exit
Configuration Summary
Here’s a complete configuration example for production:Related
- Scheduler Endpoints - HTTP API reference
- Monitors - Monitor configuration guide
- Alerts - Alert configuration and conditions