<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John</title>
    <description>The latest articles on DEV Community by John (@john_10).</description>
    <link>https://dev.to/john_10</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4053244%2F0a59a18f-5b83-4368-a04e-dba68b395c4e.png</url>
      <title>DEV Community: John</title>
      <link>https://dev.to/john_10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/john_10"/>
    <language>en</language>
    <item>
      <title>Debugging LLM Calls: How to Trace What Your AI Agent Actually Did</title>
      <dc:creator>John</dc:creator>
      <pubDate>Thu, 30 Jul 2026 10:07:36 +0000</pubDate>
      <link>https://dev.to/john_10/debugging-llm-calls-how-to-trace-what-your-ai-agent-actually-did-43j2</link>
      <guid>https://dev.to/john_10/debugging-llm-calls-how-to-trace-what-your-ai-agent-actually-did-43j2</guid>
      <description>&lt;p&gt;So I was messing around with a little side project, a chatbot that answers questions about the World Cup. Fun, low stakes, nobody's paycheck depends on it.&lt;/p&gt;

&lt;p&gt;Someone asked it "has the tournament ended yet?"&lt;/p&gt;

&lt;p&gt;It said no. Confidently. Wrong. It had actually ended weeks earlier.&lt;/p&gt;

&lt;p&gt;Fine, models get things wrong sometimes, that's not exactly breaking news. What actually got me was the next question: why? Did it even try to check? Did it just guess from something it remembered? I genuinely had no way to find out. The model doesn't keep a diary. It answers, and that's it, the reasoning just evaporates.&lt;/p&gt;

&lt;p&gt;And that's true whether you're building a hobby project or something with real users. No logs, no "here's exactly what I looked at before I answered," nothing. You're stuck debugging a black box with screenshots and vibes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one-sentence version, if you're not deep into this yet
&lt;/h2&gt;

&lt;p&gt;I'm sure a chunk of you already know exactly where this is going: OpenTelemetry. If that's you, feel free to skip ahead.&lt;/p&gt;

&lt;p&gt;But if you're more in the "yeah I've heard the name, never actually looked into it" camp, here's the short version: it's basically a black box flight recorder for your AI calls. Every time your code asks a model something, it quietly writes down what was asked, what came back, how long it took, and what it cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to actually set this up, no infra background needed
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Grab a small library built for whatever model provider you're using, it wraps your existing code automatically, you don't rewrite your calls&lt;/li&gt;
&lt;li&gt;Point it at somewhere to send the data, just a URL and a key&lt;/li&gt;
&lt;li&gt;Ask your bot something like you normally would
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openinference.instrumentation.anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AnthropicInstrumentor&lt;/span&gt;

&lt;span class="nc"&gt;AnthropicInstrumentor&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;instrument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tracer_provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Nothing else changes below. This call is now traced automatically.
&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;A full record shows up right after: the prompt, the answer, the timing, the cost. First time you see it, it's a genuinely satisfying "oh, THAT'S what happened" moment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you need:&lt;/strong&gt; whatever API key you already use for your model, and somewhere to send the data to, several solid free options exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to get this working:&lt;/strong&gt; under 30 minutes, most of it is pasting two lines into code you've already written.&lt;/p&gt;
&lt;h2&gt;
  
  
  The landscape, so you know what's out there
&lt;/h2&gt;

&lt;p&gt;Some existing tools in this space, worth knowing the names even if you don't need all of them: LangSmith, Langfuse, Helicone, PromptLayer, Braintrust, and Arize Phoenix (free and open source if you want to self-host).&lt;/p&gt;

&lt;p&gt;If you just want to poke around and get a feel for this without committing to anything, &lt;a href="https://enprompta.com" rel="noopener noreferrer"&gt;Enprompta&lt;/a&gt; is a solid, beginner-friendly place to start.&lt;/p&gt;

&lt;p&gt;There's even a small public sample project set up specifically for trying this out hands-on:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/enprompta" rel="noopener noreferrer"&gt;
        enprompta
      &lt;/a&gt; / &lt;a href="https://github.com/enprompta/worldcup2026" rel="noopener noreferrer"&gt;
        worldcup2026
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;2026 World Cup Assistant&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;A lightweight assistant that answers questions about the 2026 FIFA World Cup
(USA / Canada / Mexico, June 11 – July 19, 2026). It calls Claude with the
built-in web-search tool, so answers can reflect live results and fixtures.&lt;/p&gt;
&lt;p&gt;Comes in two forms — a web app and a command-line tool — sharing one prompt and
one dependency.&lt;/p&gt;
&lt;p&gt;The app is intentionally left uninstrumented; adding instrumentation is a
student exercise.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Instrument it with Enprompta&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Want to see exactly what instrumentation adds? Open the quickstart notebook in
Colab — it clones this app, wires OpenTelemetry tracing, a versioned prompt, and
evals around the single LLM call site, then streams the traces to your Enprompta
project.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://colab.research.google.com/github/Enprompta/worldcup2026/blob/main/notebooks/enprompta_quickstart.ipynb" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/eff96fda6b2e0fff8cdf2978f89d61aa434bb98c00453ae23dd0aab8d1451633/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667" alt="Open In Colab"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Take the course: Evaluating AI Agents&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Once you've traced it, learn to &lt;strong&gt;evaluate&lt;/strong&gt; it. This app is the running example in
Enprompta's free course on agent evaluation — you'll score it across…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/enprompta/worldcup2026" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Clone it, wire up tracing, and go find your own version of "wait, why did it say that."&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
