API Analytics - Time Series

Time Series analysis allows you to view aggregate trends for your API events over a time period. All the regular search filters filters are also present in time series, so you can filter traffic for a specific route such as GET /items, or even from a specific User Agent such as only request from Python clients.

API Time Series

Filters

All the filters that usually work on Event Stream also work in time series. This enables you to filter by specific properties such as a certain User Id or only a particular route of interest.

Segment on

Time series analysis also supports segmentation which allows you to plot multiple time series pivoting around a specific property such as Response Status.

In the above chart, we selected to segment on Response Status so we can see a break down of how various errors trend over time. You can segment on any property that non time-series segmentation supports including any custom HTTP headers and metadata.

If the chart gets cluttered when plotting many time series, you can select the key name in legend underneath chart to toggle hiding/showing a time series.

Metric to plot

By default, time series will show event count per time window, if you want to derive additional metrics such as plotting the average latency, you can click the button + Metric to Plot.

To plot average latency, we would select the property to select such as Elapsed Time (ms) and then pick the operator avg

You can plot additional metrics on the same chart by clicking the button + Metric to Plot again.

So we can plot both avg and max duration via the following:

API Time Series Picking Metrics

Fields that are numeric type such as Elapsed Time supports average, sum, min, max, and distinct. Fields that are string types such as HTTP headers supports distinct.

Exporting data

At the very bottom, you can select Export to CSV to download a CSV of your time series if you need to create custom charts or want to play with the data more.

How are intervals calculated

Moesif will calculate your time series intervals based on your start time. For example, if the current time is August 4, 2018 11:24AM PST and you select Last 24 Hours, then the chart will plot data from August 3, 2018 11:24AM to August 4, 2018 11:24AM.

In addition if you select to use the HOUR interval, then the first few intervals will be:

  • August 3, 2018 11:24 AM to August 3, 2018 12:24 PM
  • August 3, 2018 12:24 AM to August 3, 2018 1:24 PM
  • August 3, 2018 1:24 AM to August 3, 2018 2:24 PM
  • August 4, 2018 10:24 AM to August 4, 2018 11:24 AM

This helps ensure there is no “cut off” due to incomplete intervals especially when selecting Last XX such as Last 7 Days or Last Hour.

On the other hand if you need to compute metrics based on calendar day or week such as for historical reasons, meaning the first interval starts at start of the day or start of the week, then ensure your start date is a Monday at midnight.

Why 28-day?

Many of our users use Moesif for API product analytics to understand how there API traffic is trending in the medium and long term. 28-day is a very common interval taken from mobile/web app analytics to remove day-of-week effects. This is especially true in SaaS or B2B such as SaaS APIs where you expect the usage to be much lower on weekends than on weekdays.

Updated: