# How to Monitor Your APIs Using Postman and Datadog

[Monitoring your APIs](https://learning.postman.com/docs/designing-and-developing-your-api/monitoring-your-api/intro-monitors/) is an essential part of the API management process. While Postman[ monitors](https://learning.postman.com/docs/designing-and-developing-your-api/monitoring-your-api/intro-monitors/) let you keep a check on your API performance and stability, our enhanced integration with [Datadog](https://learning.postman.com/docs/integrations/available-integrations/datadog/)—an API performance monitoring tool—enables you to perform further analysis by logging, alerting, and dashboarding. Plus, this integration in conjunction with Postman[ asserting](https://learning.postman.com/docs/writing-scripts/test-scripts/) allows you to closely monitor your business logic. Here’s how this integration works: Postman posts the monitor run results to Datadog. The results can then be further analyzed to gain greater insights into your API performance and reliability. Follow the steps[ here](https://learning.postman.com/docs/integrations/available-integrations/datadog/) to set up a Datadog integration and achieve the following use cases. ## Monitor the API latency across various regions

 Postman sends the [latency](https://blog.postman.com/what-is-api-latency/) of each request as well as the complete monitor run to Datadog. The metrics **PostmanMonitors\_totalLatency** and **PostmanMonitor\_request\_latency** can be observed to test the latency of your API across a particular ["region](https://learning.postman.com/docs/designing-and-developing-your-api/monitoring-your-api/intro-monitors/#multi-region-monitoring)" (which is a tag associated with the metric). Observing these metrics in conjunction with the system performance metrics can help you detect the degradation of your API performance and take quick action. This observation helps you drill deeper into an anomaly in API performance and better understand the effects of latency on system resources and vice versa. Datadog also lets you set[ alerts](https://docs.datadoghq.com/monitors/) once a metric crosses a certain threshold, so you will always be aware of any significant performance degradation. ![API Latency analyzed along with the CPU usage](https://blog.postman.com/wp-content/uploads/2021/02/postman-datadog-integration-1.png)API Latency analyzed along with the CPU usage## Keep a check on errors and test-case status

 It's important to keep a check on any unusual errors or test failures in the APIs. Postman monitors send across metrics such as **PostmanMonitors\_failedTests**, **PostmanMonitors\_passedTests**, **PostmanMonitors\_errors**, and more to Datadog to keep checking for any errors or unusual test failure in your APIs. These metrics can help you be proactive in taking corrective measures in the event of an API failure. Tracking these over time can give you a good idea of the reliability of your APIs. Correlating these metrics with other application metrics can help you identify the root cause of failures and errors. With this latest release, we have introduced a few new request-level metrics: **PostmanMonitor\_request\_failedTests** and **PostmanMonitor\_request\_passedTests**. ![Number of tests passed and failed, and the API errors being analyzed together on Datadog](https://blog.postman.com/wp-content/uploads/2021/02/Postman-Datadog-integration-2.png)Number of tests passed, tests failed, and the API errors being analyzed together on Datadog## Detect unusual data transfer to and from your APIs

 The number of bytes sent or received by your APIs directly impacts the resource utilization of your network and system. This also in turn impacts the performance of your APIs. The new metrics **PostmanMonitor\_request\_bytes** helps you monitor closely the number of bytes being sent or received by your API over a time frame. This in conjunction with the network and system resource metrics can help you detect any adverse impacts being caused by your APIs on your network and systems. The higher resource (CPU, RAM, etc.) utilization can further have an impact on the latency metrics as well, hence the metric can indirectly answer any anomaly in the API latency metrics. ## Know the availability of your APIs

 API availability is one of the most important metrics that have a direct impact on your business sustainability. Postman sends across metrics such as **PostmanMonitor\_run\_httpStatus2XX, PostmanMonitor\_run\_httpStatus4XX,** and **PostmanMonitor\_run\_httpStatus5XX** to monitor the HTTP status of your requests. The metric in conjunction with the Datadog alerting (talked about earlier) can help you stay on top of your APIs' availability. Also, observing the trend over a time frame will give you a good idea about your API availability, which can be correlated to business impact if there is any. ![Setting up alerts for API latency on Datadog](https://blog.postman.com/wp-content/uploads/2021/02/postman-datadog-integration-3.png)Setting up alerts for API latency on Datadog ![The alert as seen on Microsoft Teams](https://blog.postman.com/wp-content/uploads/2021/02/postman-datadog-integration-4.png)The alert as seen on Microsoft Teams## Creating a dashboard in Datadog

 While all the metrics above have a standalone significance, the power of metrics increases exponentially when viewed in conjunction with each other. Datadog lets you create dashboards of related metrics, which can help you monitor your APIs and systems closely. We strongly recommend creating a dashboard corresponding to each monitor that contains all the metrics associated with that monitor and a few other systems/network resource metrics. This gives you an end-to-end view of your APIs' performance, resilience, resource utilization, and availability. ![A dashboard to analyze the API metrics and system metrics together](https://blog.postman.com/wp-content/uploads/2021/02/postman-datadog-integration-5.png)A dashboard to analyze the API metrics and system metrics together With these enhancements to the Datadog integration, Postman now empowers you to comprehensively evaluate every aspect of your API performance and be more proactive in taking corrective measures when needed. Try out the upgraded integration and let us know what you think.