<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roshan shetty</title>
    <description>The latest articles on DEV Community by Roshan shetty (@roshan8).</description>
    <link>https://dev.to/roshan8</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%2F312543%2F7d287c90-7dd1-43f5-837e-e91b286e8265.jpeg</url>
      <title>DEV Community: Roshan shetty</title>
      <link>https://dev.to/roshan8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roshan8"/>
    <language>en</language>
    <item>
      <title>Introducing our open source SLO Tracker - A simple tool to track SLOs and Error Budget</title>
      <dc:creator>Roshan shetty</dc:creator>
      <pubDate>Wed, 08 Sep 2021 11:10:53 +0000</pubDate>
      <link>https://dev.to/squadcast/introducing-our-open-source-slo-tracker-a-simple-tool-to-track-slos-and-error-budget-4dp</link>
      <guid>https://dev.to/squadcast/introducing-our-open-source-slo-tracker-a-simple-tool-to-track-slos-and-error-budget-4dp</guid>
      <description>&lt;p&gt;&lt;em&gt;One of the tools we use internally at Squadcast for SLO and Error Budget tracking is now open-source. In keeping up with the SRE ideology of automating as many ops tasks as possible, we built this &lt;a href="https://slotracker.com/" rel="noopener noreferrer"&gt;SLO Tracker&lt;/a&gt;. We made this open-source so that the SRE community can also use it too. Looking forward to get your feedback, suggestions and patches :)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Introduction to SLO tracking&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The tenet of a strong SRE culture lies in responsibly managing Error Budgets. However, you can only calculate error budgets after establishing the expected service SLOs in agreement with all the relevant stakeholders.&lt;/p&gt;

&lt;p&gt;After defining organization-wide SLOs, and the subsequent SLIs (to track SLAs), calculating Error Budgets is just a numbers-game. In short, these metrics are the foundation to establish a strong SRE culture and I cannot stress enough on how it promotes accountability, trust and timely innovation.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What are SLOs and SLIs?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let’s understand this with an example. Assuming that your Service Level Indicators (SLIs) are - “&lt;strong&gt;xyz is true&lt;/strong&gt;”, then the Service Level Objectives (SLOs) which are organization-level objectives will read - “&lt;strong&gt;xyz is true for a % of time&lt;/strong&gt;” and the corresponding Service Level Agreements (SLAs) meant for external/ end users are legal contracts that say - “&lt;strong&gt;if xyz is not true for a % of time, then, so and so will be compensated&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;Typically, Error Budgets allow you to track downtime as real time with a burn rate. It is calculated as “1-(Service Level Objectives)”. So, an SLO of 99.99% yearly means it is acceptable for the service to be down for no more than 52.56 minutes in a year.&lt;/p&gt;

&lt;p&gt;The development team can spend their Error Budget however they feel is right - either by preventing or by fixing system instabilities.&lt;/p&gt;

&lt;p&gt;Ensuring service uptime is just one of the SRE objectives to ensure user gratification. A few other basic indicators concerning end user requirements could be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App load time should be less than 3 seconds,&lt;/li&gt;
&lt;li&gt;Load times for every feature in the app should be less than 3 seconds,&lt;/li&gt;
&lt;li&gt;Less buggy features rolled out - not more than 2 bugs reported by users in a span of 20 days,&lt;/li&gt;
&lt;li&gt;‘Update time’ for data inputs to reflect should be less than 4 seconds,&lt;/li&gt;
&lt;li&gt;And Retrieval of data within the app should be less than 2 seconds, to name a few.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put in simple words, there needs to be a balance between what is acceptable to the end user versus what is actually deliverable keeping in mind the effort and budget needed. Understanding where end users can compromise with the experience is key. Based on that, identifying the right target thresholds for the identified indicators would be easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Impact of SLOs on organizational SLAs&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The ideal way to start off is by doing just enough to reduce the number of complaints raised by the end user for a particular feature in the app. For example, when a user is trying to retrieve a huge data set from the app, they would be ready to accept a slight tolerance/ delay. In such a case, promising a 99% SLO for this indicator is both unnecessary and unrealistic. A more sensible target would be around 85% SLO. Even after satisfying this threshold, if users continue complaining, then the indicators and objectives along with their thresholds can be revisited.&lt;/p&gt;

&lt;p&gt;In addition to this, having telemetry and &lt;a href="https://www.squadcast.com/blog/using-observability-tools-to-set-slos-for-kubernetes-applications" rel="noopener noreferrer"&gt;observability&lt;/a&gt; in place is very important. Without tracking these indicators, you will not be able to measure end user experience against SLO thresholds. This also gives you a sense of the other dependent factors and how their performance can affect the overall performance of a feature or the application in general.&lt;/p&gt;

&lt;p&gt;Defining SLOs is a journey and not a destination. You should constantly refine your SLOs because with time, many factors change such as the user base, size of your app and user expectations, etc. Hence your SLOs should be defined mainly to achieve user satisfaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Challenges in SLO monitoring&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Over the years of setting up SLOs, I have come up against this routine challenge of dealing with False Positives. No matter how efficient or accurate, monitoring tools will sometimes flag an event as an issue in spite of no violation of SLOs. Thus triggering a false positive. So keep in mind that building an efficient, battle-tested and trustingly insightful platform takes time.&lt;/p&gt;

&lt;p&gt;During the early days, I’ve noticed teams getting a lot of false positives, which will eat into the Error Budget. And I’ve always yearned for a feature that can help me easily mark events as false positives so as to get precious minutes back into the Error Budget. This helps in practicing observability with actionable data.&lt;/p&gt;

&lt;p&gt;Another basic challenge faced by engineers in organizations is tracking all the defined SLIs. Since SLOs are monitored by multiple tools in the observability stack, not maintaining a unified dashboard to accurately track the error budget will make them oblivious to the error budget burn rate.&lt;/p&gt;

&lt;p&gt;Thus a single source of truth with multiple SLOs (across all services) tracked in one place, will ensure greater reliability. In most cases, services will be dependent on one another and thus outages are inevitable. The aim here is not just to 'not fail'. Instead, it is about failing measurably and with enough insights to mend it, we can ensure it does not happen again.&lt;/p&gt;

&lt;p&gt;The challenges can be summarized as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lack of a centralized dashboard for tracking SLIs (from multiple alert sources)&lt;/li&gt;
&lt;li&gt;Too many ‘False Positives’ eating into the error budget&lt;/li&gt;
&lt;li&gt;Short retention period of metrics stored in Prometheus (or other monitoring tools)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tackling these challenges which started off as a hobby, became my passion. And that is how this open-source project came into existence.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Introducing the SLO Tracker&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As someone who painstakingly experienced the challenges with SLO monitoring, I built this open source project “&lt;a href="https://slotracker.com/" rel="noopener noreferrer"&gt;SLO tracker&lt;/a&gt;” - as a simplified means to track the defined SLOs, Error Budgets, and Error Budget burn rate with intuitive graphs and visualizations. This dashboard is easy to set up and makes it simple to aggregate SLI metrics coming in from different sources.&lt;/p&gt;

&lt;p&gt;You will be required to first set up your target SLOs. The Error Budget will be calculated and allocated based on that. The SLO Tracker currently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provides a unified dashboard for all the SLOs that have been set up, in turn giving insights into the SLIs being tracked&lt;/li&gt;
&lt;li&gt;Gives you a clear visualisation of the Error Budget and alerts you when Error Budget burn rate threshold gets breached&lt;/li&gt;
&lt;li&gt;Supports Webhook integrations with various observability tools (Prometheus, Pingdom, New Relic) and whenever an alert is received from these tools, the tracker will re-calculate and reduce time from the allocated Error Budget&lt;/li&gt;
&lt;li&gt;Provides the ability to claim your falsely spent Error Budget back by marking erroneous SLO violation alerts as False Positives&lt;/li&gt;
&lt;li&gt;Supports manual alert creation from the web app when a violation is not caught:

&lt;ul&gt;
&lt;li&gt;Either by your monitoring tool due to various reasons, but should have been&lt;/li&gt;
&lt;li&gt;Or, if your monitoring tool is not integrated with SLO Tracker&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Displays basic Analytics for SLO violation distribution (SLI distribution graph)&lt;/li&gt;

&lt;li&gt;Is easy to set up, lightweight since it only stores and computes what matters (SLO violation alerts) and not the bulk of the data (every single metric)&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to set this up?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docker-compose file is already part of the project &lt;a href="http://github.com/roshan8/slo-tracker" rel="noopener noreferrer"&gt;repo&lt;/a&gt;. You can bring all the components up with it.&lt;/li&gt;
&lt;li&gt;Once all the components are up, Users can start adding SLOs from the frontend.&lt;/li&gt;
&lt;li&gt;"Alert Sources" button will have all the webhook links of supported integrations. Users can add these webhook URLs to their respective monitoring tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I hope this blog helped you understand the annoyance around SLO and Error Budget tracking. In keeping up with the SRE ideology of automating as many ops tasks as possible, we built this &lt;a href="https://slotracker.com/" rel="noopener noreferrer"&gt;SLO Tracker&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While this started off as a tool for internal use, we have now made it open-source for everyone to use, provide suggestions, code patches or contribute in any way that can make this a better tool. Let’s make the path to reliability a smoother ride for everyone :)&lt;/p&gt;

</description>
      <category>slo</category>
      <category>sre</category>
      <category>monitoring</category>
      <category>observability</category>
    </item>
    <item>
      <title>Faster Incident Resolution with Context Rich Alerts</title>
      <dc:creator>Roshan shetty</dc:creator>
      <pubDate>Wed, 16 Jun 2021 12:16:33 +0000</pubDate>
      <link>https://dev.to/squadcast/faster-incident-resolution-with-context-rich-alerts-264l</link>
      <guid>https://dev.to/squadcast/faster-incident-resolution-with-context-rich-alerts-264l</guid>
      <description>&lt;p&gt;&lt;em&gt;Labelling your alert payloads although simple can significantly improve the time it takes for your team to respond to incidents. In this blog learn how Squadcast's auto-tagging feature can be a game changer by enabling intelligent labelling &amp;amp; routing of alerts to ultimately reduce your MTTR.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A frequent problem faced by on-call engineers when critical outages occur is pinpointing the exact point of failure. Even though modern monitoring tools and incident management platforms provide context around each alert, there is still room for improvement. A relatively simple solution is to add labels to your alert payloads.&lt;/p&gt;

&lt;p&gt;As an on-call engineer, you may have faced a situation where a major alert took a long time to triage, often because the alert payload was missing crucial information like hostname/cluster-details etc. in a Kubernetes setup.&lt;/p&gt;

&lt;p&gt;In this blog, let's understand how we can add labels to important information within the payload so as to reduce MTTR (Mean time to respond).&lt;/p&gt;

&lt;p&gt;We’ll also explore how Prometheus Alert manager and Squadcast with &lt;a href="https://www.squadcast.com/effective-on-call-and-incident-response" rel="noopener noreferrer"&gt;Routing, and Tagging rules&lt;/a&gt; can ensure that Alert Payloads with specific labels are sent to the concerned engineers for faster remediation of issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A Payload Label can be used to classify the Payload data and identify crucial information. While we cover a Kubernetes specific example in this blog, this can be done with other monitoring tools as well.&lt;/p&gt;

&lt;p&gt;The below screenshot is an example of a basic Payload (without any labels).&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8683a0f614dec0bb0d8_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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8683a0f614dec0bb0d8_1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an on-call engineer, you will need more details about the alert such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IP address / hostname&lt;/li&gt;
&lt;li&gt;Cluster identification, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since this info. is not available in the payload, you have to manually fetch the IP address for troubleshooting the issue.&lt;/p&gt;

&lt;p&gt;Your life could’ve been simpler if you were given details such as IP addr., hostname, application name, severity level, environment name, etc., within the alert itself. You could have ignored the alert if it came from a test/staging environment as it would have had environment related labels in the payload.&lt;/p&gt;

&lt;p&gt;There is a relatively simple way to add labels to the payload using your preferred monitoring tool. In the following example, we will be using Prometheus Alert Manager to make context-rich alert payloads.&lt;/p&gt;

&lt;p&gt;Below screenshot is an example of a configuration file in Prometheus Alert manager that has labels for context-rich payloads.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Prometheus Alert manager config file&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;apiVersion:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;apps/v&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;kind:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Deployment&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;metadata:&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;name:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;pubsub&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;namespace:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;laddertruck&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;labels:&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;name:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"laddertruck"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;language:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ruby"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;language-version:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.0.0"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;framework:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rails"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;framework-version:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5.2.1"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;team:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"xyz"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;developed-by:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"diane"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;service-owner:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the various labels mentioned above.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to decide which labels to add to the payload?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Naming the labels will depend on the type of technology stack and on-call team you have in place. The type of labels to be used should be decided by the on-call team since they are the first responders when a critical outage occurs.&lt;/p&gt;

&lt;p&gt;The labels shown below are some of the common ones your team can use to get started with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;owner: This tag identifies the owner of the service.&lt;/li&gt;
&lt;li&gt;language: The programming language the service is written in.&lt;/li&gt;
&lt;li&gt;framework: The framework on which the service is built. This is vital if there are multiple services written in the same language but utilising different frameworks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now, let's setup an Alerting rule in the Prometheus Alert manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;alert:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;ContainerMemoryUsage&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;expr:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(sum(container_memory_working_set_bytes&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;namespace=&lt;/span&gt;&lt;span class="s2"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(instance,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;name)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;sum(container_spec_memory_limit_bytes&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;namespace=&lt;/span&gt;&lt;span class="s2"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(instance,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;name)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;for:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;m&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;labels:&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;severity:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;warning&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;annotations:&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;summary:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Container Memory usage (instance {{ $labels.instance }})"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;description:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Container Memory usage is above 90%&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt; VALUE = {{ $value }}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt; LABELS: {{ $labels }}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above rule, we are defining the conditions for severity in the alerting rule.&lt;/p&gt;

&lt;p&gt;So now, when an alert is sent to Squadcast from Alertmanager, all the relevant information will be embedded in the payload, such as severity, deployment and other labels mentioned in the Prometheus configuration file. We can make use of Squadcast &lt;a href="https://support.squadcast.com/docs/alert-routing" rel="noopener noreferrer"&gt;routing rules&lt;/a&gt; to efficiently manage/route the incident to the concerned person/ team.&lt;/p&gt;

&lt;p&gt;Furthermore, we can make use of the annotations option in alertmanager to send much more detailed and lengthy information in the alert payload. In organisations that are reliant on playbooks / runbooks on-call engineers can start troubleshooting right away rather than searching for the relevant playbook when an incident occurs.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d87fae5b694e862fd933_2.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d87fae5b694e862fd933_2.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;a href="https://www.google.com/url?q=https://prometheus.io/blog/2016/03/03/custom-alertmanager-templates/&amp;amp;sa=D&amp;amp;source=editors&amp;amp;ust=1623240723424000&amp;amp;usg=AOvVaw0b16lhyi_rIaXGusnpLrB0" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;



&lt;p&gt;As seen here, the alert notification from Prometheus contains a link to the internal runbook.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Configuring Squadcast with help of labels&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the screenshot below you can see how to configure Squadcast to route alerts based on the labels attached to the incident payload. Here the service which we are configuring is called “K8s Cluster Monitoring”.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d89b3a0f612e520bb117_3.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d89b3a0f612e520bb117_3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;‘Tagging Rules’&lt;/em&gt; is used to define the labels that will be processed by Squadcast. Once the ‘tags’ have been defined, &lt;em&gt;Routing Rules&lt;/em&gt; can be used to send alerts to the concerned person, team or escalation policy.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8a9bc317f652a0ed20a_4.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8a9bc317f652a0ed20a_4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the labels defined in the payload are now recognised as ‘tags’ in Squadcast. Once this step is complete we can define custom routing rules based on the ‘tags’.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8b9e095549693871964_5.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8b9e095549693871964_5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the screenshot above we have created three tags based on the following criteria: “service-owner”, “squad” and “deployed-by”.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8d65aa22e849e2e823f_6.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8d65aa22e849e2e823f_6.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that these tags have been defined, we can go on to create granular incident routing rules for the service. In the screenshot above we are creating a routing rule where if the alert payload has ‘serviceowner’ defined as ‘john’ the alert notification is sent directly to John.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8e357e7195452f6bd2b_7.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8e357e7195452f6bd2b_7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above we can see the routing rule being created when the alert payload has the label ‘team’ in it. We can see the alert notification getting routed to the specific team.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8f3f0ff15bbebc21f80_8.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d8f3f0ff15bbebc21f80_8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this instance the alert will be routed to the person who deployed the feature (‘Diane’)&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d903df40f4c4a465acbb_9.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d903df40f4c4a465acbb_9.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, we have seen alerts getting routed to specific individuals however it is also possible to route alers to predefined &lt;a href="https://support.squadcast.com/docs/escalation-policies" rel="noopener noreferrer"&gt;escalation policies&lt;/a&gt;. In the screenshot above we see an example of the same.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d9172ff9c9ab6b2888fe_10.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d9172ff9c9ab6b2888fe_10.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose multiple tags and boolean operators (‘AND’) to make routing rules as specific as possible and to cover as many possible scenarios.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d9172ff9c9ab6b2888fe_10.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d9172ff9c9ab6b2888fe_10.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Squadcast, Routing Rules are executed in a top-down approach. If the first rule is executed, then the remaining rules are automatically ignored. The &lt;a href="https://support.squadcast.com/docs/de-duplication-rules#faqs" rel="noopener noreferrer"&gt;Execution Priority&lt;/a&gt; feature helps in defining the order in which the rules will be implemented.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Other Benefits of context-rich alerts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Having contextual information around each payload is of great help during &lt;a href="https://www.squadcast.com/post-incident-review" rel="noopener noreferrer"&gt;post-mortems / reviews&lt;/a&gt; after major outages since detailed incident timelines are automatically created. While the concept of context-rich alert payloads may seem simple but in the long term can help improve reliability of your system.&lt;/p&gt;

&lt;p&gt;Below we can see an instance of an incident in Squadcast with their associated labels. With this rule-based, auto-tagging system you can now define customised tags based on incident payloads, that get automatically assigned to incidents when they are triggered.&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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d93592a9f6187bfc8df4_12.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%2Fuploads-ssl.webflow.com%2F5c9200c49b1194323aff7304%2F60c0d93592a9f6187bfc8df4_12.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In many cases it is not feasible to reduce the ad-hoc complexity of your existing architecture. This is where the combination of ‘context rich alerts’ + ‘intelligent routing’ helps to drastically reduce the MTTA and MTTR.&lt;/p&gt;

&lt;p&gt;The example provided above is just the tip of the iceberg - you can create custom labels and routing rules as well. As your infrastructure scales up with new users and dependencies, your MTTR will still be within acceptable limits thanks to better labeling and routing.&lt;/p&gt;

&lt;p&gt;What do you struggle with as a DevOps/SRE? Do you have ideas on how incident response could be done better in your organization? We would be thrilled to hear from you! Leave us a comment or reach out over a DM via &lt;a href="https://twitter.com/squadcasthq?lang=en" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; and let us know your thoughts.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.squadcast.com/" rel="noopener noreferrer"&gt;Squadcast&lt;/a&gt; is an incident management tool that’s purpose-built for SRE. Your team can get rid of unwanted alerts, receive relevant notifications, work in collaboration using the virtual incident war rooms, and use automated tools like runbooks to eliminate toil.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.squadcast.com/register/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F5c51758c58939b30a6fd3d73%2F5e16013f80ad26b00925d758_image--5--1.png"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bestpractices</category>
      <category>incidentresponse</category>
      <category>oncall</category>
    </item>
    <item>
      <title>How to track your product's SLO/ErrorBudget: A simple tool to keep track of things!</title>
      <dc:creator>Roshan shetty</dc:creator>
      <pubDate>Mon, 12 Apr 2021 07:19:31 +0000</pubDate>
      <link>https://dev.to/roshan8/how-to-track-your-product-slo-errorbudget-5a4a</link>
      <guid>https://dev.to/roshan8/how-to-track-your-product-slo-errorbudget-5a4a</guid>
      <description>&lt;p&gt;Today, Most of the organization track their product SLO’s to avoid being liable for breach of SLAs (Service level agreements). In case of any SLO violation, They will be under obligation to pay something in return for breach of contract. Once the SLO for their product has been defined, A corresponding error budget will be calculated based on that number. For example, If 99.99% is the SLO, then the error budget will be 52.56 mins in a year. That’s the amount of downtime that the product may have in a year without breaching the SLO.&lt;/p&gt;

&lt;p&gt;Once companies agree on the SLO, they need to pick the most relevant SLI’s(service level indicators). Any violation of these SLI’s will be considered as downtime and the duration of downtime will be deducted from the error budget. For example, a payment gateway product might have the following SLI’s.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Latency on p95 for requests&lt;/li&gt;
&lt;li&gt;ErrorRates&lt;/li&gt;
&lt;li&gt;Payment failures etc&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Additional reading:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://sre.google/workbook/implementing-slos/"&gt;https://sre.google/workbook/implementing-slos/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://sre.google/workbook/error-budget-policy/"&gt;https://sre.google/workbook/error-budget-policy/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why is it challenging for many companies to track error budgets at the moment?
&lt;/h2&gt;

&lt;p&gt;Usually, Organizations use a mix of tools to monitor/track these SLI’s (For eg: latency-related SLI’s generally tracked in APM’s such as Newrelic while other SLI’s tracked in monitoring tools such as Prometheus/Datadog etc). That makes it hard to keep track of the error budget in one centralized location.&lt;/p&gt;

&lt;p&gt;Sometimes companies have a very low retention period(&amp;lt;6 months) for their metrics in Prometheus. Retaining metrics for a longer period may require setting up Thanos/Cortex, federation rules, and performing capacity planning for their metrics storage.&lt;/p&gt;

&lt;p&gt;Next comes the problem of false positives - Even if you are tracking something in Prometheus, it’s hard to flag an event as false positive when the incident is not a genuine SLO violation. Building an efficient and battle-tested monitoring platform takes time. Initially, Teams might end up getting a lot of false positives. and you may want to mark some old violations as false positives to get minutes back into your error budget&lt;/p&gt;
&lt;h2&gt;
  
  
  What does the SLO tracker do?
&lt;/h2&gt;

&lt;p&gt;This error budget tracker seeks to provide a simple and effective way to keep track of the error budget, burn rate without the hassle of configuring and aggregating multiple data sources.   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users first have to set up their target SLO and the error budget will be allocated based on that.&lt;/li&gt;
&lt;li&gt;It currently supports webhook integration with few monitoring tools(Prometheus, Pingdom, and Newrelic) and whenever it receives an incident from these tools, It will reduce some error budget.&lt;/li&gt;
&lt;li&gt;If a violation is not caught in your monitoring tool or if this tool doesn’t have integration with your monitoring tool then the incident can be reported manually through the user interface.&lt;/li&gt;
&lt;li&gt;Provides some analytics into SLO violation distribution. (SLI distribution graph)&lt;/li&gt;
&lt;li&gt;This tool doesn’t require much storage space since this only stores violations but not every metric.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How to set this up?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clone the &lt;a href="https://github.com/roshan8/slo-tracker"&gt;repo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repo already has a docker-compose, So just run &lt;code&gt;docker-compose up -d&lt;/code&gt;, and your setup is done!&lt;/li&gt;
&lt;li&gt;Default creds are &lt;code&gt;admin:admin&lt;/code&gt;. This can be changed in &lt;code&gt;docker-compose.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Now set some SLO target in the UI.&lt;/li&gt;
&lt;li&gt;To integrate this tool with other monitoring tools, You can use the following webhook url’s.

&lt;ul&gt;
&lt;li&gt;For prometheus: serverip:8080/webhook/prometheus&lt;/li&gt;
&lt;li&gt;For Newrelic: serverip:8080/webhook/newrelic&lt;/li&gt;
&lt;li&gt;For Pingdom: serverip:8080/webhook/pingdom&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now set up rules to monitor SLI’s in your monitoring tool (Let’s see how this can be done in Prometheus). 
Alert manager rule to monitor an example SLI ==&amp;gt; &lt;code&gt;Nginx p99 latency&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  - alert: NginxLatencyHigh
    &lt;span class="nb"&gt;expr&lt;/span&gt;: histogram_quantile&lt;span class="o"&gt;(&lt;/span&gt;0.99, &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;rate&lt;span class="o"&gt;(&lt;/span&gt;nginx_http_request_duration_seconds_bucket[2m]&lt;span class="o"&gt;))&lt;/span&gt; by &lt;span class="o"&gt;(&lt;/span&gt;host, node&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 3
    &lt;span class="k"&gt;for&lt;/span&gt;: 2m
    labels:
      severity: critical
    annotations:
      summary: Nginx latency high &lt;span class="o"&gt;(&lt;/span&gt;instance &lt;span class="o"&gt;)&lt;/span&gt;
      description: Nginx p99 latency is higher than 3 seconds&lt;span class="se"&gt;\n&lt;/span&gt;  VALUE &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="se"&gt;\n&lt;/span&gt;  LABELS: 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Alert routing based on tags set in checks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
          global:
            resolve_timeout: 10m
          route:
            routes:
            - receiver: blackhole
            - receiver: slo-tracker
              group_wait: 10s
              match_re:
                severity: critical
              &lt;span class="k"&gt;continue&lt;/span&gt;: &lt;span class="nb"&gt;true
          &lt;/span&gt;receivers:
          - name: ‘slo-tracker’
            webhook_config: 
              url: 
&lt;span class="s1"&gt;'http://ENTERIP:8080/webhook/prometheus'&lt;/span&gt;
              send_resolved: &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add different tags if you don’t want to route requests based on the severity tags.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What’s next:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add a few more monitoring tool integration&lt;/li&gt;
&lt;li&gt;Tracking multiple product SLO’s&lt;/li&gt;
&lt;li&gt;Add more graphs for analytics&lt;/li&gt;
&lt;li&gt;Better visualization tools to pinpoint problematic services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;This project is open-source. Feel free to open a PR or raise issue :)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you would like to see the dashboard then please check &lt;a href="http://35.232.125.243:3000/"&gt;this&lt;/a&gt; out!&lt;/strong&gt;&lt;br&gt;
(&lt;code&gt;admin:admin&lt;/code&gt; is the creds. Also please use laptop to open this webapp. It's not mobile-friendly yet)&lt;/p&gt;

</description>
      <category>sre</category>
      <category>devops</category>
      <category>showdev</category>
      <category>slo</category>
    </item>
  </channel>
</rss>
