Configuration
Service Configuration
Section titled “Service Configuration”Each monitored Worker is registered as a service config in D1. You manage them through the Orchestrator API.
Register a Service
Section titled “Register a Service”curl -X PUT https://sentinel.example.com/api/config/services/my-worker \ -H "Content-Type: application/json" \ -d '{ "serviceName": "my-worker", "repoUrl": "https://github.com/org/my-worker", "repoBranch": "main", "pollIntervalMs": 30000, "enabled": true, "errorClassFilter": ["server_5xx", "unhandled_exception"], "minOccurrences": 1 }'Fields
Section titled “Fields”| Field | Type | Default | Description |
|---|---|---|---|
serviceName | string | required | Worker name (matches Workers Observability) |
repoUrl | string | required | GitHub repository HTTPS URL |
repoBranch | string | "main" | Default branch for cloning |
pollIntervalMs | number | 30000 | Polling interval in milliseconds |
enabled | boolean | true | Whether to monitor this service |
errorClassFilter | string[] | ["server_5xx", "unhandled_exception"] | Error classes to detect |
minOccurrences | number | 1 | Minimum occurrences before creating an incident |
Error Classes
Section titled “Error Classes”| Class | Description |
|---|---|
client_4xx | HTTP 400–499 responses |
server_5xx | HTTP 500–599 responses |
unhandled_exception | Uncaught exceptions and promise rejections |
Secrets
Section titled “Secrets”Set secrets using Wrangler. These are never stored in code:
bunx wrangler@latest secret put GITHUB_TOKENbunx wrangler@latest secret put ANTHROPIC_API_KEYFor local development, add them to .dev.vars:
GITHUB_TOKEN=ghp_...ANTHROPIC_API_KEY=sk-ant-...CLOUDFLARE_API_TOKEN=...CLOUDFLARE_ACCOUNT_ID=...| Secret | Purpose |
|---|---|
GITHUB_TOKEN | Create branches, PRs, and issues on monitored repos |
ANTHROPIC_API_KEY | AI Gateway fallback for LLM calls |
CLOUDFLARE_API_TOKEN | Query Workers Observability API |
CLOUDFLARE_ACCOUNT_ID | Identify the Cloudflare account |
Wrangler Configuration
Section titled “Wrangler Configuration”The main wrangler.jsonc file defines all Cloudflare bindings. Key settings:
Queue Tuning
Section titled “Queue Tuning”| Queue | batch_size | max_batch_timeout | max_retries | Notes |
|---|---|---|---|---|
errors-detected | 10 | 5s | 3 | High throughput for error detection |
triage-ready | 5 | 10s | 3 | Medium throughput for triage |
fix-ready | 1 | 30s | 2 | Serial — one fix at a time per queue |
completed | 10 | 5s | 1 | Logging only, low retry |
The fix-ready queue uses batch_size: 1 to prevent concurrent fix attempts on the same repository.
Observability
Section titled “Observability”All observability settings are enabled by default:
"observability": { "enabled": true, "head_sampling_rate": 1, "logs": { "enabled": true, "persist": true, "invocation_logs": true }, "traces": { "enabled": true, "persist": true }}This ensures full visibility into agent behavior in the Cloudflare dashboard.