<?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: Farzan Hossan Shaikat</title>
    <description>The latest articles on DEV Community by Farzan Hossan Shaikat (@farzan_hossanshaikat_d61).</description>
    <link>https://dev.to/farzan_hossanshaikat_d61</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3902913%2F2354fc65-1cad-41e3-80b0-1959dd6b02a6.jpg</url>
      <title>DEV Community: Farzan Hossan Shaikat</title>
      <link>https://dev.to/farzan_hossanshaikat_d61</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/farzan_hossanshaikat_d61"/>
    <language>en</language>
    <item>
      <title>AI Agents in Production Are Flying Blind — AgentLens Fixes That</title>
      <dc:creator>Farzan Hossan Shaikat</dc:creator>
      <pubDate>Wed, 29 Apr 2026 03:19:21 +0000</pubDate>
      <link>https://dev.to/farzan_hossanshaikat_d61/ai-agents-in-production-are-flying-blind-agentlens-fixes-that-3h90</link>
      <guid>https://dev.to/farzan_hossanshaikat_d61/ai-agents-in-production-are-flying-blind-agentlens-fixes-that-3h90</guid>
      <description>&lt;h2&gt;
  
  
  The Visibility Problem
&lt;/h2&gt;

&lt;p&gt;Running an AI agent in production means dealing with a problem most developers hit quickly.&lt;/p&gt;

&lt;p&gt;The agent makes 15–20 LLM calls per session — chained, conditional, sometimes parallel. Something goes wrong. The output is bad, the cost spiked, or the agent looped. And there's no answer to any of these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which specific call failed?&lt;/li&gt;
&lt;li&gt;What did the model actually receive?&lt;/li&gt;
&lt;li&gt;What did it return?&lt;/li&gt;
&lt;li&gt;How much did this session cost?&lt;/li&gt;
&lt;li&gt;Where in the run did it break?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Existing Tools Don't Solve It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;LangSmith&lt;/strong&gt; only works if you're using LangChain. Custom agents are unsupported.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Helicone&lt;/strong&gt; proxies individual LLM API calls. Useful for per-request cost tracking, but it has no concept of agent structure — no parent/child spans, no session grouping, no multi-step trace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Langfuse&lt;/strong&gt; is the closest alternative but requires meaningful code instrumentation to get meaningful traces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Datadog&lt;/strong&gt; is built for enterprise infrastructure teams, not a developer running their first production agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  The AgentLens Approach
&lt;/h2&gt;

&lt;p&gt;AgentLens is an open-source observability platform built specifically for AI agent runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Zero code changes (proxy)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Before&lt;/span&gt;
&lt;span class="nv"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://api.openai.com

&lt;span class="c"&gt;# After — one change, full observability&lt;/span&gt;
&lt;span class="nv"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:8090/v1/p/&lt;span class="o"&gt;{&lt;/span&gt;projectId&lt;span class="o"&gt;}&lt;/span&gt;/openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every LLM call flows through AgentLens. It forwards to OpenAI transparently and captures the full trace — tokens, cost, latency, model, full prompt and completion. Works with any language and any framework.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: TypeScript SDK
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@farzanhossans/agentlens-openai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="c1"&gt;// auto-patches the OpenAI SDK — every call is traced&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option 3: Python SDK
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;agentlens.patchers.openai&lt;/span&gt;
&lt;span class="c1"&gt;# same — all calls auto-traced
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Self-Host in 3 Minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/farzanhossan/agentlens
&lt;span class="nb"&gt;cd &lt;/span&gt;agentlens/infra
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.prod.example .env
docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; docker-compose.prod.yml up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dashboard at &lt;code&gt;localhost:4021&lt;/code&gt;. API at &lt;code&gt;localhost:4020&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NestJS + BullMQ&lt;/strong&gt; — async span processor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare Workers&lt;/strong&gt; — edge ingest endpoint&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elasticsearch&lt;/strong&gt; — trace storage, full-text search, error clustering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostgreSQL&lt;/strong&gt; — metadata, users, projects, alerts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React dashboard&lt;/strong&gt; — real-time updates via WebSocket&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Phase 2 is the AI intelligence layer — using Claude API to automatically analyze traces, explain why agent conversations fail, and surface prompt improvement suggestions. The shift from "see what happened" to "understand why."&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;Landing: &lt;a href="https://agentlens.techmatbd.com" rel="noopener noreferrer"&gt;https://agentlens.techmatbd.com&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/farzanhossan/agentlens" rel="noopener noreferrer"&gt;https://github.com/farzanhossan/agentlens&lt;/a&gt;&lt;br&gt;
MIT licensed.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>monitoring</category>
    </item>
  </channel>
</rss>
