<?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: BHUVAN</title>
    <description>The latest articles on DEV Community by BHUVAN (@polikeybhuvan).</description>
    <link>https://dev.to/polikeybhuvan</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%2F4047708%2Fa9b960e7-a573-4ff2-8062-0020b2a9cc79.jpg</url>
      <title>DEV Community: BHUVAN</title>
      <link>https://dev.to/polikeybhuvan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/polikeybhuvan"/>
    <language>en</language>
    <item>
      <title>I Built an AI SRE Agent That Doesn't Just Detect Incidents — It Investigates Them</title>
      <dc:creator>BHUVAN</dc:creator>
      <pubDate>Sun, 26 Jul 2026 10:45:08 +0000</pubDate>
      <link>https://dev.to/polikeybhuvan/i-built-an-ai-sre-agent-that-doesnt-just-detect-incidents-it-investigates-them-2l01</link>
      <guid>https://dev.to/polikeybhuvan/i-built-an-ai-sre-agent-that-doesnt-just-detect-incidents-it-investigates-them-2l01</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Most observability platforms tell you **what&lt;/em&gt;* broke. I wanted to build something that could figure out &lt;strong&gt;why&lt;/strong&gt; it broke.*&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;During my first hackathon, I set myself a challenge that sounded simple but turned out to be incredibly interesting:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can an AI investigate production issues the way an SRE would?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not by reading one giant prompt containing thousands of logs.&lt;br&gt;
Not by following a hardcoded script.&lt;br&gt;
But by &lt;strong&gt;thinking through the investigation&lt;/strong&gt; — deciding what information it needs next, collecting evidence from an observability platform, and finally arriving at a root-cause analysis.&lt;/p&gt;

&lt;p&gt;That idea became &lt;strong&gt;AI SRE Agent&lt;/strong&gt;, an autonomous incident investigator built on &lt;strong&gt;SigNoz&lt;/strong&gt;, &lt;strong&gt;OpenTelemetry&lt;/strong&gt;, &lt;strong&gt;FastAPI&lt;/strong&gt;, and &lt;strong&gt;Gemini function calling&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Modern observability tools are amazing at collecting telemetry. They tell us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which service is slow&lt;/li&gt;
&lt;li&gt;Which requests are failing&lt;/li&gt;
&lt;li&gt;Which traces have high latency&lt;/li&gt;
&lt;li&gt;Which logs contain errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But after that, the real work begins. An engineer still has to manually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open traces&lt;/li&gt;
&lt;li&gt;Search logs&lt;/li&gt;
&lt;li&gt;Compare services&lt;/li&gt;
&lt;li&gt;Follow dependencies&lt;/li&gt;
&lt;li&gt;Form a hypothesis&lt;/li&gt;
&lt;li&gt;Validate it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The dashboard provides the clues. The engineer solves the mystery.&lt;/p&gt;

&lt;p&gt;I wanted to see if an AI could perform that investigation automatically.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Idea
&lt;/h2&gt;

&lt;p&gt;Instead of giving an LLM every log and trace in one massive prompt, I built an AI that behaves like an engineer. It starts with almost no information, then it decides:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What should I inspect first?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After receiving that information, it decides:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Now what should I inspect next?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It keeps collecting evidence until it has enough confidence to produce a diagnosis. The important part: &lt;strong&gt;the investigation path is never hardcoded.&lt;/strong&gt; Every decision is made dynamically by the model.&lt;/p&gt;


&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;The application is four microservices built with FastAPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 ┌─────────────────────┐
                 │  frontend-service   │
                 │      Port 8001      │
                 └──────────┬──────────┘
                            │
                            ▼
                 ┌─────────────────────┐
                 │   order-service     │
                 │      Port 8002      │
                 └───────┬───────┬─────┘
                         │       │
                         ▼       ▼
           ┌─────────────────┐  ┌─────────────────┐
           │ inventory-service│ │  agent-service   │
           │    Port 8003     │ │    Port 8004     │
           └─────────────────┘  └─────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every service is instrumented with &lt;strong&gt;OpenTelemetry&lt;/strong&gt; and exports traces, logs, and metrics into a self-hosted &lt;strong&gt;SigNoz&lt;/strong&gt; instance.&lt;/p&gt;

&lt;p&gt;To make the environment realistic, each service intentionally injects production-like failures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random latency spikes&lt;/li&gt;
&lt;li&gt;HTTP 500 and 502 failures&lt;/li&gt;
&lt;li&gt;Slow database queries&lt;/li&gt;
&lt;li&gt;Connection pool exhaustion&lt;/li&gt;
&lt;li&gt;AI response failures&lt;/li&gt;
&lt;li&gt;Simulated transaction deadlocks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal wasn't another e-commerce demo — it was a system that behaves like a real production environment, warts and all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Live Observability with SigNoz
&lt;/h2&gt;

&lt;p&gt;Once the services start running, SigNoz immediately begins collecting telemetry from every service. Instead of just seeing that requests are slow, I get visibility into P99 latency, error rates, operations per second, distributed traces, and structured logs — across every service at once.&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%2Fd8ervbbueprqyiywx0gb.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%2Fd8ervbbueprqyiywx0gb.png" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SigNoz Services Dashboard — you can already spot the culprits before the AI even gets involved: &lt;code&gt;frontend-service&lt;/code&gt; and &lt;code&gt;order-service&lt;/code&gt; share the same 16.35% error rate, while &lt;code&gt;diagnosis-agent&lt;/code&gt; (the AI itself) sits at 0% errors with a 10.6s P99 — a hint that it's doing multi-step reasoning, not just serving fast requests.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Building the AI Investigator
&lt;/h2&gt;

&lt;p&gt;This is where the project gets interesting. The AI agent doesn't know the answer — it only has access to three tools:&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="nf"&gt;get_slow_traces&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;get_error_logs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;service_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;get_error_traces&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all. The LLM decides which tool to call, which service deserves investigation, whether another query is necessary, and when enough evidence has been collected. This makes every investigation unique.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real Investigation
&lt;/h2&gt;

&lt;p&gt;Here's one investigation session, end to end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 — cast a wide net.&lt;/strong&gt; The AI first requests the slowest traces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get_slow_traces()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It finds multiple slow requests, all pointing the same direction — &lt;code&gt;frontend-service&lt;/code&gt;, &lt;code&gt;GET /checkout&lt;/code&gt;, roughly 6 seconds each. Interesting, but slow doesn't automatically mean guilty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 — narrow the search.&lt;/strong&gt; Instead of checking every service one by one, the model narrows in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get_error_logs(frontend-service)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The logs repeatedly show the same failure: the order service failing with a 502. Now the picture clears up — the frontend wasn't the one failing, it was waiting on something downstream.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3 — the diagnosis.&lt;/strong&gt; The AI concludes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checkout latency is high&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;frontend-service&lt;/code&gt; is waiting on &lt;code&gt;order-service&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;order-service&lt;/code&gt; is returning HTTP 500/502&lt;/li&gt;
&lt;li&gt;The root cause likely lives inside &lt;code&gt;order-service&lt;/code&gt; or one of its downstream dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And instead of pretending it knows everything, it recommends the next investigation step.&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%2Fshbbm0v6m7w6outea8fg.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%2Fshbbm0v6m7w6outea8fg.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The complete run — three agent steps, two tool calls, and a final diagnosis with a recommended next action, all generated without a hardcoded investigation script.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Making the AI Observable
&lt;/h2&gt;

&lt;p&gt;While building this, I had another thought: if the AI is making decisions, how do I debug the AI itself?&lt;/p&gt;

&lt;p&gt;So I instrumented the agent exactly like any other microservice. Every investigation creates a distributed trace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;agent.investigation
│
├── agent.step.1
│      ├── Gemini API
│      └── get_slow_traces()
│
├── agent.step.2
│      ├── Gemini API
│      └── get_error_logs()
│
└── agent.step.3
       └── Final diagnosis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every LLM request records prompt tokens, completion tokens, total tokens, response latency, and tool execution timing. The same platform that debugs my application also debugs my AI — that turned into my favorite part of the project.&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%2Fedsa86hracs8n1uaz89e.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%2Fedsa86hracs8n1uaz89e.png" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A full 10.6-second investigation broken into its three reasoning steps. You can see exactly where the time goes — &lt;code&gt;agent.step.3&lt;/code&gt;, the final synthesis step, took 4.33s (40.78% of total execution), while the earlier tool-calling steps were faster. That's the kind of insight you just don't get from a chat transcript alone.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Simulating Production Traffic
&lt;/h2&gt;

&lt;p&gt;To properly evaluate the system, I built a load generator that continuously sends checkout requests — some succeed, some fail, some become extremely slow. This keeps realistic traces, logs, and metrics flowing into SigNoz, so the AI investigator always has real production-shaped telemetry to analyze instead of synthetic examples.&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%2Fmfa3clh300nfot9cs0ag.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%2Fmfa3clh300nfot9cs0ag.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Four services and a load generator running side by side. The summary panel (195 attempts, 158 successful, 37 failed, 81.03% success rate) is exactly the kind of noisy, partially-degraded signal a real on-call engineer has to make sense of — and what the agent has to reason through.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Biggest Challenges
&lt;/h2&gt;

&lt;p&gt;Ironically, most of the hackathon wasn't spent writing AI code — it was spent solving infrastructure problems. Some memorable ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repairing a corrupted WSL installation&lt;/li&gt;
&lt;li&gt;Migrating to SigNoz's new Foundry installation&lt;/li&gt;
&lt;li&gt;Docker Desktop vs. native WSL engine issues&lt;/li&gt;
&lt;li&gt;ClickHouse startup problems&lt;/li&gt;
&lt;li&gt;OpenTelemetry configuration&lt;/li&gt;
&lt;li&gt;Auth issues with SigNoz's new Roles Beta API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These slowed development, but honestly they made the project more realistic. Building observability tooling means spending as much time on infrastructure as on application code.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;The biggest lesson wasn't about AI — it was about observability.&lt;/p&gt;

&lt;p&gt;Dashboards answer questions you already know to ask. Investigations begin when you don't know what question to ask next. That's exactly where AI becomes valuable — not by replacing engineers, but by automating the repetitive first stage of incident investigation.&lt;/p&gt;




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

&lt;p&gt;Given more time, I'd love to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuous monitoring that automatically triggers investigations when error rates exceed thresholds&lt;/li&gt;
&lt;li&gt;More realistic production failure scenarios&lt;/li&gt;
&lt;li&gt;Automatic incident reports generated after every investigation&lt;/li&gt;
&lt;li&gt;Support for the SigNoz MCP Server instead of handwritten API tools&lt;/li&gt;
&lt;li&gt;Multi-agent collaboration, where specialized agents investigate logs, metrics, and traces independently before combining findings&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This was my &lt;strong&gt;first hackathon&lt;/strong&gt;, and I built the entire project solo. I intentionally kept the microservices simple because the real focus wasn't the application — it was the investigation process.&lt;/p&gt;

&lt;p&gt;What I'm most proud of isn't that I built an AI capable of analyzing telemetry. It's that &lt;strong&gt;the AI itself became observable&lt;/strong&gt;. Every decision, every tool call, every LLM request, every reasoning step — all of it shows up inside SigNoz as a distributed trace.&lt;/p&gt;

&lt;p&gt;We're entering a future where we won't just observe our applications — we'll observe the AI systems responsible for operating them, too. I think that's a pretty exciting direction for modern SRE tooling.&lt;/p&gt;




&lt;h2&gt;
  
  
  GitHub Repository
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;a href="https://github.com/polikeybhuvan/signoz-ai-sre-agent" rel="noopener noreferrer"&gt;github.com/polikeybhuvan/signoz-ai-sre-agent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have suggestions, ideas, or feedback, I'd love to hear them!&lt;/p&gt;

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