<?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: Siddarth Jain</title>
    <description>The latest articles on DEV Community by Siddarth Jain (@thebengaluruguy).</description>
    <link>https://dev.to/thebengaluruguy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1063662%2Fcac4b7da-0d47-48bc-b778-b0583551a9ef.jpg</url>
      <title>DEV Community: Siddarth Jain</title>
      <link>https://dev.to/thebengaluruguy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thebengaluruguy"/>
    <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>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>
