<?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: gdcohen</title>
    <description>The latest articles on Forem by gdcohen (@gdcohen).</description>
    <link>https://forem.com/gdcohen</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%2F175939%2F1d8107e9-a64c-4d9e-ada3-cbb6f45f97b7.png</url>
      <title>Forem: gdcohen</title>
      <link>https://forem.com/gdcohen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gdcohen"/>
    <language>en</language>
    <item>
      <title>3 ways ML is a Game Changer for your Incident Management Lifecycle</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Mon, 12 Apr 2021 16:55:26 +0000</pubDate>
      <link>https://forem.com/gdcohen/3-ways-ml-is-a-game-changer-for-your-incident-management-lifecycle-55md</link>
      <guid>https://forem.com/gdcohen/3-ways-ml-is-a-game-changer-for-your-incident-management-lifecycle-55md</guid>
      <description>&lt;p&gt;Any developer, SRE or DevOps engineer responsible for an application with users has felt the pain of responding to a high priority incident. There's the immediate stress of mitigating the issue as quickly as possible, often at odd hours and under severe time pressure. There's the bigger challenge of identifying root cause so a durable fix can be put in place. There's the aftermath of postmortems, reviews of your monitoring and observability solutions, and inevitable updates to alert rules. And there's the typical frustration of wondering what could have been done to avoid the problem in the first place.&lt;/p&gt;

&lt;p&gt;In a modern cloud native environment, the complexity of distributed applications and the pace of change make all of this ever harder. Fortunately, AI and ML technologies can help with these human-driven processes. Here are three specific ways:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Drastically cut incident remediation times
&lt;/h2&gt;

&lt;p&gt;The toughest incidents are ones where the symptoms are obvious, but the root cause is not. In other words, they are easy to detect, but hard to root cause -- as seen in &lt;a href="https://www.zebrium.com/blog/lessons-from-slack-gcp-and-snowflake-outages-zebrium"&gt;recent outages at GCP, Slack and Snowflake&lt;/a&gt;. SREs and engineers can spend hours digging through dashboards, traces, and inevitably -- scan&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g2z5ZVCX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/manual%2520hunting%2520for%2520root%2520cause.png%3Fwidth%3D234%26name%3Dmanual%2520hunting%2520for%2520root%2520cause.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g2z5ZVCX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/manual%2520hunting%2520for%2520root%2520cause.png%3Fwidth%3D234%26name%3Dmanual%2520hunting%2520for%2520root%2520cause.png" alt="manual hunting for root cause"&gt;&lt;/a&gt; millions of log lines. There might be clues to narrow the scope of the problem -- perhaps a set of services, containers, or hosts -- but ultimately there is a search for the unknown. Is there a new type of error? Or any unusual events? Or a significant deviation from the normal in event patterns? And when there are many of the above -- how do they relate to each other?&lt;/p&gt;

&lt;p&gt;Really experienced engineers develop instincts to help with this hunt for the unknown. But machine learning is very well suited to this problem -- it can keep tracking the evolving (but healthy) event patterns and their correlations, &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted"&gt;quickly surface unusual ones that explain root cause&lt;/a&gt;, and even &lt;a href="https://www.zebrium.com/blog/real-world-examples-of-gpt-3-plain-language-root-cause-summaries-zebrium"&gt;summarize the problem in plain language&lt;/a&gt; by matching the events against known problems in the public domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Eliminate the Alert Rule hamster wheel
&lt;/h2&gt;

&lt;p&gt;The second pain point is the need to revise and continually evolve alert rules and settings that give you early warning. While a pure approach might only monitor a narrow set of user-impacting health metrics&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H_UD3AE9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/manual%2520alert%2520rules.png%3Fwidth%3D396%26name%3Dmanual%2520alert%2520rules.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H_UD3AE9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/manual%2520alert%2520rules.png%3Fwidth%3D396%26name%3Dmanual%2520alert%2520rules.png" alt="manual alert rules"&gt;&lt;/a&gt; and symptoms, that can make it harder to identify root cause. So in reality most organizations set alerts for a blend of user facing symptoms as well as underlying health indicators (errors, latencies, reconnects, resource exhaustion etc.) After a particularly painful incident, it is natural to review and modify alerts -- adding new ones or modifying thresholds each time a new type of issue is encountered. The challenge is that as long as new types of problems continue to occur, this is a never ending game of catch up.\&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B70022JZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/ML%2520driven%2520alert%2520rules.png%3Fwidth%3D262%26name%3DML%2520driven%2520alert%2520rules.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B70022JZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/ML%2520driven%2520alert%2520rules.png%3Fwidth%3D262%26name%3DML%2520driven%2520alert%2520rules.png" alt="ML driven alert rules"&gt;&lt;/a&gt;\&lt;br&gt;
Machine learning can reduce this burden considerably. The simplest approach is to configure a set of "signals" which will trigger ML driven reports. Signals could of course be real incidents, but they could also be symptom alerts. For example, many teams watch for the overall error frequency -- if it spikes relative to recent trends, you know something is wrong, but not necessarily what. Well, you can use the same simple alert as a trigger for machine learning to scan the logs and metrics for that deployment around the time of the alert -- identifying unusual events/sequences and anomalous metrics that could explain the spike in errors. Even better, machine learning can fingerprint these sequences -- so when a particularly noteworthy root cause is detected, you already have a pre-built alert rule you can simply connect to an alert channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Proactively catch silent bugs and inform developers early in the cycle
&lt;/h2&gt;

&lt;p&gt;In the not too distant past, new releases were tested extensively before deploying to production. This allowed for deliberately constructed test plans, stress tests and an opportunity to catch bugs that might&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VotKfmXF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/proactive%2520detection%2520of%2520incidents.png%3Fwidth%3D234%26name%3Dproactive%2520detection%2520of%2520incidents.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VotKfmXF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/proactive%2520detection%2520of%2520incidents.png%3Fwidth%3D234%26name%3Dproactive%2520detection%2520of%2520incidents.png" alt="proactive detection of incidents"&gt;&lt;/a&gt; have potentially nasty downstream consequences. Today, deployment cycles are much faster, drastically shrinking the time to do any of the above. There is now a trend towards "test in production". Although many teams do use staging environments and approaches like chaos tools, it's more likely that subtle bugs will only surface in production when they result in user complaints or visible symptoms.&lt;/p&gt;

&lt;p&gt;By using ML to surface new or unusual errors, event patterns and patterns in the metrics, machine learning can quickly become a developer's best friend in proactively surfacing subtle bugs early, before they impact users. For instance, using our own ML technology, the Zebrium engineering team recently caught a bug related to a malformed middleware SQL query, that under certain conditions prevented users from completing their intended workflow. Another example involved an exception that was handled in a try/catch block which emitted an error log message but was otherwise silently breaking outbound webhook notifications. Our developers have come to appreciate the proactive detection from our internal Zebrium service to catch these kinds of bugs early, before they can do real damage.&lt;/p&gt;

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

&lt;p&gt;As more users rely on software applications, the pressure to shrink MTTR and the stress of troubleshooting incidents under pressure all grow proportionally. Over the last decade a rich set of observability tools have emerged to help detect problems easily, but troubleshooting has remained very manual, driven by the instincts and experience of the engineer on call. New approaches that apply machine learning to tackle this problem can help by &lt;a href="https://www.zebrium.com/blog/youve-nailed-incident-detection-what-about-incident-resolution"&gt;drastically reducing MTTR&lt;/a&gt;, catching new bugs early, and reducing the manual effort involved in tasks like creating RCA reports and maintaining alert rules.&lt;/p&gt;

&lt;p&gt;If you're interested in using ML as part of your incident management lifecycle, please &lt;a href="https://www.zebrium.com/"&gt;visit Zebrium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the Author &lt;a href="https://www.zebrium.com/blog/author/ajay-singh"&gt;Ajay Singh&lt;/a&gt; @ Zebrium&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Real World Examples of GPT-3 Plain Language Root Cause Summaries</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Thu, 25 Mar 2021 18:22:15 +0000</pubDate>
      <link>https://forem.com/gdcohen/real-world-examples-of-gpt-3-plain-language-root-cause-summaries-22d8</link>
      <guid>https://forem.com/gdcohen/real-world-examples-of-gpt-3-plain-language-root-cause-summaries-22d8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MRkJv8RT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Plain%2520language%2520Root%2520Cause%2520process.png%3Fwidth%3D758%26name%3DPlain%2520language%2520Root%2520Cause%2520process.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MRkJv8RT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Plain%2520language%2520Root%2520Cause%2520process.png%3Fwidth%3D758%26name%3DPlain%2520language%2520Root%2520Cause%2520process.png" alt="Plain language Root Cause process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few weeks ago, &lt;a href="http://twitter.com/stochastimus"&gt;Larry&lt;/a&gt; our CTO, wrote about a new beta feature leveraging the GPT-3 language model - &lt;a href="https://www.zebrium.com/blog/using-gpt-3-with-zebrium-for-plain-language-incident-root-cause-from-logs"&gt;Using GPT-3 for plain language incident root cause from logs&lt;/a&gt;. To recap -- Zebrium's unsupervised ML identifies the root cause of incidents and generates concise reports (typically between 5-20 log events) identifying the first event in the sequence (typically the root cause), worst symptom, other associated events and correlated metrics anomalies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yc3mqWn1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Root%2520cause%2520report%2520summary-1.png%3Fwidth%3D2018%26name%3DRoot%2520cause%2520report%2520summary-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yc3mqWn1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Root%2520cause%2520report%2520summary-1.png%3Fwidth%3D2018%26name%3DRoot%2520cause%2520report%2520summary-1.png" alt="Root cause report summary-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As Larry pointed out, this works well for developers who are familiar with the logs, but can be hard to digest if an SRE or frontline ops engineer isn't familiar with the application internals. The GPT-3 integration allows us to take the next step -- distill these root cause reports down to concise natural language summaries by scanning the entire internet for occurrences of a similar incident, and extracting brief "English" descriptions for a user to scan.&lt;/p&gt;

&lt;p&gt;After a few weeks of beta testing this feature with a limited group, and examining results from a couple of hundred incidents, we're now ready to share some exciting results and expand access to ALL Zebrium users, even those on free trials.&lt;/p&gt;

&lt;p&gt;In a nutshell -- it works so well and in such a wide range of scenarios that we felt most users would benefit from having access to it. These summaries are both accurate and truly useful -- distilling log events into a description a frontline or experienced engineer can easily understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;First the caveats&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is still an early-stage feature for us, and there are cases where GPT-3 veers into guesswork and suggests summaries that seem related to the core RCA report, but aren't exactly right. To make sure users know this, we tag the summaries with an "EXPERIMENTAL" badge in the UI.&lt;/p&gt;

&lt;p&gt;There are also times the specific RCA report does not generate a particularly illuminating natural language summary beyond recapping the key log event(s). For instance --&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;em&gt;The first log message indicates that the node was not responding.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;The first log message is a fatal error indicating that the program detected a problem and aborted.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;The client sent a request to the server, but the server did not respond.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;The first log message shows that the *&lt;/em&gt;** task took *** ms to complete.*&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are several possible reasons for these suboptimal outcomes. One possibility is that there simply aren't enough examples of that type of issue in the public domain, so GPT-3 is responding with the closest details it can find. Another is that we haven't yet explored all the variants of prompts and options we can use with the GPT-3 model.&lt;/p&gt;

&lt;p&gt;The good news is that even when results are suboptimal, they are mostly not misleading and are easily ignored. More importantly, our ML-generated root cause summaries are the perfect input source for GPT-3, and with more work, the outcomes will only get better from here.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Now for the good part&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The great news is that it actually works well more often than not, and the results are actually quite useful. Here are some examples where the GPT-3 summary really described the event collection accurately, and was really helpful to the user to quickly digest the RCA. &lt;em&gt;Note: we have obfuscated details that might be potentially sensitive, and we're not sharing the raw log events for the same reason, although they would be useful to compare alongside the summaries.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a first bucket, here are some interesting and useful incident summaries related to memory starvation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The **** daemon was unable to allocate memory for the **** data.&lt;/li&gt;
&lt;li&gt;  The RabbitMQ broker was running out of memory.&lt;/li&gt;
&lt;li&gt;  The **** process was killed by the OOM killer.&lt;/li&gt;
&lt;li&gt;  The application was trying to fork a child process, but the fork call failed because the system was out of memory.&lt;/li&gt;
&lt;li&gt;  The memcached process was killed by the OOM killer because it was consuming too much memory. The OOM killer is a Linux kernel feature that allows the system to kill a process when the system is running out of memory.&lt;/li&gt;
&lt;li&gt;  The memory cgroup was out of memory, so the kernel killed process **** and its child ****.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, here are some other infrastructure related incidents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The AWS Machine Image AMI  that the customer used was for an x86_64 architecture, but the customer s instance type was arm64.&lt;/li&gt;
&lt;li&gt;  The file system was corrupted.&lt;/li&gt;
&lt;li&gt;  The Kafka producer was not configured to be a leader for the topic-partition.&lt;/li&gt;
&lt;li&gt;  The root cause of the issue was that the Jenkins master was not able to connect to the vCenter server.&lt;/li&gt;
&lt;li&gt;  The root cause was a drive failed error&lt;/li&gt;
&lt;li&gt;  The cluster was under heavy load, and the scheduler was unable to schedule the pod.&lt;/li&gt;
&lt;li&gt;  The pod was scheduled on a node that had insufficient CPU.&lt;/li&gt;
&lt;li&gt;  The root cause was that the Slack API was rate limited.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For variety, here are some database related incidents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The database was closed, and the query failed.&lt;/li&gt;
&lt;li&gt;  The EC2 instance was running out of connections to the database.&lt;/li&gt;
&lt;li&gt;  The database driver was unable to ping the database server.&lt;/li&gt;
&lt;li&gt;  The first message is a SQL error, which means that the database server was unable to execute the query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, here are some examples of security related incident summaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The LDAP server was not responding to the client.&lt;/li&gt;
&lt;li&gt;  The root cause of the issue was that the certificate chain did not match any of the trust anchors.&lt;/li&gt;
&lt;li&gt;  The root cause of the problem was that the sshd daemon on the server was configured to allow only three authentication attempts per IP address.&lt;/li&gt;
&lt;li&gt;  The server rejected the connection because it has already seen too many invalid authentication attempts for that user.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Our focus is to cut troubleshooting time using machine learning to summarize the key event sequences that describe an incident based on logs and associated metrics anomalies. The GPT-3 integration is a big step towards our goals -- enabling quick review of RCA reports by anyone, even personnel who may not be intimately familiar with application internals. As described above -- there are still improvements to be made, but it works so well in real world scenarios that we are now opening it up to all our users.&lt;/p&gt;

&lt;p&gt;Try it for yourself by &lt;a href="https://www.zebrium.com/sign-up"&gt;signing up for a free trial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the author &lt;a href="https://www.zebrium.com/blog/author/ajay-singh"&gt;Ajay Singh&lt;/a&gt; @ Zebrium&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lessons from Slack, GCP and Snowflake outages</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Thu, 04 Feb 2021 22:51:31 +0000</pubDate>
      <link>https://forem.com/gdcohen/lessons-from-slack-gcp-and-snowflake-outages-1f5b</link>
      <guid>https://forem.com/gdcohen/lessons-from-slack-gcp-and-snowflake-outages-1f5b</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Foutages%2520at%2520gcp%2520slack%2520snowflake-1.png%3Fwidth%3D589%26name%3Doutages%2520at%2520gcp%2520slack%2520snowflake-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Foutages%2520at%2520gcp%2520slack%2520snowflake-1.png%3Fwidth%3D589%26name%3Doutages%2520at%2520gcp%2520slack%2520snowflake-1.png" alt="outages at gcp slack snowflake-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An outage at a market leading SaaS company is always noteworthy. Thousands of organizations and millions of users are so reliant on these services that a widespread outage feels as surprising and disruptive as a regional power outage. But the analogy with an electricity provider is unfair. While we expect a utility to be safe, boring and just plain reliable, we expect SaaS services to also innovate relentlessly. As we pointed out a while back, this is the crux of the problem. Although they employ some of the best engineers, sophisticated observability strategies and cutting-edge DevOps practices, SaaS companies also have to deal with ever accelerating change and growing complexity. And that occasionally defeats every effort to identify and resolve a problem quickly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2Fsnowflake.png%3Fwidth%3D252%26name%3Dsnowflake.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2Fsnowflake.png%3Fwidth%3D252%26name%3Dsnowflake.png" alt="snowflake"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, &lt;a href="https://community.snowflake.com/s/article/SI-20201216" rel="noopener noreferrer"&gt;Snowflake had a major outage&lt;/a&gt; six weeks ago. Users were unable to log into the UI or found it unresponsive for about 4 hours. The problem started because a web server running an older version of the OS ran out of disk space. After RCA was determined, alert rules were updated. But this is a classic illustration of why alert rules can't possibly keep up with all new failure modes, and why you need ML to root cause such failure modes rapidly. This specific example is one that ML has repeatedly proven to handle easily (see &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted" rel="noopener noreferrer"&gt;here&lt;/a&gt; and &lt;a href="https://www.zebrium.com/blog/using-autonomous-monitoring-with-litmus-chaos-engine-on-kubernetes" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2FGoogle%2520Cloud.png%3Fwidth%3D316%26name%3DGoogle%2520Cloud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2FGoogle%2520Cloud.png%3Fwidth%3D316%26name%3DGoogle%2520Cloud.png" alt="Google Cloud"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another recent &lt;a href="https://status.cloud.google.com/incident/zall/20013" rel="noopener noreferrer"&gt;outage impacted users of GCP, Big Query, GKE and other Google services&lt;/a&gt; for almost an hour. The root cause was a quota bug introduced when Google switched to new quota management service, and the absence of adequate logic to catch this new failure mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2Fslack.png%3Fwidth%3D300%26name%3Dslack.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FLogos%2Fslack.png%3Fwidth%3D300%26name%3Dslack.png" alt="slack"&gt;&lt;/a&gt;Slack had another example -- a &lt;a href="https://devopsish.com/pdf/Slack-Incident-Jan-04-2021-RCA-Final.pdf" rel="noopener noreferrer"&gt;4 hour outage that started with network disruption&lt;/a&gt; (unusually high packet loss), but was really exacerbated when the provisioning service could not keep up with demand and started adding improperly configured servers to the fleet. To add insult to injury, the observability stack itself was unreachable due to the network disruptions. After RCA a swath of corrective actions were put in place, including new run books, new alert rules for network disruptions, design changes, a way to bypass the observability stack etc. But the crux of the issue remains - the provisioning service failure is another example of an unanticipated (new) failure mode that took a long time to resolve.&lt;/p&gt;

&lt;p&gt;Expecting humans to anticipate the unknown and figure out what happened was hard enough in the old days of simple monolithic architectures, monthly software releases, formal test plans and extensive QA. It is entirely unreasonable in the world of hundreds of intertwined microservices, multiple daily deployments and "test in production". What is most interesting about the examples above, is that in each case the vendor quickly knew there was a problem, but it took a long time and a lot of hunting to figure out what caused the problem (the "root cause"). A growing number of organizations are now realizing that the only way to root cause these problems much faster (or even proactively detect them) is to employ ML to identify new failure modes and their root cause. ML in the observability domain has come a long way from the early attempts at anomaly detection and AIOps (read more about this &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;We encourage you try it for yourself by breaking things and examining the ML generated RCA reports. Don't have an environment you can easily do this? Try it with this &lt;a href="https://www.zebrium.com/blog/testing-zebrium-with-a-cloud-native-microservices-demo-app" rel="noopener noreferrer"&gt;simple K8s based demo app.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Posted with permission of the author - &lt;a href="https://www.zebrium.com/blog/author/ajay-singh" rel="noopener noreferrer"&gt;Ajay Singh, CEO @ Zebrium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>machinelearning</category>
      <category>sre</category>
    </item>
    <item>
      <title>Testing ML incident detection using a cloud native microservices app
</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Thu, 17 Dec 2020 00:31:32 +0000</pubDate>
      <link>https://forem.com/gdcohen/testing-ml-incident-detection-using-a-cloud-native-microservices-app-24f0</link>
      <guid>https://forem.com/gdcohen/testing-ml-incident-detection-using-a-cloud-native-microservices-app-24f0</guid>
      <description>&lt;p&gt;There is no better way to try Zebrium machine learning incident detection than with a production application that is experiencing a problem. The machine learning will not only detect the problem, but also show its root cause. But no user wants to induce a problem in their app just to experience the magic of our technology! So, although it's second best, an alternative is to try Zebrium with a sample real-life application, break the app and then see what Zebrium detects. One of our customers kindly introduced us to Google's microservices demo app - &lt;a href="https://github.com/GoogleCloudPlatform/microservices-demo"&gt;Online Boutique&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/GoogleCloudPlatform/microservices-demo"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---9lHq9VX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hubfs/Logos/google%2520online%2520boutique%2520microservices%2520app.svg" alt="google online boutique microservices app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This blog will show you how to install and break the sample app using a local minkube Kubernetes cluster running on your laptop. The entire process, including installing Istio, Promethues, Kiali, Online Boutique, plus signing up for a Zebrium account and installing Zebrium log and metrics collectors, takes 20-30 minutes.&lt;/p&gt;

&lt;p&gt;Important: Before starting, you will need to install &lt;a href="https://minikube.sigs.k8s.io/docs/"&gt;minikube&lt;/a&gt; (instructions for Linux, MacOS and Windows &lt;a href="https://minikube.sigs.k8s.io/docs/start/"&gt;here&lt;/a&gt;). You'll also need to install &lt;a href="https://git-scm.com/"&gt;git&lt;/a&gt;, &lt;a href="https://helm.sh/docs/intro/install/"&gt;helm&lt;/a&gt; and curl (Google "curl" for your platform) if you don't already have them. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Sign-up for a Zebrium account
&lt;/h3&gt;

&lt;p&gt;Now let's get going with your Zebrium account! You can sign-up for a new account &lt;a href="https://www.zebrium.com/sign-up"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OCRzsUem--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Get%2520started%2520with%2520Zebrium%2520for%2520free.png%3Fwidth%3D400%26name%3DGet%2520started%2520with%2520Zebrium%2520for%2520free.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OCRzsUem--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Get%2520started%2520with%2520Zebrium%2520for%2520free.png%3Fwidth%3D400%26name%3DGet%2520started%2520with%2520Zebrium%2520for%2520free.png" alt="Get started with Zebrium for free"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've entered your details and set a password, you will see the &lt;strong&gt;Zebrium Setup page&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Because this is a demo environment, adjust some default Zebrium settings
&lt;/h3&gt;

&lt;p&gt;The default settings of the Zebrium platform work well for most production environments. However, for the purpose of this demo, we will compensate for the short run time and small amount of data by changing a few default settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set incident sensitivity to high and enable infrastructure incidents:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bTr9I0s0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Zebrium%2520sensitivity.png%3Fwidth%3D539%26name%3DZebrium%2520sensitivity.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bTr9I0s0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Zebrium%2520sensitivity.png%3Fwidth%3D539%26name%3DZebrium%2520sensitivity.png" alt="Zebrium sensitivity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the top RHS of the Setup page in Zebrium UI (see picture above), click the gear button (1) and select Incidents (2) from the dropdown. Now click "Create" (3) under Infrastructure Incidents (this will allow certain types of K8s infrastructure logs to be included for incident detection) and select "high" (4) under Incident Sensitivity. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Change the refractory period&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you break the demo app (see later), it will generate a lot of similar log events and patterns to ones that occurred during the bring-up of your demo environment. For this reason, we will change the default refractory period so that the ML will know it's ok to create an incident even if something similar has already happened recently. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k2EkXx_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/advanced%2520settings.png%3Fwidth%3D533%26name%3Dadvanced%2520settings.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k2EkXx_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/advanced%2520settings.png%3Fwidth%3D533%26name%3Dadvanced%2520settings.png" alt="advanced settings"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;See picture above - in the top RHS, click the gear button (1) and select Advanced (2) from the dropdown. Set Refractory Period to 10 minutes (3). Finally click the Ze icon (4) in the top LHS to go back to the setup page.&lt;/p&gt;

&lt;p&gt;It's important to note that the above settings are needed to compensate for the short run time and small amount of data in this demo setup. For normal use, you do not need to change these settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Start minikube with enough resources
&lt;/h3&gt;

&lt;p&gt;Note the -p option for all minikube commands. This is because we will use a separate minikube instance named "boutique" (this will make it easier to clean-up when you're done).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minikube start --cpus=4 --memory 4096 --disk-size 32g -p boutique
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to make the frontend IP address of the Online Boutique app accessible (needed later), you will need to run the "minikube tunnel command". It must be run in a separate terminal window.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Make sure you run this command in a different window
minikube tunnel -p boutique
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Install the Zebrium log and metrics collectors
&lt;/h3&gt;

&lt;p&gt;Go the the Zebrium Setup page in your browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6-vnkIiI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Zebrium%2520k8s%2520setup%2520page.png%3Fwidth%3D568%26name%3DZebrium%2520k8s%2520setup%2520page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6-vnkIiI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/Zebrium%2520k8s%2520setup%2520page.png%3Fwidth%3D568%26name%3DZebrium%2520k8s%2520setup%2520page.png" alt="Zebrium k8s setup page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start by clicking on "Kubernetes" under Log Collector Setup. This will produce a popup similar to the picture below. You should select to install with "Helm v3":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--txa-eO3V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zebrium%2520log%2520collector%2520setup.png%3Fwidth%3D481%26name%3Dzebrium%2520log%2520collector%2520setup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--txa-eO3V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zebrium%2520log%2520collector%2520setup.png%3Fwidth%3D481%26name%3Dzebrium%2520log%2520collector%2520setup.png" alt="zebrium log collector setup"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now copy and paste the install commands from the Zebrium UI. When installing zlog-collector, set "zebrium.deployment" to a name like "boutique" and delete the part of the line that sets zebrium.timezone. See the example below (make sure you use the token from your own Zebrium UI):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install the Zebrium log collector by copying and pasting commands from the Zebrium UI.
kubectl create namespace zebrium
helm install zlog-collector zlog-collector --namespace zebrium --repo https://raw.githubusercontent.com/zebrium/ze-kubernetes-collector/master/charts --set zebrium.collectorUrl=https://zapi03.zebrium.com,zebrium.authToken=XXXXX,zebrium.deployment=boutique
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now install the Zebrium metrics collector by clicking on the from the Kubernetes button under "Metrics Collector Setup" in the Zebrium Setup UI. Once again use the Helm v3 method and cut and paste the commands from the UI popup. Note that when executing the install command for zstats-collector, use the same value that you used above ("boutique") for "zebrium.deployment":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install the Zebrium metrics collector by copying and pasting commands from the Zebrium UI.
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm install node-exporter --namespace zebrium stable/prometheus-node-exporter
helm install zstats-collector zstats --namespace zebrium --repo https://raw.githubusercontent.com/zebrium/ze-stats/master/charts --set zebrium.collectorUrl=https://zapi03.zebrium.com/stats/api/v1/zstats,zebrium.authToken=XXXX,zebrium.deployment=boutique
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Zebrium ML will begin receiving and structuring logs and metrics from your newly created K8s environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Install Istio, Prometheus and Kiali 
&lt;/h3&gt;

&lt;p&gt;More detailed instructions for installing &lt;a href="https://istio.io/"&gt;Istio&lt;/a&gt; service mesh can be found &lt;a href="https://istio.io/latest/docs/setup/getting-started/"&gt;here&lt;/a&gt;. Istio and Prometheus aren't actually needed for the demo app, but it allows the use of &lt;a href="https://kiali.io/"&gt;Kiali&lt;/a&gt; which will give you a really nice graphical view of the environment!  &lt;/p&gt;

&lt;p&gt;First download Istio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Make a directory for this environment
mkdir onlineboutique
cd onlineboutique

# Get the latest version of Istio
curl -L https://istio.io/downloadIstio | sh -

# Check the name of the Istio directory that was created
ls

# go into Istio directory (name in ls output)
cd istio-1.8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now install Istio and Prometheus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#install istio. Note: if on a Mac and you get a message about istioctl being from an unidentified developer, see the note above.
kubectl create namespace istio-system
export PATH=$PWD/bin:$PATH
istioctl install --set profile=demo -y
kubectl label namespace default istio-injection=enabled

# Install Prometheus
kubectl apply -f ./samples/addons/prometheus.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you're ready to Install and bring up kiali&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Make sure you are still in the Istio directory from the steps above
kubectl apply -f ./samples/addons/kiali.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important - you might see a bunch of errors saying something like: "&lt;strong&gt;unable to recognize...&lt;/strong&gt;". If so, this is a &lt;a href="https://github.com/istio/istio/issues/27577"&gt;known bug&lt;/a&gt;. To fix this, run the apply command again and you should see a few "...created" messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f ./samples/addons/kiali.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that everything is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Verify that Istio, Prometheus and Kiali pods are running. You should see something similar to below:
kubectl get pods -n istio-system
NAME                                    READY   STATUS    RESTARTS   AGE
istio-egressgateway-d84f95b69-zghjf     1/1     Running   0          20m
istio-ingressgateway-75f6d79f48-zcpk2   1/1     Running   0          20m
istiod-c9f6864c4-q68bj                  1/1     Running   0          21m
kiali-7476977cf9-jkz6b                  1/1     Running   0          15m
prometheus-7bfddb8dbf-8sg46             2/2     Running   0          19m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now bring up the &lt;a href="https://kiali.io/"&gt;Kiali&lt;/a&gt; UI. It will appear in a new tab in your browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bring up the Kiali UI (this will open the UI in a new browser tab)
istioctl dashboard kiali &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Time to install and fire up the Online Boutique app
&lt;/h3&gt;

&lt;p&gt;The app has 12 services (adservice, cartservice, checkoutservice, currencyservice, emailservice, frontend, loadgenerator, paymentservice,productcatalogservice, recommendationservice, redis-cart and shippingservice) and will take a few minutes to start up. While starting up, you might see some of the pods enter Error/CrashLoopBackOff states a few times. Make sure you wait until they are all in a Running state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Go back to the directory you created above (onlineboutique)
cd ..

# Clone the Online Boutique repository
git clone https://github.com/GoogleCloudPlatform/microservices-demo.git
cd microservices-demo

# Install the app.
kubectl apply -f ./release/kubernetes-manifests.yaml

# Check to see if everything has started - this takes a few minutes. Keep checking and don't move on until all pods are in a running state
kubectl get pods
adservice-5f6f7c76f5-mnn2v               2/2     Running   0          4m18s
cartservice-675b6659c8-nzrnb             2/2     Running   2          4m19s
checkoutservice-85d4b74f95-jm4z8         2/2     Running   0          4m20s
currencyservice-6d7f8fc9fc-l74nc         2/2     Running   0          4m19s
emailservice-798f4f5575-b72s6            2/2     Running   0          4m20s
frontend-6b64dc9665-g22mp                2/2     Running   0          4m19s
loadgenerator-7747b67b5-8946m            2/2     Running   4          4m19s
paymentservice-98cb47fff-rxqjm           2/2     Running   0          4m19s
productcatalogservice-7f857c47f-kml88    2/2     Running   0          4m19s
recommendationservice-5bf5bcbbdf-9g5l2   2/2     Running   0          4m20s
redis-cart-74594bd569-vbx5h              2/2     Running   0          4m18s
shippingservice-75f7f9dc6c-sfczx         2/2     Running   0          4m18s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once all the services are Running, you can bring up the app in your browser. You will need to get the frontend IP address by running the command below (make sure that you didn't forget the "minikube tunnel" command in step 1 above or this won't work).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#get IP address for boutique and then open EXTERNAL-IP in a browser tab (sample output below)
kubectl get service/frontend-external
NAME                TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)        AGE
frontend-external   LoadBalancer   10.99.208.30   10.99.208.30   80:32326/TCP   6h8m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open the EXTERNAL-IP address in a new browser tab! And you should see the online boutique app:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2o8WzhGy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/online%2520boutique%2520screen%2520shot.png%3Fwidth%3D621%26name%3Donline%2520boutique%2520screen%2520shot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2o8WzhGy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/online%2520boutique%2520screen%2520shot.png%3Fwidth%3D621%26name%3Donline%2520boutique%2520screen%2520shot.png" alt="online boutique screen shot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Kiali tab in your browser, click Graph. In the Display dropdown, select "Traffic animation". You should see something like the picture below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EeIBrcE---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/kiali%2520screen%2520shot.png%3Fwidth%3D623%26name%3Dkiali%2520screen%2520shot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EeIBrcE---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/kiali%2520screen%2520shot.png%3Fwidth%3D623%26name%3Dkiali%2520screen%2520shot.png" alt="kiali screen shot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: Now go and get a cup of your favorite beverage and come back in 10 minutes. Yes I'm serious! This will give the Zebrium ML a chance to learn the structures and patterns that occur under normal running conditions. &lt;/p&gt;

&lt;h3&gt;
  
  
  6. Break the Online Boutique app
&lt;/h3&gt;

&lt;p&gt;In the Kiali dashboard, you can see that a lot of traffic moves through the "productcatalogservice" (select Traffic Animation under the Display dropdown in the Kiali graph dashboard). So let's kill the productcatalogservice pod!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Kill the productservicecatalog pod by scaling it to zero
kubectl scale deploy productcatalogservice --replicas=0; date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note down the time from the output of the "date" command in the step above. Go to your browser and you should see that the app no longer works and the Kiali dashboard should show a lot of red:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rynNtboQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/online%2520boutique%2520app%2520broken.png%3Fwidth%3D512%26name%3Donline%2520boutique%2520app%2520broken.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rynNtboQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/online%2520boutique%2520app%2520broken.png%3Fwidth%3D512%26name%3Donline%2520boutique%2520app%2520broken.png" alt="online boutique app broken"&gt;&lt;/a&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U7e1UVbO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/kiali%2520dashbaord%2520showing%2520failure.png%3Fwidth%3D460%26name%3Dkiali%2520dashbaord%2520showing%2520failure.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U7e1UVbO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/kiali%2520dashbaord%2520showing%2520failure.png%3Fwidth%3D460%26name%3Dkiali%2520dashbaord%2520showing%2520failure.png" alt="kiali dashbaord showing failure"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  7. The results
&lt;/h3&gt;

&lt;p&gt;Since this is a brand new Zebrium instance, things can take a bit longer than usual and so it could take 10 minutes or more before Zebrium detects the problem. Also, since there are many new/rare patterns in the logs, and because incident sensitivity is set to high, you will likely get a bunch of new incidents even though not all of them are for real problems.&lt;/p&gt;

&lt;p&gt;Also, you might notice that when the relevant incident is first created, it is incomplete (it might not be as detailed as the example below). Give it some time and you might see that the detail of the incident improves. This is because the machine learning will continue to refine its model over the next few hours.&lt;/p&gt;

&lt;p&gt;When Zebrium does detect the incident, you will get a Slack alert (you should have a received an email to join the Zebriumcommunity Slack workspace). You can also click on the &lt;strong&gt;incidents tab&lt;/strong&gt; in the Zebrium UI at any time to see a list of  incidents that have been detected. This is what my environment looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IIIkZeZf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zebrium%2520incidents%2520list.png%3Fwidth%3D2002%26name%3Dzebrium%2520incidents%2520list.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IIIkZeZf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zebrium%2520incidents%2520list.png%3Fwidth%3D2002%26name%3Dzebrium%2520incidents%2520list.png" alt="zebrium incidents list"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The incident with the red box is the one that that we induced. Here's how to understand the incident list (see picture above):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  1 - shows time of the incident&lt;/li&gt;
&lt;li&gt;  2 - shows hosts and logs that the incident spans&lt;/li&gt;
&lt;li&gt;  3 - shows the First event in the incident. This often gives a clue of the root cause.&lt;/li&gt;
&lt;li&gt;  4 - shows the Worst event in the incident. This is usually the event that a human would think of as being the most serious event in the incident.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, to see details of what was detected, click on "&lt;strong&gt;INCIDENT REPORT&lt;/strong&gt;" and you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0t-iCoqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/incident%2520details.png%3Fwidth%3D2002%26name%3Dincident%2520details.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0t-iCoqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/incident%2520details.png%3Fwidth%3D2002%26name%3Dincident%2520details.png" alt="incident details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  1 - shows the events that make up this incident. They tell the story of what happened. Note in particular this one which tells us the root cause "Deleted pod: productcatalogservice-7f857c47f-n9cxn":&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4OY0NoOI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/root%2520cause.png%3Fwidth%3D1674%26name%3Droot%2520cause.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4OY0NoOI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/root%2520cause.png%3Fwidth%3D1674%26name%3Droot%2520cause.png" alt="root cause"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  2 - shows related metrics anomalies. You can see that everything suddenly drops at the same time the pod was deleted.&lt;/li&gt;
&lt;li&gt;  3 - shows a timeline of the incident. You can click on any of the dots to go to that particular event (this is very useful if you turn the filter off - see below)&lt;/li&gt;
&lt;li&gt;  4 - is the Show Nearby button. It will bring in additional anomalies and errors that our ML has detected nearby. This often helps to provide more detail on the incident.&lt;/li&gt;
&lt;li&gt;  5 - is the Filter button for the incident. Click the green filter button to turn off incident filtering. This will show you all the log events around your current position.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. Optional clean-up of the minikube K8s instance
&lt;/h3&gt;

&lt;p&gt;When you're done with testing the microservices app, you can delete the entire minikube K8s cluster with the following commands. Warning, you can't undo this step!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Stop and delete the minikube K8s cluster - WARNING: you can't undo this!
minikube stop -p boutique
minikube delete -p boutique
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The above steps provide an easy way to test Zebrium's machine learning technology - just fire up a demo app, break the app and then see how Zebrium detects the problem and its root cause. But don't get lost in the weeds! The most important thing to remember is that the problem was detected by our machine learning &lt;strong&gt;without any prior understanding of your environment, and with absolutely no human built rules&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Zebrium ML technology works by learning the structures and patterns in your logs and metrics. It then finds incidents by looking for hotspot of abnormally correlated anomalous patterns across your logs and metrics. More detail about how it works can can be found &lt;a href="https://www.zebrium.com/product/how-zebrium-works"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We encourage you to continue exploring the Zebrium platform with the demo environment you have built. But really the best way to see the magic of Zebrium is to try it with your real application - you'll be amazed at what it finds!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>sre</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Virtual tracing: A simpler alternative to distributed tracing for troubleshooting</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Thu, 23 Jul 2020 18:48:21 +0000</pubDate>
      <link>https://forem.com/gdcohen/virtual-tracing-a-simpler-alternative-to-distributed-tracing-for-troubleshooting-4en8</link>
      <guid>https://forem.com/gdcohen/virtual-tracing-a-simpler-alternative-to-distributed-tracing-for-troubleshooting-4en8</guid>
      <description>&lt;h2&gt;
  
  
  The promise of tracing
&lt;/h2&gt;

&lt;p&gt;Distributed tracing is commonly used in Application Performance Monitoring (APM) to monitor and manage application performance, giving a view into what parts of a transaction call chain are slowest. It is a powerful tool for monitoring call completion times and examining particular requests and transactions.&lt;/p&gt;

&lt;p&gt;Quite beyond APM, it seems natural to expect tracing to yield a 'troubleshooting tool to rule them all'. The detail and semantic locality of the trace, coupled with the depth of the service call graph, generate this expectation. It's obvious that correlating across services gives diagnostic power. The typical traceview screams the sort of "first this, then that" narrative RCAs are made of.&lt;/p&gt;

&lt;p&gt;In reality, though, users have seen mixed results. According to a prospect:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"We paid six figures for a  contract, to reduce MTTR significantly. We've given up on that. We're writing it off. Engineers had to do extra work to implement it. Operations had to do extra work to set and respond to alerts. The alerts worked well but, in the end, finding root-cause was still slow. It just wasn't worth it."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is not isolated feedback.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Tell me where to focus"
&lt;/h2&gt;

&lt;p&gt;There are two issues raised: work required to yield results, and inadequacy of those results. The first issue is easy to understand: depending on the stack, the application, the application's evolution, the deployment mechanisms and so on, it may indeed be a lot of work to generate useful traces. This problem is not surprising and can be surmounted; it is worth taking away that zero-configuration, zero-instrumentation (i.e., &lt;em&gt;autonomous&lt;/em&gt;) solutions are of great value.&lt;/p&gt;

&lt;p&gt;The larger issue is around applicability for root-cause detection. Here, respected Observability author and blogger Cindy Sridharan has some insightful things to say. I'll lift a quote &lt;a href="https://medium.com/@copyconstruct/distributed-tracing-weve-been-doing-it-wrong-39fc92a857df" rel="noopener noreferrer"&gt;from her article&lt;/a&gt; which I highly recommend:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"What's ideally required at the time of debugging is a tool that'll help reduce the search space... Instead of seeing an entire trace, what I really want to be seeing is a portion of the trace where something interesting or unusual is happening... dynamically generated service topology views based on specific attributes like error rate or response time..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Fdistributed%2520tracing.png%3Fwidth%3D900%26name%3Ddistributed%2520tracing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Fdistributed%2520tracing.png%3Fwidth%3D900%26name%3Ddistributed%2520tracing.png" alt="distributed tracing"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We need a tool that takes a stab at incident and, if possible, root-cause detection, or highlighting. Stepping back further, I would posit that trace data has become a bit like log data: a treasure trove of untapped information for root-cause detection, in-part because there is just too much detail to sift through without help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual tracing alone
&lt;/h2&gt;

&lt;p&gt;Tracing is so promising for troubleshooting because of semantic locality. Tracing works the way it does because span ids are passed around the stack - in headers or log lines, for example. These spans are then associated together into a trace, and so we know all the spans in the trace are at least to some extent "about" the same thing - a transaction or request, for example.&lt;/p&gt;

&lt;p&gt;There are other ways to establish semantic locality. Looking again at a trace, we might note that its spans demonstrate temporal locality, as well. We might suppose that a majority of service-impacting incidents also have temporal locality: if Service A fails, and Service B calls Service A, then Service B is likely also to fail, soon after Service A does. Our job will be to determine spans of telemetric data that share semantic locality.&lt;/p&gt;

&lt;p&gt;Could we suppose that events happening nearby in time are semantically related? Of course not... but, we could look for features in &lt;em&gt;ordinary telemetry&lt;/em&gt; - "rareness" or "badness", for example - and model inter-occurrence intervals of such features across services. Rareness might be indicated by rare log events from a given container, for example, or a multi-hour peak in a metric; badness might be indicated by a flurry of errors from another container, or a host log.&lt;/p&gt;

&lt;p&gt;Machine learning could observe the ordinary behavior of the system to estimate parameters for our model, and then use the model to hypothesize which features ARE semantically related, with high probability. Related features would in this way correspond to a virtual trace; each virtual span would map directly to a timespan of telemetric data capture for a single generator - host, container, or service, for example.&lt;/p&gt;

&lt;h2&gt;
  
  
  A virtual tracing example
&lt;/h2&gt;

&lt;p&gt;A database server is inadvertently shut down. A number of rare events are emitted into its log stream; a rare spike in available memory occurs on the host(s). A few seconds later, a flurry of unusual errors are emitted in the log stream of a service reliant on the database because it cannot connect to the database.&lt;/p&gt;

&lt;p&gt;Say, rare events in the database log stream happen at random about once per day, on average; rare errors in the consumer's log stream happen about once every hour; comparable spikes in available memory happen twice a day. But now, all three of these rare things happened within 3 seconds.&lt;/p&gt;

&lt;p&gt;The ML model decides these all should be part of a virtual trace, as a result; we construct spans of related activity on each generator - contiguous timespans, in fact - and bundle them up. If there was enough badness, we notify; we fingerprint to keep track of separate "trace types". In this way we've achieved the goals of autonomous incident and root-cause detection; we can present only the data and services where attention should be focused.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Fvifrtual%2520tracing.png%3Fwidth%3D900%26name%3Dvifrtual%2520tracing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2Fvifrtual%2520tracing.png%3Fwidth%3D900%26name%3Dvifrtual%2520tracing.png" alt="vifrtual tracing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual and instrumented tracing combined
&lt;/h2&gt;

&lt;p&gt;Combining these approaches yields real opportunities for improving the user experience. The instrumented trace augments the virtual one. For example, the service graph can be used to exclude virtual spans from a virtual trace based on implausibility of the related generator causing the observed badness; the full trace can give deep performance context to the virtual trace and serve as a launching-off point to navigate to other services and/or similar traces. Instrumented tracing brings precision, depth, and broad context to a virtual trace.&lt;/p&gt;

&lt;p&gt;Similarly, the virtual trace augments the instrumented one. We can hone or auto-tune our alerting based on badness seen in the virtual trace; we can hone the traceview to just those services and components touching the virtual trace, and then allow the user to expand outward, if need be. Virtual tracing brings autonomy, incident detection, and root-cause indication to an instrumented trace.&lt;/p&gt;

&lt;p&gt;Zebrium has built an implementation of virtual tracing into its autonomous log management and monitoring platform. &lt;a href="https://www.zebrium.com/" rel="noopener noreferrer"&gt;You can read more about it here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the author: &lt;a href="https://www.zebrium.com/blog/author/larry-lancaster" rel="noopener noreferrer"&gt;Larry Lancaster&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Augment a PagerDuty Incident with Root Cause</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Fri, 17 Jul 2020 19:16:08 +0000</pubDate>
      <link>https://forem.com/gdcohen/augment-a-pagerduty-incident-with-root-cause-4n1c</link>
      <guid>https://forem.com/gdcohen/augment-a-pagerduty-incident-with-root-cause-4n1c</guid>
      <description>&lt;p&gt;I wanted to give you an update on my last blog on MTTR by showing you our &lt;a href="https://www.pagerduty.com/integrations/zebrium/"&gt;PagerDuty Integration&lt;/a&gt; in action.&lt;/p&gt;

&lt;p&gt;As I said before, you probably care a lot about Mean Time To Detect (MTTD) and Mean Time To Resolve (MTTR). You're also no doubt familiar with monitoring, incident response, war rooms and the like. Who of us hasn't been ripped out of bed or torn away from family or friends at the most inopportune times? I know firsthand from running world-class support and SRE organizations that it all boils down to two simple things: 1) all software systems have bugs and 2) It's all about how you respond. While some customers may be sympathetic to #1, without exception, all of them still expect early detection, acknowledgement of the issue and near-immediate resolution. Oh, and it better not ever happen again!&lt;/p&gt;

&lt;h2&gt;
  
  
  Fast MTTD. Check!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.pagerduty.com/"&gt;PagerDuty&lt;/a&gt; is clearly a leader in Incident Response and on-call Escalation Management. There are over 300 integrations for PagerDuty to analyze digital signals from virtually any software-enabled system to detect and pinpoint issues across your ecosystem. When an Incident is created through one of these monitoring integrations, say an APM tool, PagerDuty will mobilize the right team in seconds (read: this is when you get the "page" during your daughter's 5th birthday party). Fast MTTD. Check!&lt;/p&gt;

&lt;h2&gt;
  
  
  But what about MTTR? By &lt;em&gt;R&lt;/em&gt;, I mean Resolve
&lt;/h2&gt;

&lt;p&gt;All great incident response tools will have workflow and run book automation mechanisms that can help &lt;strong&gt;restore&lt;/strong&gt; system operation quickly in some typical cases. But this doesn't get to the root cause so you can understand and &lt;strong&gt;resolve&lt;/strong&gt; the issue and not let it happen again. For that, enter the all-too-common "War Room". That term and concept was first coined in 1901 but was probably made most famous by Winston Churchill during WWII where the Cabinet War Room was the epicenter of intelligence gathering, data analysis and communications throughout the war. Back then it was the telegraph, phones, radio signals and maps on the wall. Today it's likely a virtual room using Zoom, Slack, real-time visualizations, cell phones, and most important, logs. Millions and millions of logs! But, the prevailing attitude of the War Room has remained unchanged - "If you're going through hell, keep going".&lt;/p&gt;

&lt;p&gt;The initial signal that triggered the incident was likely from an alert which perhaps detected that a predefined threshold was "out of tolerance", how ever simple or complex that may be. Or perhaps from an alert you defined in a ping-tool or maybe some home grown live tail watching for spikes in error counts or some similar patterns. Whatever the means, it was based on some predefined rule(s) to detect symptoms of a problem. In most cases, the next step is determining the root cause. For example, the symptom that triggered the signal might have been that latency was too high, but this tells you nothing about the root cause.&lt;/p&gt;

&lt;p&gt;Whether you formalize a designated War Room for a particular incident or not, two things are certain: 1) timely, thorough and accurate communication between team members is paramount and 2) You're likely going to search through logs and drill down on various metrics to get to the root cause. And this &lt;a href="https://www.zebrium.com/blog/is-log-management-still-the-best-approach"&gt;brute force searching through logs&lt;/a&gt; and metrics is probably your hell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop going through Hell
&lt;/h2&gt;

&lt;p&gt;Many monitoring tools have started to utilize various machine learning and anomaly detection techniques to raise that first signal to trigger an incident response, often via tools like PagerDuty. However, these techniques still require too much human input to handpick which metrics to monitor, and to choose specific algorithms or tuning parameters. Anomaly detection in monitoring tools is predominately geared towards time-series data and rarely for logs. Yet logs are indispensable for root case analysis. This makes these tools blind to the root cause of any issue and will ultimately require time consuming drill-down and hunting through the logs. Millions and millions of logs!&lt;/p&gt;

&lt;p&gt;By contrast, Zebrium's machine learning detects correlated anomalies and patterns in both logs and metrics and uses them to automatically catch and characterize critical incidents and show you root cause (see - &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted"&gt;The Anomaly Detection You Actually Wanted&lt;/a&gt;. This means faster MTTR and no more hunting for root cause! We call this &lt;a href="https://www.zebrium.com/blog/beyond-anomaly-detection-how-incident-recognition-drives-down-mttr"&gt;Incident Recognition&lt;/a&gt; and it's part of our Autonomous Monitoring platform.&lt;/p&gt;

&lt;p&gt;Now, let me show you how you can tie your existing incident management workflow together with automatic root cause identification, regardless of the triggering signal -- for fast incident resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Augmenting detection with Zebrium automatic root cause identification
&lt;/h2&gt;

&lt;p&gt;Zebrium uses unsupervised machine learning to &lt;a href="https://www.zebrium.com/blog/log-metrics-anomaly-detection-as-a-foundation-of-autonomous-monitoring"&gt;automatically detect and correlate anomalies and patterns across both logs and metrics&lt;/a&gt;. These signals form the basis for automated Incident Detection and Root Cause identification.\&lt;br&gt;
In addition to autonomous monitoring, we can also consume external signals to inform our Incident Detection. Imagine any one of your monitoring tools in your PagerDuty ecosystem has created an Incident and you get "The Call" (at one of those inopportune moments). What happens? Well you probably already know the pain that will lie ahead. But what if instead you looked at the PagerDuty Incident or your Slack Channel and a full report of the anomalous logs and metrics surrounding the incident -- including the root cause - was already there, at your fingertips.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Walkthrough: An APM triggered PagerDuty Incident gets  augmented with root cause&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Here's how it works:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Your AppDynamics APM tool detects a Critical Health Rule Violation: Login Time Exceeds 60 seconds (you can see that in the PagerDuty Incident below) and sets everything in motion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Through an existing integration with PagerDuty, an incident is created and the escalation policy fires (the war room is now open) and you see this in PagerDuty:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AppDynamics Triggered an Incident in PagerDuty&lt;/strong&gt;\&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9dH9-SZA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/pd_01_1200.png%3Fwidth%3D1186%26name%3Dpd_01_1200.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9dH9-SZA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/pd_01_1200.png%3Fwidth%3D1186%26name%3Dpd_01_1200.png" alt="pd_01_1200"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you also have a PagerDuty/Slack integration, you'll see something like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PagerDuty Notifies Slack with your AppDynamics Incident&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t-zIOnpX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_01_700.png%3Fwidth%3D692%26name%3Dslack_01_700.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t-zIOnpX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_01_700.png%3Fwidth%3D692%26name%3Dslack_01_700.png" alt="slack_01_700"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At that same instant, PagerDuty automatically sends a signal to Zebrium with all the incident details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At this point, &lt;strong&gt;Zebrium does three things&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The first thing&lt;/strong&gt; Zebrium does is correlate the PagerDuty incident details with its Autonomous Incident Detection and Root Cause by looking across logs and metrics over the past half hour for any Incidents it has already detected.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;And in this case, Zebrium has detected what looks to be a relevant incident. The PagerDuty incident is updated with the Zebrium Incident details and likely root cause via the PagerDuty API.  Here's what that PagerDuty update looks like in Slack:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zebrium detected an Incident and Root Case and has updated PagerDuty &lt;/strong&gt;&lt;strong&gt;and&lt;/strong&gt;&lt;strong&gt; Slack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CsKIMpLu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_02_700.png%3Fwidth%3D692%26name%3Dslack_02_700.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CsKIMpLu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_02_700.png%3Fwidth%3D692%26name%3Dslack_02_700.png" alt="slack_02_700"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you need to drill down further, it's just one click from either the Slack channel or your PagerDuty Incident. Lets take a look...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zebrium Incident Drill Down&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VqEai2a0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zeb_01_1200.png%3Fwidth%3D1187%26name%3Dzeb_01_1200.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VqEai2a0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/zeb_01_1200.png%3Fwidth%3D1187%26name%3Dzeb_01_1200.png" alt="zeb_01_1200"&gt;&lt;/a&gt;\&lt;br&gt;
Looking at our Zebrium Incident, your attention is immediately drawn to the Hallmark event in red. This is what we believe is the most relevant and important anomalous event in the Incident. When we look closer, we see that Java "Cannot create a session". That seems very closely related to our APM alert "Login Time Exceeds 60 seconds".&lt;/p&gt;

&lt;p&gt;At the top of the incident we also see a correlated metric anomaly in the JVM Pool. In fact we see that drop a couple times. We might think that's the issue. But it's not a root cause.&lt;/p&gt;

&lt;p&gt;We typically would see a root cause occurring near the beginning of a Zebrium Incident timeline. So looking up the list of events, we see the Kernel invoking the OOM-KILLER on a process called oom_test. And this is in fact the root cause. We had started oom_test to continue to consume memory until killed.&lt;/p&gt;

&lt;p&gt;The Zerbium Autonomous Monitoring Platform identified this Incident and Root Cause completely unsupervised. There were no predefined alert rules and there was no human intervention whatsoever (other than starting the oom_test program).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;strong&gt;second a really cool thing&lt;/strong&gt; Zebrium does, is create a Synthetic Incident. While it's very likely Zebrium has already detected the Incident and Root Cause automatically, we will additionally take the Signal from the APM Incident and create a new Zebrium Incident with any further anomalous events or metrics around the time of the signal to make sure this information is also easily at-hand. This often proves very useful to the person doing the troubleshooting. And indeed, you can see that happened and we've added a note to the PagerDuty Incident and Slack channel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zebrium Synthetic Incident Created and Updated in PagerDuty&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VjV_3YcN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_03_700.png%3Fwidth%3D692%26name%3Dslack_03_700.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VjV_3YcN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/slack_03_700.png%3Fwidth%3D692%26name%3Dslack_03_700.png" alt="slack_03_700"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally,&lt;strong&gt; the third thing&lt;/strong&gt; we'll do is keep an eye on things for the next thirty minutes and continue to update the PagerDuty Incident with any new Incidents we identify.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So lets recap the timeline from the PagerDuty Incident shown below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;09:55&lt;/strong&gt; - AppDynamics detected a Health Rule Violation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;09:55&lt;/strong&gt; - Seconds later, PagerDuty creates the Incident and signals Zebrium right away&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;09:55&lt;/strong&gt; - Less than a minute later, Zebrium has updated the PagerDuty Incident with a link to the Zebrium Incident and ultimately the Root Cause that had already been identified in the past half hour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10:07&lt;/strong&gt; - Zebrium creates a Synthetic Incident with additional details and updates the PagerDuty Incident.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10:25&lt;/strong&gt; - Zebrium continues to watch for additional incdents for 30 minutes after the signal is received.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BF5Ua79M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/pd_02_1200.png%3Fwidth%3D1187%26name%3Dpd_02_1200.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BF5Ua79M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Blogs/pd_02_1200.png%3Fwidth%3D1187%26name%3Dpd_02_1200.png" alt="pd_02_1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Summary of the Overall &lt;/strong&gt;&lt;strong&gt;Workflow&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eBUBX2aF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/PagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png%3Fwidth%3D818%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eBUBX2aF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/PagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png%3Fwidth%3D818%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png" alt="PagerDuty with Zebrium to augment incidents with root cause"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let Zebrium take care of MTTR
&lt;/h2&gt;

&lt;p&gt;Using PagerDuty, Zebrium can now augment existing incidents that have been detected by any 3rd-party tool. In doing so, your incident will be automatically updated with details of root cause without all the hunting, scrambling and adrenaline that is normally associated with a war room!&lt;/p&gt;

&lt;p&gt;You can get started for free by visiting either &lt;a href="https://www.zebrium.com/"&gt;https://www.zebrium.com&lt;/a&gt; or &lt;a href="https://www.pagerduty.com/integrations/zebrium"&gt;https://www.pagerduty.com/integrations/zebrium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now that's MTTR!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Posted with permission of the author: &lt;a href="https://www.zebrium.com/blog/author/rod-bagg"&gt;Rod Bagg&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
    </item>
    <item>
      <title>This Slack App Speeds-up Incident Resolution Using ML
</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Wed, 08 Jul 2020 18:37:05 +0000</pubDate>
      <link>https://forem.com/gdcohen/this-slack-app-speeds-up-incident-resolution-using-ml-56el</link>
      <guid>https://forem.com/gdcohen/this-slack-app-speeds-up-incident-resolution-using-ml-56el</guid>
      <description>&lt;p&gt;If your team (like many others) uses Slack to collaborate during incident management and triage, this new Slack app will be a big-time saver.&lt;/p&gt;

&lt;p&gt;Let's say a monitoring tool in your environment triggered an incident, and now you're working with colleagues to figure out what went wrong and how to resolve it. You start digging into logs and metrics, looking for anything unusual, with only the incident symptoms and your hunch to guide your searches. Incident response is a big and growing pain point for teams managing modern applications -- &lt;a href="https://www.pagerduty.com/blog/unplanned-work-report-global/" rel="noopener noreferrer"&gt;contributing to lost productivity, stress&lt;/a&gt; and a &lt;a href="https://technology.informa.com/572369/businesses-losing-700-billion-a-year-to-it-downtime-says-ihs" rel="noopener noreferrer"&gt;big economic cost overall&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Zebrium's machine learning platform consumes a feed of raw logs and metrics, and automatically learns data structures, event types and normal patterns. It automatically detects anomalies, and uses a virtual tracing technique to identify correlations between anomalies that characterize real incidents. This lets Zebrium automatically detect incidents. But for the moment let's continue with the scenario described above -- you already have an incident identified based on alerts from some other tool. Well Zebrium can also consume an external incident signal to inform and correlate its incident detection and root cause. To do this, just enable the slack app in your workspace, configure the Zebrium data collectors (one helm command in k8s), and type one command in your slack channel (or get your Bot to do it) to ask Zebrium for help.&lt;/p&gt;

&lt;p&gt;Zebrium will pull together an incident report describing the sequence of anomalous events, related anomalous metrics, and the services and nodes participating in the incident, and the worst symptom of the incident -- combined this forms a "virtual trace". Typically, the report will give you enough detail and context to identify root cause. And when needed, it also enables near instant drill down to examine the surrounding events and metrics. Because the "virtual trace" has already narrowed down the context and time range, this helps you get to resolution much faster than a hunch and blind searching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here's how it works
&lt;/h2&gt;

&lt;p&gt;1 - Setup Zebrium data collectors -- takes 2 minutes and a single helm command for k8s environments, or a couple of steps for other environments.&lt;/p&gt;

&lt;p&gt;2 - Install the Slack app for your workspace. You can do this from Zebrium settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2FZebrium%2520Slack%2520App.png%3Fwidth%3D468%26name%3DZebrium%2520Slack%2520App.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FBlogs%2FZebrium%2520Slack%2520App.png%3Fwidth%3D468%26name%3DZebrium%2520Slack%2520App.png" alt="Zebrium Slack App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3 - Now let's say you setup a slack channel for your Virtual War Room. You get the team together and you're looking at data from the APM tool and see some troubling stat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png%3Fwidth%3D931%26name%3DSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png%3Fwidth%3D931%26name%3DSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png" alt="Slack with Zebrium to augment incidents with root cause"&gt;&lt;/a&gt;4 - Type "/zebrium incident analyze (with the option to specify the incident time)" to call on Zebrium for analysis and root cause.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png%3Fwidth%3D994%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png" alt="PagerDuty with Zebrium to augment incidents with root cause 2"&gt;
&lt;/h3&gt;

&lt;p&gt;5 - Simply click and see full incident details.\&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png%3Fwidth%3D908%26name%3DZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png%3Fwidth%3D908%26name%3DZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png" alt="Zebrium Incident showing root cause and correlated metrics anomalies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let Zebrium take care of MTTR&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Using the Zebrium Slack App, you can now leverage Zebrium ML to augment incidents that have been detected by any tool. In doing so, our virtual tracing will automatically identify the impacted services and nodes, and pull in the sequence of anomalous events and metrics that best describe the incident root cause. And you'll get this without all the hunting, scrambling and adrenaline that is normally associated with a war room. &lt;strong&gt;Now that's MTTR!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can learn more or get started for free by visiting &lt;a href="https://www.zebrium.com/" rel="noopener noreferrer"&gt;https://www.zebrium.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the author: &lt;a href="https://www.zebrium.com/blog/author/ajay-singh" rel="noopener noreferrer"&gt;Ajay Singh&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Zebrium + Grafana = Awesome</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Fri, 19 Jun 2020 22:15:19 +0000</pubDate>
      <link>https://forem.com/gdcohen/zebrium-grafana-awesome-1c50</link>
      <guid>https://forem.com/gdcohen/zebrium-grafana-awesome-1c50</guid>
      <description>&lt;p&gt;Lots of people like to construct dashboards in Grafana, for monitoring and alerting -- it's fast, sleek, and practical. Zebrium is awesome for analytics in-part because &lt;a href="https://www.zebrium.com/blog/structure-is-strategic"&gt;we lay everything down into tables&lt;/a&gt; in a scale-out MPP relational column store at ingest. Each event type gets its own table with typed columns for the parameters; metrics data is also tabled; ditto for anomalies and incidents.&lt;/p&gt;

&lt;p&gt;In our next release, we're rolling out support for Grafana, with Zebrium functioning as a data source. The basic architecture looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ITnWHfQk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ITnWHfQk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana.png" alt="Zebrium and Grafana"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Zebrium's strong data discipline means it can be used as a rich and practical data source for monitoring. We can easily group / join / analyze data through functions and SQL views, and expose such views to Grafana.&lt;/p&gt;

&lt;p&gt;As an example, we =, rolled up to the minute and normalized, and call it cpu_basic. It might have these columns, among others:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
select ts,host,util from p03_views.cpu_basic limit 10;

ts          |      host       |  util
---------------------+-----------------+-------
 2020-06-18 09:43:00 | ip-172-31-55-34 |  2.44
 2020-06-18 19:54:00 | ip-172-31-55-34 |  1.83
 2020-06-16 19:33:00 | ip-172-31-62-10 |   1.8
 2020-06-18 02:25:00 | ip-172-31-55-34 |  6.07
 2020-06-17 18:16:00 | ip-172-31-62-10 |  3.65
 2020-06-18 11:18:00 | ip-172-31-62-10 |  7.92
 2020-06-16 20:04:00 | ip-172-31-62-10 |  0.48
 2020-06-17 07:05:00 | ip-172-31-62-10 |  5.04
 2020-06-17 08:54:00 | ip-172-31-55-34 | 17.12
 2020-06-18 13:43:00 | ip-172-31-62-10 |  6.95
(10 rows)

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Similarly, we might create a simple view in Zebrium to monitor error counts, rolled up to the minute, and call it errors_basic. It might have these columns, among others:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select ts,host,errors from p03_views.errors_basic limit 10;

         ts          |      host       | errors
---------------------+-----------------+--------
 2020-06-18 23:19:00 | ip-172-31-55-34 |      7
 2020-06-18 07:01:00 | ip-172-31-55-34 |      7
 2020-06-18 04:21:00 | ip-172-31-55-34 |      7
 2020-06-15 00:36:00 | ip-172-31-62-10 |     14
 2020-06-17 19:49:00 | ip-172-31-62-10 |     15
 2020-06-15 17:47:00 | ip-172-31-55-34 |      7
 2020-06-16 05:53:00 | ip-172-31-62-10 |     15
 2020-06-18 21:46:00 | ip-172-31-62-10 |     15
 2020-06-16 21:31:00 | ip-172-31-62-10 |     14
 2020-06-17 11:03:00 | ip-172-31-55-34 |      7
(10 rows)

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We could define a Grafana variable, host, with the query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT DISTINCT host FROM p03_views.cpu

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and in a Grafana panel definition for cpu_basic, we could then use the query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT    $__time(ts),host,util
FROM      p03_views.cpu_basic
WHERE     $__timeFilter(ts)
          AND host IN (${host:sqlstring})
ORDER BY  host,ts

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tpj83Tbc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25201.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25201.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tpj83Tbc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25201.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25201.png" alt="Zebrium and Grafana chart 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doing similarly with our errors_basic view and placing both the panels on a dashboard along with a variable multi-selector, we see the beautiful Grafana magic come to life:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AqyGMneg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25202.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25202.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AqyGMneg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25202.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25202.png" alt="Zebrium and Grafana chart 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;where we can zoom in to look at a particular host at a particular point in time, everything functioning the way it usually would in Grafana:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wrv5LWHd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25203.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25203.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wrv5LWHd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/Zebrium%2520and%2520Grafana%2520chart%25203.png%3Fwidth%3D800%26name%3DZebrium%2520and%2520Grafana%2520chart%25203.png" alt="Zebrium and Grafana chart 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a follow-on blog, we'll take a closer look at some more complex example views, as well as some more advanced analytics.&lt;/p&gt;

&lt;p&gt;Posted with permission of the author: &lt;br&gt;
&lt;a href="https://www.zebrium.com/blog/author/larry-lancaster"&gt;Larry Lancaster&lt;/a&gt; @ Zebrium&lt;/p&gt;

</description>
      <category>devops</category>
    </item>
    <item>
      <title>You've Nailed Incident detection, what about Incident Resolution?</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Fri, 05 Jun 2020 01:35:16 +0000</pubDate>
      <link>https://forem.com/gdcohen/you-ve-nailed-incident-detection-what-about-incident-resolution-1737</link>
      <guid>https://forem.com/gdcohen/you-ve-nailed-incident-detection-what-about-incident-resolution-1737</guid>
      <description>&lt;p&gt;If you're reading this, you probably care a lot about Mean Time To Detect (MTTD) and Mean Time To Resolve (MTTR). You're also no doubt familiar with monitoring, incident response, war rooms and the like. Who of us hasn't been ripped out of bed or torn away from family or friends at the most inopportune times? I know firsthand from running world-class support and SRE organizations that it all boils down to two simple things: 1) all software systems have bugs and 2) It's all about how you respond. While some customers may be sympathetic to #1, without exception, all of them still expect early detection, acknowledgement of the issue and near-immediate resolution. Oh, and it better not ever happen again!&lt;/p&gt;

&lt;h2&gt;
  
  
  Fast MTTD. Check!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.pagerduty.com/" rel="noopener noreferrer"&gt;PagerDuty&lt;/a&gt; is clearly a leader in Incident Response and on-call Escalation Management. There are over 300 integrations for PagerDuty to analyze digital signals from virtually any software-enabled system to detect and pinpoint issues across your ecosystem. When an Incident is created through one of these monitoring integrations, say an APM tool, PagerDuty will mobilize the right team in seconds (read: this is when you get the "page" during your daughter's 5th birthday party). Fast MTTD. Check!&lt;/p&gt;

&lt;h2&gt;
  
  
  But what about MTTR? By R, I mean Resolve
&lt;/h2&gt;

&lt;p&gt;All great incident response tools will have workflow and run book automation mechanisms that can help &lt;strong&gt;restore&lt;/strong&gt; system operation quickly in some typical cases. But this doesn't get to the root cause so you can understand and &lt;strong&gt;resolve&lt;/strong&gt; the issue and not let it happen again. For that, enter the all-too-common "War Room". That term and concept was first coined in 1901 but was probably made most famous by Winston Churchill during WWII where the Cabinet War Room was the epicenter of intelligence gathering, data analysis and communications throughout the war. Back then it was the telegraph, phones, radio signals and maps on the wall. Today it's likely a virtual room using Zoom, Slack, real-time visualizations, cell phones, and most important, logs. Millions and millions of logs! But, the prevailing attitude of the War Room has remained unchanged - "If you're going through hell, keep going".&lt;/p&gt;

&lt;p&gt;The initial signal that triggered the incident was likely from an alert which perhaps detected that a predefined threshold was "out of tolerance" however simple or complex that may be. Or perhaps from an alert you defined in a ping-tool or maybe some home grown live tail watching for spikes in error counts or some similar patterns. Whatever the means, it was based on some predefined rule(s) to detect symptoms of a problem. In most cases, the next step is determining the root cause. For example, the symptom that triggered the signal might have been that latency was too high, but this tells you nothing about the root cause.&lt;/p&gt;

&lt;p&gt;Whether you formalize a designated War Room for a particular incident or not, two things are certain: 1) timely, thorough and accurate communication between team members is paramount and 2) You're likely going to search through logs and drill down on various metrics to get to the root cause. And this &lt;a href="https://www.zebrium.com/blog/is-log-management-still-the-best-approach" rel="noopener noreferrer"&gt;brute force searching through logs&lt;/a&gt; and metrics is probably your hell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop going through Hell
&lt;/h2&gt;

&lt;p&gt;Many monitoring tools have started to utilize various machine learning and anomaly detection techniques to raise that first signal to trigger an incident response, often via tools like PagerDuty. However, these techniques still require too much human input to handpick which metrics to monitor, and to choose specific algorithms or tuning parameters. Anomaly detection in monitoring tools is predominately geared towards time-series data and rarely for logs. Yet logs are indispensable for root case analysis. This makes these tools blind to the root cause of any issue and will ultimately require time consuming drill-down and hunting through the logs. Millions and millions of logs!&lt;/p&gt;

&lt;p&gt;By contrast, Zebrium's machine learning detects correlated anomalies and patterns in both logs and metrics and uses them to automatically catch and characterize critical incidents and show you root cause (see - &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted" rel="noopener noreferrer"&gt;The Anomaly Detection You Actually Wanted&lt;/a&gt;. This means faster MTTR and no more hunting for root cause! We call this &lt;a href="https://www.zebrium.com/blog/beyond-anomaly-detection-how-incident-recognition-drives-down-mttr" rel="noopener noreferrer"&gt;Incident Recognition&lt;/a&gt; and it's part of our Autonomous Monitoring platform.&lt;/p&gt;

&lt;p&gt;Now, let me show you how you can tie your existing incident management workflow together with automatic root cause identification, regardless of the triggering signal -- for fast incident resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Augmenting detection with Zebrium automatic root cause identification
&lt;/h2&gt;

&lt;p&gt;Zebrium uses unsupervised machine learning to &lt;a href="https://www.zebrium.com/blog/log-metrics-anomaly-detection-as-a-foundation-of-autonomous-monitoring" rel="noopener noreferrer"&gt;automatically detect and correlate anomalies and patterns across both logs and metrics&lt;/a&gt;. These signals form the basis for automated Incident Detection and Root Cause identification.&lt;/p&gt;

&lt;p&gt;In addition to autonomous monitoring, we can also consume external signals to inform our Incident Detection. Imagine any one of your monitoring tools in your PagerDuty ecosystem has created an Incident and you get "The Call" (at one of those inopportune moments). What happens? Well you probably already know the pain that will lie ahead. But what if instead you looked at the PagerDuty Incident and a full report of the anomalous logs and metrics surrounding the incident -- including the root cause - was already there, at your fingertips.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Part 1 - If you use PagerDuty&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Your monitoring tool raises an alarm&lt;/li&gt;
&lt;li&gt; Through an existing integration with PagerDuty, an incident is created and the escalation policy fires (the war room is now open)&lt;/li&gt;
&lt;li&gt; At that same instant, PagerDuty automatically calls an outbound webhook to Zebrium with all the incident details it has.&lt;/li&gt;
&lt;li&gt; Zebrium correlates those incident details with its Autonomous Incident Detection and Root Cause by looking across logs and metrics&lt;/li&gt;
&lt;li&gt; The PagerDuty incident is updated with Zebrium Incident details and likely root cause via the PagerDuty API&lt;/li&gt;
&lt;li&gt; If you need to drill down further, it's just one click from your PagerDuty Incident.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png%3Fwidth%3D818%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png%3Fwidth%3D818%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause-1.png" alt="PagerDuty with Zebrium to augment incidents with root cause"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Part 2 - If you use Slack as your incident management workspace&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Zebrium's Autonomous Monitoring platform can consume any external signal to inform and correlate incident detection and root cause. Let's say for example, you're working with colleagues and communicating in a Slack channel that has Zebrium's integration enabled in the workspace. Just type a command (or get your Bot to do it) to ask Zebrium for help and we'll pull together all the relevant anomalies, logs, metrics and provide near instant drill down capabilities to get you to resolution fast! All from Slack.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; You setup a slack channel for your Virtual War Room. You get the team together and you're looking at data from the APM tool and see some troubling stat&lt;/li&gt;
&lt;li&gt; You type "/&lt;em&gt;zebrium incident analyze&lt;/em&gt;" to call on Zebrium for analysis and root cause&lt;/li&gt;
&lt;li&gt; Here it is... no more pain!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1 - The War Room&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png%3Fwidth%3D931%26name%3DSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png%3Fwidth%3D931%26name%3DSlack%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause.png" alt="Slack with Zebrium to augment incidents with root cause"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2 - Zebrium slash command in action&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png%3Fwidth%3D994%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png%3Fwidth%3D994%26name%3DPagerDuty%2520with%2520Zebrium%2520to%2520augment%2520incidents%2520with%2520root%2520cause%25202.png" alt="PagerDuty with Zebrium to augment incidents with root cause 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3 - Zebrium Incident UI showing root cause and correlated metrics anomalies&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png%3Fwidth%3D908%26name%3DZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2FZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png%3Fwidth%3D908%26name%3DZebrium%2520Incident%2520-%2520root%2520cause%2520and%2520correlated%2520metrics%2520anomalies.png" alt="Zebrium Incident UI showing root cause and correlated metrics anomalies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let Zebrium take care of MTTR
&lt;/h2&gt;

&lt;p&gt;Using the above integrations, you can now augment existing incidents that have been detected by any tool with Zebrium. In doing so, your incident will be automatically augmented with details of root cause without all the hunting, scrambling and adrenaline that is normally associated with a war room.&lt;/p&gt;

&lt;p&gt;You can get started for free by visiting &lt;a href="https://www.zebrium.com/" rel="noopener noreferrer"&gt;https://www.zebrium.com&lt;/a&gt;. Further details of PagerDuty and Slack incident augmentation will be coming soon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now that's MTTR!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Posted with permission of the original author &lt;a href="https://www.zebrium.com/blog/author/rod-bagg" rel="noopener noreferrer"&gt;Rod Bagg @ Zebrium&lt;/a&gt; &lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
    </item>
    <item>
      <title>Is Log Management Still the Best Approach?</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Tue, 02 Jun 2020 22:08:25 +0000</pubDate>
      <link>https://forem.com/gdcohen/is-log-management-still-the-best-approach-3keh</link>
      <guid>https://forem.com/gdcohen/is-log-management-still-the-best-approach-3keh</guid>
      <description>&lt;p&gt;Disclosure -- I work for &lt;a href="https://www.zebrium.com/" rel="noopener noreferrer"&gt;Zebrium&lt;/a&gt;. Part of our product does what most log managers do: aggregates logs, makes them searchable, allows filtering, provides easy navigation and lets you build alert rules. So why write this blog? Because in today's cloud native world (microservices, Kubernetes, distributed apps, rapid deployment, testing in production, etc.) while useful, log managers can be a time sink when it comes to detecting and tracking down the root cause of software incidents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick history
&lt;/h2&gt;

&lt;p&gt;When troubleshooting software problems, engineers have forever hunted through logs to find root cause.&lt;/p&gt;

&lt;p&gt;This used to be done manually by writing perl scripts, or using native tools like vi, grep, sed, awk, etc. This changed in the early 2000's when log managers appeared on the scene, makiing this process smoother, faster and more scalable. Splunk, the first commercial product to arrive, was aptly termed "Google for log files". &lt;/p&gt;

&lt;p&gt;Since then, log management tools have proliferated with a mix of open source tools like the Elastic Stack (often called ELK Stack, short for Elasticsearch, Logstash and Kibana) and commercial products like Sumologic. Today, they vie for leadership in dimensions such as cost, scalability, and speed of search, but they are all still based on the fundamental idea of &lt;em&gt;making logs easier to search&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is &lt;strong&gt;&lt;em&gt;search&lt;/em&gt;&lt;/strong&gt; still the right paradigm?
&lt;/h2&gt;

&lt;p&gt;Troubleshooting and finding root cause require patience, skill, experience and intuition. With enough time, a skilled operator can usually determine root cause. The process typically starts with a search for keywords like error, critical, abort, panic, etc. And then continues with a journey of iterative searches that narrow things down to root cause.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"I don't know what I'm looking for, but I'll know when I find it!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But some problems don't show themselves through obvious error severity log events and some are elusive because they're intermittent and hard to characterize, etc. Where do you even start when all you know is that a user said, "my screen just froze"?&lt;/p&gt;

&lt;h2&gt;
  
  
  Complexity and scale make things worse
&lt;/h2&gt;

&lt;p&gt;When Splunk was founded in 2003, things were a lot simpler: Apps were monolithic, mostly deployed on-prem and log volumes were relatively small (fewer log files with fewer lines per file). When something went wrong, it would typically impact one customer at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fcomplexity%2520impacts%2520mttr.png%3Fwidth%3D545%26name%3Dcomplexity%2520impacts%2520mttr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fcomplexity%2520impacts%2520mttr.png%3Fwidth%3D545%26name%3Dcomplexity%2520impacts%2520mttr.png" alt="complexity impacts mttr"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But with today's distributed SaaS applications and extensive use of microservices, things are very different. It's not uncommon to see apps that have hundreds of microservices and produce billions of log lines a day. The process of iteratively searching through so many logs across so many services, with a vast and ever-growing set of failure modes can be very daunting, especially while multiple customers are waiting for an issue to be resolved. How do you know what to search for and how do you sift through the huge volumes of data that your searches might return?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fhumans%2520do%2520not%2520scale%2520with%2520complexity.png%3Fwidth%3D489%26name%3Dhumans%2520do%2520not%2520scale%2520with%2520complexity.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fhumans%2520do%2520not%2520scale%2520with%2520complexity.png%3Fwidth%3D489%26name%3Dhumans%2520do%2520not%2520scale%2520with%2520complexity.png" alt="humans do not scale with complexity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, human-driven troubleshooting doesn't scale with complexity, and this is impacting Mean-Time-To-Resolution (MTTR) which today is measured in hours and days, driven by the long tail of obscure and previously unknown issues that keep cropping up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parsing to get at the payload
&lt;/h2&gt;

&lt;p&gt;Most logs are messy and unstructured (more accurately, there is usually clear structure for each individual type of log event, but within a log there might be thousands of different event types each with a different structure).&lt;/p&gt;

&lt;p&gt;This is even true for logs that conform to standards like syslog &lt;a href="https://tools.ietf.org/html/rfc5424" rel="noopener noreferrer"&gt;RFC 5424&lt;/a&gt;. It defines that a log line should have structured components like a timestamp, severity, process ID, etc. But, what is often the most important part of a log line -- its payload -- has no structure at all (from the RFC, "The MSG part contains a free-form message that provides information about the event"). Even the recent trend of structuring logs in JSON or XML is often plagued with the same issue, where buried in a cleanly structured blob sits the same old payload in a single unstructured field!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Enter the parser...&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let's say it's really important to get at specific information inside log lines to troubleshoot a problem. E.g. you want to compare the number of times status "timeout" occurred across all the different instances of a service for an event like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
May 27 11:56:11 host-47 myservice[24112]: Service instance X completed with status Y

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You would need to parse out fields X and Y. In the past you would have written a script and crafted &lt;a href="https://en.wikipedia.org/wiki/Regular_expression" rel="noopener noreferrer"&gt;regular expressions&lt;/a&gt; (regex) using grep, sed or awk. Today, each log management tool provides its own mechanism to parse out specific fields. For example, the open source logstash &lt;a href="https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html" rel="noopener noreferrer"&gt;grok plugin filter&lt;/a&gt;. Unfortunately, it takes a lot of time and effort to build and maintain these fragile parsing expressions. Especially as log events change across different software versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quest for automation: do log managers help?
&lt;/h2&gt;

&lt;p&gt;Automation is what sets apart the best DevOps teams. Google dedicates an entire chapter to automation in their famous &lt;a href="https://landing.google.com/sre/sre-book/chapters/automation-at-google/" rel="noopener noreferrer"&gt;SRE book&lt;/a&gt;. One of the headings in that chapter famously reads:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fautomate%2520yourself%2520out%2520of%2520a%2520job-1.png%3Fwidth%3D785%26name%3Dautomate%2520yourself%2520out%2520of%2520a%2520job-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.zebrium.com%2Fhs-fs%2Fhubfs%2FAssets%2Fblog%2520images%2Fautomate%2520yourself%2520out%2520of%2520a%2520job-1.png%3Fwidth%3D785%26name%3Dautomate%2520yourself%2520out%2520of%2520a%2520job-1.png" alt="automate yourself out of a job-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Log managers are useful for automating the detection and root cause identification of some software incidents. This is achieved by building &lt;strong&gt;alert rules&lt;/strong&gt; that monitor logs for particular events, values within events and/or sequences of log events. As long as you know what the events/values are that characterize the problem, this approach can work well.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;You can't automate the unknown unknowns&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Unfortunately, you can only build alert rules for symptoms / causes that you understand and can be well-defined through log events. This leaves a big gap for incidents where you don't know the cause, the symptoms or both. In these cases, the troubleshooting process relies entirely on the skill of the operator and the searches and techniques used to uncover root cause -- which (as discussed above) is hard to scale as complexity increases. For example, you might be able to build an alert that tells you when latency is too high (known symptom), but you would still need to manually search for one of the thousands of possible root causes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is there a better way?
&lt;/h2&gt;

&lt;p&gt;The idea of building a tool that aggregates and makes your logs searchable was revolutionary and log managers have proven to be useful and better than the alternative of writing scripts and building pipelines to collect and manage logs. But what worked well almost two decades ago ("Google for log files") hasn't kept up with the complexity of today. The manual process of searching for an obscure, previously unknown failure among hundreds of log streams can be extremely costly.&lt;/p&gt;

&lt;p&gt;We believe that a fundamentally different approach is needed -- one that is based on machine learning rather than human-driven search. It might sound far-fetched, but despite the complexity of today's apps, software still breaks in fundamental ways that are visible as pattern changes in logs. In the same way that skilled DevOps engineers are adept at finding these patterns, machine learning models can be trained to do the same thing. And machine learning, unlike humans, can scale with complexity. If you're interested in learning more, please read our blog: &lt;a href="https://www.zebrium.com/blog/the-future-of-monitoring-is-autonomous?utm_source=blog&amp;amp;utm_content=pwlm" rel="noopener noreferrer"&gt;The Future of Monitoring is Autonomous&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Written by: &lt;a href="https://www.zebrium.com/blog/author/gavin-cohen" rel="noopener noreferrer"&gt;Gavin Cohen&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Beyond Anomaly Detection: How Incident Recognition Drives down MTTR</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Wed, 20 May 2020 17:40:46 +0000</pubDate>
      <link>https://forem.com/gdcohen/beyond-anomaly-detection-how-incident-recognition-drives-down-mttr-479n</link>
      <guid>https://forem.com/gdcohen/beyond-anomaly-detection-how-incident-recognition-drives-down-mttr-479n</guid>
      <description>&lt;h2&gt;
  
  
  The State of Monitoring
&lt;/h2&gt;

&lt;p&gt;Monitoring is about catching unexpected changes in application behavior. Traditional monitoring tools achieve this through alert rules and spotting outliers in dashboards. While this traditional approach can typically catch failure modes with obvious service impacting symptoms, it has two limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  There is a long tail of problems that are not service impacting in the aggregate, but impact some aspect of the user experience (e.g. software bugs that give a user an unexpected error, or incorrect results). Traditional &lt;a href="https://www.zebrium.com/blog/using-machine-learning-to-shine-a-light-inside-the-monitoring-black-box"&gt;(black box)&lt;/a&gt; monitoring approaches do not attempt to catch all of these due to the complexity of the task (setting up and maintaining rules for each unique problem).&lt;/li&gt;
&lt;li&gt;  The root cause is not identified -- many failure modes have similar symptoms, so it takes time consuming investigation to identify the root cause. And shrinking time to resolution is one of the biggest challenges of managing a modern service -- high Mean-Time-To-resolution (MTTR) hurts both customer loyalty and team productivity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TXkFzEai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/mttr%2520vs%2520service%2520complexity.png%3Fwidth%3D300%26name%3Dmttr%2520vs%2520service%2520complexity.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TXkFzEai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/mttr%2520vs%2520service%2520complexity.png%3Fwidth%3D300%26name%3Dmttr%2520vs%2520service%2520complexity.png" alt="mttr vs service complexity"&gt;&lt;/a&gt;In either case, the burden is on the human -- to spot outliers in dashboards, drill down progressively, and inevitably - know what to search for in logs.&lt;/p&gt;

&lt;p&gt;However, this doesn't scale as application complexity grows and failure modes multiply. There are simply too many unknown failure modes, too much data to scan, and too many variants of log messages to search for. Some new entrants to the space focus on improving the speed, cost or scalability of search. While welcome, this does nothing to address the bottleneck -- which is the human brain's ability to know what to search for in a given situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Machine Learning and Anomaly Detection To the Rescue -- Sort Of&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Many tools have started to offer add-on machine learning features to augment human effort. While a welcome addition, it still leaves too much work for the human. Users are required to choose specific time series to track, choose the right anomaly detection technique for each one, and then be presented with visualizations of outliers to further analyze. This can be useful in &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hIuW-vQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/machine%2520learning%2520anomaly%2520detection.png%3Fwidth%3D300%26name%3Dmachine%2520learning%2520anomaly%2520detection.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hIuW-vQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/machine%2520learning%2520anomaly%2520detection.png%3Fwidth%3D300%26name%3Dmachine%2520learning%2520anomaly%2520detection.png" alt="machine learning anomaly detection"&gt;&lt;/a&gt;scenarios where a user knows exactly what types of deviations they want to analyze (and for which metrics). But it is not useful for catching the wide range of unknown unknowns that might impact the application. And traditional tools only offer this toolset for time series data (e.g. metrics) -- it is rare to see a &lt;a href="https://www.zebrium.com/blog/log-anomaly-detection-as-a-foundation-of-autonomous-monitoring"&gt;meaningful anomaly detection solution for logs&lt;/a&gt;, let alone the ability to correlate log and metric anomalies. This makes these tools blind to the root cause of any issue, and requires further time consuming drill down such as log searches.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Evolution of Machine Learning -- Autonomous Incident Recognition&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By contrast, Zebrium built machine learning (ML) based anomaly detection as the foundation, so took a very different approach. Our software automatically detects anomalies in ALL log events, and ALL metrics. We do all the work for the user -- no need to handpick which log events or metrics to track via anomaly detection, nor algorithms, corrections and other controls. We automatically apply the best technique for each type of data and adapt the behavior as the application changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--12HOgISB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/the%2520observability%2520hierarchy.png%3Fwidth%3D1319%26name%3Dthe%2520observability%2520hierarchy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--12HOgISB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/the%2520observability%2520hierarchy.png%3Fwidth%3D1319%26name%3Dthe%2520observability%2520hierarchy.png" alt="the observability hierarchy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But this is not the special part. What's unique about this approach is that it automatically &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rniBRqTS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/incident%2520recognition%2520with%2520root%2520cause.png%3Fwidth%3D333%26name%3Dincident%2520recognition%2520with%2520root%2520cause.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rniBRqTS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/incident%2520recognition%2520with%2520root%2520cause.png%3Fwidth%3D333%26name%3Dincident%2520recognition%2520with%2520root%2520cause.png" alt="incident recognition with root cause"&gt;&lt;/a&gt;identifies correlated patterns of anomalies that define service incidents. It doesn't just show pretty charts and make the user figure out how this might correlate to other issues in the application. Instead it automatically groups together all related log and metric anomalies, identifies the possible root cause, the hotspots (nodes, container/log types etc.), and creates a fully defined incident summary for the user. You can see some real life examples &lt;a href="https://www.zebrium.com/blog/is-autonomous-monitoring-the-anomaly-detection-you-actually-wanted"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This has two huge benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It is capable of detecting the long tail of incidents that don't necessarily trigger the symptom alerts at an aggregate service level. This includes issues such as software bugs, latent infrastructure degradation, problems in inter-service interaction, database issues, container orchestration issues and even security issues.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UAWvG3tP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/zebrium%2520improves%2520mttr%2520vs%2520service%2520complexity.png%3Fwidth%3D300%26name%3Dzebrium%2520improves%2520mttr%2520vs%2520service%2520complexity.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UAWvG3tP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/zebrium%2520improves%2520mttr%2520vs%2520service%2520complexity.png%3Fwidth%3D300%26name%3Dzebrium%2520improves%2520mttr%2520vs%2520service%2520complexity.png" alt="zebrium improves mttr vs service complexity"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It doesn't just detect an incident - by automatically creating a summary of all the anomalous events and metrics patterns surrounding the incident, it slashes time to root cause and resolution. And it does this not by correlating meta-data, notes or tags from a library of previously known incidents, rather it detects brand new incidents with high signal to noise. This includes all the unknown unknowns that crop up regularly in a modern cloud native application, without peppering them with lots of useless false positives.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MaOkw1m7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/Examples%2520of%2520incidents%2520caught%2520with%2520Zebrium%2520Autonomous%2520Monitoring.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MaOkw1m7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/Blog%2520-%2520beyond%2520anomaly%2520detection/Examples%2520of%2520incidents%2520caught%2520with%2520Zebrium%2520Autonomous%2520Monitoring.png" alt="Examples of incidents caught with Zebrium Autonomous Monitoring"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is why we believe Autonomous Monitoring, which includes autonomous Incident Recognition is the future of monitoring. You can try it for yourself. &lt;a href="https://www.zebrium.com/sign-up"&gt;Getting started is free and takes less than two minutes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the author &lt;a href="https://www.zebrium.com/blog/author/ajay-singh"&gt;Ajay Singh&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Busting the Browser's Cache</title>
      <dc:creator>gdcohen</dc:creator>
      <pubDate>Tue, 12 May 2020 21:56:42 +0000</pubDate>
      <link>https://forem.com/gdcohen/busting-the-browser-s-cache-4h3c</link>
      <guid>https://forem.com/gdcohen/busting-the-browser-s-cache-4h3c</guid>
      <description>&lt;p&gt;A new release of your web service has just rolled out with some awesome new features and countless bug fixes. A few days later and you get a call: Why am I not seeing my what-ch-ma-call-it on my thing-a-ma-gig? After setting up that zoom call it is clear that the browser has cached old code, so you ask the person to hard reload the page with Ctrl-F5. Unless its a Mac in which case you need Command-Shift-R. And with IE you have to click on Refresh with Shift. You need to do this on the other page as well. Meet the browser cache, the bane of web service developers!&lt;/p&gt;

&lt;p&gt;In this blog we share how we struggled and finally busted the browser cache for new releases of the Zebrium web service, including design and implementation details. Buckle up, it's a bumpy ride!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What Didn't Work?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;At Zebrium we build our front-end using React. We find React to be extremely flexible, making it easy to write and maintain a variety of components from simple deployment drop-down menus to complex log and metric visualizations, all with a distinctive Zebrium dark-mode style.&lt;/p&gt;

&lt;p&gt;Our build-test-deploy strategy is based on the create-react-app framework. Like React itself, that framework has served us well, but, like many who adopted it in the last few years, we suffered from one pretty big gotcha. Aggressive browser caching of application resources. So aggressive, that our users were missing out on key feature updates and bug fixes because the UI code they had in their browser cache was outdated. For a start-up with a need to quickly iterate on customer feedback, this was a real pain point.&lt;/p&gt;

&lt;p&gt;Our customer-service team identified the issue first and the pattern of the problem was elusive.  Many users would see the upgrades automatically. But some would not.  Zebrium has always been lucky to have dedicated and enthusiastic users who understand our value proposition; luckily no more so than at moments like this. So, while we worked through the issue, customer-service helped affected users to clear their caches manually whenever we deployed a new version. But this was painful for us and the customers.&lt;/p&gt;

&lt;p&gt;Before the UI team understood the root of the problem, we stepped through the usual remedies. We had our web server deliver headers with ever stricter cache-control settings. We reduced max-age from weeks to days and so on.  That wasn't ideal because theoretically it meant users would be pulling down code versions their browser had already cached. We were surprised to see that approach did not solve the problem either. And we even threw pragma: no-cache at it, a Hail-Mary that unfortunately had no effect. &lt;/p&gt;

&lt;p&gt;So, we began our investigation into create-react-app to discover why these tried-and-true HTTP client/server mechanisms were failing. After a lot of work, we finally isolated the issue to this: our version of create-react-app employed a service worker to cache content. That explained why some users encountered the problem while others did not. Users who were in the habit of closing their browser often did not see the problem. Users who kept their browser up for days and kept our app open in one or more tabs never saw our updates because the service worker was holding on to an old version of our UI code in cache. Here's a good discussion on create-react-app's Github page that lays out the issue and possible solutions ( &lt;a href="https://github.com/facebook/create-react-app/issues/5316"&gt;https://github.com/facebook/create-react-app/issues/5316&lt;/a&gt; ).  At the time of our investigation, we weren't in a position to take and test a new version of the create-react-app framework or to test some of the workarounds mentioned in that discussion. So, we decided to go old school, exposing versioning in our app path. It has worked very well.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Summary of what we did&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In every UI build, we set the software version as a custom environment variable in the .env file prefix with REACT_APP_.  We can then access the current running version by referencing process.env.REACT_APP_MY_SOFTWARE_VERSION defined in .env. The current software version that the browser is running is also embedded in the URL and the software version is persisted throughout all UI route paths. &lt;/p&gt;

&lt;p&gt;Whenever an API call is invoked from any page, it returns the software version currently running on the server.  If the server and UI are in sync, the software versions will be the same. No more work to be done. However, if the API returned software version is different from process.env.REACT_APP_MY_SOFTWARE_VERSION, we throw up a popup dialog displaying a message saying a newer version has been detected. It includes a button the user can click to reload the page with content from the new software version.  The newly loaded software version will then be reflected in the URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n2wsp5oQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/New%2520UI%2520version%2520detected.png%3Fwidth%3D514%26name%3DNew%2520UI%2520version%2520detected.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n2wsp5oQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.zebrium.com/hs-fs/hubfs/Assets/blog%2520images/New%2520UI%2520version%2520detected.png%3Fwidth%3D514%26name%3DNew%2520UI%2520version%2520detected.png" alt="New UI version detected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's run through this in more detail...&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Routing&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once we decided to take the version in the URL approach, everything was simple, right? Sort of. Our web pages are served from the same Go application that serves the API. We had the build script generate a bit of Go code to compile the release version into the binary and altered the routing to put the release version into the path for serving the static content of the UI. This handler function takes a http.FileSystem that is initialized to the root UI directory and a string with the release version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func FileServerNotFoundRedirect(fs http.FileSystem, redirect string) http.Handler {
    fsh := http.FileServer(fs)
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        if strings.HasPrefix(r.URL.Path, redirect) {
            r.URL.Path = r.URL.Path[len(redirect):]
            fd, err := fs.Open(path.Clean(r.URL.Path))
            if os.IsNotExist(err) {
                r.URL.Path = "/"
            }
            if err == nil {
                fd.Close()
            }
            fsh.ServeHTTP(w, r)
        } else {
            uri := r.RequestURI
            comps := strings.Split(uri, "/")
            if len(comps) &amp;gt; 1 {
                uri = uri[1+len(comps[1]):]
            }
            RedirectHTTPS(w, r, redirect+uri)
        }
    })
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The first condition of the IF statement is fairly straight forward. When you have the release name at the start of the path, remove it and serve the request. Here when the requested file is not found we are serving up the root (index.html) required for routing within the UI. But what if the request comes in with an old release number? In that case we compose a new URL replacing the old version with the new one and then redirect the browser to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
func RedirectHTTPS(w http.ResponseWriter, r *http.Request, redirect string) {
    url := fmt.Sprintf("%s://%s:%s%s",
        os.Getenv("ZWSD_PROTOCOL"),
        strings.Split(os.Getenv("ZWSD_DOMAINS"), ",")[0],
        os.Getenv("ZWSD_ORIGIN_PORT"),
        redirect)
    http.Redirect(w, r, url, http.StatusMovedPermanently)
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It is important to note that we need the full browser's view of the URL beginning with the protocol (HTTP or HTTPS) and endpoint it is connecting to. This is the same server name that terminates an HTTPS connection which might be a proxy or load-balancer. Then we use the built-in "http" library to form a redirect response. This gets the new version into the browser's URL.&lt;/p&gt;

&lt;p&gt;The last bit of work in the Go server was to return the version string on most every API request. We had already decided to encapsulate every response so adding the version involved adding a new tag to the top level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
{
    "data": [ array of data returned from the API ],
    "error": {
        "code": 200,
        "message": ""
    },
    "op": "read",
    "softwareRelease": "20200506071506"
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Well, that's it! It was a long journey for us, but since making this change, we haven't been bitten by the browser cache again. And, as further proof that it's been working well, we've been delighted by how many more of our customers have started commenting on the great new what-ch-ma-call-it on my thing-a-ma-gig features we've been releasing 😀 We only wish we had done this sooner.&lt;/p&gt;

&lt;p&gt;If you want to see it in action -- take our product for a free test run by visiting &lt;a href="https://www.zebrium.com/"&gt;www.zebrium.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Posted with permission of the authors:&lt;br&gt;
&lt;a href="https://www.zebrium.com/blog/author/alan-jones-roy-selig-and-ko-wang"&gt;Alan Jones, Roy Selig and Ko Wang @ Zebrium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>uiweekly</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
