docs(cookbook): instrument an existing app and verify it end to end - #786
Open
abhijaisrivastava15 wants to merge 4 commits into
Open
docs(cookbook): instrument an existing app and verify it end to end#786abhijaisrivastava15 wants to merge 4 commits into
abhijaisrivastava15 wants to merge 4 commits into
Conversation
Adds a cookbook quickstart that takes an app with no tracing to a verified integration, covering both the Future AGI SDK and plain OpenTelemetry routes, and ships fi_verify.py as a downloadable asset so the ten gates can be run against the spans an app really produced.
Install, Tutorial with Steps, What you built with Check, Next steps, matching the 34 sibling quickstarts rather than the one that deviates from them, and restoring the done-condition and the blocked-report format the first draft dropped.
…boundary Time and difficulty were out of family: 45 min was the longest value on any of the 35 quickstarts and this page is half the length of the one that says 20. The Python prerequisite read as a constraint on the reader's app; only fi_verify.attach() is Python-bound, so the not-Python section now says what to do without it.
Runs the six steps against openai/openai-agents-python's customer service agent and shows the trace list, the trace tree and the session from that run. Name the track inside every listing so the two tracks stay separable when the page is flattened to text, print the entry point the worked example adds, and link the Colab notebook.
abhijaisrivastava15
marked this pull request as ready for review
August 5, 2026 09:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A cookbook quickstart that takes an app with no tracing at all to a verified integration, and then proves it worked rather than asking the reader to eyeball the dashboard.
Today the closest thing we have is
observe/troubleshooting/no-traces-appearing, which diagnoses a symptom. Nothing tells you your integration is correct: a trace that arrives looking fine can still be missing cost, sessions, users, or half its spans.Page added
src/pages/docs/cookbook/quickstart/instrument-and-verify.mdxsrc/lib/navigation.ts- one entry, first in Cookbooks > Quickstart > Observability, because the five siblings there all assume tracing already worksAsset added
public/fi_verify.py(246 lines) - serves atdocs.futureagi.com/fi_verify.py, which the Install section curlsIt is in this PR rather than its own so the page never ships a live link to a 404. The page publishes the file's line count and sha256 (
9b331742...) so a reader can prove their copy in one command.The worked example
Chintan's note was that a cookbook is only finished when it shows an agent end to end. The page now does, on a repository nobody wrote for us.
openai/openai-agents-python, itsexamples/customer_serviceairline support agent: a triage agent, a handoff, two specialist agents and a local tool. It is a fair target because it has all four of the page's problems at once. It emits no trace we can read, one message fans out across four agents,main.pyis an interactive REPL so there is no entry point that runs once, and it already carries a conversation id and a passenger context, so Step 3 has a real session and a real user rather than invented ones.The six steps were then followed literally against it. No business logic edited,
main.pyimported not modified, one new file for the entry point the repository does not have.That is a real run against
api.futureagi.comwith a real model call, real tokens and a real cost, not a transcript written by hand.Screenshots
Three, from that run, on the platform. Every one is the genuine surface with nothing reconstructed.
The trace list reads the root and nothing else, which is why Step 4 puts the totals there. Latency, tokens and status arrive on their own; cost and the model do not.
Inside a trace, the instrumentor typed the agents, the model calls and the handoff.
faq_lookup_toolis a local function the instrumentor cannot see, so itsTOOLspan is the three lines from Step 4. The attributes panel is the same list Step 4 sends, read back off a real span.Because
session.idwas set once at the edge, both turns group without either turn knowing about the other.This supersedes the earlier note on this PR that said there was nothing to screenshot. That was true of the tutorial alone and stopped being true once the worked example gave us a real trace to point at.
Notebook
quickstart/instrument-and-verify.ipynbis now oncookbook/quickstart-notebooksinfuture-agi/cookbooks, the 22nd in that folder, and the page carries the Colab and GitHub badge row like its 21 siblings. Both badge URLs return 200.This also supersedes the earlier note saying there would be no badge row.
Shape
Written to the section's own skeleton, checked against all 34 existing quickstarts rather than one of them:
## Install(28/34),## Tutorialwith<Steps>/<Step>(33/34),## What you builtwith<Check>(34/34),## Next stepswith<CardGroup cols={4}>(33/34)<TLDR>,<Prerequisites>, the badge row (21/34), and the| Time | Difficulty | Package |table, all presenttitle+descriptiononly, as every sibling hasOne deliberate deviation:
<Tabs>for the two integration routes (Future AGI SDK and plain OpenTelemetry).distributed-tracingsets the precedent for tabs on a multi-variant page, and the alternative is two pages for one procedure.Tested by an agent that had never seen it
A fresh agent was given the page URL, real keys and a sandbox, and told to reach GREEN LIGHT or stop honestly. It reached all ten gates on the first real run, in about seven minutes against the page's own estimate of twenty. It also reached green on the printed directory layout with no
__init__.pyfiles at all, which confirms the tree as printed is correct.It found four things, all fixed in this branch:
The tabs are a trap for anything that flattens the page to text. Steps 2 to 4 present the two tracks as tab-switched UI, so flattened they concatenate with no marker:
setup.pytwice,futureagi_rollup.pytwice, andfutureagi_spans.pytwice as structurally different files under the same name. Mixing them is a guaranteedImportError. Our own "Copy page as Markdown for LLMs" button and the docs MCP server both invite exactly that flattening. Every listing now names its track on the first line, and one sentence up front says to pick one track and stay on it.The worked example described its one new file without printing it. It is now printed in full, including the line that points the agents SDK at an OpenAI-compatible endpoint that is not OpenAI.
The install list omitted
-openai-agents, which is the instrumentor the worked example installs.An undocumented stderr line on every run (
ai-evaluation is not installed, please install it to trace protect) now has one sentence saying it is the optional Protect package and affects no gate.Checks run
node scripts/audit-links.mjs- 0 broken nav links, 0 broken content links, in nav so not an orphandevPreview
http://localhost:4321/docs/cookbook/quickstart/instrument-and-verify
Follow-up, not in this PR
observe/troubleshooting/no-traces-appearingcurrently ends at "recheck the causes above in order". A one-line link out to this page would close that dead end. Kept separate to keep this diff to one page.