mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-03 03:37:36 +00:00
gitconfig: name/email from chezmoi data, gh credential helper by PATH lookup (portable to darwin). claude: no credentials, history, projects, sessions, or plugin caches. ssh config as private_ (0600). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
45 lines
1.3 KiB
Markdown
45 lines
1.3 KiB
Markdown
# Observability
|
|
|
|
Fetch https://developers.cloudflare.com/agents/api-reference/observability/ for complete documentation.
|
|
|
|
Agents emit structured events via Node.js `diagnostics_channel`. Subscribe in development or forward via Tail Workers in production.
|
|
|
|
## Subscribe to Events
|
|
|
|
```typescript
|
|
import { subscribe } from "agents/observability";
|
|
|
|
subscribe("agents:rpc", (event) => {
|
|
console.log(`RPC call: ${event.payload.method}`);
|
|
});
|
|
|
|
subscribe("agents:state", (event) => {
|
|
console.log(`State change on ${event.agent}`);
|
|
});
|
|
```
|
|
|
|
## Available Channels
|
|
|
|
| Channel | Events |
|
|
|---------|--------|
|
|
| `agents:state` | State changes |
|
|
| `agents:rpc` | `@callable` invocations |
|
|
| `agents:message` | WebSocket messages |
|
|
| `agents:schedule` | Schedule triggers |
|
|
| `agents:lifecycle` | Agent start, connect, disconnect |
|
|
| `agents:workflow` | Workflow progress, completion, errors |
|
|
| `agents:mcp` | MCP server connections, tool calls |
|
|
| `agents:email` | Email received |
|
|
|
|
## Per-Agent Override
|
|
|
|
```typescript
|
|
export class MyAgent extends Agent<Env, State> {
|
|
observability = undefined; // disable for this agent
|
|
}
|
|
```
|
|
|
|
## Production: Tail Workers
|
|
|
|
In production, events appear as `diagnosticsChannelEvents` on the Tail Worker `event` object. Attach a Tail Worker to your agent's Worker to forward events to your observability platform.
|