Guest post by Andrew Stiefel, Product Marketing Manager for F5 NGINX
With more and more companies adopting API‑first design practices to build modern applications, measuring your APIs’ operational performance and value becomes a top priority. To measure API performance, you must establish a framework for measuring API metrics. As a general rule, you should start with the business goals and work backward to the metrics.
There are three categories of API metrics that companies can track, with answering a different question:
- Operational metrics – Are APIs delivering the stability, reliability, and performance you need?
- Adoption metrics – Are developers adopting and using your APIs?
- Product metrics – How are APIs supporting your business objectives?
Imagine these overarching metrics as a pyramid. At the bottom, operational metrics measure the tactical performance of individual APIs and the infrastructure supporting them. At the top, product metrics measure the business value your APIs create. And in the middle, adoption metrics track the API program’s growth with end users (developers). Generally, product and adoption metrics align with the business outcomes you need to measure, while operational metrics align with the technical standards you need to maintain.
In this post, we break down 12 critical metrics to measure, discuss how they enable infrastructure and application teams, and explain how the metrics relate to real business goals.
When you are just starting, operational metrics are usually the first thing you want to measure. They are tactical and provide insights into how APIs are functioning. Operational metrics are not business goals themselves. But they do help you measure the quality and performance of the software your teams are building. They can provide early indicators of emerging problems or help you drill down and discover issues impacting your product performance.
The operational metrics you track will vary by team and responsibility.
Platform Ops is the team responsible for maintaining, connecting, and securing the collection of infrastructure and technologies used by different teams to deliver applications. For API programs, this often includes API gateways and API developer portals.
Key metrics for infrastructure teams like Platform Ops include:
- Uptime – Uptime is the gold standard for measuring the availability of a service. Uptime is often tied to a service level agreement (SLA).
- CPU and memory usage – Tracking resource utilization at the API gateway is critical to identify when to scale your instances. It also can provide an early warning when something in your infrastructure or application tier starts to break, usage spikes due to errors, or a configuration problem generates unnecessary drag on infrastructure.
- Total pass and error rates – Measuring how often APIs trigger HTTP error (non‑200) status codes helps you judge the overall quality of the APIs your teams are putting into production. High numbers of error codes, and a high percentage of error codes per total API calls, are a sign of clear trouble.
Application teams, made up of API developers and service owners, are responsible for building and operating individual services or applications. The APIs they build and manage could be used as part of a larger product, to integrate with a partner, or when delivering APIs-as-a-service to developers.
Here are some of the most important metrics for application teams:
- Requests per minute (RPM) – This performance metric measures the number of requests your API handles. RPMs may vary over time, but you want to manage towards lower rates to ensure a better user experience. This metric is often affected by seasonal, weekly, and daily peeks. Application teams should know the maximum RPM their API can handle while maintaining a good user experience.
- Average and maximum latency – Tracking your API’s average time to receive a request and return a response is crucial. A single slow API can negatively impact the user experience and the business by bottlenecking other components that depend on the API or degrading the user experience in one critical area. (For example, a shopping cart widget that won’t load).
- Errors per minute – Like everything else, no API is perfect. Failures are a matter of when not if. You need to monitor errors and have a planned course of action for fixing them before they suddenly start to tick up.
For an API‑first business, looking beyond engineering metrics and understanding how developers interact with your APIs is essential. You must also measure and monitor the API developer experience to ensure developers adopt and get value from your APIs.
A few examples of adoption metrics include:
- Unique API consumers – This metric measures how many developers adopt and use your APIs. Usually, you measure this metric on a monthly b asis. Ideally, this metric grows over time as more developers integrate your API into their applications.
- API usage growth – This metric also measures API adoption but is a more direct measurement of usage and adoption. In reality, usage growth is a more meaningful indicator than consumer growth because many consumers that only lightly use an API might indicate adoption that is not sticky or deeply embedded in products. Ideally, API traffic grows monthly as the number of applications and developers increases.
- Time to first call – This metric measures how much time between when a developer creates an account, generates API credentials, and runs the first API call. Enabling developers to get up and running as fast as possible is a high priority, making this metric the most important for measuring the overall API developer experience.
API product metrics play a significant role in understanding the value of an API. Although only a small subset of APIs may directly contribute to revenue, every API must provide value to the business.
Key product metrics to measure include:
- Direct and indirect revenue – These metrics target the different ways APIs contribute to revenue. While some APIs are directly monetized (product feeds, for example), others support integrations with business partners or are third‑party integrations valued by customers. As with the adoption rate for your APIs, tracking indirect revenue helps developers build revenue‑generating apps for partners.
- Applications per API – APIs need to be reusable. This metric measures how many applications integrate with an API to see which APIs provide the most value. This is related to API consumers. More is almost always better.
- Number of partners – APIs often enable business relationships. Tracking the number of partner API integrations helps drive adoption and demonstrate value to other business units. Some of the most robust B2B platforms prioritize partner API integrations as a way to drive new revenue lines, foster cross-marketing opportunities, and enable more self-service options for users.
Turning Metrics Into KPIs or Other Goal Systems
Metrics are fundamental to any business growth and performance strategy. For modern businesses that use software, metrics must include the technology measures like API performance to present a complete picture of all the factors contributing to success or failure. Mapping the above metrics to goals clarifies what matters to an organization. For example, putting a heavier weight on API partner integrations and in-band infrastructure utilization tells teams to prioritize partner business development and support and closely monitor cloud utilization and performance. Those goals, in turn, might be KPIs within an overarching goal of driving more significant revenue from partner integrations and optimizing technology spend. The bottom line? Your APIs don’t lie, so watch them closely to ensure your API — and business strategy — are doing what you want.
Dig into API operations and learn which KPIs and metrics are critical from a business perspective in chapters 3–5 of the eBook Mastering API Architecture from O’Reilly, compliments of NGINX.