intermediate·10 min read·Updated

API Usage Monitoring: Usage Over Time, per API (Part 1)

How often is each API really called, and who says so? Keep test-run analytics apart from real usage, read one API's last 30 days source by source, and find the numbers on a dashboard.

This is lesson 9.27, part 1, of Shift-Left API in Depth. The previous lesson recorded decisions about each API, and decisions need evidence. Project Analytics is in every edition. An API's Analytics tab comes with Professional, the 15-day trial and Enterprise. Usage needs a source from the API Discovery add-on, and dashboards come with the trial and Enterprise. The trial includes all of them.

What does API usage monitoring tell you?

API usage monitoring answers a plain question: how often is each of your APIs really called, and who says so? Shift-Left API keeps two kinds of numbers apart:

NumbersWhat they measureWho measures them
Project AnalyticsYour own test runs: pass rate, response times, failing testsThe product
An API's Analytics tabReal traffic from your users and applicationsA source, such as a gateway, a log or a trace store

Four rules apply to usage:

  1. Every count is what a source reported, and the screen names the source.
  2. A day nobody reported is a gap, never a zero.
  3. Two sources are never added together, because they may count the same calls.
  4. If a source does not say how many calls failed, failures stay unknown, not zero.

What does Project Analytics show?

Tick Analytics under Top menu tabs, open it, and choose Project Analytics. Pick a time range from the last 7 days up to the last year. The page shows total tests, success rate, average response time, failed tests and endpoint coverage, along with test creation and response-time distribution. More sections cover trends, top failing tests, a comparison between environments and per-endpoint results. All of these come from test runs, so "total calls" here means your tests' calls, not your users' calls.

How do you read one API's usage?

Open the project from Overview, find the API under API by API, and click its Analytics tab. Usage and availability covers the last 30 days, grouped by the environment the source named, with one chart per source.

  • Each bar is one day, compared with the busiest day.
  • A faint mark on the baseline is a day with no report.
  • Lighter bars come from a reading that covered several days, so its calls were spread evenly across them.
  • A sentence gives the total, the days with data and the daily average.

When a source records response times in a known unit and there are enough timed calls in a day, a second line shows typical and slowest-1-in-20 times.

An API with no reported calls says so, and adds that this is not the same as no calls. An API that Discovery never found says something different: there is no usage to show. Without permission to view the API inventory, the section does not appear.

Where do the numbers come from?

Sources are connected under Discovery, Sources. They include access logs, traffic files and captures, gateway exports, Splunk, Elasticsearch, Datadog, OpenTelemetry traces and Azure API Management analytics, which also reports failures and an average time. Kong and Kubernetes give counts only through a Prometheus address you add, and AWS API Gateway only through CloudWatch.

A folder of access logs keeps method, path, counts and times, never bodies or client addresses. Usage reaches an API only once the API is linked: by importing the specification into the project, or by accepting it from Discovery. If a log does not name the host callers use, add the public host when you set up the source.

In Discovery settings, you can keep usage history for 30 to 1,095 days; the default is 395. Changes apply to new data only, and removing a source also removes its usage.

Where else does usage appear?

The API usage and availability panel on the CTO and DevOps dashboards lists up to five of a project's busiest APIs. It takes each from the source that reported on the most days, and says how many APIs have usage reported.

How should you read usage?

  • Connect the sources that carry your real traffic.
  • Compare sources side by side, but never add them up.
  • Treat a gap as a question for the source, not as an unused API.
  • Before you deprecate an API, check its last 30 days in every source.

Try it yourself

With a trial: tick Analytics and Discovery, and read Project Analytics for a project with test runs. Then connect a folder of access logs or a traffic file, with your API's public host, and open an API's Analytics tab.

Recap

  • Project Analytics measures your tests; the API's tab shows real calls.
  • Usage is shown per day and per source, with gaps left as gaps.
  • Failures are never guessed.
  • These API monitoring metrics come from the logs, traffic and gateways you connect.

Next: part 2, the audit log and compliance exports. For production monitoring in general, read the guide to monitoring API performance.

Hands-on lab

Try it: With a trial, tick Analytics and Discovery, read Project Analytics for a project that has test runs, then connect a folder of access logs or a traffic file with your API's public host, and open one API's Analytics tab.

Enter your email to open the lab steps. One unlock opens every lab in the learning center.

No spam. Protected by reCAPTCHA — Google Privacy & Terms.

Frequently asked questions

What is API usage monitoring?+

It answers how often each API is really called, and which source says so. In Shift-Left API, usage comes from what connected sources report, such as access logs, traffic files or gateway data. It is separate from the results of your own test runs.

Why does a day with no data not count as zero calls?+

No report is not the same as no calls. Shift-Left API shows a day that no source reported as a gap, so you can check the source before you assume an API was unused.

Which API monitoring metrics can you see for each API?+

For each source, you see calls per day over the last 30 days and a total with a daily average. Failure counts appear only when the source reports them, and response times only when the source's data supports them.

Read more on the blog