<?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>Forem: Samyukktha</title>
    <description>The latest articles on Forem by Samyukktha (@samyukktha).</description>
    <link>https://forem.com/samyukktha</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%2F905353%2Fc7951360-c21e-4028-a509-4df1a311f60e.jpeg</url>
      <title>Forem: Samyukktha</title>
      <link>https://forem.com/samyukktha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/samyukktha"/>
    <language>en</language>
    <item>
      <title>Inferencing - the AI-led future of Observability?</title>
      <dc:creator>Samyukktha</dc:creator>
      <pubDate>Wed, 02 Aug 2023 07:38:18 +0000</pubDate>
      <link>https://forem.com/samyukktha/inferencing-the-ai-led-future-of-observability-4kl6</link>
      <guid>https://forem.com/samyukktha/inferencing-the-ai-led-future-of-observability-4kl6</guid>
      <description>&lt;p&gt;Over the last 9 months, rapid advancements in Generative AI have impacted nearly every industry. What are the implications for how we do observability and monitoring of our production systems?&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;I posit that the next evolution in this space will be a new class of solutions that do "Inferencing" - i.e., directly root-cause the source of an error for a developer with reasonable accuracy.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;In this article, we examine -&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inferencing as a natural next step to observability&lt;/li&gt;
&lt;li&gt;Learnings from AIOps - why it failed to take off, and implications for inferencing&lt;/li&gt;
&lt;li&gt;Some emergent principles for the class of inferencing solutions
&lt;p&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where we are
&lt;/h2&gt;

&lt;p&gt;To understand the next generation of observability, let us start with the underlying goal of all of these tools. It is to keep production systems healthy and running as expected and, if anything goes wrong, to allow us to quickly understand why and resolve the issue.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;If we start there, we see that are three distinct levels in how tools can support us:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Level 1: "Alert me when something is off in my system" — monitoring&lt;br&gt;
Level 2: "Tell me why something is off (and how to fix it)" — let's call this inferencing&lt;br&gt;
Level 3: "Fix it yourself and tell me what you did" — auto-remediation.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Monitoring tools do Level 1 (detecting issues) reasonably well. The natural next step is level 2, where a system automatically tells us why something is breaking. We don't yet have solutions that can do this, so we added a category of tools called observability between Level 1 and Level 2, whose goal was to "help us understand why something is breaking”. This essentially became "any data that could potentially help us understand what is happening".&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NBJOxirW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbccakv0z4d41jjym1tu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NBJOxirW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbccakv0z4d41jjym1tu.png" alt="Observability vs Inferencing" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with observability today
&lt;/h2&gt;

&lt;p&gt;The main problem with observability today is that it is loosely defined and executed. This is because we don't know what data we need beforehand - that depends on the issue. And the nature of production errors is that they are long-tail and unexpected - if they could've been predicted, they would've been resolved. So we collect a broad variety of data types - metrics, logs, distributed traces, stack-traces, error data, K8s events, and continuous profiling - all to ensure we have some visibility when things go wrong.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The best way to understand observability as it is implemented in practice is - "Everything outside of metrics, plus metrics."&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B083cMdV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zf7k0yj62rks2opxdtm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B083cMdV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zf7k0yj62rks2opxdtm.png" alt="Observability in practice" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;An observability platform also has to make choices around how much data to capture and store. This decision is currently pushed to customers, and customers default to collecting as much data as they can afford to. Rapid cloud adoption &amp;amp; of SaaS models has made it possible to collect and store massive amounts of data.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The underlying human driver for collecting more types &amp;amp; volume of observability data is - "What if something breaks and I don't have enough data to be able to troubleshoot?" This is every engineering team's worst nightmare. As a result of this, we have a situation today where there is -&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Observability data types are continuously expanding&lt;/li&gt;
&lt;li&gt;Observability data volumes are exploding&lt;/li&gt;
&lt;li&gt;Increasing tool sprawl - avg. company uses 5+ observability tools
&lt;p&gt; &lt;/p&gt;
With all this, we started running into new problems. It is now increasingly hard for developers to manually navigate the tens of data-intensive dashboards to identify an error. Observability has also become prohibitively expensive, so companies have to start making complex trade-offs around what data to store, sometimes losing visibility. Between both of this and the continued increase in complexity of production systems, we are seeing that MTTR for production errors is actually increasing over the years.
&lt;p&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Inferencing— observability plus AI
&lt;/h2&gt;

&lt;p&gt;I'd argue the next step after observability is Inferencing — where a platform can reasonably explain why an error occurred, so we can fix it. This becomes possible now in 2023 with the rapid evolution of AI models in the last few months.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Imagine a solution that:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically surfaces just the errors that need immediate developer attention.&lt;/li&gt;
&lt;li&gt;Tells the developer exactly what is causing the issue and where the issue is - this pod, this server, this code path, this type of request.&lt;/li&gt;
&lt;li&gt;Guides the developer on how to fix it.&lt;/li&gt;
&lt;li&gt;Uses the developer's actual actions to continuously improve its recommendations.
&lt;p&gt; &lt;/p&gt;
There is some early activity in this space (including ZeroK.ai), but we are still extremely early and we can expect several new companies to emerge here over the next couple of years.
&lt;p&gt; &lt;/p&gt;
However, any conversation around AI + observability would be incomplete without a discussion on AIOPs, which was the same promise (use AI to automate production ops), and saw a wave of investment between '15-20 but had limited success and died down. For a comprehensive exploration of why AIOPs failed, read this - AIOps Is Dead.
&lt;p&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Avoiding the pitfalls of AIOps
&lt;/h2&gt;

&lt;p&gt;The original premise of AIOps was that if we pushed data from the five or six different observability sources into one unifying platform and then applied AI on all this data (metrics, logs, dependencies, traces, configurations, updates, K8s events), we would get to insights on why something broke.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vJrRtQFj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2qadq54vb19zsbw6x4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJrRtQFj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2qadq54vb19zsbw6x4f.png" alt="Architecture of an AIOPs platform" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;While attractive in theory, this argument fell short in a few ways.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;First, tying everything together was impractical and a much harder problem than estimated. Different observability tools collected different data about different systems at different time intervals, and they exposed different subsets of the data they collected to a third-party tool. In addition, each individual customer had their own data collection practices. Enterprises, for example, would have several different observability tools with highly customized and non-standard data collection, and the enterprise would have to manually provide context about them to any new AIOPs tool. All this impacted the quality of response/ root-causing that the ML models could get to and the value they ended up delivering.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Second, the AIOPs model was too broad and not use-case driven. For example, what specific kinds of errors were the models targeting? Infrastructure errors/ code errors/ hard errors/ soft errors? Most AIOPs platforms went quite broad here, and tried to ingest 8 different data types in the hope of finding patterns and anomalies, and had too much dependence on how much data and of what quality the customer pushed into the platform, which varied the quality of their output.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Third, the integration process in each company was too complex. A large company has a fragmented footprint of observability tools, with 10s of tools being run by different teams. An AIOps platform needed to be integrated into all those tools to be able to add value. Even in the case of the AIOPs module of a large observability platform like a Datadog or DynaTrace, the requirement was that the entire observability stack be moved to the single vendor (across infra &amp;amp; app. metrics, logs, distributed tracing, error monitoring, and so on), for the AIOPs module to be effective.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Fourth, the massive data volumes and the processing power required to process the data also made these tools very expensive in relation to their questionable value.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;All this resulted in a degree of disillusionment among many early adopters of AIOps tools, and most companies reverted to a simple “collect data and display on dashboards” mechanism for their needs.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Several learnings from here will be applicable and can learn and apply as we attempt Inferencing.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Principles of Inferencing
&lt;/h2&gt;

&lt;p&gt;Inferencing would have to be different in a few ways to more efficiently achieve the end goal.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Architected from the ground up with AI in mind
&lt;/h3&gt;

&lt;p&gt;An Inferencing solution would have to be architected ground-up for the AI use-case i.e., data collection, processing, pipeline, storage, and user interface are all designed ground-up for "root-causing issues using AI".&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;What it will probably NOT look like, is AI added on top of an existing observability solution or existing observability data, simply because that is what we attempted and failed with AIOPs. It will have to be a full-stack system in which everything is designed around using AI for the explicit goal of performing root cause analysis.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;What would this look like in practice?&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Full-stack AI-native architecture with data collection, processing, storage, and visualization
&lt;/h3&gt;

&lt;p&gt;An Inferencing solution would have to be vertically integrated — that is, it would have to collect telemetry data, process the data, and own the data pipeline, and the interaction layer with users.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This is important because it would allow the solution to use user interactions to learn and update its data processing and collection mechanisms.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;It would also be critical for the Inferencing solution to directly be able to collect the data it needs, in the format it needs, with the context it needs, from the customer environments — to have control over the effectiveness of the root-causing and the user experience.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Adaptive data collection
&lt;/h3&gt;

&lt;p&gt;An Inferencing solution would have to have intelligence embedded into the data collection itself. That means the agent should be able to look at the data streaming in and decide at the moment whether to capture or discard.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Today, all instrumentation agents are "dumb" — they just take a snapshot of all data and ship it, and processing occurs later. This makes sense today because we primarily use code-agents, and we want the agents to be as lightweight as possible and add minimal overhead.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;However, with the emergence of technologies like eBPF that allow us to do out-of-band data collection from the kernel with almost zero overhead, it is possible to imagine an intelligent instrumentation agent that actively solves for the data quality that inferencing models would require.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Data processing tuned to specific use-cases
&lt;/h3&gt;

&lt;p&gt;In Inferencing, all data processing techniques would have to be centered around specific use cases — for instance, How do I reliably error type A? And error type B? And so on.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;All data processing models would follow the principle of being able to reliably root-cause some types of errors, and slowly increase the type of errors they would identify as the models evolve. This may lead to different data types, data pipelines, and prompts for each type of error. We may have some inferencing platforms that are better at root-causing infrastructure errors, some at security issues, some at code errors, and so on, with each type collecting slightly different data sets, with slightly different data pipelines and a different model framework.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;What they will probably not do is "general anomaly detection" and then work backward to see what might have caused the anomaly. This is because the data required to root cause an error is very different from the data required to "identify/spot" an error.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Storage designed for AI
&lt;/h3&gt;

&lt;p&gt;The view of storage in an Inferencing world already looks different from that in a monitoring or observability world. We now have massive data stores for everything that occurred, but in inferencing what we need is just storage of the most relevant and recent data the AI models need to root cause errors reliably. This could involve several practices — storing data in vector DBs for easy clustering and withdrawal, storing only a small portion of success cases and discarding the rest, deduping errors, and, so on.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;As a result, the amount of storage required for Inferencing solutions could actually be less than what traditional monitoring and observability solutions needed.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Simpler, more interactive user interface
&lt;/h3&gt;

&lt;p&gt;An Inferencing interface would probably look less like a bunch of dashboards with data, and more like a conversational++ interface that is tuned for development teams. Maybe it has a simple table of prioritized errors that need human attention — you click on each error, and it gives a list of the most likely root causes with a probability of accuracy. It could then have RLHF (Reinforcement Learning from Human Feedback) to have users confirm whether a root cause was identified correctly, so the models would improve performance with time. The possibilities are broad here.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In summary, there are likely to be sweeping changes in the monitoring and observability space with the recent developments in Gen. AI.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The first wave of solutions are likely to resemble the AIOPs platforms of yore, with a thin Gen. AI wrapper around existing observability data. Incumbents are best positioned to win this wave. This is likely to be akin to Github Copilot - you get a good suggestion about ~10% of the time. However, the true leap forward is probably a couple of years out, with a new class of Inferencing solutions that can accurately root cause errors 80%+ of the time. To be able to do this, they would need to be full-stack and own the data collection, processing, storage, models, and user interactions. We explored some early hypotheses on how Inferencing solutions would differ from existing practices in each part of the stack.&lt;/p&gt;

</description>
      <category>observability</category>
      <category>ai</category>
      <category>inferencing</category>
    </item>
    <item>
      <title>Monitoring vs Observability in 2023 - An honest take</title>
      <dc:creator>Samyukktha</dc:creator>
      <pubDate>Mon, 17 Jul 2023 08:48:40 +0000</pubDate>
      <link>https://forem.com/samyukktha/monitoring-vs-observability-in-2023-an-honest-take-3kph</link>
      <guid>https://forem.com/samyukktha/monitoring-vs-observability-in-2023-an-honest-take-3kph</guid>
      <description>&lt;p&gt;If you're running a software system, you need to know what’s happening with it: how it’s performing, whether it’s running as expected, and whether any issues need your attention. And once you spot an issue, you need information so you can troubleshoot. &lt;/p&gt;

&lt;p&gt;A plethora of tools promise to help with this, from monitoring, APMs, Observability, and everything in between. This has resulted in something of a turf war in the area of observability, where monitoring vendors claims they also do observability, while “observability-first” players disagree and accuse them of observability-washing.&lt;/p&gt;

&lt;p&gt;So let's take an unbiased look at this and answer a few questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How are monitoring and observability different, if at all?&lt;/li&gt;
&lt;li&gt;How effective is each at solving the underlying problem?&lt;/li&gt;
&lt;li&gt;How does AI impact this space now and what comes next?
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is monitoring?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A monitoring solution performs 3 simple actions-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pre-define some "metrics" in advance&lt;/li&gt;
&lt;li&gt;Deploy agents to collect these metrics&lt;/li&gt;
&lt;li&gt;Display these metrics in dashboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that a metric here is a simple number that captures a quantifiable characteristic of a system. We can then perform mathematical operations on metrics to get different aggregate views. &lt;/p&gt;

&lt;p&gt;Monitoring has existed for the past 40 years — since the rise of computing systems — and was originally how operations teams kept track of how their infrastructure was behaving.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Types of monitoring&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Originally, monitoring was most heavily used in infrastructure to keep track of infrastructure behavior - this was infrastructure monitoring. Over time, as applications became more numerous and diverse, we wanted to monitor them as well, leading to the emergence of a category called APM (Application performance monitoring). In a modern distributed system, we have several components we want to monitor — infrastructure, applications, databases, networks, data streams, and so on, and the metrics we want differ depending on the component. For instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Infrastructure monitoring: uptime, CPU utilization, memory utilization&lt;/li&gt;
&lt;li&gt;Application performance monitoring: throughput, error rate, latency&lt;/li&gt;
&lt;li&gt;Database monitoring: number of connections, query performance, cache hit ratios&lt;/li&gt;
&lt;li&gt;Network monitoring: roundtrip time, TCP retransmits, connection churn&lt;/li&gt;
&lt;li&gt;..and so on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These metrics are measures that are generally agreed upon as relevant for that system, and most monitoring tools come pre-built with agents that know which metric to collect, and what dashboards to display.&lt;/p&gt;

&lt;p&gt;As the number of components in distributed systems multiplied, the volume and variety of metrics grew exponentially. To manage this complexity, a separate suite of tools and processes emerged that expanded upon traditional monitoring tools, with time-series databases, SLO systems, and new visualizations.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Distinguishing monitoring&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Through all this, the core functioning of a monitoring system remains the same, and a monitoring system can be clearly distinguished if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It captures predefined data&lt;/li&gt;
&lt;li&gt;The data being collected is a metric (a number)
&lt;p&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The goal of monitoring&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The goal of a monitoring tool is to alert us when something unexpected is happening in a system.&lt;/p&gt;

&lt;p&gt;This is akin to an annual medical checkup - we measure a bunch of pre-defined values that will give us an overall picture of our body and let us know if any particular sub-system (organ) is behaving unexpectedly.&lt;/p&gt;

&lt;p&gt;And just like annual checkups, a monitoring tool may or may not provide any additional information about why something is unexpected. For that, we’ll likely need deeper, more targeted tests and investigation.&lt;/p&gt;

&lt;p&gt;An experienced physician might still be able to diagnose a condition based on just the overall test, but that is not what the test is designed for. Same with a monitoring solution.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is observability?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Unlike monitoring, observability is much harder to define. This is because the goal of observability is fuzzier. It is to "help us understand why something is behaving unexpectedly".&lt;/p&gt;

&lt;p&gt;Logs are the original observability tool that we've been using since the 70s. How we worked until the late 2000s was - traditional monitoring systems would alert us when something went wrong, and logs would help us understand why.&lt;/p&gt;

&lt;p&gt;However, in the last 15 years, our architectures have gotten significantly more complex. It became near impossible to manually scour logs to figure out what happened. At the same time, our tolerance for downtime decreased dramatically as businesses became more digital, and we could no longer afford to spend hours understanding and fixing issues.&lt;/p&gt;

&lt;p&gt;We needed more data than we had, so we could troubleshoot issues faster. This led to the rise of the observability industry, whose purpose was to help us understand more easily why our systems were misbehaving. This started with the addition of a new data type called traces, and we said the 3 pillars of observability were metrics, logs, and traces. Then from there, we kept adding new data types to " improve our observability".&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The problem with observability&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The fundamental problem with observability is - we don't know what information we might need beforehand. The data we need depends on the issue. The nature of production errors is that they are unexpected and long-tail: if they could've been foreseen, they’d have been fixed already.&lt;/p&gt;

&lt;p&gt;This is what makes observability fuzzy: there’s no clear scope around what and how much to capture. So observability became "any data that could potentially help us understand what is happening".&lt;/p&gt;

&lt;p&gt;Today, the best way to describe observability as it is implemented is - "Everything outside of metrics, plus metrics."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IkrMKuft--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cm0rxj7ovgtvkd05q2ar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IkrMKuft--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cm0rxj7ovgtvkd05q2ar.png" alt="MOnitoring vs Observability" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A perfectly observable system would record everything that happens in production, with no data gaps. Thankfully, that is impractical and prohibitively expensive, and 99% of the data would be irrelevant anyway, so an average observability platform needs to make complex choices on what and how much telemetry data to capture. Different vendors view this differently, and depending on who you ask, observability seems slightly different.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Commonly cited descriptions of observability are unhelpful&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Common articulations of observability, like "observability is being able to observe internal states of a system through its external outputs", are vague and give us neither a clear indication of what it is, nor guide us in deciding whether we have sufficient observability for our needs.&lt;/p&gt;

&lt;p&gt;In addition, most of the commonly cited markers that purport to distinguish observability from monitoring are also vague, if not outright misleading. Let’s look at a few examples:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. "Monitoring is predefined data; observability is not"&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In reality, nearly everything we capture in an observability solution today is also predetermined. We define in advance what logs we want to capture, what distributed traces we want to capture (including sampling mechanisms), what context to attach to each distributed trace, and when to capture a stack trace.&lt;/p&gt;

&lt;p&gt;We're yet to enter the era of tools that selectively capture data based on what is actually happening in production.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;2. "Monitoring is simple dashboards; observability is more complex analysis and correlation"&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This is another promise that’s still unmet in practice.&lt;br&gt;
Most observability platforms today also just have dashboards — just that their dashboards show more data than metrics (for example, strings for logs) or can pull up different charts and views based on user instructions. We don't yet have tools that can do any meaningful correlation context by themselves to help us understand problems faster.&lt;/p&gt;

&lt;p&gt;Being able to connect a log and a trace using a unique ID doesn’t qualify as a complex analysis or correlation, even though the effort required for it may be non-trivial.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;3. "Monitoring is reactive; observability is proactive"&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;All observability data we collect is pre-defined and nearly everything we do in production today (including around observability) is reactive. The proactive part was what we did while testing. In production, if something breaks and/or looks unexpected, we respond and investigate.&lt;/p&gt;

&lt;p&gt;At best, we use SLO systems which could potentially qualify as proactive. With SLO systems we predefine an acceptable amount of errors (error budgets) and take action before we surpass them. However SLO systems are more tightly coupled with monitoring tools, so this is not a particularly relevant distinction between a monitoring and observability solution.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;4. "Monitoring focuses on individual components; observability reveals relationships across components"&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This is a distinction created just to make observability synonymous with distributed tracing. Distributed tracing is just one more data type that shows us the relationships across components. Today, distributed tracing needs to be used in conjunction with other data to be really useful (for more on this, read this article that explores the real utility of distributed tracing).&lt;/p&gt;

&lt;p&gt;In summary, we have a poorly defined category with no outer boundaries. Then we made up several vague, not very helpful markers to distinguish that category from monitoring, which existed before. This narrative is designed to tell us that there's always some distance to go before we get to "true observability" —and always one more tool to buy. As a result, we’re continuously expanding the scope of what we need within observability.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is the impact of this?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Ever increasing list of data types for observability&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;All telemetry data is observability because it helps us "observe" the states of our system. Do logs qualify as observability? Yes, because they help us understand what happened in production. Does distributed tracing qualify? Yes. How about error monitoring systems that capture stack traces for exceptions? Yes. How about live debugging systems? Yes. How about continuous profilers? Yes. How about metrics? Also yes, because they also help us understand the state of our systems.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Ever increasing volume of observability data&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;How much data to capture is left to the customer to decide, especially outside of monitoring. How much you want to log, how many distributed traces you want to capture, how many events you want to capture and store, at what intervals, for how long — everything is an open question, with limited guidance on how much is "reasonable" and at what point you might be capturing too much. Companies can spend $1M or as much as $65M on observability; it all depends on who builds what business case.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Tool sprawl and spending increase&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;All of the above has led to the amount spent on observability rising rapidly. Most companies today use five or more observability tools, and monitoring &amp;amp; observability is typically the second-largest infrastructure spend in a company after cloud infrastructure itself, with a market size of ~$17B.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Fear and loss-aversion are underlying drivers for observability expansion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The underlying human driver for the adoption of all these tools is fear -"What if something breaks and I don't have enough data to be able to troubleshoot"? This is every engineering team's worst nightmare. This naturally drives teams to capture more and more telemetry data every year so they feel more secure.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Yet MTTR appears to be increasing globally&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;One would expect that with the wide adoption of observability and the aggressive capturing and storing of various types of observability data, MTTR would have dropped dramatically globally.&lt;/p&gt;

&lt;p&gt;On the contrary, it appears to be increasing, with 73% of companies taking more than an hour to resolve production issues (vs 47% just 2 years ago).&lt;/p&gt;

&lt;p&gt;Despite all the investment, we seem to be making incremental progress at best.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RPrT9eXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgk9gsqdbvwpn1wlgfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RPrT9eXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgk9gsqdbvwpn1wlgfl.png" alt="Increasing production MTTRs" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Where we are now&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;So far, we continued to collect more and more telemetry data in the hope that processing and storage costs would keep dropping to support that. But with exploding data volumes, we ran into a new problem outside of cost, which is usability. It was getting impossible for a human to directly look at 10s of dashboards and arrive at conclusions quickly enough. So we created different data views and cuts to make it easier for users to test and validate their hypotheses. But these tools have become too complex for an average engineer to use, and we need specially trained "power users" (akin to data scientists) who are well versed in navigating this pool of data to identify an error.&lt;/p&gt;

&lt;p&gt;This is the approach many observability companies are taking today: capture more data, have more analytics, and train power users who are capable of using these tools. But these specialized engineers do not have enough information about all the parts of the system to be able to generate good-enough hypotheses.&lt;/p&gt;

&lt;p&gt;Meanwhile, the average engineer continues to rely largely on logs to debug software issues, and we make no meaningful improvement in MTTR. So all of observability seems like a high-effort, high-spend activity that allows us merely to stay in the same place as our architectures rapidly grow in complexity.&lt;/p&gt;

&lt;p&gt;So what’s next?&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Inferencing - the next stage after Observability?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To truly understand what the next generation would look like, let us start with the underlying goal of all these tools. It is to keep production systems healthy and running as expected and, if anything goes wrong, to allow us to quickly understand why and resolve the issue.&lt;/p&gt;

&lt;p&gt;If we start there, we can see that are three distinct levels in how tools can support us:&lt;/p&gt;

&lt;p&gt;Level 1: "Tell me when something is off in my system" — monitoring&lt;/p&gt;

&lt;p&gt;Level 2: "Tell me why something is off (and how to fix it)" — let's call this inferencing&lt;/p&gt;

&lt;p&gt;Level 3: "Fix it yourself and tell me what you did" — auto-remediation&lt;/p&gt;

&lt;p&gt;Traditional monitoring tools do Level 1 reasonably well and help us detect issues. We have not yet reached Level 2 where a system can automatically tell us why something is breaking.&lt;/p&gt;

&lt;p&gt;So we introduced a set of tools called observability that sit somewhere between Level 1 and Level 2, to "help understand why something is breaking” by giving us more data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sMfYjs64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuz2oqg2iq7fpkfipd1n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sMfYjs64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuz2oqg2iq7fpkfipd1n.png" alt="Monitoring, observability and inferencing" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Inferencing — Observability plus AI&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I'd argue the next step after observability is Inferencing — where a platform can reasonably explain why an error occurred, so we can fix it. This becomes possible now in 2023 with the rapid evolution of AI models over the last few months.&lt;/p&gt;

&lt;p&gt;Imagine a solution that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically surfaces just the errors that need immediate developer attention.&lt;/li&gt;
&lt;li&gt;Tells the developer exactly what is causing the issue and where the issue is: this pod, this server, this code path, this line of code, for this type of request.&lt;/li&gt;
&lt;li&gt;Guides the developer on how to fix it.&lt;/li&gt;
&lt;li&gt;Uses the developer's actual actions to improve its recommendations continuously.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is some early activity in this space, including with companies like ZeroK, but this is an open space as yet and we can expect several new companies to emerge here over the next couple of years.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Avoiding the pitfalls of AIOps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In any conversation around AI + observability, it’s important to remember that this has been attempted before with AIOps, with limited success. To understand why, read -AIOps Is Dead.&lt;/p&gt;

&lt;p&gt;It will be important for inferencing solutions to avoid the pitfalls of AIOps. To do that, inferencing solutions would have to be architected ground-up for the AI use-case i.e., data collection, processing, storage, and user interface are all designed ground-up for root-causing issues using AI.&lt;/p&gt;

&lt;p&gt;What it will probably NOT look like, is AI added on top of existing observability tools and existing observability data, simply because that is what we attempted and failed with AIOPs.&lt;/p&gt;

&lt;p&gt;See here for a more detailed exploration of what AI-based Inferencing solutions will look like.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We explored monitoring and observability and how they differ. We looked at how observability is poorly defined today with loose boundaries, which results in uncontrolled data, tool, and spend sprawl. Meanwhile, the latest progress in AI could resolve some of the issues we have with observability today with a new class of Inferencing solutions based on AI. Watch this space for more on this topic!&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>observability</category>
      <category>distributedsystems</category>
      <category>aiops</category>
    </item>
    <item>
      <title>Distributed Tracing - Past, Present and Future</title>
      <dc:creator>Samyukktha</dc:creator>
      <pubDate>Wed, 14 Jun 2023 17:15:53 +0000</pubDate>
      <link>https://forem.com/samyukktha/distributed-tracing-past-present-and-future-335c</link>
      <guid>https://forem.com/samyukktha/distributed-tracing-past-present-and-future-335c</guid>
      <description>&lt;p&gt;Distributed Tracing is a divisive topic. Once the &lt;a href="https://www.youtube.com/watch?v=n8mUiLIXkto"&gt;doyen of every KubeCon&lt;/a&gt;, the technology was expected to revolutionize observability.&lt;/p&gt;

&lt;p&gt;Fast forward 5 years, the hype has subsided somewhat, there's a &lt;a href="https://www.youtube.com/watch?v=Q5Vf8bpTDlI"&gt;lot more talk about the pain&lt;/a&gt;, and adoption is moderate. Meanwhile, there continues to be steady activity around expanding and standardizing the technology - Open Telemetry (based on OpenTracing) is the &lt;a href="https://www.cncf.io/blog/2023/01/11/a-look-at-the-2022-velocity-of-cncf-linux-foundation-and-top-30-open-source-projects/"&gt;2nd largest CNCF project&lt;/a&gt; after Kubernetes. So what is the deal with Distributed Tracing? Should one implement it right away or wait and watch? In this article, let's explore Distributed Tracing in depth -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; What is special about Distributed Tracing and why do we need it?&lt;/li&gt;
&lt;li&gt; What are the problems with distributed tracing today?&lt;/li&gt;
&lt;li&gt; What are upcoming developments and how do they address existing challenges?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introduction - How Distributed Tracing Works
&lt;/h2&gt;

&lt;p&gt;For the uninitiated, Distributed Tracing is a technology that allows us to track a single request as it traverses several different components/ microservices of a distributed environment. Each network call made in the request's path is captured and represented as a span.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TRHK0QVS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/wgho26L.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TRHK0QVS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/wgho26L.png" alt="Why we need distributed tracing" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why we need distributed tracing&lt;/p&gt;

&lt;p&gt;To enable this, distributed tracing tools insert a unique trace context (trace ID) into each request's header and implement mechanisms to ensure that the trace context is propagated throughout the request path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LFH3AY9M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/pu2kNvx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LFH3AY9M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/pu2kNvx.png" alt="How a distributed trace represents a request path " width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How a distributed trace represents a request path&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we need Distributed Tracing in the first place
&lt;/h2&gt;

&lt;p&gt;Distributed tracing is unique because it focuses on a &lt;em&gt;request&lt;/em&gt; as the unit for observability. In a monitoring/ metrics platform, a &lt;em&gt;component&lt;/em&gt; (e.g., a service, host) is the fundamental unit that is being observed. One can ask these platforms questions about the behavior of this unit as a whole, over time. For example, what is this service's health/ throughput /error rate in a specific timeframe?&lt;/p&gt;

&lt;p&gt;With logs, the fundamental unit being observed is an &lt;em&gt;event&lt;/em&gt; - e.g., whenever an event occurs during code execution, print some information. These "events" are subjectively defined by developers while writing code. The challenge with logs is that they are all disjointed, with each component printing its own form of log messages in isolation, with no easy way to connect them together to make sense.&lt;/p&gt;

&lt;p&gt;In contrast, with distributed tracing what is being observed is a single request as it traverses several components. This allows us to ask questions about the distributed system as a whole and understand what occurred where in a complex, interconnected system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s8K-BqZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/4F5xRCO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s8K-BqZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/4F5xRCO.png" alt="View across metrics, logs and distributed tracing" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;View across metrics, logs, and distributed tracing&lt;/p&gt;

&lt;p&gt;The basic case for distributed tracing lies in the argument that this orientation around requests is the &lt;em&gt;closest to the end user's experience&lt;/em&gt;. And as a result, it is also the most intuitive for how we'd like to examine and troubleshoot distributed architectures.&lt;/p&gt;

&lt;h2&gt;
  
  
  The evolution of Distributed Tracing
&lt;/h2&gt;

&lt;p&gt;Distributed Tracing has risen in importance due to the widespread adoption of distributed software architectures in the last decade.&lt;/p&gt;

&lt;p&gt;The modern microservices-based architecture is an evolution from the late 90s internet growth story, when it became common to use &lt;em&gt;request-response&lt;/em&gt; systems.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"With the late 90s and explosive growth of the internet, came the huge proliferation of &lt;em&gt;request-response systems&lt;/em&gt;, such as two-tier websites, with a web server frontend and a database backend... Requests were a new dimension for reasoning about systems, orthogonal to any one machine or process in aggregate."&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Distributed Tracing in Practice, O'Reilly Media&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In these microservices architectures, every single request ends up hitting many (10s or even 100s of microservices), making several network calls in between. Refer below for Uber's microservices architecture, which has 3000+ services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ppgElaHD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_8146a7a13e184f46b5939db45c58dca8%257Emv2.png/v1/fill/w_614%2Ch_523%2Cal_c%2Clg_1%2Cq_85%2Cenc_auto/ae6199_8146a7a13e184f46b5939db45c58dca8%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ppgElaHD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_8146a7a13e184f46b5939db45c58dca8%257Emv2.png/v1/fill/w_614%2Ch_523%2Cal_c%2Clg_1%2Cq_85%2Cenc_auto/ae6199_8146a7a13e184f46b5939db45c58dca8%257Emv2.png" alt="Uber's microservices architecture image from Jaeger" width="614" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Uber's microservices architecture from 2018. Source: &lt;a href="https://www.uber.com/en-IN/blog/microservice-architecture/"&gt;https://www.uber.com/en-IN/blog/microservice-architecture/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In such complex systems, distributed tracing becomes critical for any form of troubleshooting. As a result, Distributed Tracing was pioneered by large companies that were early adopters using large, complex, distributed environments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Google's Dapper paper released in 2010 was the beginning of distributed tracing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the next few years, two more companies open-sourced their own distributed tracing systems (Twitter open-sourced Zipkin in 2012 and Uber open-sourced Jaeger in 2017). Zipkin and Jaeger continue to be among the most popular distributed tracing tools even today&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since 2016, there has been a significant effort to standardize distributed tracing across components through the OpenTracing project. OpenTracing eventually became &lt;a href="https://opentelemetry.io/"&gt;OpenTelemetry&lt;/a&gt; in 2019. OpenTelemetry is widely popular and has thousands of contributors globally&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now Distributed Tracing is widely regarded as the third "pillar" of observability alongside metrics and logs. Most major monitoring and observability players provide distributed tracing tools as part of their products.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  State of Distributed Tracing: Theory vs Reality
&lt;/h2&gt;

&lt;p&gt;However, despite the promise, excitement, and community effort, the adoption of distributed tracing today is around ~25%. It is not uncommon to find companies on microservices architectures who are making do with logs and metrics, even though they clearly need distributed tracing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5oron_TV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_5cabb9f67fb24b69a3ee9ab467b6748e%257Emv2.png/v1/fill/w_1480%2Ch_748%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_5cabb9f67fb24b69a3ee9ab467b6748e%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5oron_TV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_5cabb9f67fb24b69a3ee9ab467b6748e%257Emv2.png/v1/fill/w_1480%2Ch_748%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_5cabb9f67fb24b69a3ee9ab467b6748e%257Emv2.png" alt="Distributed Tracing adoption" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Distributed Tracing adoption&lt;/p&gt;

&lt;p&gt;At the same time, Mean-Time-To-Resolve production errors are going up in the world today. &lt;a href="https://logz.io/devops-pulse-2023/#increasing_mttr"&gt;73% of companies report it takes over an hour&lt;/a&gt; to resolve production issues today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--voDtF7sU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_e6cb3b704d3a4f40a2230c9eb9591ae6%257Emv2.png/v1/fill/w_1480%2Ch_716%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_e6cb3b704d3a4f40a2230c9eb9591ae6%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--voDtF7sU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_e6cb3b704d3a4f40a2230c9eb9591ae6%257Emv2.png/v1/fill/w_1480%2Ch_716%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_e6cb3b704d3a4f40a2230c9eb9591ae6%257Emv2.png" alt="Increasing production MTTRs" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Increasing production MTTRs&lt;/p&gt;

&lt;p&gt;Ask any developer what the most painful moments in their life are and they'll talk about time spent debugging a Sev-1 error in production with what seemed like a few hundred people breathing down their neck.&lt;/p&gt;

&lt;p&gt;Seems then, that any company that cares about its MTTR (which is nearly every company) should be using distributed tracing, and the adoption should have skyrocketed in this environment. But the actual numbers do not support that - so what gives?&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges with Distributed Tracing today
&lt;/h2&gt;

&lt;p&gt;There are several problems with distributed tracing today that companies have to overcome to get value - all of which don't get discussed as widely in the mainstream narrative.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Implementation is hard!
&lt;/h2&gt;

&lt;p&gt;To implement distributed tracing in a service today, we need to make a code change and a release. While making code changes is a common-enough ask for observability, the challenge specifically with distributed tracing is this - e*very service or component* needs to be instrumented to get a distributed trace, or the trace breaks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z4DoW45Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/SMolra1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z4DoW45Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/SMolra1.png" alt="Distributed Tracing instrumentation" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each service has to be instrumented with an agent&lt;/p&gt;

&lt;p&gt;One cannot just get started with a single service - as one can with monitoring or logging - and realize value. Distributed tracing requires instrumentation across a &lt;em&gt;collective set of services&lt;/em&gt; to generate usable traces.&lt;/p&gt;

&lt;p&gt;This requires coordination across several teams and service owners to make changes in their services. So it becomes an organizational problem- imagine getting 100s of teams to instrument their services over several months before you can realize value.&lt;/p&gt;

&lt;p&gt;This is the biggest challenge with distributed tracing today.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Need for complex sampling decisions
&lt;/h2&gt;

&lt;p&gt;Next, the volume of trace data generated by Distributed Tracing can be overwhelming. Imagine hundreds of services each emitting a small amount of trace data for &lt;em&gt;every single request&lt;/em&gt;. This is going to be millions of requests per second, and makes distributed tracing expensive both in terms of storage and network bandwidth.&lt;/p&gt;

&lt;p&gt;While logging also does the same thing (and emits &lt;em&gt;more data&lt;/em&gt; per request, which is then managed by massive log aggregation tools), the difference is that most companies today &lt;em&gt;already have&lt;/em&gt; logging. Introducing one more data type which is going to be almost as voluminous as logging is a daunting task and will likely double the spend.&lt;/p&gt;

&lt;p&gt;To handle this problem of cost, all distributed tracing systems today use &lt;a href="https://www.jaegertracing.io/docs/1.45/sampling/"&gt;sampling&lt;/a&gt; and record only a subset of traces. The common sampling rates in practice today are between 0.1% to 2%. The rationale is that even 1% of samples are sufficient to give a decent aggregate picture of where the performance bottlenecks are.&lt;/p&gt;

&lt;p&gt;Most platforms today let customers choose their sampling strategy and make their own cost-visibility trade-offs. However, this decision process adds to the already complex overhead of instrumenting and managing a distributed tracing system.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. But sampling meaningfully diminishes the value
&lt;/h2&gt;

&lt;p&gt;Let's assume a company goes through the effort of instrumenting every service/ component and then deciding the sampling strategy to ensure they don't break the bank.&lt;/p&gt;

&lt;p&gt;What now - should we expect MTTR to drop dramatically? No, because developers can't use distributed tracing to actually troubleshoot issues, because of sampling.&lt;/p&gt;

&lt;p&gt;Imagine a developer's experience - "I can't find the issue &lt;em&gt;I know&lt;/em&gt; is there. I generated the error, but I cannot find the corresponding trace".&lt;/p&gt;

&lt;p&gt;So what happens? Developers stop trusting the quality of distributed tracing data and revert to their regular methods for debugging/ troubleshooting (i.e., using logs)&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Developer usage is low frequency
&lt;/h2&gt;

&lt;p&gt;Given these constraints, today Distributed Tracing is primarily sold as a way to troubleshoot &lt;em&gt;performance problems&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Remember that a basic distributed trace really just tells us who called who and how long each span took. Distributed traces don't tell us &lt;em&gt;what happened within the service&lt;/em&gt; that caused the error/ high latency. For that, developers still have to look at the log message and/ or reproduce the issue locally to debug.&lt;/p&gt;

&lt;p&gt;In a typical company, performance issues are likely &amp;lt;10% of the total. So in reality, distributed tracing is only useful for this small segment of issues.&lt;/p&gt;

&lt;p&gt;The average developer who ships and owns a service is using a distributed tracing tool maybe 2-3 times a year.&lt;/p&gt;

&lt;h2&gt;
  
  
  Impact of all these challenges
&lt;/h2&gt;

&lt;p&gt;In summary -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Distributed tracing is hard to implement&lt;/li&gt;
&lt;li&gt; Distributed Tracing needs extensive sampling to control costs&lt;/li&gt;
&lt;li&gt; But sampling reduces the value considerably&lt;/li&gt;
&lt;li&gt; As a result, developers only use tracing for the odd one-off performance use case&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All this makes the RoI case for distributed tracing quite fuzzy.&lt;/p&gt;

&lt;p&gt;In a typical hype cycle, what we can say is that we are now past the stage of inflated expectations and disillusionment is beginning to settle in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6wtVMnDW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/ex5GJQU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6wtVMnDW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/ex5GJQU.png" alt="Hype cycle - Distributed Tracing" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hype cycle - Distributed Tracing&lt;/p&gt;

&lt;p&gt;If we think in terms of end-state though, if the future of computing systems is distributed, then distributed tracing is naturally the most fundamental vector for observability. In that world, any company with a distributed architecture uses tracing as the primary mechanism for troubleshooting anything occurring in production - true "observability" - vs the passive monitoring of systems we have today.&lt;/p&gt;

&lt;p&gt;Before we can get to that end-state though, we will need several improvements over the status quo. The good news is that much of this is already underway. Let's look at each of them. So what can we expect to see in the future?&lt;/p&gt;

&lt;h2&gt;
  
  
  Future of distributed tracing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Instant instrumentation with no code changes
&lt;/h3&gt;

&lt;p&gt;Imagine dropping in an agent and being able to cover an entire distributed system (all services, components) in one go without code changes.&lt;/p&gt;

&lt;p&gt;This looks realistically possible in the next 2-3 years.&lt;/p&gt;

&lt;p&gt;OpenTelemetry's &lt;a href="https://opentelemetry.io/docs/concepts/instrumentation/"&gt;auto-instrumentation libraries&lt;/a&gt; already enable this for some programming languages (however fall short in compiled languages such as Go). In parallel, &lt;a href="https://www.zerok.ai/post/how-ebpf-is-changing-observability-as-we-know-it"&gt;technologies like eBPF&lt;/a&gt; are evolving to &lt;a href="https://www.zerok.ai/post/ebpf-vs-agents-vs-sidecars"&gt;enable system-wide instrumentation with no code change&lt;/a&gt;. Between the two, we can safely expect the instrumentation problem to be solved in a few years.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sampling gives way to AI-based selection of requests-of-interest
&lt;/h3&gt;

&lt;p&gt;In an LLM world, random sampling begins to look like a relic from the dark ages. Ideally, we should be able to look at 100% of traces, identify anything that looks anomalous, and store that for future examination. No more random sampling.&lt;/p&gt;

&lt;p&gt;If we think about it, we don't really care about the ~95% "happy requests". We only care about the ~5% of anomalous traces - errors, exceptions, high latency, or some form of soft errors. So we just need a way to look at 100% and pick out the interesting 5%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EtDFHQw6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_6ae8f516dbce4a7c874000421c190658%257Emv2.png/v1/fill/w_1480%2Ch_924%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_6ae8f516dbce4a7c874000421c190658%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EtDFHQw6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_6ae8f516dbce4a7c874000421c190658%257Emv2.png/v1/fill/w_1480%2Ch_924%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_6ae8f516dbce4a7c874000421c190658%257Emv2.png" alt="Traces we care about" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Traces we care about&lt;/p&gt;

&lt;p&gt;There are mechanisms like &lt;a href="https://opentelemetry.io/docs/concepts/sampling/"&gt;tail-based sampling&lt;/a&gt; that aim to do this today. In tail-based sampling, the system waits until all the spans in a request have been completed, and then based on the full trace, decides whether it has to be retained.&lt;/p&gt;

&lt;p&gt;The main challenge with tail-based sampling is that you have to store all the spans of a trace until the whole request is completed and then decide whether to keep/ discard the trace. This means we store every single request, with all the spans, for a certain period (until the request completes) - this requires a separate data architecture with components for load-balancing, storage &amp;amp; processing which is highly complex and expensive.&lt;/p&gt;

&lt;p&gt;OpenTelemetry has a &lt;a href="https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/README.md"&gt;tail-based sampling collector&lt;/a&gt;, however, it is not yet mature and has several &lt;a href="https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/4758"&gt;scalability challenges&lt;/a&gt; (due to the problem mentioned above). Meanwhile, several companies including &lt;a href="https://www.zerok.ai/"&gt;ZeroK.ai&lt;/a&gt; are working on using AI to make anomaly detection efficient and scalable.&lt;/p&gt;

&lt;p&gt;With the fast pace of development in this space, we can reasonably expect this problem to also be solved in the next 3-5 years.&lt;/p&gt;

&lt;h3&gt;
  
  
  The emergence of "rich" distributed traces that enable all debugging
&lt;/h3&gt;

&lt;p&gt;A true leap into the next generation of tracing will be when tracing evolves from the realm of "performance issues only" to "all issues". That is when the true power of distributed tracing is unleashed.&lt;/p&gt;

&lt;p&gt;For this to be possible, each trace needs to have rich context.&lt;/p&gt;

&lt;p&gt;Imagine a scenario where each span in each trace has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request &amp;amp; response payloads (with PII masking)&lt;/li&gt;
&lt;li&gt;Stack traces for any exceptions&lt;/li&gt;
&lt;li&gt;Logs&lt;/li&gt;
&lt;li&gt;Kubernetes events&lt;/li&gt;
&lt;li&gt;Pod states&lt;/li&gt;
&lt;li&gt;And anything else that occurred along that span&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in one integrated, seamless flow.&lt;/p&gt;

&lt;p&gt;And imagine if the trace one is looking for is super easy to find - there are no sampling-related data gaps, issues are deduped &amp;amp; grouped, and can be filtered across several dimensions.&lt;/p&gt;

&lt;p&gt;This then, is all a developer needs to debug any software issue. And potentially, all an AI model needs to diagnose and point a developer to what's going wrong&lt;/p&gt;

&lt;p&gt;In this world, the trace becomes the primary axis for observability, &lt;a href="https://www.zerok.ai/post/can-distributed-tracing-replace-logging"&gt;replacing logging&lt;/a&gt;. That is what the end-state of distributed tracing could look like - while it's not here yet, it is visible from where we are today.&lt;/p&gt;

&lt;p&gt;The main barrier to making this possible is the explosion in data volume that storing all this context data will cause. We will require deep innovation in data processing and storage architectures to make this possible. It is still early days yet and we have to wait and see what happens here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In summary, Distributed Tracing is a necessary and intuitive view required for being able to observe distributed application architectures in production.&lt;/p&gt;

&lt;p&gt;The first generation of distributed tracing, while promising, has been beset by several challenges which have made it difficult for companies to get value from tracing, which has stymied adoption somewhat.&lt;/p&gt;

&lt;p&gt;However, several exciting developments are occurring in the space which are expected to make tracing easier, simpler, and more powerful than what we have today, making observability more seamless in the future.&lt;/p&gt;

</description>
      <category>distributedtracing</category>
      <category>observability</category>
    </item>
    <item>
      <title>A comparison of eBPF Observability vs Agents and Sidecars</title>
      <dc:creator>Samyukktha</dc:creator>
      <pubDate>Fri, 26 May 2023 21:44:15 +0000</pubDate>
      <link>https://forem.com/samyukktha/a-comparison-of-ebpf-observability-vs-agents-and-sidecars-3ep7</link>
      <guid>https://forem.com/samyukktha/a-comparison-of-ebpf-observability-vs-agents-and-sidecars-3ep7</guid>
      <description>&lt;p&gt;The observability landscape is witnessing a radical transformation today. The central driver of this shift is eBPF (extended Berkeley Packet Filter), a technology that is revolutionizing how we observe and monitor systems. &lt;a href="https://www.zerok.ai/post/how-ebpf-is-changing-observability-as-we-know-it"&gt;In an earlier post&lt;/a&gt;, we took a detailed look at the technology of eBPF and its implications for observability.&lt;/p&gt;

&lt;p&gt;In this article, we will compare eBPF-based instrumentation with other instrumentation methods like code agents and sidecars and see which best suits the needs of observability today.&lt;/p&gt;

&lt;p&gt;Before we dive in, let's briefly revisit eBPF.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bM5h39zI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/TyKjgX3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bM5h39zI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/TyKjgX3.png" alt="eBPF logo" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;eBPF logo&lt;/p&gt;

&lt;h2&gt;
  
  
  What is eBPF?
&lt;/h2&gt;

&lt;p&gt;eBPF is a framework in the Linux kernel that allows us to safely run sandboxed programs in the kernel space, without changing kernel source code or adding kernel modules.&lt;/p&gt;

&lt;p&gt;eBPF programs are highly efficient and secure - they undergo strict verification by the kernel to ensure they don't risk stability or security, and they are run as native machine code in the kernel so are highly performant.&lt;/p&gt;

&lt;p&gt;eBPF as a technology has existed for 25+ years and is &lt;a href="https://www.infoq.com/articles/ebpf-cloud-native-platforms/"&gt;now becoming mainstream&lt;/a&gt; with the emergence of cloud-native architectures.&lt;/p&gt;

&lt;p&gt;Companies like &lt;a href="https://engineering.linkedin.com/blog/2022/skyfall--ebpf-agent-for-infrastructure-observability"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://twitter.com/brendangregg/status/1402072818108407810?lang=en"&gt;Netflix&lt;/a&gt;, &lt;a href="https://engineering.fb.com/2018/05/22/open-source/open-sourcing-katran-a-scalable-network-load-balancer/"&gt;Facebook&lt;/a&gt; and &lt;a href="https://www.youtube.com/watch?v=7UQ2CU6UEGY"&gt;Adobe&lt;/a&gt; have been using eBPF in production for years. If you are using GKE (Google's Kubernetes offering), you're using eBPF already, as GKE's &lt;a href="https://cloud.google.com/blog/products/containers-kubernetes/bringing-ebpf-and-cilium-to-google-kubernetes-engine"&gt;networking, security, and observability&lt;/a&gt; are powered by eBPF.&lt;/p&gt;

&lt;p&gt;While eBPF has been used widely in networking (high-speed packet processing) and security historically, it is recently gaining traction in observability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to eBPF observability
&lt;/h2&gt;

&lt;p&gt;The premise for eBPF in observability is straightforward.&lt;/p&gt;

&lt;p&gt;eBPF operates at the kernel level, and as everything eventually goes through the kernel, one can technically observe everything from this vantage point.&lt;/p&gt;

&lt;p&gt;So eBPF provides a new way to instrument for telemetry. Other components of a typical observability solution like data processing, storage, and visualization are unaffected by eBPF.&lt;/p&gt;

&lt;p&gt;eBPF opens up new visibility into system and application behavior that was previously difficult to achieve, such as low-overhead profiling, system call tracing, and deep visibility into network traffic. As a result, eBPF is pushing the boundaries of what is possible in observability and providing tools to understand, optimize, and troubleshoot systems like never before.&lt;/p&gt;

&lt;p&gt;So how does eBPF-based instrumentation compare with existing instrumentation mechanisms? For that, let's look at the commonly used instrumentation techniques today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent-based instrumentation: The Old Guard
&lt;/h2&gt;

&lt;p&gt;Agent-based methods have been the mainstay for system monitoring and observability for years. They work by installing an agent (software SDK/ library) on every node, microservice, or infrastructure component that needs monitoring. These agents collect data and send it back to a central location for analysis.&lt;/p&gt;

&lt;p&gt;While this method provides deep visibility, it comes with its challenges. The installation of agents is time-consuming, requires code changes, and the agents can induce a performance overhead. There are also potential security issues and the agents need to be meticulously screened for safety.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sidecar-based Instrumentation: The Microservices accessory
&lt;/h2&gt;

&lt;p&gt;With the rise of microservices architecture, sidecar-based instrumentation emerged as an alternative mechanism for instrumentation. Sidecars are lightweight, independent processes that run alongside an application or service. In this setup, a sidecar proxy (e.g., &lt;a href="https://www.envoyproxy.io/"&gt;envoy&lt;/a&gt;) is attached to each service, acting as a shared module for monitoring tasks and can see everything going in and out of a service.&lt;/p&gt;

&lt;p&gt;Sidecars are easier to implement compared to agents (no code changes). However, they can be resource-intensive, leading to increased CPU and memory usage. Additionally, updating sidecars often requires service restarts, which may not be ideal for always-on services.&lt;/p&gt;

&lt;h2&gt;
  
  
  eBPF-based Instrumentation: The new kid on the Block
&lt;/h2&gt;

&lt;p&gt;Enter eBPF, a technology that has been around for a while in the networking and security space but has recently gained traction in observability.&lt;/p&gt;

&lt;p&gt;eBPF operates at the kernel level making it possible to observe system, infrastructure and application behavior from one place. eBPF programs can be dropped into the kernel without any code changes or releases. Moreover, they are non-intrusive, causing no impact on running workloads, and are checked for safety before execution, providing an added layer of security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges with existing instrumentation methods
&lt;/h2&gt;

&lt;p&gt;The traditional code agent-based model is the most widely used - almost all observability solutions in the market today use agents. However, it has become unwieldy in modern distributed environments that have hundreds of services and hosts.&lt;/p&gt;

&lt;p&gt;In the agent world, each service/ host is instrumented separately with an agent, requiring a release/ restart. And for every maintenance update, this process is repeated for every component - dramatically increasing human overhead.&lt;/p&gt;

&lt;p&gt;The Sidecar proxy-based model was once expected to emerge as a viable alternative to agents due to the ease of implementation (no code changes). However, they still require restarts and add performance overhead, &lt;a href="https://matt-rickard.com/agent-vs-agentless"&gt;dampening the enthusiasm&lt;/a&gt; around sidecars, and the sidecar wave seems to be crashing before even taking off.&lt;/p&gt;

&lt;p&gt;Meanwhile, eBPF is emerging as the more performant, secure, scalable, and easy-to-implement alternative to sidecars in distributed environments (&lt;a href="https://www.youtube.com/watch?v=7ZVQSg9HX68"&gt;Is eBPF the end of Kubernetes sidecars?&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Let us evaluate these 3 types of instrumentation a bit more closely&lt;/p&gt;

&lt;h2&gt;
  
  
  eBPF vs agents vs Sidecars - a comprehensive assessment
&lt;/h2&gt;

&lt;p&gt;First, what are the considerations around which we want to evaluate? What factors do we care about? Let's start with the following -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Data visibility/ granularity&lt;/strong&gt; - what types of observability data can be obtained?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Intrusiveness -&lt;/strong&gt; Is data collection inline of a running workload being or out-of-band?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Performance overhead&lt;/strong&gt; - what are the additional resource requirements and impact on running workloads?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Safety and security&lt;/strong&gt; - what are the guardrails around security, given these are added to production workloads?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Ease of implementation&lt;/strong&gt; - how easy is it to get started?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Ease of maintenance and updates&lt;/strong&gt; - what do maintenance and updates involve?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Scalability&lt;/strong&gt; - In high-scale systems, how does the instrumentation method perform in all of the parameters above?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that we have the criteria, let us compare the 3 instrumentation methods against each of the above. See below&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;eBPF&lt;/th&gt;
&lt;th&gt;Agents&lt;/th&gt;
&lt;th&gt;Sidecars&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Data Visibility/Granuality&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt; (but some gaps)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Intrusiveness&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Low&lt;/strong&gt; (out of band)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt; (inline)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt; (inline)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Performance overhead&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Safety and Security&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Ease of implementation&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. Ease of maintenance and updates&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7. Scalability&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;eBPF vs Code agents vs Sidecars: Comparison&lt;/p&gt;

&lt;p&gt;Based on our assessment, eBPF appears to outperform other instrumentation methods across nearly all parameters. Let us dive deeper and see how.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data visibility/ granularity
&lt;/h2&gt;

&lt;p&gt;The most important question with an instrumentation method is - what type of observability data can I get through this? How deep and wide can I go?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;eBPF:&lt;/strong&gt; Unparalleled visibility into infrastructure and network behavior. Can also provide visibility into application behavior. Custom metrics can be implemented through custom probes without restarts or code changes. The unique vantage point of the kernel opens up additional use cases like low overhead continuous profiling and &lt;a href="https://www.cncf.io/blog/2021/11/17/debugging-with-ebpf-part-1-tracing-go-function-arguments-in-prod/"&gt;live debugging&lt;/a&gt;. While the coverage is broad, the gap today is primarily in distributed tracing (&lt;a href="https://github.com/deepflowio/deepflow"&gt;possible&lt;/a&gt;, but still not mature) and seeing rapid innovation by the community.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent&lt;/strong&gt;: Agents provide comprehensive coverage of application behavior. Written in the same language as the application they monitor, agents provide deep visibility into application code execution and metrics. Agents written separately for infrastructure components provide visibility into infra. metrics. However agents fall short in network observability (e.g., visibility into network events and network packets), and system visibility (e.g., visibility into system calls or kernel data structures).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy&lt;/strong&gt;: Sidecar proxies can provide basic application metrics like latency, error rates, and throughput. They can even implement distributed tracing and access logs. However, they do not provide infrastructure visibility. They also do not have code-level visibility.&lt;/p&gt;

&lt;p&gt;See below for a summary of how the 3 mechanisms fare in providing visibility into common observability data types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c1mppc2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_da5d90b9c65b44e4852bba02a2c4ea2f%257Emv2.png/v1/fill/w_1480%2Ch_772%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_da5d90b9c65b44e4852bba02a2c4ea2f%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c1mppc2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_da5d90b9c65b44e4852bba02a2c4ea2f%257Emv2.png/v1/fill/w_1480%2Ch_772%2Cal_c%2Cq_90%2Cusm_0.66_1.00_0.01%2Cenc_auto/ae6199_da5d90b9c65b44e4852bba02a2c4ea2f%257Emv2.png" alt="Obervability data types available throuth eBPF, sidecars and code agents" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Observability data types available&lt;/p&gt;

&lt;h2&gt;
  
  
  Intrusiveness
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;eBPF:&lt;/strong&gt; Least intrusive. Out-of-band data collection - no impact on applications being executed. Snapshots are taken from the side as data passes through the kernel, from an isolated sandbox.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Most intrusive - agents are inline of the monitored components and are executed every time the workload is executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy:&lt;/strong&gt; Also inline of execution path, although somewhat less than agents as they don't sit within the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Overhead
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;eBPF&lt;/strong&gt;: eBPF really shines here and has the lowest performance overhead. This is because eBPF programs run as native machine code on the kernel and there is no context switching between user space and kernel space, driving &lt;a href="https://www.groundcover.com/blog/ebpf-observability-agent"&gt;near-zero overhead&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent&lt;/strong&gt;: High overhead (can range from 10-100%+) and varies widely across individual agent implementations. Operate in user space so high context-switching, plus inline so executed each time the code is executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy&lt;/strong&gt;: Fare poorest here. They are also inline of traffic and operate in user space like agents. But in addition, they add performance overhead due to the extra network hop they introduce and the resources they consume (see figure below)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DP38VsoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/WyzP9Uv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DP38VsoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/WyzP9Uv.png" alt="High performance overhead: Additional network hop introduced by sidecars" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;High performance overhead: Additional network hop introduced by sidecars&lt;/p&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;eBPF:&lt;/strong&gt; Most secure - sandboxed execution environment, which restricts eBPF programs' access to a limited set of kernel functions and resources. In addition, they undergo verification by the kernel through the eBPF verifier to ensure safety.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Code injection increases the potential attack surface, as vulnerabilities in the agent code could be exploited by malicious actors. Requires careful vetting (and management) of agent code to ensure security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy:&lt;/strong&gt; Sidecar proxies introduce additional network components, increasing the potential attack surface. However, isolation between the proxy and the application can help mitigate some security risks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ease of Installation, maintenance, and updates
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;eBPF:&lt;/strong&gt; Easiest, as eBPF agents can be dropped in directly - one agent in the kernel for all applications, infrastructure - everything in one go, without any restarts. However, the installation requires privileged access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Hardest. Agents must be installed in every service and component, which requires code changes, releases, and restarts for each service and component. It's not just the installation but the management, maintenance, and debugging of all these disparate pieces that add to the significant overhead. However, emerging &lt;a href="https://opentelemetry.io/docs/instrumentation/java/automatic/"&gt;auto-instrumentation libraries&lt;/a&gt; are looking to reduce the effort.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WrhlhFWP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/5kfOEFU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WrhlhFWP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/5kfOEFU.png" alt="Code agents vs eBPF-based instrumentation" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code agents vs eBPF-based instrumentation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy:&lt;/strong&gt; Sidecar proxies can be installed and updated with no code changes so are easier than agents. However they still require restarts, and the pod injection process can be problematic, slowing pod start-up times or causing &lt;a href="https://release-v1-1.docs.openservicemesh.io/docs/guides/troubleshooting/container_startup/"&gt;race conditions or instabilities&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scalability
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;eBPF:&lt;/strong&gt; Highly scalable, as eBPF programs can efficiently gather data from multiple sources without requiring additional agents or tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Scalability is challenging as each application component and infra host requires its own monitoring agent. This increases resource consumption and management complexity in large-scale environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidecar proxy:&lt;/strong&gt; Low scalability, as they consume additional resources for each application component. The increased resource consumption and network overhead can become significant in large-scale environments, especially when managing multiple sidecar instances.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary Pros and Cons
&lt;/h2&gt;

&lt;p&gt;In summary, eBPF-based instrumentation is significantly better than current instrumentation mechanisms -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Broad coverage - across applications and infrastructure in one go&lt;/li&gt;
&lt;li&gt;Non-intrusive - out-of-band data collection has no impact on running workloads&lt;/li&gt;
&lt;li&gt;Easy to implement and maintain&lt;/li&gt;
&lt;li&gt;Highly performant&lt;/li&gt;
&lt;li&gt;More secure&lt;/li&gt;
&lt;li&gt;More scalable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That said, there are some limitations as of today -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Distributed tracing with eBPF is not as mature&lt;/li&gt;
&lt;li&gt;Restricted to Linux environments (windows implementation is not yet mature)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're in a modern cloud-native environment (Kubernetes, microservices), that's when the difference between eBPF and the agent-based approach is most visible (performance overhead, scalability, security, ease of installation &amp;amp; maintenance, etc). This is likely one of the reasons why eBPF adoption in the last 5-6 years has been highest in scale technology companies with massive footprints.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what are the implications for observability?
&lt;/h2&gt;

&lt;p&gt;Given the significant advantages eBPF-based instrumentation offers, the next generation of observability solutions are all likely to be built with eBPF.&lt;/p&gt;

&lt;p&gt;There are already several emerging eBPF-native observability solutions, including &lt;a href="https://www.zerok.ai/"&gt;ZeroK&lt;/a&gt;. Meanwhile, traditional observability players like NewRelic and Datadog are also investing in updating their instrumentation.&lt;/p&gt;

&lt;p&gt;Over time, as eBPF becomes the default instrumentation mechanism that everyone uses, we can expect innovation in this space to shift to higher levels of the observability value chain, like data processing, advanced analytics and &lt;a href="https://www.zerok.ai/"&gt;AI&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>observability</category>
      <category>ebpf</category>
      <category>kubernetes</category>
      <category>microservices</category>
    </item>
    <item>
      <title>Decoding eBPF Observability: How eBPF transforms Observability as we know it 🕵️🐝</title>
      <dc:creator>Samyukktha</dc:creator>
      <pubDate>Mon, 22 May 2023 12:01:58 +0000</pubDate>
      <link>https://forem.com/samyukktha/decoding-ebpf-observability-how-ebpf-transforms-observability-as-we-know-it-2418</link>
      <guid>https://forem.com/samyukktha/decoding-ebpf-observability-how-ebpf-transforms-observability-as-we-know-it-2418</guid>
      <description>&lt;p&gt;There has been a lot of chatter about eBPF in cloud-native communities over the last 2 years. eBPF was a &lt;a href="https://www.youtube.com/watch?v=KhPrMW5Rbbc"&gt;mainstay&lt;/a&gt; at KubeCon, &lt;a href="https://www.youtube.com/playlist?list=PLDg_GiBbAx-lZtLQtDaoj_eoMfmGzSmxo"&gt;eBPF days&lt;/a&gt; and &lt;a href="https://ebpf.io/summit-2022.html"&gt;eBPF summits&lt;/a&gt; are rapidly growing in popularity, companies like Google and Netflix have been &lt;a href="https://ebpf.io/"&gt;using eBPF&lt;/a&gt; for years, and new use cases are emerging all the time. Especially in observability, eBPF is expected to be a game changer.&lt;/p&gt;

&lt;p&gt;So let's look at eBPF - what is the technology, how is it impacting observability, how does it compare with existing observability practices, and what might the future hold?&lt;/p&gt;



&lt;h2&gt;
  
  
  What is eBPF really?
&lt;/h2&gt;



&lt;p&gt;eBPF is a programming framework that allows us to safely run sandboxed programs in the Linux kernel without changing kernel code.&lt;/p&gt;

&lt;p&gt;It was originally developed for Linux (and it is still where the technology is most mature today), but Microsoft is rapidly evolving the &lt;a href="https://github.com/microsoft/ebpf-for-windows"&gt;eBPF implementation for Windows&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;eBPF programs are by design highly efficient and secure - they are verified by the kernel to ensure they don't risk the operating system's stability or security.&lt;/p&gt;



&lt;h2&gt;
  
  
  So why is eBPF a big deal?
&lt;/h2&gt;



&lt;p&gt;To understand this, we need to understand User space and Kernel space.&lt;/p&gt;

&lt;p&gt;User space is where all applications run. Kernel space sits between user space and the physical hardware. Applications in user space can't access hardware directly. Instead, they make system calls to the kernel, which then accesses the hardware.&lt;/p&gt;

&lt;p&gt;All memory access, file read/writes, and network traffic go through the kernel. The kernel also manages concurrent processes.&lt;/p&gt;

&lt;p&gt;Basically, everything goes through the kernel (see Figure below).&lt;/p&gt;

&lt;p&gt;And eBPF provides a safe, secure way to extend kernel functionality.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---gGlEep9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/j0jCqta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---gGlEep9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/j0jCqta.png" alt="What is user space and kernel space" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;User space and Kernel space&lt;/p&gt;

&lt;p&gt;Historically, for obvious reasons, changing anything in the kernel source code or operating systems layer has been super hard.&lt;/p&gt;

&lt;p&gt;The Linux kernel has &lt;a href="https://www.phoronix.com/news/Linux-5.12-rc1-Code-Size"&gt;30M lines of code&lt;/a&gt;, and it takes several years for any change to go from an idea to being available widely. First, the Linux community has to agree to it. Then, it has to become part of the official Linux release. Then, after a few months, it is picked up by distributions like Red Hat and Ubuntu, which take it to a wider audience.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Technically,&lt;/em&gt; one could load kernel modules to one's kernel and make changes directly, but this is &lt;em&gt;very&lt;/em&gt; high risk and involves complex kernel-level programming, so is almost universally avoided.&lt;/p&gt;

&lt;p&gt;eBPF comes along and solves this - and gives a &lt;strong&gt;secure and efficient&lt;/strong&gt; mechanism to attach and run programs in the kernel.&lt;/p&gt;

&lt;p&gt;Let's look at how eBPF ensures both security and performance.&lt;/p&gt;



&lt;h2&gt;
  
  
  Highly secure
&lt;/h2&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stringent verification&lt;/strong&gt; - Before any eBPF program can be loaded into a kernel, it is verified by the &lt;em&gt;eBPF verifier&lt;/em&gt;, which ensures the code is absolutely safe - e.g., no hard loops, invalid memory access, unsafe operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sandboxed&lt;/strong&gt; - eBPF programs are run in a memory-isolated sandbox within the kernel, separate from other kernel components. This prevents unauthorized access to kernel memory, data structures, and kernel source code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited operations&lt;/strong&gt; - eBPF programs typically have to be written in a small subset of the C language - a restricted instruction set. This limits the operations that eBPF programs can perform, reducing the risk of security vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  High-performance / lightweight
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run as native machine code&lt;/strong&gt; - eBPF programs are run as native machine instructions on the CPU. This leads to faster execution and better performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No context switches&lt;/strong&gt; - A regular application regularly context-switches between user-space and kernel-space, which is resource intensive. eBPF programs, as they run in the kernel layer, can directly access kernel data structures and resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event-driven&lt;/strong&gt; - eBPF programs typically run only in response to specific kernel events vs being always-on. This minimizes overhead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimized for hardware&lt;/strong&gt; - eBPF programs are compiled into machine code by the kernel's JIT (Just-In-Time) compiler just before execution, so the code is optimized for the specific hardware it runs on.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So eBPF provides a safe and efficient hook into the kernel for programming. And given everything goes through the kernel, this opens up several new possibilities that weren't possible until now.&lt;/p&gt;



&lt;h2&gt;
  
  
  Why is this a big deal only &lt;em&gt;now&lt;/em&gt;?
&lt;/h2&gt;



&lt;p&gt;The technology around eBPF has evolved over a long time and has been ~30 years in the making.&lt;/p&gt;

&lt;p&gt;In the last 7-8 years, eBPF has been used at scale by several large companies and now we're entering an era where the use of eBPF is becoming mainstream. See &lt;a href="https://www.youtube.com/watch?v=DAvZH13725I"&gt;this video by Alexei Starovoitov&lt;/a&gt;, the co-creator of Linux and co-maintainer of eBPF, on the evolution of eBPF.&lt;/p&gt;



&lt;h3&gt;
  
  
  eBPF - a brief history
&lt;/h3&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;1993- A &lt;a href="https://www.tcpdump.org/papers/bpf-usenix93.pdf"&gt;paper&lt;/a&gt; from Lawrence Berkeley National Lab explores using a kernel agent for packet filtering. This is where the name BPF (“Berkeley Packet Filter") comes from.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1997 - BPF is officially introduced as part of the Linux kernel (version 2.1.75).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1997-2014 - Several features are added to improve, stabilize and expand BPF capabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2014 - A significant update is introduced, called "extended Berkeley packet Filter" (eBPF). This version makes big changes to BPF technology &amp;amp; makes it more widely usable - hence the word "extended"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why this release was big, was that this made extending kernel functionality &lt;em&gt;easy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A programmer could code more or less like they would a regular application - and the surrounding eBPF infrastructure takes care of the low-level verification, security, and efficiency.&lt;/p&gt;

&lt;p&gt;An entire supporting ecosystem and scaffolding around eBPF makes this possible (see figure below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vm7xZGag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_e4010dfea3894e21ace73cd84a3a8a8d%257Emv2.png/v1/fill/w_959%2Ch_495%2Cal_c%2Cq_90%2Cenc_auto/ae6199_e4010dfea3894e21ace73cd84a3a8a8d%257Emv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vm7xZGag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.wixstatic.com/media/ae6199_e4010dfea3894e21ace73cd84a3a8a8d%257Emv2.png/v1/fill/w_959%2Ch_495%2Cal_c%2Cq_90%2Cenc_auto/ae6199_e4010dfea3894e21ace73cd84a3a8a8d%257Emv2.png" alt="eBPF ecosystem and stack" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://ebpf.io/what-is-ebpf/"&gt;https://ebpf.io/what-is-ebpf/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even better, eBPF programs could be loaded and unloaded from the kernel without any restarts.&lt;/p&gt;

&lt;p&gt;All this suddenly allowed for widespread adoption and application.&lt;/p&gt;



&lt;h2&gt;
  
  
  Widespread adoption in production systems
&lt;/h2&gt;



&lt;p&gt;eBPF's popularity has exploded in the last 7-8 years, with several large companies using it in scale production systems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;By 2016, Netflix was using eBPF widely for tracing. &lt;a href="https://www.brendangregg.com/"&gt;Brendan Gregg&lt;/a&gt;, who implemented it, became widely known in infrastructure &amp;amp; operations circles as an authority on eBPF.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2017 - Facebook open-sourced &lt;a href="https://engineering.fb.com/2018/05/22/open-source/open-sourcing-katran-a-scalable-network-load-balancer/"&gt;Katran&lt;/a&gt;, their eBPF-based load balancer. Every single packet to &lt;a href="http://facebook.com/"&gt;Facebook.com&lt;/a&gt; since 2017 has passed through eBPF.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2020- Google made eBPF part of its Kubernetes offering. eBPF now powers the &lt;a href="https://cloud.google.com/blog/products/containers-kubernetes/bringing-ebpf-and-cilium-to-google-kubernetes-engine"&gt;networking, security, and observability layer&lt;/a&gt; of GKE. By now there's also broad enterprise adoption in companies like &lt;a href="https://www.youtube.com/watch?v=hwOpCKBaJ-w"&gt;Capital One&lt;/a&gt; and &lt;a href="https://www.youtube.com/watch?v=7UQ2CU6UEGY"&gt;Adobe&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2021 - Facebook, Google, Netflix, Microsoft &amp;amp; Isovalent came together to announce the &lt;a href="https://isovalent.com/blog/post/2021-08-ebpf-foundation-announcement/"&gt;eBPF foundation&lt;/a&gt; to manage the growth of eBPF technology.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now there are thousands of companies using eBPF and hundreds of eBPF projects coming up each year exploring different use cases.&lt;/p&gt;

&lt;p&gt;eBPF is now a separate subsystem within the Linux kernel with a wide community to support it. The technology itself has expanded considerably with several new additions.&lt;/p&gt;



&lt;h2&gt;
  
  
  So what can we do with eBPF?
&lt;/h2&gt;



&lt;p&gt;The most common use cases for eBPF are in 3 areas -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Networking&lt;/li&gt;
&lt;li&gt; Security&lt;/li&gt;
&lt;li&gt; Observability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Security and networking have seen wider adoption and application, fuelled by projects like &lt;a href="https://github.com/cilium/cilium"&gt;Cilum&lt;/a&gt;. In comparison, eBPF-based observability offerings are earlier in their evolution and just getting started.&lt;/p&gt;

&lt;p&gt;Let's look at the use cases in security and networking first.&lt;/p&gt;



&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;



&lt;p&gt;Security is a highly popular use case for eBPF. Using eBPF, programs can observe everything happening at the kernel level, process events at a high speed to check for unexpected behavior, and raise alerts much more rapidly than otherwise.&lt;/p&gt;

&lt;p&gt;For example -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=l8jZ-8uLdVU"&gt;Google&lt;/a&gt; uses eBPF for intrusion detection at scale&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=6pVci31Mb6Q"&gt;Shopify&lt;/a&gt; uses eBPF to implement container security&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Several &lt;a href="https://www.traceable.ai/blog-post/ebpf-and-api-security-with-traceable"&gt;third-party security offerings&lt;/a&gt; now use eBPF for data gathering and monitoring.&lt;/p&gt;



&lt;h2&gt;
  
  
  Networking
&lt;/h2&gt;



&lt;p&gt;Networking is another widely applied use case. Being at the eBPF layer allows for comprehensive network observability, like visibility into the full network path including all hops, along with source and destination IP. With eBPF programs, one can process high-volume network events and manipulate network packets directly within the kernel with very low overhead.&lt;/p&gt;

&lt;p&gt;This allows for various networking use cases like load balancing, DDoS prevention, Traffic shaping, and Quality of Service (QoS).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://legacy.netdevconf.info/2.1/session.html?bertin"&gt;Cloudflare&lt;/a&gt; uses eBPF to detect and prevent DDoS attacks, processing &lt;a href="https://blog.cloudflare.com/how-to-drop-10-million-packets/"&gt;10M packets per second&lt;/a&gt; without impacting network performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Meta's eBPF-based &lt;a href="https://engineering.fb.com/2018/05/22/open-source/open-sourcing-katran-a-scalable-network-load-balancer/"&gt;Katran&lt;/a&gt; does load-balancing for all of Facebook&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Observability
&lt;/h2&gt;



&lt;p&gt;By now it must be straightforward how eBPF can be useful in Observability.&lt;/p&gt;

&lt;p&gt;Everything passes through the kernel. And eBPF provides a highly performant and secure way to observe everything from the kernel.&lt;/p&gt;

&lt;p&gt;Let us dive deeper into observability and look at the implications of this technology.&lt;/p&gt;



&lt;h2&gt;
  
  
  How exactly does eBPF impact Observability?
&lt;/h2&gt;



&lt;p&gt;To explore this, let's step out of the eBPF universe and into the Observability universe and look at what makes up our standard observability solution.&lt;/p&gt;

&lt;p&gt;Any observability solution has 4 major components -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data collection&lt;/strong&gt; - Getting telemetry data from applications and infrastructure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data processing&lt;/strong&gt; - Filtering, indexing, and performing computations on the collected data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data storage&lt;/strong&gt; - Short-term and long-term storage of data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User experience layer&lt;/strong&gt; - Determining how data is consumed by the user&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of this, what eBPF impacts (as of today), is really just the data collection layer - the easy gathering of telemetry data directly from the kernel using eBPF.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7tceJoND--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/RSejSrJ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7tceJoND--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/RSejSrJ.png" alt="eBPF impact on observability" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;eBPF - Impact on observability&lt;/p&gt;

&lt;p&gt;So what we mean when we say "eBPF observability" today, is using eBPF as the instrumentation mechanism to gather telemetry data, instead of using other methods of instrumenting. Other components of an observability solution remain unaffected.&lt;/p&gt;



&lt;h2&gt;
  
  
  How eBPF Observability works
&lt;/h2&gt;



&lt;p&gt;To fully understand the underlying mechanisms behind eBPF observability, we need to understand the concept of hooks.&lt;/p&gt;

&lt;p&gt;As we saw earlier, eBPF programs are primarily event-driven - i.e., they are triggered any time a specific event occurs. For example, every time a function call is made, an eBPF program can be called to capture some data for observability purposes.&lt;/p&gt;

&lt;p&gt;First, these hooks can be in kernel space or user space. So eBPF can be used to monitor both user space applications as well as kernel-level events.&lt;/p&gt;

&lt;p&gt;Second, these hooks can either be pre-determined/ static or inserted dynamically into a running system (without restarts!)&lt;/p&gt;

&lt;p&gt;Four distinct eBPF mechanisms allow for each of these (see figure below)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Predetermined/Manual&lt;/th&gt;
&lt;th&gt;Dynamic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kernel&lt;/td&gt;
&lt;td&gt;Kernel tracepoints&lt;/td&gt;
&lt;td&gt;kprobes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Userspace&lt;/td&gt;
&lt;td&gt;USDT&lt;/td&gt;
&lt;td&gt;uprobes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Static and dynamic eBPF hooks into user space and kernel space&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kernel tracepoints&lt;/strong&gt; - used to hook into events pre-defined by kernel developers (with TRACE_EVENT macros)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;USDT&lt;/strong&gt; - used to hook into predefined tracepoints set by developers in application code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kprobes&lt;/strong&gt; (Kernel Probes) - used to dynamically hook into any part of the kernel code at runtime&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Uprobes&lt;/strong&gt; (User Probes) - used to dynamically hook into any part of a user-space application at runtime&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are several pre-defined hooks in the kernel space that one can easily attach an eBPF program to (e.g., system calls, function entry/ exit, network events, kernel tracepoints). Similarly in the user space, many language runtimes, database systems, and software stacks expose predefined hooks for Linux BCC tools that eBPF programs can hook into.&lt;/p&gt;

&lt;p&gt;But what's more interesting is kprobes and uprobes. What if something is breaking in production and I do not have sufficient information and I want to dynamically add instrumentation at runtime? That is where kprobes and uprobes allow for powerful observability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sFqos6TP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/k2fswDB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sFqos6TP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/k2fswDB.png" alt="How eBPF kprobes and uprobes work " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;eBPF kprobes and uprobes&lt;/p&gt;

&lt;p&gt;For example, using uprobes, one can hook into a specific function within an application without modifying the application's code, &lt;em&gt;at runtime&lt;/em&gt;. Whenever the function is executed, an eBPF program can be triggered to capture required data. This allows for exciting possibilities like &lt;a href="https://www.cncf.io/blog/2021/11/17/debugging-with-ebpf-part-1-tracing-go-function-arguments-in-prod/"&gt;live&lt;/a&gt; debugging.&lt;/p&gt;

&lt;p&gt;Now that we know how observability with eBPF works, let's look at use cases.&lt;/p&gt;



&lt;h2&gt;
  
  
  eBPF Observability use cases
&lt;/h2&gt;



&lt;p&gt;eBPF can be used for almost all common existing observability use-cases, and in addition opens up new possibilities.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System and Infrastructure Monitoring:&lt;/strong&gt; eBPF allows for deep monitoring of system-level events such as CPU usage, memory allocation, disk I/O, and network traffic. For example, &lt;a href="https://engineering.linkedin.com/blog/2022/skyfall--ebpf-agent-for-infrastructure-observability"&gt;LinkedIn uses eBPF for all their infra monitoring&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Container and Kubernetes Monitoring:&lt;/strong&gt; Visibility into Kubernetes-specific metrics, resource usage, and health of individual containers and pods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application Performance Monitoring (APM):&lt;/strong&gt; Fine-grained observability into user-space applications and visibility into application throughput, error rates, latency, and traces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Custom Observability:&lt;/strong&gt; Visibility into custom metrics specific to applications or infra that may not be easily available without writing custom code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced Observability:&lt;/strong&gt; eBPF can be used for advanced observability use cases such as &lt;a href="https://developers.redhat.com/articles/2023/02/13/how-debugging-go-programs-delve-and-ebpf-faster#the_flow_of_tracing_and_debugging_using_ebpf"&gt;live debugging&lt;/a&gt;, &lt;a href="https://www.youtube.com/watch?v=W7ja3jKd6EA"&gt;low-overhead application profiling&lt;/a&gt;, and &lt;a href="https://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html"&gt;system call tracing&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are new applications of eBPF in Observability emerging every day.&lt;/p&gt;

&lt;p&gt;What does this mean for how observability is done today? Is eBPF likely to replace existing forms of instrumentation? Let's compare with existing options.&lt;/p&gt;



&lt;h2&gt;
  
  
  eBPF vs existing instrumentation methods
&lt;/h2&gt;



&lt;p&gt;Today, there are two main ways to instrument applications and infrastructure for Observability, apart from eBPF.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Agent-based instrumentation:&lt;/strong&gt; Independent software SDKs/ libraries integrated into application code or infrastructure nodes to collect telemetry data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sidecar proxy-based instrumentation&lt;/strong&gt;: Sidecars are lightweight, independent processes that run alongside an application or service. They are popular in microservices and container-based architectures such as Kubernetes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a detailed comparison of how eBPF-based instrumentation compares against agents and sidecars, &lt;a href="https://www.zerok.ai/post/ebpf-vs-agents-vs-sidecars"&gt;see here&lt;/a&gt;. Below is a summary view -&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;eBPF&lt;/th&gt;
&lt;th&gt;Agents&lt;/th&gt;
&lt;th&gt;Sidecars&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Data Visibility/Granuality&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt;&lt;br&gt;(but some gaps)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Intrusiveness&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Low&lt;/strong&gt;&lt;br&gt;(out-of-band)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt;&lt;br&gt;(inline)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt;&lt;br&gt;(inline)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Performance overhead&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Safety and Security&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Ease of implementation&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. Ease of maintenance and updates&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7. Scalability&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Low&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;eBPF vs agents vs sidecars: Comparison&lt;/p&gt;

&lt;p&gt;As we can see, eBPF outperforms existing instrumentation methods across nearly all parameters. There are several benefits -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Can cover everything in one go&lt;/strong&gt; (infrastructure, applications)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Less intrusive&lt;/strong&gt; - eBPF is not inline of running workloads like code agents, which run everytime the workload runs. Data collection is out-of-band and sandboxed, so there is no impact on a running system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Low performance overhead&lt;/strong&gt; - eBPF runs as native machine code and there is no context switching.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;More secure&lt;/strong&gt; - due to in-built security measures like verification.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to install&lt;/strong&gt; - can be dropped in without any code change or restarts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to maintain and update&lt;/strong&gt; - again no code change &amp;amp; restarts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;More scalable&lt;/strong&gt; - driven by easy implementation &amp;amp; maintenance, and low performance overhead&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In terms of cons, the primary gap with eBPF observability today is in distributed tracing (&lt;a href="https://github.com/deepflowio/deepflow"&gt;feasible&lt;/a&gt;, but the use case is still in early stages).&lt;/p&gt;

&lt;p&gt;In balance, given the significant advantages eBPF offers over existing instrumentation methods, we can reasonably expect that eBPF will emerge as the default next-generation instrumentation platform.&lt;/p&gt;



&lt;h2&gt;
  
  
  Implications for observability
&lt;/h2&gt;



&lt;p&gt;What does this mean for the observability industry? What changes?&lt;/p&gt;

&lt;p&gt;Imagine an observability solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;that you can drop into the kernel in 5 minutes&lt;/li&gt;
&lt;li&gt;no code change or restarts&lt;/li&gt;
&lt;li&gt;covers everything in one go - infrastructure, applications, everything&lt;/li&gt;
&lt;li&gt;has near-zero overhead&lt;/li&gt;
&lt;li&gt;is highly secure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is what eBPF makes possible. And that is the reason why there is so much excitement around the technology.&lt;/p&gt;

&lt;p&gt;We can expect the next generation of observability solutions to all be instrumented with eBPF instead of code agents.&lt;/p&gt;

&lt;p&gt;Traditional players like Datadog and NewRelic are already investing in building eBPF-based instrumentation to augment their code-based agent portfolio. Meanwhile there are several next-generation vendors built on eBPF, solving both &lt;a href="https://www.parca.dev/"&gt;niche use-cases&lt;/a&gt; and for &lt;a href="https://www.zerok.ai/"&gt;complex observability&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While traditional players had to build individual code agents language by language and for each infrastructure component over several years, the new players can get to the same degree of coverage in a few months with eBPF. This allows them to also focus on innovating higher up the value chain like data processing, user experience, and even &lt;a href="https://www.zerok.ai/"&gt;AI&lt;/a&gt;. In addition, their data processing and user experience layers are also built ground-up to support the new use cases, volumes and frequency.&lt;/p&gt;

&lt;p&gt;All this should drive a large amount of innovation in this space and make observability more seamless, secure and easy to implement over the coming years.&lt;/p&gt;



&lt;h2&gt;
  
  
  Who should use eBPF observability?
&lt;/h2&gt;



&lt;p&gt;First, if you're in a modern cloud-native environment (Kubernetes, microservices), then the differences between eBPF-based and agent-based approaches are most visible (performance overhead, security, ease of installation etc).&lt;/p&gt;

&lt;p&gt;Second, if you are operating at a large scale, then eBPF-based lightweight agents will drive dramatic improvements over status-quo. This is likely one of the reasons why eBPF adoption has been highest in technology companies with massive footprints like LinkedIn, Netflix, and Meta.&lt;/p&gt;

&lt;p&gt;Third, if you're short on tech. capacity and are looking for an observability solution that requires almost no effort to install and maintain, then go straight for an eBPF-based solution.&lt;/p&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;



&lt;p&gt;In summary, by offering a significantly better instrumentation mechanism, eBPF has the potential to fundamentally reshape our approach to observability in the years ahead.&lt;/p&gt;

&lt;p&gt;While in this article we primarily explored eBPF's application in data collection/ instrumentation, future applications could see eBPF used in data processing or even data storage layers. The possibilities are broad and as yet unexplored.&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;



&lt;ol&gt;
&lt;li&gt; &lt;a href="https://www.oreilly.com/library/view/learning-ebpf/9781098135119/ch01.html"&gt;https://www.oreilly.com/library/view/learning-ebpf/9781098135119/ch01.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://ebpf.io/"&gt;https://ebpf.io/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://ebpf.io/summit-2022.html"&gt;https://ebpf.io/summit-2022.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://github.com/microsoft/ebpf-for-windows"&gt;https://github.com/microsoft/ebpf-for-windows&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://events.linuxfoundation.org/wp-content/uploads/2022/10/elena-zannoni-tracing-tutorial-LF-2021.pdf"&gt;https://events.linuxfoundation.org/wp-content/uploads/2022/10/elena-zannoni-tracing-tutorial-LF-2021.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>observability</category>
      <category>devops</category>
      <category>ebpf</category>
    </item>
  </channel>
</rss>
