Skip to content

Configuration

Each monitored Worker is registered as a service config in D1. You manage them through the Orchestrator API.

Terminal window
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
}'
FieldTypeDefaultDescription
serviceNamestringrequiredWorker name (matches Workers Observability)
repoUrlstringrequiredGitHub repository HTTPS URL
repoBranchstring"main"Default branch for cloning
pollIntervalMsnumber30000Polling interval in milliseconds
enabledbooleantrueWhether to monitor this service
errorClassFilterstring[]["server_5xx", "unhandled_exception"]Error classes to detect
minOccurrencesnumber1Minimum occurrences before creating an incident
ClassDescription
client_4xxHTTP 400–499 responses
server_5xxHTTP 500–599 responses
unhandled_exceptionUncaught exceptions and promise rejections

Set secrets using Wrangler. These are never stored in code:

Terminal window
bunx wrangler@latest secret put GITHUB_TOKEN
bunx wrangler@latest secret put ANTHROPIC_API_KEY

For local development, add them to .dev.vars:

GITHUB_TOKEN=ghp_...
ANTHROPIC_API_KEY=sk-ant-...
CLOUDFLARE_API_TOKEN=...
CLOUDFLARE_ACCOUNT_ID=...
SecretPurpose
GITHUB_TOKENCreate branches, PRs, and issues on monitored repos
ANTHROPIC_API_KEYAI Gateway fallback for LLM calls
CLOUDFLARE_API_TOKENQuery Workers Observability API
CLOUDFLARE_ACCOUNT_IDIdentify the Cloudflare account

The main wrangler.jsonc file defines all Cloudflare bindings. Key settings:

Queuebatch_sizemax_batch_timeoutmax_retriesNotes
errors-detected105s3High throughput for error detection
triage-ready510s3Medium throughput for triage
fix-ready130s2Serial — one fix at a time per queue
completed105s1Logging only, low retry

The fix-ready queue uses batch_size: 1 to prevent concurrent fix attempts on the same repository.

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.