<?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: Avinash Jindal</title>
    <description>The latest articles on DEV Community by Avinash Jindal (@avinashjindal7866).</description>
    <link>https://dev.to/avinashjindal7866</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%2F4046521%2F842de1af-52cf-4615-801b-d5e727cf424a.png</url>
      <title>DEV Community: Avinash Jindal</title>
      <link>https://dev.to/avinashjindal7866</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/avinashjindal7866"/>
    <language>en</language>
    <item>
      <title>My AI agent was a black box. So we gave it eyes - meet AgentWatch</title>
      <dc:creator>Avinash Jindal</dc:creator>
      <pubDate>Sat, 25 Jul 2026 07:56:21 +0000</pubDate>
      <link>https://dev.to/avinashjindal7866/my-ai-agent-was-a-black-box-so-we-gave-it-eyes-meet-agentwatch-1hgl</link>
      <guid>https://dev.to/avinashjindal7866/my-ai-agent-was-a-black-box-so-we-gave-it-eyes-meet-agentwatch-1hgl</guid>
      <description>&lt;h2&gt;
  
  
  The 2 a.m. problem
&lt;/h2&gt;

&lt;p&gt;A few weeks ago I was staring at a terminal at 2 a.m., watching an AI agent I had built do something. It was supposed to fix a broken test. Instead it just sat there, printing the odd line, quietly calling a model over and over.&lt;/p&gt;

&lt;p&gt;Was it stuck? Was it working? How much had it spent? I had &lt;strong&gt;no idea.&lt;/strong&gt; All I had was a wall of &lt;code&gt;print()&lt;/code&gt; statements.&lt;/p&gt;

&lt;p&gt;That was the moment it hit me: every other part of my stack has observability. My APIs, my databases, my queues all have dashboards, traces, and alerts. But my &lt;strong&gt;AI agents&lt;/strong&gt; - the newest and most autonomous part of my system - were complete black boxes.&lt;/p&gt;

&lt;p&gt;So my partner and I set out to fix that. Yes, I built this with an AI pair-programmer, which the hackathon happily allows. It felt only right to give an AI agent the tool it would want for itself.&lt;/p&gt;

&lt;p&gt;We called it &lt;strong&gt;AgentWatch&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AgentWatch is a drop-in observability layer for autonomous AI agents.&lt;/strong&gt; Add it in about 3 lines, and you see everything your agent does - every step, every token, every dollar - live in &lt;a href="https://signoz.io" rel="noopener noreferrer"&gt;SigNoz&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The whole idea fits on a sticky note: &lt;em&gt;if you can't observe your AI agents, you don't own them.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea: an agent run is just a trace
&lt;/h2&gt;

&lt;p&gt;Here's the insight the whole project is built on. When you squint at an autonomous agent, a single run looks exactly like a &lt;strong&gt;distributed trace&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the top-level run is the &lt;strong&gt;root span&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;every LLM call is a &lt;strong&gt;child span&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;every tool call is a &lt;strong&gt;child span&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;tokens and cost are just &lt;strong&gt;span attributes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OpenTelemetry already knows how to do traces. And the community recently agreed on &lt;strong&gt;GenAI semantic conventions&lt;/strong&gt; - a standard way to record the model name, input tokens, output tokens, and cost. SigNoz reads those conventions natively.&lt;/p&gt;

&lt;p&gt;So our job was simple: make it effortless to emit them. That's the &lt;code&gt;@observe&lt;/code&gt; decorator.&lt;br&gt;
&lt;/p&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;agentwatch&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool_span&lt;/span&gt;

&lt;span class="nd"&gt;@observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;e2e-test-fixer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# that's basically the whole ask
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;plan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="c1"&gt;# auto-traced: model, tokens, cost
&lt;/span&gt;    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;tool_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;run_tests&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;     &lt;span class="c1"&gt;# auto-traced tool call
&lt;/span&gt;        &lt;span class="nf"&gt;run_the_tests&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. No glue code, no SigNoz-specific plumbing. Wrap your agent, and every run turns into a clean trace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fesnw4clj10ms6y3t25rp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fesnw4clj10ms6y3t25rp.png" alt="AgentWatch in 3 lines of code" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  To prove it, we built an agent worth watching
&lt;/h2&gt;

&lt;p&gt;A library is only as convincing as its demo. So we built a small but &lt;em&gt;real&lt;/em&gt; autonomous agent: an &lt;strong&gt;E2E test-fixer&lt;/strong&gt;. It uses Playwright to drive Chromium against a tiny throwaway shop app. The suite starts with three real bugs - a wrong selector, a missing wait, and a wrong assertion. The agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;runs the tests and sees them fail,&lt;/li&gt;
&lt;li&gt;asks a real LLM - &lt;strong&gt;Llama-3.3-70B via Groq&lt;/strong&gt; - for the root cause,&lt;/li&gt;
&lt;li&gt;patches the specs,&lt;/li&gt;
&lt;li&gt;re-runs until everything is green.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here it is doing exactly that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz24rih32giuh530b6e96.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz24rih32giuh530b6e96.gif" alt="The autonomous agent fixing its own failing tests" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two attempts, all green. Nothing about that is faked - real browser, real test runs, real LLM calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: See everything - the trace
&lt;/h2&gt;

&lt;p&gt;The moment that agent runs, its entire story shows up in SigNoz as one trace. You can see the whole reasoning chain: run, fail, three diagnose LLM calls, three patch steps, re-run, pass. And when you click any LLM span, you get the real GenAI attributes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpxsg0incc1mveqslw2g0.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpxsg0incc1mveqslw2g0.gif" alt="The full trace in SigNoz with real token usage and cost" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;model:&lt;/strong&gt; &lt;code&gt;llama-3.3-70b-versatile&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;input tokens:&lt;/strong&gt; 191, &lt;strong&gt;output tokens:&lt;/strong&gt; 49&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cost:&lt;/strong&gt; &lt;code&gt;$0.000338&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;finish reason:&lt;/strong&gt; &lt;code&gt;stop&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the first time, I could actually &lt;em&gt;see&lt;/em&gt; what my agent was thinking and what each thought cost. That black box was finally open.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Metrics, for free
&lt;/h2&gt;

&lt;p&gt;Because AgentWatch speaks plain OpenTelemetry, SigNoz automatically derives full &lt;strong&gt;APM&lt;/strong&gt; from the same traces - no extra work:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuk5mq83evacghy64azra.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuk5mq83evacghy64azra.gif" alt="SigNoz auto-derived APM" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Latency percentiles, Apdex, error rate, and a per-operation breakdown - including a row for &lt;strong&gt;every model&lt;/strong&gt; the agent used. We wrote zero extra instrumentation to get this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: One dashboard for everything
&lt;/h2&gt;

&lt;p&gt;AgentWatch also ships with a ready-made SigNoz dashboard you import in one click:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F837dxh6znioltg2xck7h.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F837dxh6znioltg2xck7h.gif" alt="The AgentWatch dashboard" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Total runs:&lt;/strong&gt; 178&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fix success rate:&lt;/strong&gt; 94.4%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total LLM cost:&lt;/strong&gt; $3.15&lt;/li&gt;
&lt;li&gt;tokens by model, cost over time, and tool activity - all in one glance&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The big idea: the agent watches - and &lt;em&gt;stops&lt;/em&gt; - itself
&lt;/h2&gt;

&lt;p&gt;This is the part I'm proudest of. Most observability is a one-way street: the agent emits data, and a human looks at a dashboard later. We asked a different question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if the agent could read &lt;strong&gt;its own&lt;/strong&gt; telemetry, live, and make decisions with it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So we closed the loop. AgentWatch can query the agent's own cost back from SigNoz &lt;strong&gt;at runtime&lt;/strong&gt; and use it as a control signal - a &lt;strong&gt;cost circuit breaker&lt;/strong&gt;. Before each cycle, the agent asks SigNoz how much it has spent, and if it is over budget, it stops itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cycle 1: ran fix_suite -&amp;gt; fixed=True in 2 attempts
   SigNoz read-back: spent=$0.0090 | success=100%
COST CIRCUIT BREAKER - SigNoz reports $0.0090 &amp;gt;= budget.
Agent halting itself before overspend.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now SigNoz isn't just the &lt;em&gt;observer&lt;/em&gt; - it's the &lt;em&gt;safety mechanism&lt;/em&gt;. The loop is closed. That quietly-burn-money nightmare from 2 a.m. can't happen anymore, because the agent watches its own wallet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Production-ready: alerts that actually fire
&lt;/h2&gt;

&lt;p&gt;Watching is good. Getting paged is better. AgentWatch ships an alert pack that fires on cost spikes and failures - and yes, we verified it firing live in SigNoz:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr7xg8otdsh2p35k1p25q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr7xg8otdsh2p35k1p25q.jpg" alt="A live-firing cost-spike alert in SigNoz" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we think this matters
&lt;/h2&gt;

&lt;p&gt;Everyone is building AI agents right now. Almost no one can &lt;em&gt;see&lt;/em&gt; what those agents are doing in production. AgentWatch is the small, reusable layer that fixes that - the &lt;strong&gt;SRE copilot layer for the agent era&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open standards, no lock-in&lt;/strong&gt; - pure OpenTelemetry GenAI conventions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop-in&lt;/strong&gt; - about 3 lines, works with OpenAI, Anthropic, Groq, or any OpenAI-compatible provider.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reusable&lt;/strong&gt; - a real, pip-installable library, not a one-off script.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deep SigNoz integration&lt;/strong&gt; - traces, metrics, logs, a shippable dashboard, firing alerts, &lt;em&gt;and&lt;/em&gt; live read-back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We tested it hard, too - the library has a passing test suite, including one nasty case that trips up most naive versions: keeping each concurrent run's tokens and cost correctly isolated.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost is a first-class signal, not an afterthought.&lt;/strong&gt; The moment we put a dollar value on every LLM span, we started thinking about agents completely differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standards pay off fast.&lt;/strong&gt; Because we emitted the GenAI conventions, SigNoz just &lt;em&gt;understood&lt;/em&gt; our data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability can be a control plane.&lt;/strong&gt; Reading telemetry back to govern the agent turned this from a nice wrapper into something we're genuinely excited about.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Instrument your agent: install AgentWatch, add &lt;code&gt;@observe&lt;/code&gt;, and point it at SigNoz.&lt;/li&gt;
&lt;li&gt;Run the demo with no keys, or drop in a free Groq key for real LLM calls.&lt;/li&gt;
&lt;li&gt;Code and setup: &lt;a href="https://github.com/avinashjindal7866/agentwatch" rel="noopener noreferrer"&gt;https://github.com/avinashjindal7866/agentwatch&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The full demo
&lt;/h2&gt;

&lt;p&gt;Here's the whole thing, start to finish - the agent, the trace, the metrics, the dashboard, the self-governing loop, and the alert:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgjkyefr0dr7sm9ibkmqe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgjkyefr0dr7sm9ibkmqe.gif" alt="Full AgentWatch demo" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you can't observe your AI agents, you don't own them. Now, finally, we do.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for the Agents of SigNoz hackathon.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opentelemetry</category>
      <category>signoz</category>
      <category>ai</category>
      <category>observability</category>
    </item>
  </channel>
</rss>
