Skip to content

Monitoring

All agents emit structured JSON logs via console.log() and console.error():

{
"agent": "LogTailerAgent",
"event": "poll_completed",
"timestamp": "2026-02-20T10:00:30Z",
"eventsProcessed": 15,
"newIncidents": 2,
"serviceName": "my-worker"
}

These logs are visible in the Cloudflare dashboard under Workers → Logs with full-text search.

Sentinel runs with full observability enabled:

  • Invocation logs — every Worker invocation is logged
  • Traces — distributed traces across agent invocations
  • Head sampling rate: 1 — 100% of requests are sampled

View in the Cloudflare dashboard: Workers & Pages → sentinel → Logs/Traces.

Terminal window
curl https://sentinel.example.com/api/health

Returns { "status": "ok" } when the Orchestrator is running.

Terminal window
curl https://sentinel.example.com/api/stats

Returns counts by incident status:

{
"stats": [
{ "status": "detected", "count": 5 },
{ "status": "test_generating", "count": 1 },
{ "status": "fixing", "count": 2 },
{ "status": "resolved", "count": 15 },
{ "status": "needs_human", "count": 3 }
]
}
Terminal window
curl 'https://sentinel.example.com/api/incidents?status=needs_human'

Filter incidents that require human attention.

Every LLM call is recorded in the llm_calls D1 table with:

  • Model name and provider
  • Token counts (prompt, completion, total)
  • Latency in milliseconds
  • Cache hit status (when AI Gateway is enabled)

Query directly via D1 console:

SELECT model, provider, SUM(total_tokens) as total_tokens,
AVG(latency_ms) as avg_latency_ms, COUNT(*) as calls
FROM llm_calls
GROUP BY model, provider;

The agent_runs table tracks every agent execution:

SELECT agent_type, status, COUNT(*) as count,
AVG(duration_ms) as avg_duration_ms
FROM agent_runs
WHERE started_at > datetime('now', '-24 hours')
GROUP BY agent_type, status;

Failed messages appear in sentinel-dlq. The DLQ handler logs them to console.error with full message body, timestamp, and retry count.

Monitor DLQ activity in the Cloudflare dashboard under Queues → sentinel-dlq.