<?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: Mayank</title>
    <description>The latest articles on DEV Community by Mayank (@032_mayank_d7cf900fa03d4b).</description>
    <link>https://dev.to/032_mayank_d7cf900fa03d4b</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%2F4235081%2F15c20d34-0682-4bb0-be77-8059cf76a930.png</url>
      <title>DEV Community: Mayank</title>
      <link>https://dev.to/032_mayank_d7cf900fa03d4b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/032_mayank_d7cf900fa03d4b"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Mayank</dc:creator>
      <pubDate>Mon, 09 Nov 2026 12:23:57 +0000</pubDate>
      <link>https://dev.to/032_mayank_d7cf900fa03d4b/-3mcn</link>
      <guid>https://dev.to/032_mayank_d7cf900fa03d4b/-3mcn</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h" class="crayons-story__hidden-navigation-link"&gt;I tested whether eBPF helps diagnose slow AI agents. I wrote my predictions first and got many wrong.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/032_mayank_d7cf900fa03d4b" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F4235081%2F15c20d34-0682-4bb0-be77-8059cf76a930.png" alt="032_mayank_d7cf900fa03d4b profile" class="crayons-avatar__image" width="96" height="96"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/032_mayank_d7cf900fa03d4b" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Mayank
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Mayank
                
                
              
              &lt;div id="story-author-preview-content-5004315" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/032_mayank_d7cf900fa03d4b" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F4235081%2F15c20d34-0682-4bb0-be77-8059cf76a930.png" class="crayons-avatar__image" alt="" width="96" height="96"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Mayank&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 9&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h" id="article-link-5004315"&gt;
          I tested whether eBPF helps diagnose slow AI agents. I wrote my predictions first and got many wrong.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/observability"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;observability&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opentelemetry"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opentelemetry&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
          
          &lt;div class="only-sidebar-menu-item trusted-visible-block print-hidden align-center"&gt;
                
                    
                
          &lt;/div&gt;

        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>agents</category>
      <category>ai</category>
      <category>debugging</category>
      <category>performance</category>
    </item>
    <item>
      <title>I tested whether eBPF helps diagnose slow AI agents. I wrote my predictions first and got many wrong.</title>
      <dc:creator>Mayank</dc:creator>
      <pubDate>Mon, 09 Nov 2026 12:16:45 +0000</pubDate>
      <link>https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h</link>
      <guid>https://dev.to/032_mayank_d7cf900fa03d4b/i-tested-whether-ebpf-helps-diagnose-slow-ai-agents-i-wrote-my-predictions-first-and-got-many-f8h</guid>
      <description>&lt;p&gt;A slow AI agent run is a chain of network calls: the model, tools, a database, outside APIs. An application-level trace tells you &lt;em&gt;which&lt;/em&gt; call was slow. It can't tell you &lt;em&gt;why&lt;/em&gt;, because a DNS stall, a slow connection and a slow server all happen inside one HTTP span. System-level eBPF tools see DNS time, connect time, retransmits and round-trip time, but they know nothing about the agent.&lt;/p&gt;

&lt;p&gt;So I tested a simple hypothesis: &lt;strong&gt;joining agent traces with kernel-level evidence diagnoses faults better than agent traces alone.&lt;/strong&gt; I wrote my predictions down and committed them to git before every run, and many were wrong. This post is the short version.&lt;/p&gt;

&lt;p&gt;Code, benchmark, predictions and the full report: &lt;a href="https://github.com/mac146/crosstrace" rel="noopener noreferrer"&gt;https://github.com/mac146/crosstrace&lt;/a&gt; (tag &lt;code&gt;report-v1&lt;/code&gt;)&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;A seeded fault-injection benchmark (slow DNS, network latency, packet loss, a slow API server, a slow database and more)&lt;/li&gt;
&lt;li&gt;An eBPF collector, first in bpftrace, then a compiled C/libbpf version that uses about 2.9x less CPU&lt;/li&gt;
&lt;li&gt;A correlator that aligns kernel events with OpenTelemetry spans (clock alignment, indexed matching)&lt;/li&gt;
&lt;li&gt;Rule-based diagnosers and an evaluation where every stage's predictions, with "I would be wrong if..." conditions, were committed before the runs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What held up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kernel evidence works where the cause is in the network path.&lt;/strong&gt; Top-1 accuracy on DNS delay, latency and packet loss rose from about 30% (spans only) to about 97% on a fresh set of 90 runs, with no false accusations in 240 runs. The caveat is in the report: these are mock services on loopback, and the spans-only baseline can't separate those causes by construction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The join is robust.&lt;/strong&gt; 160/160 runs passed integrity checks against ground-truth ports, and 5,120/5,120 spans got exactly their own connection with up to 512 simultaneous agent threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On a real model over the internet,&lt;/strong&gt; the rules found injected DNS delays in 10/10 runs and latency in 9/10 (10 runs per group, one network path, so observations rather than estimates).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I had to narrow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Per-request kernel timing carries the result, not the join itself.&lt;/strong&gt; Host-wide counters plus the run's maximum server wait matched the join on single faults.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I ran the real OpenTelemetry eBPF agent (OBI v1.0.0).&lt;/strong&gt; Its per-request server duration names a slow server as well as my join (100%) but is at chance on network causes. With its per-connection RTT matched exactly to each call by client port, it equals my join (99.5-100% with 9 and 24 concurrent agents in different conditions). Matched by connection order, it falls to 63-69%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;So the join is not better evidence.&lt;/strong&gt; What my correlator adds is matching a call to its connection without the application declaring its socket. That works for thread-per-call agents. Async agents on one thread need the port declared, and a quick text search of the standard Python HTTP client instrumentations suggests they don't set it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host-wide counters get worse as you add agents.&lt;/strong&gt; One stray retransmit anywhere in a run gets pooled into every agent's evidence (rescoring without it fixed it: 64/64 instead of 24/64). Per-call evidence doesn't have this problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What didn't work (all kept in the report)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On a real, NAT'd network path, packet loss can't be told from the background retransmits by count: 70% detection at best, and an alternative feature that looked better on the design set failed on fresh data.&lt;/li&gt;
&lt;li&gt;My CPU target was missed (2.9x less, predicted 3.4x), a clock-sampling prediction was wrong, a probe silently missed 0.1% of connections until I found a better hook, and a harness bug briefly made a latency fault look like packet loss.&lt;/li&gt;
&lt;li&gt;The report lists 13 numbered negative or wrong-prediction results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits you should know about
&lt;/h2&gt;

&lt;p&gt;Mock services on loopback, one host, scenarios I designed to discriminate, and one OBI version and configuration that I tuned to make it attach. No packet-loss, HTTP/3 or streaming tests. The collector needs root-equivalent access, so it is for dev machines only. I don't know how often slow agent runs in the real world are network problems. The one dataset I found suggests provider-side causes like rate limits dominate.&lt;/p&gt;

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

&lt;p&gt;Two experiments are pre-registered but not run: whether async agents can be matched without a declared port, and whether the results hold with 8 concurrent real agents on a real model and network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A question for you:&lt;/strong&gt; if you run agents in production, how often are slow or failing runs network or infrastructure problems rather than model or tool problems? Your last two or three slow-run incidents, anonymized, would help me more than any benchmark row. Comments or issues on the repo are welcome, and so are corrections if I've misused OBI anywhere.&lt;/p&gt;

&lt;p&gt;Report, code and predictions: &lt;a href="https://github.com/mac146/crosstrace" rel="noopener noreferrer"&gt;https://github.com/mac146/crosstrace&lt;/a&gt;&lt;/p&gt;

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