<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>EBPF on RockB</title><link>https://baeseokjae.github.io/tags/ebpf/</link><description>Recent content in EBPF on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 24 Aug 2026 07:01:52 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/ebpf/index.xml" rel="self" type="application/rss+xml"/><item><title>MCP as an Observability Interface: Connecting AI Agents to Kernel Tracepoints</title><link>https://baeseokjae.github.io/posts/mcp-as-an-observability-interface-connecting-ai-agents-to-kernel-tracepoints/</link><pubDate>Mon, 24 Aug 2026 07:01:52 +0000</pubDate><guid>https://baeseokjae.github.io/posts/mcp-as-an-observability-interface-connecting-ai-agents-to-kernel-tracepoints/</guid><description>MCP observability connects AI agents to kernel tracepoints, giving them ground-truth system state. Learn how eBPF, kprobes, and OTel GenAI conventions close the agent observability gap.</description><content:encoded><![CDATA[<p>MCP observability turns the Model Context Protocol into a two-way interface: AI agents don&rsquo;t just call tools, they receive ground-truth telemetry from kernel tracepoints, eBPF programs, and kprobes. By exposing low-level system instrumentation through MCP servers, agents get a real-world model of the live system instead of hallucinated state — closing the observability gap that traditional APM leaves wide open.</p>
<h2 id="what-is-mcp-and-why-it-needs-observability">What Is MCP and Why It Needs Observability</h2>
<p>The Model Context Protocol (MCP) is an open standard that standardizes how AI agents discover and invoke tools, resources, and prompts. Instead of every agent building bespoke integrations with every service, MCP defines a common protocol: a host (the agent runtime) connects to MCP servers, which expose tools the model can call and resources it can read.</p>
<p>The problem is that what happens <em>between</em> tool calls is a black box. When an agent invokes a tool, the request crosses the network, hits a server, executes, and returns — but none of that journey is visible by default. As SigNoz notes, &ldquo;MCP-based architectures enable AI agents to invoke tools, but what happens in between is a black box.&rdquo; Latency spikes in tool responses degrade agent performance, and silent failures occur when a tool invocation returns no valid data.</p>
<p>This is precisely why MCP needs observability. An agent that chains ten tools in a single run multiplies its failure and cost surface tenfold. Without telemetry on each step, you cannot tell whether a slow response is a network issue, a server overload, or a misbehaving tool — and you cannot trust the agent&rsquo;s output.</p>
<h2 id="the-observability-gap-why-traditional-apm-fails-for-ai-agents">The Observability Gap: Why Traditional APM Fails for AI Agents</h2>
<p>Infrastructure solved its observability problem a decade ago with Prometheus, Grafana, and Datadog. AI agents remain opaque. Traditional APM sees an HTTP 200 and 143ms latency and calls it success — while completely missing the failures that actually matter for agents: leaked PII, hallucinated citations, cost overruns, and prompt injection.</p>
<p>The gap is structural. Traditional APM instruments <em>requests</em>; agents produce <em>reasoning chains</em>. A single agent execution is not one call but a sequence of decisions, tool invocations, and intermediate results. As the March 2026 state-of-MCP-observability analysis points out, 89% of teams deploying software have production observability in place, yet AI agents remain largely unobserved.</p>
<p>What&rsquo;s missing is protocol-native observability. Most current approaches are SDK-based instrumentation bolted onto the agent runtime, not telemetry carried by the protocol itself. That is the core of the gap: you are observing the agent from the outside, not from within the conversation it is having with the world.</p>
<h2 id="mcp-as-a-two-way-observability-interface">MCP as a Two-Way Observability Interface</h2>
<p>The framing that unlocks this problem is to treat MCP not as a one-way tool-calling channel but as a two-way observability interface. In one direction, agents call tools to act on the system. In the other, MCP servers expose telemetry back to the agent — metrics, traces, logs, and kernel-level state — so the agent can reason about the actual condition of the infrastructure it is operating on.</p>
<p>This is the orchestration model ClickHouse describes: MCP for observability is about orchestration, not just investigation. Agents drive the full incident workflow, jumping between logs, traces, dashboards, deployments, and hypotheses the way a human engineer does. Every query, chart, reasoning step, and intermediate result should be visible and auditable.</p>
<p>The two-way model matters because it gives the agent a feedback loop. It can observe the effect of its own actions, correct course, and align its reasoning with ground truth at every step — rather than operating on a stale mental model.</p>
<h2 id="kernel-tracepoints-the-ground-truth-source-for-agent-state">Kernel Tracepoints: The Ground-Truth Source for Agent State</h2>
<p>Kernel tracepoints are static instrumentation points compiled into the Linux kernel. They fire at well-defined locations — syscall entry and exit, scheduler events, network packet processing, filesystem operations — and expose structured data about what the kernel is actually doing.</p>
<p>For AI agents, tracepoints are the ultimate ground-truth source. An LLM can give perfect directions on a map it was trained on, but it has no ground-truth model of the live system. Kernel tracepoints provide exactly that: real, current, verifiable state about CPU usage, I/O, network, memory, and process behavior.</p>
<p>The challenge, as Jonathan Corbet outlined at the 2016 Kernel Summit, is that tracepoints must be kept stable across kernel versions to avoid breaking tracing tools. Maintaining a stable tracepoint ABI is a known and ongoing challenge. But the payoff is enormous: a stable, low-overhead, kernel-blessed source of truth that agents can query through an MCP server.</p>
<h2 id="ebpf-kprobes-and-uprobes-instrumenting-the-kernel-for-agents">eBPF, kprobes, and uprobes: Instrumenting the Kernel for Agents</h2>
<p>While tracepoints are static, eBPF and the dynamic instrumentation points — kprobes and uprobes — let you attach programs to nearly any function in the kernel or user space without modifying source code.</p>
<ul>
<li><strong>Tracepoints</strong>: static, stable, low-overhead instrumentation points compiled into the kernel.</li>
<li><strong>kprobes</strong>: dynamic probes that attach to kernel function entry and exit points.</li>
<li><strong>uprobes</strong>: dynamic probes that attach to user-space function entry and exit points.</li>
<li><strong>eBPF</strong>: a safe, sandboxed virtual machine that runs small programs at these probe points with minimal overhead.</li>
</ul>
<p>eBPF enables low-overhead, safe kernel-level observability without modifying kernel source. An MCP server can wrap eBPF programs and expose their output as MCP resources and tools, giving agents a live, queryable view of kernel behavior.</p>
<table>
  <thead>
      <tr>
          <th>Instrumentation</th>
          <th>Type</th>
          <th>Stability</th>
          <th>Overhead</th>
          <th>Use Case for Agents</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Tracepoints</td>
          <td>Static</td>
          <td>High (ABI-stable)</td>
          <td>Very low</td>
          <td>Ground-truth syscall/scheduler state</td>
      </tr>
      <tr>
          <td>kprobes</td>
          <td>Dynamic</td>
          <td>Low (may change)</td>
          <td>Low</td>
          <td>Kernel function-level debugging</td>
      </tr>
      <tr>
          <td>uprobes</td>
          <td>Dynamic</td>
          <td>Low</td>
          <td>Low</td>
          <td>User-space function tracing</td>
      </tr>
      <tr>
          <td>eBPF</td>
          <td>Program</td>
          <td>Depends on probe</td>
          <td>Low</td>
          <td>Safe, flexible kernel observability</td>
      </tr>
  </tbody>
</table>
<h2 id="protocol-native-vs-sdk-based-observability">Protocol-Native vs SDK-Based Observability</h2>
<p>The key architectural decision is whether observability lives in the protocol or in the SDK. SDK-based instrumentation requires every agent runtime to embed a tracing library, configure exporters, and agree on a common schema. It is fragile, fragmented, and observes the agent from outside.</p>
<p>Protocol-native observability carries telemetry inside MCP itself. The MCP server emits spans and metrics as part of its normal operation, so any host that speaks MCP automatically gets observability without extra instrumentation. This is the direction the ecosystem is moving: OpenTelemetry GenAI semantic conventions now include dedicated specifications for agent spans and MCP server telemetry.</p>
<p>Protocol-native is more robust because it observes the actual conversation between agent and tool — the exact thing that matters — rather than approximating it from HTTP-level signals.</p>
<h2 id="opentelemetry-genai-semantic-conventions-and-mcp-server-telemetry">OpenTelemetry GenAI Semantic Conventions and MCP Server Telemetry</h2>
<p>OpenTelemetry&rsquo;s GenAI semantic conventions are now published, and they are the backbone of modern agent observability. They define standard attribute names for agent spans, tool invocations, token usage, and MCP server telemetry, so that observability data from different vendors and runtimes is comparable.</p>
<p>Every major observability vendor is building on these conventions. Datadog ships an MCP bridge; Arize Phoenix builds on OTel GenAI conventions. The result is a common language for describing what an agent did, which tools it called, how long each took, and what it cost.</p>
<p>For MCP observability specifically, the conventions let you track <code>tool_token_usage_total</code> counters for cost, distributed traces across tool chains, and performance metrics per tool. This is the difference between &ldquo;the agent ran&rdquo; and &ldquo;the agent ran these ten tools, this one took 4 seconds, and it consumed 12,000 tokens.&rdquo;</p>
<h2 id="security-the-adoption-bottleneck-for-mcp-observability">Security: The Adoption Bottleneck for MCP Observability</h2>
<p>Security is the single biggest blocker to MCP adoption. The data is stark: 25% of MCP servers have no authentication whatsoever, and 38% of teams say security concerns are actively blocking their MCP adoption.</p>
<p>This is where kernel-level visibility becomes a trust mechanism. If an MCP server exposes kernel tracepoints, you can observe exactly what the agent is doing at the system level — which processes it spawns, which files it touches, which network connections it makes. That visibility is the foundation of trust: you can verify that the agent is not leaking PII, not being prompt-injected, and not exceeding its authority.</p>
<p>An unauthenticated MCP server that can trigger kernel instrumentation is a serious risk. Kernel-level observability must be paired with strict authentication, authorization, and audit logging — the same discipline you would apply to any privileged system access.</p>
<h2 id="cost-visibility-across-the-agent-tool-chain">Cost Visibility Across the Agent Tool Chain</h2>
<p>Cost is a blind spot in agent observability because agents make chains, not individual calls. A single $0.01 API call becomes $0.50 per execution when you trace the full chain. A typical agent execution can chain 10+ tools in a single run, multiplying the cost surface.</p>
<p>MCP observability solves this by attributing cost to the full chain rather than individual calls. With <code>tool_token_usage_total</code> counters and distributed tracing, you can see the cumulative cost of an entire agent execution — not just one API call. This is essential for budgeting, for detecting runaway agents, and for understanding which tools are the expensive ones.</p>
<table>
  <thead>
      <tr>
          <th>Observability Signal</th>
          <th>What It Tells You</th>
          <th>Why It Matters for Agents</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Performance metrics</td>
          <td>Per-tool latency</td>
          <td>Detect slow tools degrading agent performance</td>
      </tr>
      <tr>
          <td>Distributed traces</td>
          <td>Full tool chain</td>
          <td>See the 10-tool execution, not one call</td>
      </tr>
      <tr>
          <td>Token/cost counters</td>
          <td>Cumulative spend</td>
          <td>Catch cost overruns and runaway agents</td>
      </tr>
      <tr>
          <td>Kernel telemetry</td>
          <td>System-level state</td>
          <td>Ground truth, not hallucinated state</td>
      </tr>
  </tbody>
</table>
<h2 id="human-in-the-loop-agents-as-sre-co-pilots">Human-in-the-Loop: Agents as SRE Co-Pilots</h2>
<p>The honest take is that LLMs are not yet ready to replace human SREs. Hallucinations, misclassification biases, and a lack of explainability mean agent suggestions must be confirmed against dashboards, logs, and traces. The combinatorial explosion of tool chains means an agent can go astray unless aligned with ground truth at every step.</p>
<p>Kernel tracepoints are the alignment mechanism. When an agent&rsquo;s claim about system state can be checked against live kernel telemetry, you have a human-in-the-loop loop that actually works: the agent proposes, the tracepoints verify, the human decides. This is the co-pilot model — agents augment SREs with speed and breadth, while humans retain judgment and accountability.</p>
<h2 id="building-an-mcp-observability-interface-a-practical-guide">Building an MCP Observability Interface: A Practical Guide</h2>
<p>To build an MCP observability interface that connects agents to kernel tracepoints, follow this practical path:</p>
<ol>
<li><strong>Expose kernel telemetry as MCP resources.</strong> Wrap eBPF programs and tracepoint readers in an MCP server that exposes live system state as queryable resources.</li>
<li><strong>Instrument the MCP server with OTel GenAI conventions.</strong> Emit agent spans, tool spans, and <code>tool_token_usage_total</code> counters so every invocation is traceable.</li>
<li><strong>Add authentication and authorization.</strong> Never expose kernel instrumentation through an unauthenticated MCP server. Enforce strict access control and audit logging.</li>
<li><strong>Track the full tool chain.</strong> Use distributed tracing to see the entire agent execution, not individual calls, so cost and failure surface are visible.</li>
<li><strong>Align agents with ground truth.</strong> Have the agent verify its claims against kernel telemetry at every step, and require human confirmation for consequential actions.</li>
<li><strong>Keep humans in the loop.</strong> Treat the agent as a co-pilot that proposes, with tracepoints as the source of truth and humans as the decision-makers.</li>
</ol>
<h2 id="conclusion-from-black-box-to-ground-truth">Conclusion: From Black Box to Ground Truth</h2>
<p>MCP observability is the bridge between high-level agent reasoning and low-level kernel reality. By treating MCP as a two-way interface — agents calling tools, and tools exposing kernel tracepoints back to agents — you replace the black box with ground truth. Agents get a real-world model of the live system, cost and failure surfaces become visible across the full tool chain, and security is enforced through kernel-level visibility.</p>
<p>The infrastructure world solved observability a decade ago. With MCP as an observability interface and kernel tracepoints as the source of truth, AI agents can finally be observed with the same rigor — and trusted with the same confidence.</p>
<h2 id="faq">FAQ</h2>
<p><strong>What is MCP observability?</strong>
MCP observability is the practice of instrumenting the Model Context Protocol so that AI agent tool calls, reasoning chains, costs, and system-level effects are visible and auditable, rather than operating as a black box.</p>
<p><strong>How do kernel tracepoints help AI agents?</strong>
Kernel tracepoints provide ground-truth, real-time system state — CPU, I/O, network, memory, and process behavior — that agents can query through an MCP server, replacing hallucinated state with verifiable facts.</p>
<p><strong>What is the difference between tracepoints, kprobes, and uprobes?</strong>
Tracepoints are static, ABI-stable instrumentation points compiled into the kernel; kprobes dynamically probe kernel functions; uprobes dynamically probe user-space functions. eBPF programs attach to all of them safely.</p>
<p><strong>Why does traditional APM fail for AI agents?</strong>
Traditional APM observes individual HTTP requests and calls them success on a 200 status, missing the failures that matter for agents: leaked PII, hallucinated citations, cost overruns, and prompt injection across multi-tool reasoning chains.</p>
<p><strong>Is MCP observability secure?</strong>
Only with strict controls. Since 25% of MCP servers have no authentication, kernel-level observability must be paired with authentication, authorization, and audit logging to prevent privileged instrumentation from being abused.</p>
]]></content:encoded></item></channel></rss>