Codex Instrumentation Prompt: from implementation to decision
A complete codex instrumentation prompt measurement loop connects one owned workflow, a bounded event contract, a controlled fixture, and a question someone can act on.
- 1
Set the boundary
Generate or copy a Telemetry API key.
- 2
Capture the outcome
Begin with page_viewed, code_snippet_copied, integration_check_submitted and document the grain of each event.
- 3
Prove the rows
Query Telemetry for the new events and fill remaining gaps.
- 4
Make the decision
Do users who copy setup prompts reach activation faster?
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.
Codex Instrumentation Prompt 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
- 1Generate or copy a Telemetry API key.
- 2Ask Codex to apply the prompt in your repository.
- 3Run the product flows that matter.
- 4Query Telemetry for the new events and fill remaining gaps.
Events to capture
Questions unlocked
- Do users who copy setup prompts reach activation faster?
- Which docs pages produce registrations?
- Which product areas are used before checkout?
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.
api_request_completed
One completed API request.
Inspect contractagent_tool_call_completed
One completed tool-call attempt within an agent run.
Inspect contractai_agent_run_completed
One terminal outcome per logical agent run.
Inspect contractRelated product capability
Continue this workflow in Alerts
Promote the reviewed reliability query into an owned threshold and response workflow.
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 p50, p95, and p99 API Latency
Which endpoints have the worst tail latency?
Open recipeMeasure Background Job Retry and Failure Rate
Which background jobs consume the most retries or still fail?
Open recipeQuery Nested AI Tool-Call Events
Which AI tools and arguments are associated with the most failed calls?
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 pageClaude Code Observability
Give Claude Code a prompt that makes telemetry part of the implementation pass instead of a separate cleanup project.
Open pageCursor Telemetry Setup
A copyable setup prompt for adding event tables, funnel tracking, and dashboards from inside Cursor.
Open page