<?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: Doctor Droid</title>
    <description>The latest articles on DEV Community by Doctor Droid (@drdroid).</description>
    <link>https://dev.to/drdroid</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%2Forganization%2Fprofile_image%2F6865%2Fbeb3f4b3-a1b9-418b-8304-8c19b4bb774c.png</url>
      <title>DEV Community: Doctor Droid</title>
      <link>https://dev.to/drdroid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/drdroid"/>
    <language>en</language>
    <item>
      <title>How to Effectively Monitor Cron Jobs Using Dr Droid</title>
      <dc:creator>Siddarth Jain</dc:creator>
      <pubDate>Thu, 27 Apr 2023 19:08:00 +0000</pubDate>
      <link>https://dev.to/drdroid/how-to-effectively-monitor-cron-jobs-using-dr-droid-3847</link>
      <guid>https://dev.to/drdroid/how-to-effectively-monitor-cron-jobs-using-dr-droid-3847</guid>
      <description>&lt;h3&gt;
  
  
  TABLE OF CONTENTS:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Some Examples of Cron Jobs&lt;/li&gt;
&lt;li&gt;
Typical Problems with Cron Jobs

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-2.1"&gt;Delays&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-2.2"&gt;Erroneous Execution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-2.3"&gt;Operational Maintenance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
How to Effectively Monitor and Manage Cron Jobs using Dr Droid

&lt;ul&gt;
&lt;li&gt;
&lt;a href="//#chapter-3.1"&gt;How does it work?&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-3.2"&gt;Fig 1: Creating events cronjob_initiated and 
cronjob_completed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.3"&gt;Fig 2: Setting up Triggers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.4"&gt;Fig 3: Setting up Actions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Product walkthrough&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cron jobs are an essential tool for developers who want to automate recurring tasks such as sending emails, running backups, and cleaning up log files. However, managing cron jobs can be challenging as they run in the background, making it difficult to troubleshoot and monitor their activities.&lt;/p&gt;

&lt;p&gt;In this article, we'll look at some examples of cron jobs and how Dr Droid simplifies the process of monitoring, making it easier to manage cron jobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Examples of Cron Jobs&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Cron scheduling is one of the oldest and most popular techniques since the introduction of UNIX. Many sysadmins, DevOps engineers, and Operations teams use it on a daily to schedule their tasks. Some of the examples are —&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Databases&lt;/strong&gt;: Automating regular backups, killing long-running queries, and generating reports using Cron jobs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App management&lt;/strong&gt;: Automating app backups and administrative tasks using cron jobs can help save time and reduce human error in managing the application. This ensures that tasks are executed regularly and efficiently, resulting in better performance of applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rotating log files&lt;/strong&gt;: To prevent server failures and downtime, it's essential to automate log file rotation. This involves taking regular backups of log files and creating new ones to minimize the risk of running out of disk space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduling Business Processes&lt;/strong&gt;: Automating business processes, batch processing, etc using cron jobs, can save time and reduce the risk of human error. Examples of such business processing include payment disbursement, report generation, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Typical Problems with Cron Jobs&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Delays&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If a cron job takes longer than expected to execute, it can cause a pile-up in the queue, which can result in subsequent jobs not running on time. This can lead to further delays.&lt;/p&gt;

&lt;h3&gt;
  
  
  Erroneous Execution&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;There can be scenarios where a job does not end and will wait forever to get the response until the server restarts or someone manually kills the job. Examples include infinite loop or condition which prevents proper termination or hung command in the job. Such jobs can consume more resources of the server and thus, affect other core business applications running on the same server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational Maintenance&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Cron jobs that are no longer needed can accumulate causing performance issues. To avoid this, it’s important to review and clean up those jobs regularly.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Effectively Monitor and Manage Cron Jobs using Dr Droid&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Monitoring cron jobs is a crucial task that ensures the smooth functioning of systems and processes. Failing to monitor them can result in potential downtime, data loss, or suboptimal resource usage. For example, cron jobs can execute important tasks that require timely and accurate completion, and regular monitoring can help detect failures quickly, optimize their scheduling, and trigger alerts.&lt;/p&gt;

&lt;p&gt;One effective tool for monitoring cron jobs is Dr Droid. It offers a stateful approach to monitoring the health of your cron jobs, enabling you to set up monitors that alert you to failures or delays. By using Dr Droid, you can address the problems mentioned above and ensure the uninterrupted and optimal performance of your systems and processes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In the cron job script, you can send some events via REST API from the job to Dr Droid. When a cron job runs, it sends an event to Dr Droid to notify it of its status such as scheduled, started, and completed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--76cWQSJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30grdxsepwpi193qphlq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--76cWQSJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30grdxsepwpi193qphlq.png" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;
Fig 1: Creating events `cronjob_initiated` and `cronjob_completed`



&lt;p&gt;The scheduled event for the cron job can be taken from the crontab configuration, which specifies the exact time and date when the job should run. Dr Droid can use this information to monitor the status of cron jobs.&lt;/p&gt;

&lt;p&gt;However, if the cron service itself is broken, it can be challenging to detect issues using this approach. In such cases, Dr Droid may not receive the expected notifications, and it may be necessary to manually check the configuration.&lt;/p&gt;

&lt;p&gt;Dr Droid can be used to monitor the average runtime of cron jobs and to send alerts if a job takes longer than expected.&lt;/p&gt;

&lt;p&gt;In the dashboard, we can set up triggers for specific events, such as when a primary event (or any cron task) takes longer than expected to complete, causing a delay in a secondary event (another cron task). At that point, we can take action to resolve the delay.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0TzCfWnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prq5c9qc1tvyczukany3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0TzCfWnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prq5c9qc1tvyczukany3.png" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;
Fig 2: Setting up Triggers



&lt;p&gt;We can set up actions like sending alerts via Email or we can even configure webhook calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bpiEBBpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/siwhqc9fb6p73hy4eq6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bpiEBBpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/siwhqc9fb6p73hy4eq6l.png" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;
Fig 3: Setting up Actions



&lt;h2&gt;
  
  
  Product walkthrough&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;


&lt;div&gt;
  &lt;iframe src="https://loom.com/embed/6deaa438135c42219f7683789f55e484"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


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

&lt;p&gt;I hope you have learned the importance of monitoring cron jobs and how tools like &lt;a href="https://docs.drdroid.io/docs"&gt;Dr Droid&lt;/a&gt; monitor cron jobs and help developers ensure that their applications continue to run effectively.&lt;/p&gt;

&lt;p&gt;Do let us know through comments, how you monitor the cron jobs. We will be happy to learn about your use case.&lt;/p&gt;

&lt;p&gt;Sign up for &lt;a href="https://docs.drdroid.io/docs"&gt;Dr Droid&lt;/a&gt; today - it's free up to 1M events/month. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>From Fresher to SDE-3: My journey at Swiggy</title>
      <dc:creator>Mohit Goyal</dc:creator>
      <pubDate>Tue, 25 Apr 2023 15:07:00 +0000</pubDate>
      <link>https://dev.to/drdroid/from-fresher-to-sde-3-my-journey-at-swiggy-h5n</link>
      <guid>https://dev.to/drdroid/from-fresher-to-sde-3-my-journey-at-swiggy-h5n</guid>
      <description>&lt;p&gt;I started my career as a software engineer at Swiggy after graduating from BITS in 2019. I was excited about this new path but didn't know what to expect since it was my first real job.&lt;/p&gt;

&lt;p&gt;Looking back, some of the highlights from my time at Swiggy include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Working on 4 different teams, from fulfilment to assignment to delivery&lt;/li&gt;
&lt;li&gt;Contributing consistently to an open-source project and driving its adoption internally&lt;/li&gt;
&lt;li&gt;Starting as an SDE fresher and leaving as an SDE-3 after three years&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I had the opportunity to work with helpful mentors and colleagues, and these three years were the most valuable journey for me. In this document, I will share what worked well for me and how any engineer getting into a startup could make the most of it:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Read, read, and read:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read through service documentation, and if you find gaps, ask your mentors and take the initiative to suggest upgrades to the documentation.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;No one will be as invested in your growth story as you. Developing a habit of scanning technical documents shouldn't be hard, especially right out of college. Pick a topic each week and start reading its documentation. For example, if your team heavily uses DynamoDB as part of their database infrastructure, understand its architecture and why DynamoDB is preferred over something like MongoDB. This will lead to two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It will allow you to actively participate, follow, and contribute to technical discussions with senior engineers on the team, building their confidence in you to handle technically challenging tasks.&lt;/li&gt;
&lt;li&gt;It will allow you to develop a research acumen that comes in handy when dealing with some technical specifications you may not have encountered before. As a fresh graduate, you will find yourself in such situations quite often.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Learn from feedback:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Pay attention to feedback from pull request (PR) reviews. Very critical and immediately actionable feedback comes from PR reviews. Make it a point to reduce the frequency of similar feedback in future PRs. Writing good code is an art. If any of the suggestions seem confounding or difficult to understand, follow these steps in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search on Google and look for relevant Stack Overflow pages.&lt;/li&gt;
&lt;li&gt;Search for similar code pieces on GitHub or Bitbucket.&lt;/li&gt;
&lt;li&gt;Ask your mentor or any senior engineer.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a "can-do, will-do" attitude, no matter how daunting the project may seem. The worst that could happen is you might need help from a senior engineer in your team. Never hesitate to seek help when you are stuck, but make sure to have done sufficient research on your own before entering any discussion. In the long run, this strategy has worked well for me.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Proactive involvement:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Develop a product backward thinking and proactively get involved in product discussions. Unlike college, catching corner cases is much more intense as it involves real-world scenarios, and missing any can have serious consequences. For example, users are quick to find loopholes while requesting for refund and if your unfiltered list of cancellation reasons shared with upstreams includes ‘tech outage’, you can probably gauge the impending nightmare.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find open-source projects being used in your company and start contributing to them. The first step is to go through the documentation (no surprise here) and the recent PRs. This will give you a fair idea of what ongoing issues are with the project. Our minds are like clay, and restricting yourself to the stack used in your team for too long will make it difficult for you to work on a new service on a different stack.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jpZCjCRM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vptg1cjez8oefi4iq6vj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jpZCjCRM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vptg1cjez8oefi4iq6vj.jpg" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading my first blog! Leave a comment below with any questions or feedback you may have - I'd love to hear from you!❤️&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mistakes to avoid in Observability</title>
      <dc:creator>Dipesh Mittal</dc:creator>
      <pubDate>Fri, 21 Apr 2023 11:13:00 +0000</pubDate>
      <link>https://dev.to/drdroid/mistakes-to-avoid-in-observability-2cgd</link>
      <guid>https://dev.to/drdroid/mistakes-to-avoid-in-observability-2cgd</guid>
      <description>&lt;h4&gt;
  
  
  TABLE OF CONTENTS:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Common Mistakes in Observability&lt;/li&gt;
&lt;li&gt;
Not building context of your product

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-2.1"&gt;Not tracking what the customer sees&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-2.2"&gt;Following the same metric sampling rate and thresholds 
across services:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Having a setup that is hard to investigate / triage

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-3.1"&gt;Only tracking what the customer sees&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.2"&gt;Lack of instrumentation guidelines for new services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.3"&gt;Not setting up tracing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.4"&gt;Inaccessible or hard-to-find data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-3.5"&gt;Adopting tools without alignment / Using too many tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Creating Fatigue and not actionable insights

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-4.1"&gt;Too many dashboards create too much noise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-4.2"&gt;Only having time-series graph-based dashboards&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-4.3"&gt;Too many alerts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Cultural Gaps

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-5.1"&gt;Positioning observability as tool to use during issues and incidents only&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-5.2"&gt;Having a single point of failure for the observability tool&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The capabilities of observability tools to manage crisis situations have significantly improved over the past decade. Despite that, a lot of issues that could’ve been avoided, with good observability, end up in production.&lt;/p&gt;

&lt;p&gt;From our experience, and inspired by inputs from experts like &lt;a href="https://www.linkedin.com/in/stephentownshend/"&gt;Stephen&lt;/a&gt; &amp;amp; &lt;a href="https://www.linkedin.com/in/soumyadeepmukherjee/"&gt;Soumyadeep&lt;/a&gt;, in this article, we talk about some common mistakes in observability that can be avoided:&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Mistakes in Observability&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Not building context of your product:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Not tracking what the customer sees:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;It’s easier to set up monitoring at a host level from the observability data but it doesn’t tell you the customer’s perspective. Set up metrics that give you insight into how the customer would be impacted.&lt;/p&gt;

&lt;p&gt;For e.g., in my previous job, we created custom dashboards to monitor the API response time to our clients and the success rate for our supply-demand matching algorithm since they were a direct indicator of our end customers’ experience.&lt;/p&gt;

&lt;p&gt;The flip side is, what if you track &lt;strong&gt;only what the customer sees&lt;/strong&gt;? Continue reading to see how that could be problematic too.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Following the same metric sampling rate and thresholds across services:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;When setting up alerts, spend time identifying the sweet spot of metrics sampling rate and thresholds in them - these could vary based on your user’s requirement and use case. Business critical flows have stringent thresholds while internal tools could have relatively lenient thresholds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--euRwlZD9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3ukn0p2d2a6c4abtvqf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--euRwlZD9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3ukn0p2d2a6c4abtvqf.jpg" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Having a setup that is hard to investigate / triage:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Only tracking what the customer sees:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;High-level metrics (e.g. response time) are useful to see the health but while investigating, your team will immediately feel the need to peek into more detailed metrics (e.g. CPU / memory / iops) so that finding the root cause is easier if any of the high-level metrics go bad.&lt;/p&gt;

&lt;p&gt;Having deeper-second order dashboards alongside an overall health dashboard helps the team investigate faster.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Lack of instrumentation guidelines for new services:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;When instrumentation is not done at the source or if it’s done differently for different parts of the code, it increases the difficulty of finding root-cause of misbehaviours: search queries become hard with inconsistent logs; monitoring becomes hard with high variance in metrics being tracked.&lt;/p&gt;

&lt;p&gt;It is recommended to share common instructions with the team on how to instrument (logs, metrics and traces data) within any new service/component.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Not setting up tracing:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Do you follow a micro-services architecture with multiple components calling each other? Tracing enables you to follow a particular request within your code, and across services. Setup tracing (at least) on your most critical product flows. It will save you crucial triaging time, esp. in times of crucial SEV0 / P0 incidents.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Inaccessible or hard-to-find data&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Limiting access to observability data &amp;amp; creating bottlenecks for access leads to data silos for engineers trying to understand the system as they are deeply interconnected. Democratic access to observability data empowers teams to triage faster and without the need for assistance.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Adopting tools without alignment / Using too many tools:&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Data scattered across multiple dashboards (e.g. logs across server files, CloudWatch &amp;amp; Kibana) create an artificial need for context switch and slows the investigation process. Additionally, mandating tools without alignment of engineers (users) can lead to poor adoption and hence, difficulty in investigations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Fatigue and not actionable insights:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Too many dashboards create too much noise&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Your service is a small portion of the overall product architecture. Standalone dashboards for each service can be avoided if they intertwine closely/cascade with another service. Combining dashboards for critical flows makes it easier to find data and give a holistic picture of the situation.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Only having time-series graph-based dashboards&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Not every metric is a graph. For some things that are as direct as error rate or the number of live pods, keep numerical counters in your dashboards as well. That will make them easy to find and absorb for quick action.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Too many alerts&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;While you would want to know about everything that is going wrong with your system, only set up alerts with thresholds that you are ready to wake up at 3 AM for. For everything else, rely on dashboards alone as they are not critical for your customer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cultural Gaps:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Positioning observability as tool to use during issues and incidents only&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Apart from incident triaging, observability is an important mechanism to help teams understand how their systems are behaving. It helps understand the performance of different requests, APIs and errors - which provides an opportunity to improve the quality of applications.&lt;/p&gt;

&lt;p&gt;Without this, teams are collecting tech debt that will be too expensive to pay later. Read more on how to promote observability in your team &lt;a href="https://charity.wtf/2019/12/17/questionable-advice-how-do-i-get-my-team-into-observability/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Having a single point of failure for the observability tool&lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Even if your team becomes trained at using the tool and has adopted it well, you should share knowledge on the set-up process and how to create dashboards/alerts. That not only will give your team a deeper perspective of how the tool works, it will remove dependency from individual developers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Observability can become your most powerful weapon in driving data-first culture in your engineering team. Read more about this &lt;a href="https://notes.drdroid.io/building-a-data-driven-engineering-culture-with-good-observability-practices"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Was there any other mistake that your team corrected over the last few years in your observability journey? Share them in the comments below and help others avoid them!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>observability</category>
      <category>developers</category>
      <category>doctordroid</category>
    </item>
    <item>
      <title>Observability | Simplified</title>
      <dc:creator>Dipesh Mittal</dc:creator>
      <pubDate>Fri, 21 Apr 2023 09:53:00 +0000</pubDate>
      <link>https://dev.to/drdroid/observability-simplified-34m4</link>
      <guid>https://dev.to/drdroid/observability-simplified-34m4</guid>
      <description>&lt;h4&gt;
  
  
  TABLE OF CONTENTS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
What is Observability?

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-1.1"&gt;Logs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-1.2"&gt;Metrics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-1.3"&gt;Traces&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;What is monitoring?&lt;/li&gt;
&lt;li&gt;
How does this work?

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-3.1"&gt;Ok, but do I need to know how this works? 😬&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Bonus section&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Observability is a common term thrown around in our developer circles; often coupled with monitoring &amp;amp; alerting. A lot of popular tools claim to be solving your problems end-to-end and a lot of exchanges go on around open source technologies and protocols around this. This article tries to simplify some of these terms and how observability really works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Observability?&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Observability is the practice of having data about your system that can help you know the unknown. It doesn’t refer to your metrics dashboards (that is monitoring) or to the alerts you set up. The process of instrumenting and collecting data that enables you to observe how your software systems behave, be aware of their health and gather detailed knowledge of how they are working is observability.&lt;/p&gt;

&lt;p&gt;There are 3 common types of data sources (called telemetry data) that help you uncover the truth:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Logs &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you’re a developer, the first thing you add while testing your code is logs. They can be either system generated (e.g. by nginx) or manually generate and can have a variety of data that helps in knowing vital information about the execution of the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Metrics &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;They are numerical values quantifying a certain behavioural aspect of your software, which is saved in a time series storage for seeing over a period of time. Most software emit metrics, be it your service running on a pod or the k8s cluster itself.&lt;/p&gt;

&lt;p&gt;To put it into context, the throughput (Requests per minute) or Avg response time of your API calls per minute are some metrics that you'll be familiar with and must have noticed in dashboards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7dFjPg2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdhud02s281c44roseku.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7dFjPg2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdhud02s281c44roseku.jpg" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Traces &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You can think of traces as a specialized form of logs, designed to give details around the set of steps your “request” took. It splits your entire execution into smaller chunks, including code level logic, DB queries &amp;amp; downstream calls. These executions (called “spans”) are easily identifiable with their names and their prefixes. Common names that you might have seen if your team has already setup traces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Datastore - DB queries and connection handling steps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;External - Calls made outside your service over a network &lt;br&gt;
protocol like HTTP, MQTT etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Function - Code execution within the current program&lt;br&gt;
There are other span names that can come up based on your &lt;br&gt;
instrumentation agent.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eBPd3Fny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kps0l3fwv14ugyjfv7v0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eBPd3Fny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kps0l3fwv14ugyjfv7v0.jpg" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Monitoring is the part where you use the telemetry data to set up dashboards and visualisations of metrics you already know that you need to track to view the system's health at any point in time. Observability means having data such that even when you don’t know what you need to track, you can investigate your system deeply enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does this work? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Below is a sample flow of how observability, when integrated within your micro-services architecture, looks like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DW8e4SGM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vn05fvr7hh0t79y1jmhk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DW8e4SGM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vn05fvr7hh0t79y1jmhk.jpg" width="792" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Instrumentation&lt;/em&gt;&lt;/strong&gt;: Refers to how the telemetry data is generated within the system. Typically, it involves adding a small piece of code/program (instrumentation agent) to your existing code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ok, but do I need to know how this works? 😬 &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;No. Not really. You can decide to go ahead with a commercial tool and all you need to do is follow a couple of lines of instructions to set it up. All the steps mentioned above are taken care of by them so the details are abstracted out and you can directly start monitoring your system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caveat&lt;/strong&gt;: As your system scales, the cost of the commercial tools will start pinching and you might consider moving to OSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus section:&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Over the last couple of years, the term o11y is starting to get popular for the word Observability (e.g. The event &lt;a href="https://o11yfest.org/"&gt;o11yfest&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Now you say how? Find the output of this code to know how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def word_encoder(word):
    word = word.replace(" ","") #removing spaces
    mid_char_count = len(word) - 2
    encoding = word[0].lower() + str(mid_char_count) + word[-1].lower()
    print(encoding)
    return encoding

word_encoder("observability")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Are you thinking “where is this inspiration coming from?” Try to find the output for these function calls and you'll know the answer :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;word_encoder("kubernetes")
word_encoder("Andreessen Horowitz")

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

&lt;/div&gt;



&lt;p&gt;Fun fact: These words are “&lt;a href="https://en.wikipedia.org/wiki/Numeronym"&gt;numeronym&lt;/a&gt;”&lt;/p&gt;

&lt;p&gt;If you have come across any other jargon that needs to be simplified, &lt;strong&gt;mention them in the comments!&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;We are shortly publishing a comparison of the most relevant open source &amp;amp; commercial tools for observability. If you would like to get a copy of it, sign up below!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>developers</category>
      <category>monitoring</category>
      <category>doctordroid</category>
    </item>
    <item>
      <title>Observability of APIs in Production Environment</title>
      <dc:creator>Dipesh Mittal</dc:creator>
      <pubDate>Fri, 21 Apr 2023 09:33:00 +0000</pubDate>
      <link>https://dev.to/drdroid/observability-of-apis-in-production-environment-4h06</link>
      <guid>https://dev.to/drdroid/observability-of-apis-in-production-environment-4h06</guid>
      <description>&lt;p&gt;TABLE OF CONTENTS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1. Why are we talking about APIs&lt;/li&gt;
&lt;li&gt;2. What does a high performant API mean?&lt;/li&gt;
&lt;li&gt;3. Setting up observability&lt;/li&gt;
&lt;li&gt;4. Setting up monitoring&lt;/li&gt;
&lt;li&gt;
5. API Symptoms &amp;amp; root causes

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-5.1"&gt;Common API Errors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-5.2"&gt;Degradation of API latency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-5.3"&gt;Other Reasons&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
6. Bonus Section

&lt;ul&gt;
&lt;li&gt;&lt;a href="//#chapter-6.1"&gt;Investigation Strategy for APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//#chapter-6.2"&gt;Cheatsheet for fixing errors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re someone who understands instrumentation well, feel free to jump directly to the &lt;a href="https://dev.tourl"&gt;symptoms and investigation&lt;/a&gt; section directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why are we talking about APIs&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Software is eating the world. Adoption of &lt;a href="https://techcrunch.com/2015/05/06/apis-fuel-the-software-thats-eating-the-world/"&gt;API-first approach has been one of the key drivers for this fast paced software development.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;APIs are the communication pathways through which programs talk to each other. They have become a powerful tool for abstracting the underlying implementations of a software and just expose what is needed for the caller to interact with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8sqFvRUa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qy8jrtynpve23fqohysj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8sqFvRUa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qy8jrtynpve23fqohysj.jpg" width="500" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What does a high performant API mean?&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;APIs come with certain promises, like repeatability of request/response structures (Contracts), predictable speed of receiving the response (SLAs) and logical outcomes (Status codes). Here are the 4 expectations from the API:&lt;/p&gt;

&lt;p&gt;1.Predictable &amp;amp; Fast Latency&lt;br&gt;
APIs are written for specific purpose and hence, that purpose must be fulfilled in a predictable time period. The faster and more predictable your APIs are, the better the experience of the caller.&lt;/p&gt;

&lt;p&gt;2.No Errors &amp;amp; logical status codes&lt;br&gt;
Runtime exceptions will cause your code to exit and throw 5xx errors to the client, which will have to be overridden using custom middleware. In cases where an exception occurs, clear reasoning on the error and the status code must be put in place.&lt;/p&gt;

&lt;p&gt;3.Scalability&lt;br&gt;
The performance and behaviour of the API should not change based on how much traffic it takes. There can be upper limits of how much traffic you can handle that you tell your clients/users, but it should behave similarly when below those limits.&lt;/p&gt;

&lt;p&gt;4.Consistent contracts&lt;br&gt;
Abstraction means that the caller wouldn’t be able to know if the structure or the code of the API has been changed. Any change to the API payload, response or code need to be updated to the caller explicitly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OR_jZ8tw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugatwalu81xgxfndh4a7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OR_jZ8tw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugatwalu81xgxfndh4a7.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why are we talking specifically about production&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QDlICJl_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlug9b1gqcoo4j1m8sqe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QDlICJl_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlug9b1gqcoo4j1m8sqe.jpg" width="735" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adding a debugger in the compiler or running unit tests typically enable you to evaluate and test functionality of the APIs in staging environment. But it doesn’t replicate the complexities &amp;amp; challenges of the production environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Setting up observability&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To identify if our API is performing well, we need to observe our API's behaviour in production. This is doable by instrumenting our service code which has this API and view its metrics &amp;amp; traces. If you are new to instrumentation, &lt;a href="https://notes.drdroid.io/observability-instrumentation-monitoring-simplified-meaning"&gt;read more about it here&lt;/a&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Logs
&lt;/h5&gt;

&lt;p&gt;You can log statements and pass them to your logging framework to be available for querying later. You can put smart logs to tell the stage of the code your API request has reached and what the value of the variables are. This can help you gain a lot of insights. Adding &lt;a href="https://www.rapid7.com/blog/post/2016/12/23/the-value-of-correlation-ids/"&gt;unique identifier in the logs&lt;/a&gt; will help you search them better (more relevant if you do not have tracing implemented).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UxbNzarJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g038pw8ole2hra72dhis.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UxbNzarJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g038pw8ole2hra72dhis.jpg" width="559" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Errors
&lt;/h5&gt;

&lt;p&gt;If you are checking logs for runtime exceptions in an API, Sentry, GlitchTip or equivalent will save you time - it pin points the error reasons and stack traces! (Both are open source)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e648fLR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xeli3emjjw0y43n2sqer.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e648fLR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xeli3emjjw0y43n2sqer.jpg" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Metrics
&lt;/h5&gt;

&lt;p&gt;A quick health check of any API can be done by having a quick scan of historical time-series based metrics analysis of the following data points:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Traffic / Request count (in requests / minute)&lt;/li&gt;
&lt;li&gt;Latency (in milliseconds)&lt;/li&gt;
&lt;li&gt;Error rate (% error)&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Traces
&lt;/h5&gt;

&lt;p&gt;Traces enable you to see step-wise details of your code during execution. For example, clicking on the DB call within the steps will tell you which query ran and what is its average behaviour as a metric.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oiELSWJz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3josj4z8xszxzk6xs4zo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oiELSWJz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3josj4z8xszxzk6xs4zo.jpg" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Metrics and traces can be setup using commercial tools or open source alternatives (Prometheus / Jaeger). More details on this to be released on a blog shortly.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Setting up monitoring&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The telemetry data mentioned above, still needs to be made available at a UI that is accessible to the user. The following are the two essentials that need to be setup here:&lt;/p&gt;

&lt;p&gt;1.Dashboards - A quick read about &lt;a href="https://sre.google/sre-book/monitoring-distributed-systems/#xref_monitoring_golden-signals"&gt;Golden Signals&lt;/a&gt; will give you an overview of what are some essential software metrics to track. Here are two tips to making your dashboards effective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Grouping of metrics: Group metrics at an API or at a service or a product workflow level depending on the criticality of the API. If it’s a business critical API (e.g. payment or login), create a unique dashboard but if not, it can be a part of the service dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accessibility: Add links to relevant dashboards in your troubleshooting playbooks and give democratic access to all dash&lt;br&gt;
boards to your users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.Alerts: Setting up an optimal alerting system with low false positives is iterative and it will be hard to explain it here in a short way. For now, you could read &lt;a href="https://sre.google/workbook/alerting-on-slos/"&gt;this guide&lt;/a&gt; by Google which explains on how to iterate on your alerts.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. API Symptoms &amp;amp; root causes&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In most cases, you might end up with a scenario where your API is not performing right. It could be because of multiple reasons.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DACDh14P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wl93k7uqd67lfck9gsk3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DACDh14P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wl93k7uqd67lfck9gsk3.jpg" width="800" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Common API Errors&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;API errors can largely be classified into two categories: handled or unhandled.&lt;/p&gt;

&lt;h4&gt;
  
  
  Handled Errors
&lt;/h4&gt;

&lt;h5&gt;
  
  
  1. HTTP 400:
&lt;/h5&gt;

&lt;p&gt;For validation failures in the request data of the API, you return a 400 error. If that happens a lot, that would mean either the callers are sending wrong data too frequently or you have added some validations which are failing correct requests. How to fix: You should check the Pull Requests for recent releases in that service to find that changed validation or if you have added logs for validation failure cases, identify which callers are failing the most and inform them to correct their request data.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. HTTP 401 / 403:
&lt;/h5&gt;

&lt;p&gt;Failure of proper authentication or authorisation results in 401 and 403 errors. If they happen too many times, that would mean your authentication token generation is happening improperly or the token checking process is failing. Most often the case is that the access token storage layer has some issue. How to fix: Check the API that is returning the auth token to the user app for any errors from your monitoring tools. If that doesn’t work, pick up a sample token from your logs which is failing to get authenticated and see how the user got it (if your company policy allows it).&lt;/p&gt;

&lt;h5&gt;
  
  
  3. HTTP 404 / 405:
&lt;/h5&gt;

&lt;p&gt;In case the endpoint the client is hitting on your service isn't exposed, you throw the 404 code. In case the endpoint is present but the HTTP verb used in the call isn't supported, you throw 405. These are mostly handled by all modern web frameworks themselves. Any presence of these shows incorrectly integrated client. How to fix: Isolate the clients who are creating these errors from your error monitoring tool and inform them to correct the integration by sharing your correct documentation for the API.&lt;/p&gt;

&lt;h5&gt;
  
  
  4. HTTP 429:
&lt;/h5&gt;

&lt;p&gt;In rare scenarios, your clients may be exceeding the rate limits you have set on the APIs and that throttling is kicking in. This would return HTTP status code 429 to them for each extra hit. This is a practice you follow to protect your servers from being hogged by a few clients. How to fix: Ideally, in such cases you should either relax the throttling at your end if your business requires it (as long as your system can handle that load) or you ask your client to check at their if they are making so many requests.&lt;/p&gt;

&lt;h4&gt;
  
  
  Unhandled Errors
&lt;/h4&gt;

&lt;h5&gt;
  
  
  1. HTTP 500:
&lt;/h5&gt;

&lt;p&gt;When an error happens in your code that you haven't handled, the web framework will mostly throw 500 error. That indicates that your code and the variables it is handling ended up in a state that your code couldn’t handle like a NullPointerException. These unhandled errors can be seen on your error monitoring tools. How to fix: From your error monitoring tool or from your logs, you will know which line of code is causing the error. This could have been introduced either due to a new release or some new data flowing in which wasn’t earlier. Most likely you’ll need to make a code fix or disable some feature that caused it to break.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. HTTP 502:
&lt;/h5&gt;

&lt;p&gt;If your API is returning 502 errors, that would mean some server is unreachable due to their DNS resolution failing. That happens if your configured hostname is incorrect for a downstream API call or that hostname is incorrect. How to fix: Putting retries in your caller code mostly solves it if its a network glitch, but don't put too many re-tries because in case the hostname is genuinely unavailable, it could cause trouble with your processing queues. You should put logs so that you can identify right away which downstream server in your API context is throwing this error. More on this here.&lt;/p&gt;

&lt;h5&gt;
  
  
  3. HTTP 503:
&lt;/h5&gt;

&lt;p&gt;503 errors happen when your service is unavailable to take on requests. This can happen due to the web container unable to connect with the application server or if your LB doesn't have any healthy targets to serve the requests. How to fix: Check in the load balancer of your service if it has healthy targets to send requests to. Most likely this happens because health checks are failing to the targets due to them being too slow or having run out of available connections. Adding more targets can solve the problem if it is a connection pool issue but if your new targets are also going unhealthy, this could be linked to latency degradation of health check API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Degradation of API latency&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--naHTBMUf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jofktw4tbf0xbrrkb3j3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--naHTBMUf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jofktw4tbf0xbrrkb3j3.jpg" width="800" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Response time increasing is a pain point that comes with increasing scale or poorly written code. Either way, the best place to know this is in the traces. For an API, the time is took to respond can be deconstructed into smaller steps it had to execute. They are called &lt;a href="https://plumbr.io/blog/monitoring/distributed-tracing-for-dummies"&gt;spans&lt;/a&gt;. By looking at them, you can find the slow moving parts.&lt;/p&gt;

&lt;p&gt;Typical reasons for API slowness:&lt;/p&gt;

&lt;h5&gt;
  
  
  a. DB queries are taking time
&lt;/h5&gt;

&lt;p&gt;DB call spans will tell you time it took to connect to your DB and querying it. Compare them with the DB span from the period when the API was working fine. Slowness in these spans could be caused by:&lt;/p&gt;

&lt;p&gt;i) &lt;strong&gt;New code changes&lt;/strong&gt; with inefficient queries (not using the correct index when selecting a large data set or fetching too big datasets). &lt;strong&gt;How to fix&lt;/strong&gt;: The fastest way to fix this will be disabling the feature which causes that query or rolling back your changes. In case neither is possible, then quick remediation could be done by introducing new indexes in real-time, although that is highly discouraged.&lt;/p&gt;

&lt;p&gt;ii) &lt;strong&gt;DB is under stress&lt;/strong&gt; and queries are taking time (this can be confirmed by checking if all queries to the same DB are taking longer than before or not).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: This could be due to a crunch of different type of resources in the DB. A detailed note on this will be published soon.&lt;/p&gt;

&lt;p&gt;iii) &lt;strong&gt;In relational DBs, concerned table could be locked&lt;/strong&gt;. In case your are writing into a particular table and it is locked by some other thread, you query could be slow and eventually time out based on your DB setup. &lt;strong&gt;How to fix&lt;/strong&gt;: Database running queries need to be check. Different DBs have different way to store and query this data. Here is how you find it in &lt;a href="https://oracle-base.com/articles/mysql/mysql-identify-locked-tables"&gt;MySQL&lt;/a&gt; and &lt;a href="https://jaketrent.com/post/find-kill-locks-postgres/"&gt;Postgresql&lt;/a&gt;. The session which is running the locking query must be killed. These steps mostly likely can only be performed by your Devops or DBA team.&lt;/p&gt;

&lt;h5&gt;
  
  
  b. External API call is taking time
&lt;/h5&gt;

&lt;p&gt;If your API is making a call synchronously to some other API, your slowness could be due to that. This could be a call to Redis or a broker or some other internal/external API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: As a caller of APIs from anywhere in your code, always setup timeouts to protect your own customer's experience. Should also look at implementing &lt;a href="https://microservices.io/patterns/reliability/circuit-breaker.html"&gt;circuit breakers&lt;/a&gt; if you are dependent on too many such downstream APIs and you can afford them not being available in your product temporarily. In any case, reach out to the owner of that API immediately if you can’t rectify it.&lt;/p&gt;

&lt;h5&gt;
  
  
  c. Code execution is taking time
&lt;/h5&gt;

&lt;p&gt;This happens due to your service running on under-provisioned infrastructure. You can identify this by checking code spans in the request trace. They can be identified by names starting with 'Function' or your programming language.&lt;/p&gt;

&lt;p&gt;i) &lt;strong&gt;CPU&lt;/strong&gt; - If a server is taking more requests than it can handle in terms of CPU cycles, it starts becoming slower overall as processes fight with each other for processing power. &lt;strong&gt;How to fix: &lt;em&gt;Robust auto scaling based on CPU&lt;/em&gt;&lt;/strong&gt; must be setup on your service hosts to make sure no host goes over the tipping point w.r.t request traffic. Make sure your host doesn’t allow more traffic than what it can handle by fine-tuning the number of connections it can take in.&lt;/p&gt;

&lt;p&gt;ii) &lt;strong&gt;Memory&lt;/strong&gt; - If the processes running on the host are utilising the memory but aren't releasing it, that would make the memory unavailable for other processes to use. Although most modern languages do auto garbage collection for freeing up memory, poorly written code can still cause it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix: &lt;em&gt;Quick remediation for memory issues&lt;/em&gt;&lt;/strong&gt; on hosts is restarting your application process on it, but for long term code changes might be needed to remove the erroneous code. Make sure you use the latest stable version for all third party libraries as they would have been tested well for memory leaks by the authors and the community.&lt;/p&gt;

&lt;h5&gt;
  
  
  d. Insufficient connection pool
&lt;/h5&gt;

&lt;p&gt;Your web containers could be finding it difficult to get connections to your application layer due to exhaustion of the connection pool. This happens when your hosts have maxed on the number of connections per host and also on the number of hosts. This could be happening due to poor configuration even though you can handle more load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: This also can be solved using auto scaling on your hosts and auto scaling of workers on your hosts up to the limit each can handle. Quick remediation would be addition of more hosts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Reasons&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another issue that you might face is that the API is within expected latency, has normal error rate but is not responding as per expectation.&lt;/p&gt;

&lt;p&gt;This usually means some logical change has gone inside the system that has broken the API. Some obvious reasons could be:&lt;/p&gt;

&lt;p&gt;a) For read-only APIs, it could be due to u*&lt;em&gt;nderlying data being corrupted or missing&lt;/em&gt;*.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: Check what process inserts/updates that data in the storage. Putting logs in both the insertion and the read API can tell which part isn’t working right. If you don’t have logs, try and make the API call for reading data which exists and should have been returned. The result of this test can help you isolate the problem.&lt;/p&gt;

&lt;p&gt;b) Some &lt;strong&gt;feature flag&lt;/strong&gt; could have caused misbehaviour in the APIs. Lack of proper testing can leave bugs in the new feature or unintended consequences in existing product flows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: Should ****look to disable the feature or rollback the release entirely to remediate quickly.&lt;/p&gt;

&lt;p&gt;c) Although unlikely, it could be caused by &lt;strong&gt;bad data coming in from your API caller&lt;/strong&gt; due to an issue at their end but is not causing any exception.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix&lt;/strong&gt;: There should be good validations set up on request data and any anomalies in it must be notified to the caller through 4xx status codes or logged for being noticed.&lt;/p&gt;

&lt;p&gt;A very useful way to identify root cause for incorrect API behaviour is to compare the current API traces with the past. You should be able to see some differences in the spans and their latency and can tell you what code flow isn't being taken anymore or is being taken now and that can help you find a pattern of the change that is happening underneath.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Bonus Section&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Investigation Strategy for APIs&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Investigation Strategy&lt;/p&gt;

&lt;p&gt;As you start investigating, what do you check first and what next? Here’s the mental model that I follow to resolve any issue related to an API latency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xpJ8D_gH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzhe9sov8lgfm0cd3zya.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xpJ8D_gH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzhe9sov8lgfm0cd3zya.jpg" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cheatsheet for fixing errors&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5osCyI7U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miffam2wu6v71xk5g4hk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5osCyI7U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miffam2wu6v71xk5g4hk.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How do you debug an API? Tell us about your debugging strategies in the comments below!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>API callback &amp; webhooks monitoring</title>
      <dc:creator>Dipesh Mittal</dc:creator>
      <pubDate>Fri, 21 Apr 2023 07:48:00 +0000</pubDate>
      <link>https://dev.to/drdroid/api-callback-webhooks-monitoring-1pi3</link>
      <guid>https://dev.to/drdroid/api-callback-webhooks-monitoring-1pi3</guid>
      <description>&lt;ul&gt;
&lt;li&gt;The 3 different types of webhooks to monitor&lt;/li&gt;
&lt;li&gt;Important practices to follow when building webhooks&lt;/li&gt;
&lt;li&gt;There are 2 ways you can monitor these webhooks&lt;/li&gt;
&lt;li&gt;How do you set up the monitoring process?&lt;/li&gt;
&lt;li&gt;3 Ways you can fix your webhooks before contacting the application owner&lt;/li&gt;
&lt;li&gt;Maximize the user experience by monitoring webhook callbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Webhooks are crucial components of a multi-system architecture. They enable one application to send automated messages or notifications to another application when a certain event occurs, without the need for constant polling. Hence, monitoring them is super important.&lt;/p&gt;

&lt;p&gt;At Doctor Droid, we are enabling API callback monitoring through a context-based linking between events. To try it out, sign up here.&lt;/p&gt;

&lt;p&gt;In this blog, I’m going to walk you through how you can monitor webhooks so that your user experience is never compromised.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 3 different types of webhooks to monitor&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h5&gt;
  
  
  1. FYI webhooks (e.g. SMS got delivered).
&lt;/h5&gt;

&lt;p&gt;These webhooks are stored for future analysis and performance measurement and do not trigger real-time actions.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Critical webhooks (e.g. Payment completed).
&lt;/h5&gt;

&lt;p&gt;Essential webhooks play a crucial role in enabling product flow and directly impact the customer experience. These types of webhooks typically require immediate attention and should trigger alerts to ensure timely response and resolution.&lt;/p&gt;

&lt;h5&gt;
  
  
  3. Human action webhooks (e.g. third-party vendor updates).
&lt;/h5&gt;

&lt;p&gt;These are vital for monitoring operational activities and may have some indirect impacts on the system's triggers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important practices to follow when building webhooks&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The aim here is to build secure and efficient webhooks to create an application that provides a seamless user experience. Here are some of the best practices for you to follow:&lt;/p&gt;

&lt;h5&gt;
  
  
  1.Keep a fallback for polling the caller.
&lt;/h5&gt;

&lt;p&gt;There could be situations where the calling application is unable to make those calls. It’s recommended to keep a fallback handy where after a certain time from the forward call, you poll that application for the same data that they may have sent you the webhook with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J3h31zLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ue0e50xp8erue8v9gyo4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J3h31zLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ue0e50xp8erue8v9gyo4.jpg" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes sure your product journey remains intact. However, if their application is not working then this won’t be useful. You should make a note internally (or alert) if this polling fails to yield the desired output.&lt;/p&gt;

&lt;h5&gt;
  
  
  2.Always put validations for request schema coming into your application
&lt;/h5&gt;

&lt;p&gt;The trick here is to only read those fields which are relevant to you and discard the rest. If this integration is important for financial reconciliation in the future, keep a copy of the incoming webhook requests in some persistent storage. This will also help in case of a callback request failure, as you'll have a copy of the original request to refer to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6k41eQ6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emv7ku6oft3h0hcer7pe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6k41eQ6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emv7ku6oft3h0hcer7pe.jpg" width="800" height="707"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  3.Throw alerts for deserialization errors in webhook requests
&lt;/h5&gt;

&lt;p&gt;Since this application is not under your control, there is a rare but possible chance they may change their request schema without prior intimation. To make sure you are aware of this when it happens, set up error handling at your deserialization and request validation layer.&lt;/p&gt;

&lt;h5&gt;
  
  
  4.Make the caller aware of your response status
&lt;/h5&gt;

&lt;p&gt;When handling webhooks, it's important to consider how failures are handled, specifically in the case of validation errors or serialization errors. Webhooks are typically called in a "fire-and-forget" mode, meaning that the caller may not be aware of any breakage in the webhook request data.&lt;/p&gt;

&lt;p&gt;This can lead to the receiver suffering from issues without the caller being aware of them. To prevent this, it's crucial to make sure that the caller is aware of the response status to ensure proper communication and handling of errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are 2 ways you can monitor these webhooks&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h5&gt;
  
  
  Stateless monitoring
&lt;/h5&gt;

&lt;p&gt;For high-traffic webhooks, like telephony callbacks on SMS delivery, you can measure overall behaviour by counting and analyzing a field in the webhook API request. No need to map it to the original request.&lt;/p&gt;

&lt;h5&gt;
  
  
  Stateful monitoring
&lt;/h5&gt;

&lt;p&gt;To track the entity for which the callback is received, map the callback status from the bank to the transaction initiated via API. Alerts should be set up for missed or delayed webhook calls, as this helps to take further actions to maintain customer experience and product journey. There are two ways you can set up alerts:&lt;/p&gt;

&lt;h5&gt;
  
  
  1.At an individual level
&lt;/h5&gt;

&lt;p&gt;You need to be informed of the duration for which each webhook has been missed. There’s little tolerance for failure due to the severe repercussions that can be inflicted and so every failure needs to be reported and investigated.&lt;/p&gt;

&lt;p&gt;For example, in the financial world, the processing of payments can’t be paused or delayed unless there’s a problem at the recipient’s bank, but that also must be known at the earliest possible time.&lt;/p&gt;

&lt;h5&gt;
  
  
  2.At aggregated level
&lt;/h5&gt;

&lt;p&gt;In this situation, you know some leakage is happening but there’s a tolerance range. To monitor potential leakage within an acceptable range, track webhooks against orders in your system, such as those fulfilled by third-party vendors. Although real-time performance monitoring may not be feasible, you can still ensure that the performance doesn't deteriorate beyond a specified threshold.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you set up the monitoring process?&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h5&gt;
  
  
  1.For stateless monitoring
&lt;/h5&gt;

&lt;h5&gt;
  
  
  a.Use logs
&lt;/h5&gt;

&lt;p&gt;Add logs for each request coming in and the field in it that defines success/failure (or whatever state matters to you). Take these logs into Grafana Loki or ELK stack and plot the count and the trend of that status value. This will be limited with the retention period of your logs so not good if you want to look at very old performance data also.&lt;/p&gt;

&lt;h5&gt;
  
  
  b. Store in DB
&lt;/h5&gt;

&lt;p&gt;Put the webhook call data into a DB of your choice as an immutable entry. Plot this using any data visualization tool you want to use like Sisense, Metabase, or Redash. This data could remain forever. You can archive this into s3 as parquet files every week and move older queries onto the s3 + athena stack.&lt;/p&gt;

&lt;h5&gt;
  
  
  c. Metrics
&lt;/h5&gt;

&lt;p&gt;Keep counters for each incoming request and another counter for each success and failure status. Use Prometheus to scrape them and then see them in any observability tool of your choices like Grafana or commercial tools like Newrelic or Datadog. This again is limited by data retention. Tools like chronosphere allow you to resample the data by coalescing it for the past so you can enjoy longer retention but with reduced granularity over time.&lt;/p&gt;

&lt;h5&gt;
  
  
  For stateful monitoring
&lt;/h5&gt;

&lt;p&gt;There is no easy way to monitor this. You want to keep the reference of your forward transaction when receiving or waiting for the webhook and map this behaviour onto alerts or charts.&lt;/p&gt;

&lt;h5&gt;
  
  
  a. Using logs
&lt;/h5&gt;

&lt;p&gt;You can log forward and incoming webhook calls with some common log_message that can help link them when searching and plotting. You can use an id to represent the entity in question, but you can search both logs or the lack of the webhook by searching for that ID. This can be done in any log visualization tool. However, if you want to do this in aggregation, the logging solutions fall short.&lt;/p&gt;

&lt;h5&gt;
  
  
  b. Store in DB
&lt;/h5&gt;

&lt;p&gt;You store both forward and webhook transactions into a DB and run periodic queries for the webhook being missed. This can be used to know of each failure (with the periodic query running every few seconds) or in aggregation every ‘X’ minutes. This can then be plotted on a chart or sent in a notification. These features exist in data visualization tools like Metabase, Superset, Sisense. You may not want to run these periodic queries on your OLTP DB, so you may want to replicate it or set up an ETL pipeline to make a data lake and then run these queries on it like Snowflake. Making this in-house is not only tedious but also adds a lot of DevOps overhead. Using a cloud solution for this is simply too expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick note:&lt;/strong&gt; Dr Droid specializes in the stateful monitoring of products. Sign up here to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 Ways you can fix your webhooks before contacting the application owner&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;1.If the number of webhooks is dropping, do the following:&lt;/p&gt;

&lt;p&gt;a. Inspect the forward action that causes webhook calls. Maybe your forward action itself is breaking or not happening, causing the application to not trigger callback requests.&lt;/p&gt;

&lt;p&gt;b. Check for any rate-limiting errors in your nginx logs or any serialization/authentication errors your server might be throwing for the webhook call. These happen less often but can be a reason for breakage.&lt;/p&gt;

&lt;p&gt;2.If the webhooks count is good but there are some missing for specific cases, identify a pattern in the forward calls for which webhooks are missing. That can help identify if the application triggering webhooks could be failing for cases matching that pattern.&lt;/p&gt;

&lt;p&gt;3.If you still can’t identify why your webhooks are missing, contact the application owner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maximize the user experience by monitoring webhook callbacks&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;There are no two ways about it - failing to monitor webhook callbacks will expose you to several application errors that will cripple application performance. Simply follow the steps outlined in this article and you’ll boost your chances of delivering an application that provides a seamless user experience.&lt;br&gt;
If you want a fast and secure way of detecting technical issues before they impact your business, then &lt;a href="https://www.loom.com/share/527944cfeabf49eab231d701f7c8431d"&gt;watch this demo&lt;/a&gt; on how DrDroid can do this for you.&lt;/p&gt;

</description>
      <category>doctordroid</category>
      <category>webdev</category>
      <category>monitoring</category>
      <category>api</category>
    </item>
    <item>
      <title>How to monitor asynchronous 3rd party integrations proactively?</title>
      <dc:creator>Siddarth Jain</dc:creator>
      <pubDate>Fri, 21 Apr 2023 04:15:20 +0000</pubDate>
      <link>https://dev.to/drdroid/how-to-monitor-asynchronous-3rd-party-integrations-proactively-10ae</link>
      <guid>https://dev.to/drdroid/how-to-monitor-asynchronous-3rd-party-integrations-proactively-10ae</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;If you'd like to try Dr Droid, &lt;a href="https://app.drdroid.io/signup"&gt;click here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In today's landscape, third-party integrations have become a crucial part of software development. These integrations offer helpful features, new capabilities, and a mashup of services to create useful products. For instance, using SaaS products like &lt;a href="https://www.twilio.com/"&gt;Twilio&lt;/a&gt; or &lt;a href="https://stripe.com/"&gt;Stripe&lt;/a&gt; saves significant time and resources, and is also non-trivial to be built in-house from scratch. (If you know any tech startup that built these in-house, let me know 😬)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Leading startups today have upwards of 50+ business critical integrations and an average of 350+ &lt;a href="https://www.saastr.com/the-top-saas-companies-have-an-average-of-350-integrations/"&gt;overall integrations&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Microservices rely on external API calls to connect to these services - most of which are asynchronous or moving towards being async. If an external API call is in the flow of a critical business journey or customer experience, it needs proactive monitoring.&lt;/p&gt;

&lt;p&gt;To address these issues, businesses need to implement effective third-party integration monitoring strategies. In this article, we will focus on how third-party integration monitoring can help businesses ensure the reliability and availability of services. Furthermore, we will discuss how &lt;a href="https://drdroid.io"&gt;Dr Droid&lt;/a&gt; enables you to monitor the functioning of these services and take necessary steps in case of any potential problems.&lt;/p&gt;

&lt;p&gt;To understand with an &lt;strong&gt;example&lt;/strong&gt;, we are discussing a &lt;strong&gt;food delivery application&lt;/strong&gt; use case that you probably use every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use case: Food Delivery Application
&lt;/h2&gt;

&lt;p&gt;Food delivery services often rely on timely and efficient communication between drivers, dispatchers, and customers. To ensure that deliveries are made on time, it's important to have a reliable and efficient system in place. This is where third-party integrations like IVR can be useful. IVR is an automated interactive voice response system, you often see deployed in call centres.&lt;/p&gt;

&lt;p&gt;For instance, imagine a customer who orders a pizza for delivery and waits for it to be delivered piping hot. Timely delivery is important for a good customer experience. Everything is going fine but let’s say the delivery agent is stuck and unresponsive for any reason. This event would risk the timely pizza delivery and the customer will have a poor experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Sample Third-Party Integration
&lt;/h2&gt;

&lt;p&gt;For the above scenario, a simple flow for this integration could include steps such as detecting the anomaly (i.e., driver not moving from their location), triggering an automated IVR call, prompting the driver to input their reason for the delay, suggesting appropriate actions based on the driver's input, and logging the outcome of the call for future reference.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f_DKsFDm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqq0s44k9be0wgixpb75.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f_DKsFDm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqq0s44k9be0wgixpb75.png" alt="Figure 1: Ideal scenario" width="800" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the ideal scenario where the call is initiated and the response is received and required actions are taken but what if no response is received? This will result in delays in taking action and a bad customer experience.&lt;/p&gt;

&lt;p&gt;For this, we need monitoring where we can take action even if the response is not received and the entire process would not be affected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monitoring using a Cron Task
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sl_AYJxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0sclxyso5d7abkzlglg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sl_AYJxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0sclxyso5d7abkzlglg.png" alt="Figure 2: Monitoring using a cron task" width="800" height="674"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s understand how we can monitor such integrations effectively to reduce business risk.&lt;/p&gt;

&lt;p&gt;The setup described involves a delivery service using an Interactive Voice Response (IVR) system and a Redis database to manage requests. A cron job is set up to trigger a specific action after 20 seconds.&lt;/p&gt;

&lt;p&gt;When a customer initiates a delivery request through the IVR system, the request ID and state are stored in the Redis database. This allows the delivery service to keep track of all active delivery requests. Once the request is initiated, a cron job is set up to trigger after 20 seconds.&lt;/p&gt;

&lt;p&gt;After 20 seconds, a signal is sent to the delivery service. The delivery service checks the Redis database to see if the request ID is still in the initiated state. If the request ID is still in the initiated state, the delivery service takes appropriate actions, such as updating the request status or sending a notification to the customer.&lt;/p&gt;

&lt;p&gt;This setup does have some potential drawbacks while cron jobs can be useful for automating tasks and reducing the need for manual intervention, they do add an additional component to the architecture and increase the overall complexity of the system. This can increase the risk of failure and make it more difficult to identify and troubleshoot issues when they occur.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does Dr Droid make the process easier?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--toIPd3w0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n02kbsgxoo7z789m85xj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--toIPd3w0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n02kbsgxoo7z789m85xj.png" alt="Figure 3: Doing the above process using Dr Droid" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above flow describes a scenario in which a delivery service is using an IVR provider and Dr Droid to monitor the external integration we discussed above using Redis.&lt;/p&gt;

&lt;p&gt;When it is found that there is some delay in delivery, the Delivery Service makes an external API call to the IVR provider to take inputs from the Delivery Executive about the reason for the delay and sends a "call initiated" event to Dr Droid. This event notifies Dr Droid that a new call has been initiated.&lt;/p&gt;

&lt;p&gt;When the response is received from the Delivery Executive, the IVR provider sends the response back to the Delivery Service and sends a "callback received" event to Dr Droid, which notifies Dr Droid that a callback has been received for the call.&lt;/p&gt;

&lt;p&gt;If a callback is not received within 20 seconds, you can set up alerts and webhooks on Dr Droid and it will take care of tracking and executing the recovery flow for delivery service.&lt;/p&gt;

&lt;p&gt;Overall, this flow allows the Delivery Service to efficiently manage requests by leveraging the capabilities of the IVR provider and Dr Droid. With Dr Droid, businesses can monitor the performance and anomalies of their business process, receive alerts in case of any disruptions, and set up necessary actions to resolve the issues. The use of event notifications and decision-making processes enables the Delivery Service to handle calls promptly and effectively, while also providing visibility into the call process for monitoring and optimization purposes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up the monitoring using Dr Droid
&lt;/h3&gt;

&lt;p&gt;We are using the &lt;a href="https://docs.drdroid.io/reference/events"&gt;API specs&lt;/a&gt; and showing how to interact with Dr Droid using the REST API.&lt;/p&gt;

&lt;p&gt;An event called &lt;code&gt;call_initiated&lt;/code&gt; is created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xs65DzMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/99uVUKJm0A1Q51b32SFSxr1JnDHoLQrVKGJYbqJqBiajYESa2DN9QeAVCT9lHtA04Z_TLHjGi9iaVmc6GXIlJ4QV8foxHTn7wI5HBnLwJKj2vXiCou1smSCneViv_42TwIffUTO1rmWgOYx8kX8ByHs%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xs65DzMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/99uVUKJm0A1Q51b32SFSxr1JnDHoLQrVKGJYbqJqBiajYESa2DN9QeAVCT9lHtA04Z_TLHjGi9iaVmc6GXIlJ4QV8foxHTn7wI5HBnLwJKj2vXiCou1smSCneViv_42TwIffUTO1rmWgOYx8kX8ByHs%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 3: &lt;/em&gt;&lt;code&gt;call_initiated&lt;/code&gt;&lt;em&gt; event created&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Following that, we created another event &lt;code&gt;callback_received&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9XkN6Uy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/-4eVa3fT0xqcMmOQ6FPuj-6aLr4yQx3jNEaFd5TmSqhju3mg-cJU-fOm9bRWGRKHLErVlU3ov2nbUEhskyQMo7QqwpuAHr4rSJcyPmFgmWqxK6XfeRYo8Z7vWnmVs8tcJBRjij033TPlTLD7mx9_qK4%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9XkN6Uy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/-4eVa3fT0xqcMmOQ6FPuj-6aLr4yQx3jNEaFd5TmSqhju3mg-cJU-fOm9bRWGRKHLErVlU3ov2nbUEhskyQMo7QqwpuAHr4rSJcyPmFgmWqxK6XfeRYo8Z7vWnmVs8tcJBRjij033TPlTLD7mx9_qK4%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 4: &lt;/em&gt;&lt;code&gt;callback_received&lt;/code&gt;&lt;em&gt; event created&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;After creating the event, you can notice in the dashboard:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TRUr4_bo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/1iW7TPUJu7O1PPxsi6MOkI_i1LUvzIGK6TUCJmeMjAvSd4CSF2GgyBxSU5QbNC2gytYEXNzFE2FzJulludmPdXjDd_7rrzNalbCJyW6pQVW4NbbLjGyJ82vCxzFSw2y6-x5n0zGY_e1uQ2Dg0-YlSH4%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TRUr4_bo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/1iW7TPUJu7O1PPxsi6MOkI_i1LUvzIGK6TUCJmeMjAvSd4CSF2GgyBxSU5QbNC2gytYEXNzFE2FzJulludmPdXjDd_7rrzNalbCJyW6pQVW4NbbLjGyJ82vCxzFSw2y6-x5n0zGY_e1uQ2Dg0-YlSH4%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 5: Events on Dr Droid’s dashboard&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We can then set up monitoring in the console to track if a callback is received in x seconds after the call is initiated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HyffWCf2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/D0SiFwkd4i_ugcy-JmZZpEgrftFje2KKvNUC3Co4Evpq6Rb2nm8HSE9DOCuCydtelGnmFurNK6pv-A06yBj2O3awgHNtsu0GqebVkZ7VjFoyrQTe7W9MW5t1fZAAgihUYK-WDkjC7hX0rfYCu7WH-8M%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HyffWCf2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/D0SiFwkd4i_ugcy-JmZZpEgrftFje2KKvNUC3Co4Evpq6Rb2nm8HSE9DOCuCydtelGnmFurNK6pv-A06yBj2O3awgHNtsu0GqebVkZ7VjFoyrQTe7W9MW5t1fZAAgihUYK-WDkjC7hX0rfYCu7WH-8M%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 6: Monitor Dashboard&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RHb50Hl3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/KSHWT3USugxHActITcI2c2YxF_tS8umASOujfAlJdhy4R0PwvJdmBIgfWv-Z0ljH-oLiD2yxAuN6aK20aT8k4sg4cyHSsdtXjUAtmM8ocgaYKIoXK3RfiFdGXbSIlQZf6ZjZCw-7B-W-iA4blR_OEFY%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RHb50Hl3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/KSHWT3USugxHActITcI2c2YxF_tS8umASOujfAlJdhy4R0PwvJdmBIgfWv-Z0ljH-oLiD2yxAuN6aK20aT8k4sg4cyHSsdtXjUAtmM8ocgaYKIoXK3RfiFdGXbSIlQZf6ZjZCw-7B-W-iA4blR_OEFY%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 7: Selecting primary and secondary events&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Configuring a notification to be triggered if there is a delay in the occurrence of the secondary event despite the primary event being initiated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A8PdUjnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/RcKDlgdvWVp9P7shL8f_m8kPFm4BtoSBHrAbzkj9PQtUMoKYufk0POuvG_L82W2xR4raPhP-81q4zLqBZbZEqx-Whb7L19zAU4B9LN8PLXnMZBrnxaxZMaV1qx0WlbKwNkJwV0zpdI5bkOYE52Idbrw%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A8PdUjnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/RcKDlgdvWVp9P7shL8f_m8kPFm4BtoSBHrAbzkj9PQtUMoKYufk0POuvG_L82W2xR4raPhP-81q4zLqBZbZEqx-Whb7L19zAU4B9LN8PLXnMZBrnxaxZMaV1qx0WlbKwNkJwV0zpdI5bkOYE52Idbrw%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 8: Setting up an alert&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TGgWZ0Yy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/C_d-KSeHai6_-vPI1qPgExN6kY14Fq6R3BUowUB-1ZDwdAKBvdaM45sVIqfhOQjIly44bjvBrzVzm_hUFFeDmepOvJLTFwZ-r_GJB0TmXuZmia4mlzZxN22fpOobeJGA24Xa7oXD_lxxHCCWSKwcWCY%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TGgWZ0Yy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh4.googleusercontent.com/C_d-KSeHai6_-vPI1qPgExN6kY14Fq6R3BUowUB-1ZDwdAKBvdaM45sVIqfhOQjIly44bjvBrzVzm_hUFFeDmepOvJLTFwZ-r_GJB0TmXuZmia4mlzZxN22fpOobeJGA24Xa7oXD_lxxHCCWSKwcWCY%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 9: Setting up email notification&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zop2FbbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/AMuqY2bgXbS2cJJ7xbWG8dJ2DRqeFhKefELgsYhQaVlRewhT7cwHK5WtEJntsNz-DZzWtgQd9vSmKwodHhQXL6ZLJYGB6_1a_VT6SeTJk0KVVneOSucmjCJxl3ThOtoeapEqEk-DTqbNnMjBh_5HEwM%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zop2FbbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/AMuqY2bgXbS2cJJ7xbWG8dJ2DRqeFhKefELgsYhQaVlRewhT7cwHK5WtEJntsNz-DZzWtgQd9vSmKwodHhQXL6ZLJYGB6_1a_VT6SeTJk0KVVneOSucmjCJxl3ThOtoeapEqEk-DTqbNnMjBh_5HEwM%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 10: Monitoring setup is done&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We are now ready to perform a test.&lt;/p&gt;

&lt;p&gt;We will proceed by creating a new event called &lt;code&gt;call_initiated&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pqf3QSVI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh5.googleusercontent.com/3RGB3B6zElpGRxfnQ3x8j1E-VqyQmaYg-trRPF4R3fTv1DVeFuR_UMZWAgnYzpjyRGO1hC9q513Oep_h3z5QGD3CSTZXCAcid9d9QIK8wn5ZkseeVp3EmmnRnKNQGWOrQZYxFMIY2PKoBvuPOMhnY7E%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pqf3QSVI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh5.googleusercontent.com/3RGB3B6zElpGRxfnQ3x8j1E-VqyQmaYg-trRPF4R3fTv1DVeFuR_UMZWAgnYzpjyRGO1hC9q513Oep_h3z5QGD3CSTZXCAcid9d9QIK8wn5ZkseeVp3EmmnRnKNQGWOrQZYxFMIY2PKoBvuPOMhnY7E%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 11: A new event created &lt;/em&gt;&lt;code&gt;call_initiated&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The primary event was initiated but as we have not yet created the secondary event, &lt;code&gt;callback_recieved&lt;/code&gt;, an alert notification has been sent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--92L2zqn4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/cz-UKQpApYaTcz0F1SidZB3S06oU9rLuIfkzUASszW4_bbKySOy1zSxDYjLPVTnm3-4_UH5ax9G9X_YQv02GJohcNoC6KJEgWJl1jvZFI8HUwNUV2Ky3cv06g4Xa4gsu00FhG0VUB54xL0C9r-F_7I4%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--92L2zqn4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh6.googleusercontent.com/cz-UKQpApYaTcz0F1SidZB3S06oU9rLuIfkzUASszW4_bbKySOy1zSxDYjLPVTnm3-4_UH5ax9G9X_YQv02GJohcNoC6KJEgWJl1jvZFI8HUwNUV2Ky3cv06g4Xa4gsu00FhG0VUB54xL0C9r-F_7I4%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 12: Monitoring dashboard&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An email notification was received stating that the secondary event, "callback_received", has not been created within a timeframe of 20 seconds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_pQKMxax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/eEoSVnJ9sxVB5lyxxR8lRwRnVWpV4_LPRlg7RPniSaytiLbnmN5MiP3SvjCpX5A3WNorNfI0MCgcIN2J9zZV4h2bL4ZPEALDuUIoSdjzh_q4iaWZ6OYNgR9JMjUtBh0rPo8_SjWMhkkCQ5OEJzkwceI%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_pQKMxax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/eEoSVnJ9sxVB5lyxxR8lRwRnVWpV4_LPRlg7RPniSaytiLbnmN5MiP3SvjCpX5A3WNorNfI0MCgcIN2J9zZV4h2bL4ZPEALDuUIoSdjzh_q4iaWZ6OYNgR9JMjUtBh0rPo8_SjWMhkkCQ5OEJzkwceI%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 13: Email Notification&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FjtWi_Pt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/hdxvc_vsQREggEPGo5s4ZJF_RruuysTFLCpRHFAReNMmG9bnFY1MNxnQ8sb8K9r6zdslglQoMNf-m3jRZhxz7EckyJsanZ5Xh75g42lNrj33j1UnS2MN0smZsHxre5uU1z0tLmLJVZWnzlRHQfm6PGA%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FjtWi_Pt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://lh3.googleusercontent.com/hdxvc_vsQREggEPGo5s4ZJF_RruuysTFLCpRHFAReNMmG9bnFY1MNxnQ8sb8K9r6zdslglQoMNf-m3jRZhxz7EckyJsanZ5Xh75g42lNrj33j1UnS2MN0smZsHxre5uU1z0tLmLJVZWnzlRHQfm6PGA%2520align%3D%2522left%2522" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;em&gt;Figure 14: Notification on the dashboard&lt;/em&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This makes monitoring the calls easier. If the event is delayed Dr Droid sends notifications via Email/Slack or triggers the configured webhook to take appropriate actions.&lt;/p&gt;

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

&lt;p&gt;I hope you have learned the importance of using third-party tools and monitoring them to make the system work reliably and efficiently with some use cases.&lt;/p&gt;

&lt;p&gt;Do let us know through comments, how you monitor the external APIs. We will be happy to learn about your use case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.drdroid.io/signup?ref=blog"&gt;Sign up&lt;/a&gt; for Dr Droid today - it's free up to 1M events/month!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Why API integrations break and how to avoid them?</title>
      <dc:creator>Siddarth Jain</dc:creator>
      <pubDate>Thu, 20 Apr 2023 08:44:00 +0000</pubDate>
      <link>https://dev.to/drdroid/why-api-integrations-break-and-how-to-avoid-them-2dp4</link>
      <guid>https://dev.to/drdroid/why-api-integrations-break-and-how-to-avoid-them-2dp4</guid>
      <description>&lt;p&gt;Today, our products are deeply dependent on third-party integrations to run successfully. Common integrations that we have come across in building products include payment gateways, communication APIs, CRMs, client integrations and banking APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most common reasons for issues with integrations&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Poor Provisioning by Service Provider. &lt;br&gt;
While multi-tenant architectures with distributed load are the recommended way to build API products, very often we end up with issues in reaching service providers because of a lack of efficient provisioning. Peak traffic apart, sometimes even during a lean period, we have had vendor services going down due to a minor increase in the request volumes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Latency breaches → Timeouts&lt;br&gt;
To protect existing workflows and thread pools from choking, we have pre-defined thresholds with service providers for APIs. When these latencies are breached, it leads to timeouts of requests at our end&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unhandled error codes&lt;br&gt;
A new error code, generated due to an edge case or otherwise, which is not managed during exception handling can impact our workflows&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incorrect response&lt;br&gt;
Changes in third-party’s APIs can lead to unexpected request responses and bodies, causing downstream APIs to reject the response, throw errors or respond unexpectedly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Webhook Deactivations &lt;br&gt;
Modern integrations depend on webhooks to receive data from third-party. We have seen instances where webhooks have been deactivated at the service provider’s end without appropriate notifications&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Remediation Strategies&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Monitoring API latencies, throughput and error rates&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple integrations in case of critical services - As you read above, a service provider’s APIs can falter due to multiple reasons. In our attempts to normalise dependency, multiple integrations should be set in place for critical services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setting up fallback options in case of failures - Setup circuits with a default fallback option in case of failure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In case of requests consistently exceeding latency thresholds, dropping the requests would be critical to avoid queuing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable webhook monitoring and set up alerts for the sudden dip in transaction frequency&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Store API response bodies in logs or databases to be able to retrieve and identify issues in data in case of debugging needs&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introducing Dr Droid: Monitor third-party integrations
&lt;/h2&gt;

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

&lt;p&gt;&lt;a href="https://docs.drdroid.io/docs"&gt;Outsiders&lt;/a&gt; help you monitor 3rd party integrations - both performance and context monitoring.****&lt;/p&gt;

&lt;h2&gt;
  
  
  Context Monitoring&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Change in response body format or variables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data variation / sudden change for a specific parameter&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A mismatch between the status code and API response body&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mapping between API call and webhook response&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance Monitoring:&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Error rates and error codes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API latency&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ack to webhook delay&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chat with us&lt;a href="https://calendly.com/siddarthjain/catchup-call-clone?month=2023-04"&gt;here&lt;/a&gt; or sign up by clicking &lt;a href="https://app.drdroid.io/signup"&gt;here&lt;/a&gt;!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Track Events Across Multiple Services</title>
      <dc:creator>Siddarth Jain</dc:creator>
      <pubDate>Thu, 20 Apr 2023 08:33:00 +0000</pubDate>
      <link>https://dev.to/drdroid/how-to-track-events-across-multiple-services-2g6b</link>
      <guid>https://dev.to/drdroid/how-to-track-events-across-multiple-services-2g6b</guid>
      <description>&lt;p&gt;In this article, we will see the various challenges in microservice architecture and we will then explore one major challenge that many developers and businesses face: how to track the events flowing across these services.&lt;/p&gt;

&lt;p&gt;Tracking events are required for various business use cases such as audit trails, fraud detection, &lt;a href="https://notes.drdroid.io/api-callback-webhooks-monitoring"&gt;missing API callbacks&lt;/a&gt;, raising alarms on unusual patterns, and delays and failure in services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Microservices Architecture:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you're well-versed in microservices, you can directly jump to the next section from the table of contents above.&lt;/p&gt;

&lt;p&gt;Microservices have been popularised since 2011 when it was introduced in an architecture &lt;a href="https://martinfowler.com/articles/microservices.html"&gt;workshop in Venice&lt;/a&gt;. Since then, most developers have adopted the microservices architectural style to develop their products.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Microservices is an approach that enables teams to work independently on different services, deploy changes more frequently, and scale services independently. The impact of microservices has been significant, enabling organiations to build and scale complex applications faster and with more agility.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Microservices offer several benefits for software development teams. The architecture provides greater agility by allowing faster development cycles and independent deployment of individual services, resulting in faster time-to-market.&lt;/p&gt;

&lt;p&gt;Other benefits include better fault isolation, improved reliability, and uptime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges in Microservices&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Microservices bring significant challenges such as distributed ownership of entities. As the number of microservices grows, it becomes difficult to track and understand the impact of decisions, leading to a lack of visibility and isolation in the decision-making process.&lt;/li&gt;
&lt;li&gt;Identifying failures or issues across services can become challenging due to distributed nature of transactions and data flow. Also, failures in one service can have cascading effects on other services.&lt;/li&gt;
&lt;li&gt;Managing data in a microservices architecture can become complex due to each microservice having its own data storage and retrieval requirements.&lt;/li&gt;
&lt;li&gt;Integration testing becomes more complex.&lt;/li&gt;
&lt;li&gt;Ensuring data privacy, having an audit trail, and implementing consistent security across multiple services can be challenging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Implement Event Tracking Across Services?&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Event tracking refers to the process of capturing and monitoring user interactions or events within an application, website, or system. Events are user actions or system-generated events such as clicks, taps, searches, logs, and more. For example, say we have an e-commerce platform where customers can place orders for products. When a customer places an order, the order is created in the Checkout Service, and the order details are stored in a database. The order is then processed by various other microservices, such as Inventory Service, Payment Service, and Delivery Service.&lt;/p&gt;

&lt;p&gt;One important metric for the platform is the time taken for an order to be delivered. However, tracking this metric is difficult because the order passes through multiple services, and none of the services has context outside their own.&lt;/p&gt;

&lt;p&gt;Below are the various ways to implement event tracking:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Adding Logs to ELK/Logging Tools&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;To facilitate issue detection across microservices, logs can be added in different services and sent to ELK or the logging system with a unique key to join events. However, this approach has cons such as complex querying in the logging system and non-trivial searching of events going into different indexes/streams.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Building an In-House System&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Implementing event tracking in-house involves building a custom system to track and store events generated by the application. To achieve this we can embed code to capture events in business logic code and push the events to a database. This can also be combined with log files to create a custom report or visualization to identify anomalies or insights.&lt;/p&gt;

&lt;p&gt;However, it can be complex and time-consuming to build and maintain such systems, so it is only recommended for applications with specific requirements that cannot be met by existing solutions. It may be more efficient to use a third-party event tracking tool instead such as Dr Droid.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Building ELT Pipelines:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;We can also use Extract-Load-Transform (ELT) techniques. This involves capturing data from multiple sources such as web analytics, mobile apps, and CRM systems, and then transforming and loading it into a centralized data warehouse for analysis. Inherently they don't provide any intelligence on top of it. We can use a BI tool and create complex queries on the data and extract value from it.&lt;/p&gt;

&lt;p&gt;Let’s consider an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4EfSAqe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wybce6n6smozpa8hpfja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4EfSAqe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wybce6n6smozpa8hpfja.png" width="763" height="331"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 1: A simplified ETL pipeline&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;Companies like Uber have &lt;a href="https://www.uber.com/en-US/blog/charon/"&gt;created entire teams to build this scalably internally&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To get insights on any metric like the order_delivered time, ELT pipeline can be created, with any OLAP database (in this case, Snowflake) as the sink. Kafka queues are being used to stream the data from the Checkout and Delivery services to the Snowflake database.&lt;/p&gt;

&lt;p&gt;Checkout and Delivery services will both send Order fact data (created_at and delivered_at timestamps) to snowflake tables which can be monitored via a BI tool generating hourly reports of the trending average service level agreements (SLAs) at the platform level.&lt;/p&gt;

&lt;p&gt;However, setting up and maintaining a mix of tools or ELT can be complex and require significant effort. It may also require specialized skills and resources to build intelligence from the captured data.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Dr Droid Simplifies Event Tracking.&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CrZv5lEF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wx40dqv8kru6dgys5mc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CrZv5lEF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wx40dqv8kru6dgys5mc.jpg" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To simplify the process of tracking events in microservices and correlating them to metrics, tools like Dr Droid can be used. This eliminates the need for managing a shared infrastructure and cron jobs. Dr Droid allows us to send events from microservices and set up alerts for individual orders or aggregated delayed orders. By sending events such as &lt;code&gt;order_created&lt;/code&gt; and &lt;code&gt;order_delivered&lt;/code&gt; to Dr Droid, it becomes easier to track metrics and set up alerts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dr Droid Set up Walkthrough&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;We are using the &lt;a href="https://docs.drdroid.io/reference/events"&gt;API specs&lt;/a&gt; and showing how to interact with Dr Droid using the REST API. An event called order_created is created.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7d6XL3FT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhqfbhx16higiytsr0te.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7d6XL3FT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhqfbhx16higiytsr0te.png" width="800" height="333"&gt;&lt;/a&gt;&lt;br&gt;Figure 2: Generating order_created event
  &lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After creating the event &lt;code&gt;order_created&lt;/code&gt;, you can notice in the dashboard:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LxInOTG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1zrh8fkgg063ak1f60g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LxInOTG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1zrh8fkgg063ak1f60g.png" width="800" height="299"&gt;&lt;/a&gt;&lt;br&gt;Figure 3: &lt;code&gt;order_created&lt;/code&gt; event on the dashboard
  &lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Following that, we created another event &lt;code&gt;order_delivered&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ph0hw8ZC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4mseelqvoy8yamhhbik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ph0hw8ZC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4mseelqvoy8yamhhbik.png" width="800" height="340"&gt;&lt;/a&gt;&lt;br&gt;Figure 4: &lt;code&gt;order_delivered&lt;/code&gt; event generation from API specs
  &lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qJ8enKBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6rb20vkaxc7e1f2pket.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qJ8enKBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6rb20vkaxc7e1f2pket.png" width="800" height="300"&gt;&lt;/a&gt;&lt;br&gt;Figure 5: order_delivered event at the dashboard&lt;br&gt;

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

&lt;p&gt;We can then set up monitoring in the console to track the time taken for each order to be delivered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B7IYY1FO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwtxi6ivis06xkgjjpgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B7IYY1FO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwtxi6ivis06xkgjjpgb.png" width="800" height="448"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 6: Monitor dashboard&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dfv1hLHl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukndpovn51yp7g61tk5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dfv1hLHl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukndpovn51yp7g61tk5w.png" width="800" height="422"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 7: Selecting primary and secondary events&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;Configuring a notification to be triggered if there is a delay in the occurrence of the secondary event despite the primary event being initiated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fTPMUOEa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/835wxlldcmqsua3sjh16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fTPMUOEa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/835wxlldcmqsua3sjh16.png" width="800" height="305"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 8: Setting up an alert&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;There are two options available for setting up notifications, and I am choosing to enable email notifications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RdrKG_lZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmqorkuzlnveswnetrfr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RdrKG_lZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmqorkuzlnveswnetrfr.png" width="800" height="193"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 9: Notification options&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2UWglZAl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryytvjsmdhzzay9s1s68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2UWglZAl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryytvjsmdhzzay9s1s68.png" width="800" height="205"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 10: Setting up email notification&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lyMKb-cb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xax7nap1bbd5n5a43wkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lyMKb-cb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xax7nap1bbd5n5a43wkn.png" width="800" height="169"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 11: Monitoring set up is done&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;We are now ready to perform a test. We will proceed by creating a new event called &lt;code&gt;order_created&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S1spQn4O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pe0hz0iq17lm7m806fmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S1spQn4O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pe0hz0iq17lm7m806fmu.png" width="800" height="393"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 12: A new event created &lt;code&gt;order_created&lt;/code&gt;&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;The primary event, which is currently active, can be viewed in the console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yQBAvisR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9botv50ygh78drnwaja3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yQBAvisR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9botv50ygh78drnwaja3.png" width="800" height="536"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 13: Monitoring dashboard&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;As we have not yet created the secondary event, &lt;code&gt;order_delivered&lt;/code&gt;, an alert notification has been received.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--06xoty1p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n3ehiem0ifmbiexijk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--06xoty1p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n3ehiem0ifmbiexijk9.png" width="800" height="144"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 14: Monitoring dashboard alerts&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;An email notification was received stating that the secondary event, &lt;code&gt;order_delivered&lt;/code&gt;, has not been created within a timeframe of 10 seconds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PiGNE9N3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pnr4l66b1etyv34oh8rs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PiGNE9N3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pnr4l66b1etyv34oh8rs.png" width="800" height="365"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 15: Email notification&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IE5Gahmw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp7dpd1n4sz460yg5f3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IE5Gahmw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp7dpd1n4sz460yg5f3k.png" width="800" height="217"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Figure 16: Notification on the dashboard&lt;br&gt;

  &lt;/p&gt;

&lt;p&gt;In this way, we can simply post the events to the Dr Droid over REST API to capture them in a single place and make it easy to audit, monitor and trigger alerts as per the business requirements.&lt;/p&gt;

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

&lt;p&gt;I hope you have learned various use cases of event tracking and why it is vital in the microservices architecture. We also quickly learned various ways to implement event tracking including using Dr Droid.&lt;/p&gt;

&lt;p&gt;Do let us know through comments, how you use event tracking and try Dr Droid. Our team will be happy to learn about your use cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.drdroid.io/signup?ref=blog"&gt;Sign up&lt;/a&gt; and try Dr Droid.&lt;/p&gt;

</description>
      <category>doctordroid</category>
      <category>events</category>
      <category>developers</category>
    </item>
    <item>
      <title>Building a Data-Driven Engineering culture</title>
      <dc:creator>Siddarth Jain</dc:creator>
      <pubDate>Mon, 19 Sep 2022 18:30:00 +0000</pubDate>
      <link>https://dev.to/drdroid/building-a-data-driven-engineering-culture-5bl0</link>
      <guid>https://dev.to/drdroid/building-a-data-driven-engineering-culture-5bl0</guid>
      <description>&lt;p&gt;TABLE OF CONTENTS&lt;/p&gt;

&lt;p&gt;Observability practices to drive data-first culture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable democratic access to observability data and monitoring dashboards:&lt;/li&gt;
&lt;li&gt;Creating a team accountability culture:&lt;/li&gt;
&lt;li&gt;Make code performance and monitoring a part of Developers’ KPI:&lt;/li&gt;
&lt;li&gt;Avoid data fatigue:&lt;/li&gt;
&lt;li&gt;Avoiding data scattered across multiple tools:&lt;/li&gt;
&lt;li&gt;Look at the Total Cost of Ownership (TCO) and not just the tool pricing while evaluating options:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're Just Getting Warmed Up&lt;/p&gt;

&lt;p&gt;Software is eating the world. This is a cliché that most of you know!&lt;/p&gt;

&lt;p&gt;But when you build software and something breaks, what’s the first reaction of your team?&lt;/p&gt;

&lt;p&gt;A data-driven engineering culture enables teams to mitigate and resolve conflicts. But where does one start? Setting up observability and setting it the right way can accelerate your team’s journey to becoming data-first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observability practices to drive data-first culture:
&lt;/h2&gt;

&lt;p&gt;From our personal experience and interactions with senior engineering leaders, here are 5 ways to set your team up for success.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Enable democratic access to observability data and monitoring dashboards:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;While an engineer might not typically be bothered to check the health of a service that’s not related directly to his/her domain, it’s common to have indirect dependencies that need to be checked. Avoiding data silos ensure that teams can get to the root cause without making your DevOps / admins the bottleneck.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vKhEVBuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fyjvoif6k6pke9lhpylx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vKhEVBuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fyjvoif6k6pke9lhpylx.jpg" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Creating a team accountability culture:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Empower and hold your engineering team accountable for follow-up communication (post-outage) to all stakeholders (both EXTERNAL and internal):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What was the root cause of the issue?&lt;/li&gt;
&lt;li&gt;Why it wasn’t mitigated previously?&lt;/li&gt;
&lt;li&gt;What remediation actions have been taken to avoid it in the future?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same document should be circulated among your engineering team as well as to the relevant/impacted stakeholders in the company.&lt;/p&gt;

&lt;p&gt;For some inspiration, here’s how Heroku’s engineering team publishes &lt;a href="https://status.heroku.com/incidents/1619"&gt;follow-up reports&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Make code performance and monitoring a part of Developers’ KPI:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Modern engineering teams deploy code in tandem - expecting every DevOps/SRE team to monitor every alert is inefficient. Instead, hold developers accountable for the performance &amp;amp; monitoring of their work pre-deployment. Some top-performing teams have the following within the charter of the developer’s responsibility:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check for instrumentation of observability within the CI/CD pipeline&lt;/li&gt;
&lt;li&gt;Measure the performance of the code after deployment/integration&lt;/li&gt;
&lt;li&gt;If it’s a new feature/service, create a monitoring dashboard that can track the health of the service appropriately. If it’s a code change on the existing one, the existing dashboard should be re-jigged if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w79j5fl1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejnjd5ybx6nn03ysdvwu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w79j5fl1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejnjd5ybx6nn03ysdvwu.jpg" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Avoid data fatigue:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Have you noticed that your team members frequently leave alerting slack channels due to irrelevant/too frequent notifications? This creates an approach of ignoring data while investigating. Here are some strategies that you can consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only have “Actionable” alerts - pair an alert with the “impact” of the alert to make it actionable.&lt;/li&gt;
&lt;li&gt;Contextual alerting - Mapping notifications to relevant stakeholders (both horizontally across teams &amp;amp; vertically within the team)&lt;/li&gt;
&lt;li&gt;Continuous improvement - “On-call engineer” to create a report at end 
of their rotation about what % of alerts were relevant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a &lt;a href="https://www.atlassian.com/incident-management/on-call/alert-fatigue"&gt;good article by Atlassian&lt;/a&gt; team on some best-practices to reduce alert fatigue.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Avoiding data scattered across multiple tools:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;There are too many developer tools in the market. Period.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adopting a new tool requires your engineer is like building a muscle - it needs conscious effort over a prolonged period of time. In this case, it could be getting used to the user interface or the querying language. Create guidelines for setting up the monitoring dashboard to enable ease of accessibility in times of crisis or urgency. As teams build habits of their respective tools, it only gets harder to migrate. (Sooner the better)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dB4uOGNj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qo6k1z064ly781nh2fp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dB4uOGNj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qo6k1z064ly781nh2fp.jpg" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Look at the Total Cost of Ownership (TCO) and not just the tool pricing while evaluating options:&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Just because a tool is open-source or free, doesn’t make it the go-to option. Sometimes, orchestrating and managing open source tools can be demanding - if your team is very lean or worked up, avoid tooling that will require constant maintenance and development.&lt;/p&gt;

&lt;p&gt;Chose tools that save your team’s time. The quick time-to-value also improves adoption. Once you’re closer to a scale where the tool cost pinches you too much, the TCO will automatically start weighing toward the open-source option.&lt;/p&gt;

&lt;h2&gt;
  
  
  We're Just Getting Warmed Up
&lt;/h2&gt;

&lt;p&gt;At Dr Droid, our team is building tools to simplify the lives of engineering teams. And we are listening to what you have to say!&lt;/p&gt;

&lt;p&gt;If you have any engineering practices to share that help drive data-first culture, tell us in the comments below.&lt;/p&gt;

</description>
      <category>doctordroid</category>
      <category>observability</category>
    </item>
  </channel>
</rss>
