Claude Code Observability: from implementation to decision
A complete claude code observability measurement loop connects one owned workflow, a bounded event contract, a controlled fixture, and a question someone can act on.
- 1
Set the boundary
Create a Telemetry account and API key.
- 2
Capture the outcome
Begin with agent_task_started, agent_task_completed, feature_used and document the grain of each event.
- 3
Prove the rows
Review the resulting tables, charts, and alerts before shipping.
- 4
Make the decision
Which agent-authored features are actually used after release?
Agent prompt
Paste this into your coding agent
Replace YOUR_API_KEY after signup, then ask the agent to run the product flow and verify the first events.
Claude Code Observability setup prompt
Instrument this project with structured logs using /skill.md.
Use this Telemetry API key: YOUR_API_KEY
Please:
1. Find the most important user-facing flows, background jobs, and AI/tooling workflows.
2. Add structured logging with pragmatic snake_case tables and fields.
3. Capture the key signals for each workflow, including status, latency, identifiers, and error context when relevant.
4. Send test events to Telemetry and verify that ingestion works.
5. Create a high-level dashboard with charts and tables that summarize the most important signals in this project.
6. Tell me what you instrumented, which tables you created, and which dashboard views I should review first.
Prefer small, composable events over giant payloads, and optimize for dashboards that humans can scan quickly.Setup steps
- 1Create a Telemetry account and API key.
- 2Paste the prompt into Claude Code at the start of a feature or observability pass.
- 3Ask Claude Code to run the app flow, send test events, and create a dashboard.
- 4Review the resulting tables, charts, and alerts before shipping.
Events to capture
Questions unlocked
- Which agent-authored features are actually used after release?
- Where are Claude Code changes creating support or reliability risk?
- Which workflows should get alerts before more automation is added?
Event schema starting points
Event contracts for this workflow
Review the row grain, emit boundary, required types, privacy classes, example payload, and validation checklist before adapting a query or snippet to production.
user_signed_up
One accepted signup per user and account.
Inspect contractproduct_milestone_completed
One completed milestone per actor, account, and occurrence.
Inspect contractai_agent_run_completed
One terminal outcome per logical agent run.
Inspect contractRelated product capability
Continue this workflow in Dashboards
Turn a validated product or revenue query into a focused decision surface.
Related SQL recipes
Answer the next question with SQL
Run the query against the structured fields from this workflow, inspect the example result, and turn a useful answer into a dashboard or alert.
Calculate API Error Rate by Route
Which API routes have the highest meaningful 5xx error rate?
Open recipeMeasure Background Job Retry and Failure Rate
Which background jobs consume the most retries or still fail?
Open recipeBuild a Signup-to-Activation Funnel in SQL
Where do new users leave before reaching first value?
Open recipeNext step
Create the API key your agent will use
The free plan is enough to run the prompt, send test events, and review the first dashboard.
Related pages
AI Agent Telemetry and Observability
Instrument AI agent telemetry for runs, tool calls, retries, latency, model cost, failures, and accepted outcomes in SQL-ready event tables.
Open pageCursor Telemetry Setup
A copyable setup prompt for adding event tables, funnel tracking, and dashboards from inside Cursor.
Open pageCodex Instrumentation Prompt
A focused prompt that asks Codex to instrument the rest of the product, verify events, and summarize coverage gaps.
Open page