<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sushidhar Jayaraman on Medium]]></title>
        <description><![CDATA[Stories by Sushidhar Jayaraman on Medium]]></description>
        <link>https://medium.com/@sushidhar26?source=rss-ff9ec2565ce0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n2y31aFLwIiVA5umKaHM4w.png</url>
            <title>Stories by Sushidhar Jayaraman on Medium</title>
            <link>https://medium.com/@sushidhar26?source=rss-ff9ec2565ce0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:49:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sushidhar26/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Where Reasoning Belongs in an Agentic Data Pipeline]]></title>
            <link>https://blog.dataengineerthings.org/where-reasoning-belongs-in-an-agentic-data-pipeline-709f3d548bfd?source=rss-ff9ec2565ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/709f3d548bfd</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Sushidhar Jayaraman]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 03:22:46 GMT</pubDate>
            <atom:updated>2026-06-04T03:22:46.796Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Building a two-level loop where LLMs schedule and rules execute.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lP2IljoVR13vGYXqNNL7Jg.png" /><figcaption>Image generated by Gemini</figcaption></figure><p>I had an Airflow operator that fetched netflow data from our network observability API across 70+ Kubernetes clusters every day. It worked, mostly.</p><p>Netflow data is network traffic: which workloads are sending bytes where, and how much. It’s the raw input for cross-zone and cross-region cost attribution: it tells you which services are generating expensive traffic, not just which ones are busy. The API returns workload objects nested with per-destination byte counts, and the responses get large; query too wide a window and the API returns a 500. You get nothing for that window rather than degraded data.</p><p>The window sizes were hardcoded: 15 minutes for the busy clusters, 60 minutes for everything else. Those numbers came from trial and error months earlier and nobody touched them after that. New clusters defaulted to 60 minutes. You’d find out the number was wrong when the Hive partition had gaps. Not from a good monitoring system, but from someone on the analytics team asking why their numbers looked off.</p><p>There was no prioritization. The operator processed clusters in whatever order the API returned them. Four of those clusters were critical: production traffic, cost attribution downstream. If they happened to run last and hit rate limits, they failed quietly. Nothing in the code knew they mattered more than the rest.</p><p>And the operator had no memory. If a cluster needed 20-minute windows to return clean data three days in a row, the operator didn’t know that. It tried 60 minutes, got throttled, fell back, and you manually updated a dict somewhere in the codebase. Then you forgot about it until the next new cluster.</p><h3><strong>The Two-Level Loop</strong></h3><p>The agent replaces the operator’s execute loop with two levels: an outer loop that reasons about what to do next, and an inner loop that actually does it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVcSe5ggaYslCir_E9NpeQ.png" /><figcaption>The outer loop asks what to do next. The inner loop doesn’t ask anything. (image by the author via Gemini)</figcaption></figure><p>The outer loop is where the agent lives. It looks at which clusters are pending, how much time is left, what the API health looks like, and picks the next action: fetch this cluster, pause, or abandon a low-priority one if time is running short. That decision happens once per cluster, not once per API call.</p><p>The inner loop is deterministic. Given a cluster, it fetches windows sequentially, handles 429 and 500 backoff, and shrinks or grows the window size based on what it sees. No reasoning required, just rules. When something breaks that pattern (sustained throttling, an error the rules don’t cover, time running critically short), the inner loop hands back to the outer loop and the agent decides what to do next.</p><p>That separation matters. Window fetching is mechanical: halve the window on throttling, retry on server errors, move on. There’s no judgment call there. But deciding which cluster to prioritize when you have 40 minutes left and 30 clusters pending, that’s a judgment call. That’s where the agent earns its place.</p><p>At the end of each run, the window size that worked gets written back to the state. The next day, the agent starts each cluster where yesterday left off, not back at 60 minutes to discover again.</p><p>Critical clusters get an additional hard guard: the agent cannot abandon them regardless of what it decides. That’s enforced in code, not in the prompt.</p><h3><strong>The One Architectural Decision That Matters</strong></h3><p>The agent makes decisions at the cluster level. Not the window level, not the API call level. The cluster level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LF2dtKrfjf2hZ3f5K3Q1uA.png" /><figcaption>One LLM call per cluster. Everything below that line is deterministic. (image by the author)</figcaption></figure><p>I was tempted to put the LLM inside the tight loop: let it decide whether to retry this specific window, what size to use next, and whether this particular 429 was serious. That’s where the interesting stuff was happening.</p><p>But that’s also where I’d have spent 200 tokens per API call and still gotten worse decisions than a simple if-else. Window fetching is mechanical. The rules for it are known. There’s no new information an agent brings to “got a 429, should I wait 2 seconds?” The answer is yes. Always yes. You don’t need reasoning for that.</p><p>Where you do need reasoning: across clusters, across time, under constraint. Which of the 30 pending clusters should I fetch next, given that I have 45 minutes left and the API has been flaky for the last 10? Should I skip a low-priority staging cluster to preserve time for a prod cluster that hasn’t started yet? Those questions require a view of the global state, not the local state. That’s the outer loop.</p><p>The state dict that gets passed to the agent reflects this. It contains per-cluster status, coverage percentages, API health trends, and remaining time. It does not contain per-window details. The agent doesn’t know which specific 15-minute window just failed. It knows that a cluster is 60% covered and the API has been returning 429s at a 25% rate for the last 10 minutes. That’s enough to make a scheduling decision. It’s not enough to micromanage a retry.</p><p>That’s the design. Here’s what the first run actually looked like.</p><h3><strong>What the First Run Taught Me</strong></h3><p>The agent ran in production for the first time. 68 clusters. 4-hour window. It completed 2.</p><p>The logs showed why: the LLM call timed out once, at attempt 4, and the error handler re-raised immediately. No retry, no recovery. Just exit. The 66 clusters that hadn’t started yet never got touched.</p><blockquote>I wrote the agent error handler assuming one failure meant something was seriously wrong. In production, one timeout means the API had a bad moment. The system should have shrugged and tried again.</blockquote><p>The fix: track consecutive failures, not total failures. Retry up to three times with a 15-second sleep between attempts. Only abort after three in a row. One timeout is noise. Three in a row is a signal.</p><p>The second bug was quieter. The run summary reported 3,318 rows fetched. The Parquet file had 64,482. The metric was off by a factor of 20.</p><blockquote>I was counting the wrong thing. The API returns workload objects, each with a list of destinations. I was counting workloads. The actual rows in the output are destinations, one per workload-destination pair. The number looked plausible enough that I almost didn’t check.</blockquote><p>One line fix: sum(len(item.get(“destinations”, [])) for item in result[“rows”]).</p><p>Two bugs, both in the scaffolding around the agent logic rather than the agent logic itself. The outer loop, the inner loop, the state management: those worked. What failed was the error handling at the seams.</p><h3><strong>Where It Earned Its Place (And Where It Didn’t)</strong></h3><p>One run, one case where the agent caught something the alternatives wouldn’t have.</p><p>A sandbox cluster spiked traffic mid-run. Not dramatically: the kind of spike that degrades API response times on that cluster specifically while every other cluster stays clean. The global 429 health check didn’t fire: aggregate error rate was fine. A per-cluster rule would have required anticipating a sandbox spike. I hadn’t. Sandbox clusters are usually quiet. The agent saw the combination: low-priority tier, isolated degradation on a cluster that shouldn’t be generating load, 429 rate climbing. It deprioritized the cluster and shifted time to prod clusters that were still clean. The 500s never started.</p><p>No threshold would have caught that. The signal was in the combination, not any single metric.</p><p>The other case: window shrinking on 429s. When the API rate-limits a cluster, the inner loop halves the window size and retries. That’s an if-else. It was always going to be an if-else. I considered routing that decision through the agent (different window sizes for different cluster tiers, dynamic backoff based on history) and then I didn’t, because the rule is simple and the rule is right. Halve it. Wait. Try again. No reasoning required.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=709f3d548bfd" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/where-reasoning-belongs-in-an-agentic-data-pipeline-709f3d548bfd">Where Reasoning Belongs in an Agentic Data Pipeline</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who’s Paying for All This Network Traffic? A Data Engineer’s Investigation]]></title>
            <link>https://blog.dataengineerthings.org/whos-paying-for-all-this-network-traffic-a-data-engineer-s-investigation-ddb4aa7861f5?source=rss-ff9ec2565ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddb4aa7861f5</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sushidhar Jayaraman]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 13:34:33 GMT</pubDate>
            <atom:updated>2026-04-27T13:34:33.099Z</atom:updated>
            <content:encoded><![CDATA[<h4>Attributing K8s network costs when the standard tools don’t scale.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trbO4Tt9P_tXvMhnCYJ0JQ.png" /><figcaption>Image generated by Gemini</figcaption></figure><p>The call came from the cloud tech team. They’d built a shared Kubernetes cluster that now served over 60 product and platform teams across the company, and they needed cost attribution. Not rough estimates. Real numbers, per team, repeatable month over month.</p><p>Compute and storage? Mostly solvable. They’d figured out most of that. But network costs? Nobody knew where to start. Bills were landing at the node level, shared across everything running on that node, with no obvious way to split them by team.</p><p>They asked if the DE team could help, and someone added me to a meeting. I left that meeting with a half-page of notes, most of which I didn’t understand, and a vague commitment to “look into it.” Cross-AZ, cross-region, internet egress. I had to look up what those meant on the walk back to my desk.</p><h3>The Setup</h3><p>Shared tenancy sounds efficient until you try to bill for it.</p><p>In a shared cluster, dozens of teams run workloads side by side on the same physical nodes. The infrastructure is cost-effective (nobody wants to pay for idle machines), but that efficiency creates an attribution problem. The cluster doesn’t understand team ownership at the node level. It knows at the pod level, sometimes. At the node level, costs are pooled.</p><p>For compute, cloud providers tag many billing rows with the Kubernetes namespace, which makes attribution tractable. You can spread the untagged node costs proportionally using namespace compute shares. It’s an approximation, but a defensible one.</p><p>Network is different. Network costs attach to nodes, not pods. The billing data tells you how much bandwidth a node consumed and what type. Not which of the twenty workloads running on that node sent those bytes.</p><p>The cluster ran on both GCP and AWS, with the same problem on both sides.</p><p>Sixty teams meant sixty budget conversations that weren’t happening yet. We needed numbers to get them started.</p><h3>Why Network Is the Hard Part</h3><p>If you don’t live in Kubernetes day-to-day, here’s the thing that trips people up: not all network traffic costs the same.</p><p>Cloud providers tier their network pricing by where traffic goes. Traffic within the same availability zone is usually free. Cross-AZ traffic costs money. Cross-region traffic costs more. Internet egress costs the most. The underlying infrastructure cost is genuinely different: traffic crossing availability zones or regions moves over more expensive network paths.</p><p>In a shared cluster with 60+ teams, all four types are happening simultaneously. A data processing job in one namespace pulls from a cross-region source. A microservice in another talks to pods in a different AZ. A third team ships telemetry to an external endpoint. From the cloud’s perspective, all of that flows through the same node network interfaces and gets billed at the node level, with no attribution to who sent what.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlQoHEbVo1VJg7sylmWfhg.png" /><figcaption>Shared node, pooled costs, zero attribution (image by the author)</figcaption></figure><p>Pod-level costs can use Kubernetes labels and namespace metadata. Node-level costs have none of that. You need a different source of truth: something that can tell you which namespace generated which bytes, broken down by traffic type. That’s where the search started.</p><blockquote>💡 I’ll be honest: when I first saw the billing data land at the node level with no namespace breakdown, my first thought was that we were looking at the wrong data source. It took a while to accept that this was just how cloud network billing works.</blockquote><h3>The Obvious Answer: Kubecost, and Why It Didn’t Work at Our Scale</h3><p>The standard recommendation for Kubernetes cost attribution is <a href="https://www.kubecost.com/">Kubecost</a>. Reasonable first stop: it deploys a DaemonSet on every node, intercepts network flows, and produces pod-level cost breakdowns with namespace attribution. For many clusters, it works well.</p><p>We evaluated it. Here’s where it broke down.</p><p>The free tier in Kubecost v3 has a $100K/30-day spend cap. Our cluster crossed that before the month was halfway through.</p><p>The network costs DaemonSet have a resource problem at high pod density. It tracks unique source/destination IP and port combinations, and at the scale of 60+ teams running hundreds of workloads, that cardinality explodes. The DaemonSet starts consuming significant node resources, which creates its own cost and reliability problem.</p><p>And some workloads use <em>hostNetwork</em> mode, sharing the host IP rather than their own. When that happens, Kubecost can’t distinguish between those pods and the node itself. The attribution disappears.</p><p>None of this is a knock on Kubecost. It’s a solid tool built for a different scale. At our size, the free tier caps out, the DaemonSet degrades, and a real chunk of traffic just disappears from the attribution.</p><h3>The Pivot: The Data Was Already There</h3><p>Our cluster runs a third-party autoscaler and node management tool. Its job is node lifecycle management: scaling up and down, bin-packing workloads, and managing preemptible instance pools. Cost attribution wasn’t anywhere on its feature list.</p><p>But to do its job, it needs to understand network topology: which nodes are in which zones, what traffic flows between them, and how workloads communicate. As a byproduct of collecting that information, it stores netflow records: per-workload, per-namespace byte counts with source zone, destination zone, and destination IP addresses for every observed flow. No cost attached, no traffic classification. Just bytes and topology metadata.</p><p>That’s exactly the data we needed. That’s enough to calculate the cost if you have the pricing tiers and can classify the traffic type.</p><p>We built a pipeline that joins two datasets:</p><p><strong>Cloud billing rows</strong> (cluster-level, by traffic type): How much did cross-AZ traffic from this cluster cost today? (GCP from Compute Engine SKUs; AWS from <em>product_transfer_type</em> and <em>operation</em> fields in CUR)</p><p><strong>Autoscaler netflow records</strong> (workload-level): What fraction of each traffic type’s bytes did each namespace generate?</p><p>Multiply the cluster cost by each namespace’s byte share per traffic type, and you have namespace-level network cost attribution. For both clouds, from the same netflow source.</p><blockquote>💡 Before reaching for a dedicated cost attribution tool, check what data your existing cluster management tooling already collects. Many modern Kubernetes autoscalers collect netflow data as a byproduct of managing node lifecycle. We spent weeks looking for a solution before realizing we were sitting on the data we needed.</blockquote><h3>Building the Attribution Pipeline</h3><p>Getting from raw netflow to per-team cost involves two separate problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jc0dQtZGpzLUi4i_fV_Kg.png" /><figcaption>Two inputs, one join, sixty teams worth of answers (image by the author)</figcaption></figure><p>The first is the netflow processing stage. Raw netflow records contain source zone, source namespace, destination namespace, and an array of destination IP addresses. The source zone is usually populated; the autoscaler manages those nodes. Destination zone and region are not always available, particularly for traffic leaving the cluster to external services.</p><p>To fill that gap, we built an internal IP-to-zone lookup using our own infrastructure inventory: a mapping of known IP ranges and addresses to their cloud zone and region. When a netflow record’s destination IPs matched a known range, we could resolve the destination zone and classify the traffic precisely: different regions → cross-region; different zones → cross-AZ; same zone with a private IP → intra-zone free; same zone with a public IP → intra-zone charged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PE9WvVj9Kb0IwpB9ifB25w.png" /><figcaption>How each netflow record gets classified into a traffic type (image by the author)</figcaption></figure><p>For records where neither the netflow nor the lookup could confirm the destination zone, we derived a cluster-level cross-AZ ratio from the records we could confirm and applied it to the ambiguous bytes, defaulting to 60% cross-AZ when no confirmed data existed for that day. It’s a real assumption, baked into the model. We documented it and communicated it to teams.</p><p>The second layer is the attribution join. The billing data (from both GCP and AWS cost exports) provides cluster-level costs by traffic type. The processed netflow gives us each namespace’s byte share per traffic type. Join them, and you get namespace-level attributed cost. Same pipeline logic, different billing source, both clouds.</p><p>The edge cases needed decisions, not just code. DaemonSet pods that serve the whole cluster get their traffic spread across namespaces by compute share. System namespaces are excluded. Untagged workloads fall into a catch-all. Every allocation method is labeled in the output, so anyone auditing the numbers can trace exactly how a cost got there.</p><p>That last part matters at 60+ teams. Someone will always question the numbers.</p><h3>The Honest Limitations</h3><p>This model is an approximation. Worth saying clearly.</p><p>The autoscaler netflow data wasn’t designed for cost attribution. It was designed to support node lifecycle decisions. Some fields we depend on (source zone, destination zone) aren’t always populated. When they’re missing, we fall back to cluster-level ratios.</p><p><em>hostNetwork</em> pods are still a blind spot. When a pod uses the host network, its traffic appears to come from the node, not a namespace. There’s no clean attribution without instrumenting the workloads themselves.</p><p>DaemonSet attribution is fuzzy by definition. Spreading their cost proportionally by namespace compute share is the best available approximation, but it’s not the same as knowing.</p><p><em>Consistent and defensible beats precise but unreliable</em>. With 60+ teams, you need a model everyone can trust month over month, not a theoretically perfect number that shifts every time methodology changes.</p><h3>What We Learned</h3><p>Labeling enforcement sounds like a nice-to-have until you see what happens without it. We had a significant number of user-owned namespaces running in sandbox clusters: test workloads, personal experiments, things people spun up and forgot about. We hadn’t enforced tagging on sandbox onboarding because it felt like unnecessary friction for exploratory work. Those costs still landed in the cloud tech account. When we finally ran the numbers, the sandbox attribution gap was significant enough that we couldn’t ignore it. Even test workloads need to be owned by someone. Tagging enforcement is mandatory everywhere, not just in production.</p><p>The other thing nobody tells you is that cost attribution isn’t a project you finish. It’s an ongoing partnership. A few months after the pipeline went live, users started pinging me about a cost spike. My first instinct was that something had broken in the attribution model. I spent time re-checking the pipeline before I found out there had been a cluster upgrade that had caused a temporary infrastructure issue. The cloud tech team had already identified and fixed it. I just hadn’t known it happened. That was the moment I realized: if you’re not in the loop on infrastructure changes, you’ll spend your time debugging your model when the answer is somewhere else entirely. Stay close to your cloud team. Not just at the start, but continuously.</p><h3>Closing</h3><p>Cost attribution in a shared cluster isn’t an infrastructure problem that occasionally touches data. It’s a data problem that happens to live in infrastructure. The instincts that make a good data engineer are exactly what this problem needs. Build something the next person can audit, because in a shared cluster, there’s always a next person.</p><p>What does your cluster management tooling collect that you haven’t looked at yet?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddb4aa7861f5" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/whos-paying-for-all-this-network-traffic-a-data-engineer-s-investigation-ddb4aa7861f5">Who’s Paying for All This Network Traffic? A Data Engineer’s Investigation</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>