Summary
Replace ad-hoc console.log calls in the worker with structured logs, ship metrics to Cloudflare Analytics Engine, and expose OpenTelemetry hooks for users who want to forward telemetry to their own observability stack.
Motivation
The analytics dashboard answers product questions; observability answers operational questions. Without it, debugging production issues (a flaky tool call, a slow Anthropic response) is guesswork.
Acceptance Criteria
Summary
Replace ad-hoc
console.logcalls in the worker with structured logs, ship metrics to Cloudflare Analytics Engine, and expose OpenTelemetry hooks for users who want to forward telemetry to their own observability stack.Motivation
The analytics dashboard answers product questions; observability answers operational questions. Without it, debugging production issues (a flaky tool call, a slow Anthropic response) is guesswork.
Acceptance Criteria
level,event,tenant,conversation_id,latency_ms,model, plus an error chain for failureschat.turn.latency,chat.tool.calls,chat.rate_limit.hits,chat.errorscreateTracer()) lets users forward spans to their own collectorLOG_MESSAGES=true(documented as off in prod)docs/operations.mdcovering common alerts and remediation steps