Customers & growth · Developer marketing
API usage metrics
Best for Startup to Growth
Use it when
Your API is live and you need to see which endpoints and developer apps drive calls, errors and slow responses, so you know where to act.
Skip it when
- You need alerts that page an engineer when the service fails. Use Performance monitoring framework.
- You need to know how many developers reach a first working integration. Use Developer activation metric, which takes these figures.
- You need to follow developers from signup to production use. Use Developer funnel metrics.
What to apply first and what to use instead are listed below.
Inputs
- Request logsEvery API call in the last 30 to 90 days with timestamp, endpoint, method, status code, response time and the calling key, from the API gateway.
- App registerEach API key mapped to its app, developer and plan, from the developer portal.
- Endpoint listEvery live endpoint with its version and owning team, from the API description.
- Service targetsOptionalAgreed latency and error targets per endpoint, from your service level objectives.
Steps
- Join the request logs to the app register so every call carries its endpoint, app, developer and plan.
- Count calls per endpoint and per app for each day, and rank the top endpoints and top apps by calls.
- Calculate the error rate per endpoint and per app, with client errors and server errors on separate lines.
- Calculate latency per endpoint at the median, 95th and 99th percentile, keeping failed requests apart from successful ones.
- Flag the endpoints and apps whose calls, error rate or latency moved most against the previous period, and give each flag an owner and a next action.
Output
A weekly API usage report with one row per endpoint and a short list of flagged endpoints and apps.
- Endpoint and version
- Calls in the period and change from the previous period
- Active apps calling it
- Client error rate
- Server error rate
- Latency at the median, 95th and 99th percentile
- Top apps by calls
- Flag, owner and next action
Done when
- Every call in the period is linked to an app, or calls with no app are counted on their own row.
- Every endpoint shows calls, both error rates and three latency percentiles for the same period.
- Latency for failed requests is reported apart from successful requests.
- Every flagged endpoint or app has an owner and a next action.
Measure
Rerun the report weekly with the same window and definitions. After acting on a flag, track that endpoint's error rate, its 99th percentile latency and the calls from affected apps for the next four weeks. It worked when the flagged figure returns to the range of your own previous eight weeks and the affected apps keep calling at their usual level.
Hypothetical example
Parcelo, a delivery routing API, ran its weekly report across 14 endpoints. The route endpoint carried most calls, and its error rates were flat. The address lookup endpoint showed client errors three times higher than the week before. Splitting by app showed one partner app sending a retired field after its own update. The quote endpoint looked fine at the median, but its 99th percentile had doubled, driven by large requests from two apps. The team gave the address flag to developer support, who contacted the partner, and the quote flag to the platform team. Two weeks later both figures were back in range.
Common mistakes
- Reporting average latency only. Report percentiles, since an average hides the slow tail.
- Mixing failed and successful requests in one latency figure. Track them apart, since fast errors make latency look better than it is.
- Counting calls without the calling app. Split every figure by app, since one app's change can move the whole total.
- Treating all errors alike. Separate client errors, which point to docs or design, from server errors, which point to your own systems.
Sources
- Site Reliability Engineering, chapter 6: Monitoring distributed systems · Rob Ewaschuk, edited by Betsy Beyer, 2017
- Using the metrics API (Apigee) · Google Cloud
- Apigee API Analytics overview · Google Cloud
By company stage
Apply first
Nothing. You can start here.
Use instead
- Performance monitoring framework
You need alerts that page an engineer when the service fails. Use Performance monitoring framework.
- Developer activation metric
You need to know how many developers reach a first working integration. Use Developer activation metric, which takes these figures.
- Developer funnel metrics
You need to follow developers from signup to production use. Use Developer funnel metrics.
Where it sits
Open the developer marketing roadmapRecommended resources
No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.
Progress is not saved until you have an account. Create a free account