3.1 Layer 1: Cloudflare Automatic Tracing
Cloudflare Workers provide built-in tracing for infrastructure operations. When enabled,
every Worker invocation captures:
| Operation | Data Captured | Use Case |
|---|
| Fetch calls | URL, method, status, latency | External API dependencies |
| D1 queries | SQL, rows affected, duration | Database performance |
| KV operations | Key, operation, size | Cache behavior |
| R2 access | Bucket, object, bytes | Storage patterns |
| Durable Objects | Class, method, duration | Stateful coordination |
Configuration is minimal—add to wrangler.jsonc:
"observability": {
"enabled": true,
"traces": {
"enabled": true,
"head_sampling_rate": 0.1
}
}
3.2 Layer 2: Langfuse LLM Tracing
Langfuse provides purpose-built observability for LLM applications. It captures:
- Traces: Top-level operations (an MCP tool call, an agent session)
- Spans: Sub-operations within a trace (a database query, a file read)
- Generations: LLM API calls with full input/output and token counts
- Scores: Quality metrics attached to traces (success, latency, user feedback)
The @create-something/observability package wraps Langfuse with Atlas metadata:
import { createTrace, createGeneration } from '@create-something/observability';
import { mcpToolMetadata } from '@create-something/observability/atlas';
// Create trace with Atlas dimensions
const trace = createTrace({
name: 'harness-mcp:get_priority',
metadata: mcpToolMetadata('harness-mcp', 'get_priority', 'orchestrate')
});
// Track LLM generation
const gen = createGeneration(trace, {
name: 'claude-completion',
model: 'claude-sonnet-4-20250514',
input: messages
});
// ... make LLM call ...
gen.end(response, { input: 150, output: 500 });
3.3 Layer 3: Loom Agent Coordination
Loom (lm) provides agent-native task management with built-in observability:
- Sessions: Agent work sessions with start/end times and cost tracking
- Issues: Task state (pending, in-progress, completed, blocked)
- Routing: Model selection decisions with confidence scores
- Cost: Token usage and dollar amounts per session
Loom stores data in SQLite (.loom/loom.db), enabling offline analysis and
crash recovery. The data syncs with Langfuse for unified dashboards.