API Guide

16. METRICS
Time series based metrics.
16.1 POST /metrics
Gets metric time series within a time range.
Fetches individual set of metric time series or multiple sets of time series.
Omit any optional parameters which are not used.
To retrieve single/multiple set(s) of time series for a single entity provide entity_id.
To retrieve single/multiple set(s) of time series for multiple related entities omit
entity_id and provide a tag which applies to all the time series.
Metrics can be retrieved as raw values or as evaluated points.
For raw metrics do not add the function_name parameter.
Example 1 - Single Entity for Single Raw Time Series Example:
Retrieve in packets between 8am and 9am on April 3rd, 2020.
metric_names = ["in_pkts"]
start_time_unix = 1585926005 (8:00AM on 04/03/2020 as a unix timestamp)
end_time_unix = 1585929605 (9:00AM on 04/03/2020 as a unix timestamp)
entity_id = the unique identier of the entity
*Result*:
A default interval is used since interval was omitted from request body.
interval is the interval at which a metric is retrieved in the time range.
E.g. For 8:00am to 9:00am the default interval is 60s. The resulting time
series will have metric points at 8:00am, 8:01am, 8:02am...8:59am, 9:00am
Example 2 - Single Entity for Single Evaluated Time Series:
Using the same parameters as Example 1 but to retrieve the rate of in packets
from 8am to 9am add to the request body:
function_name = "RATE"
*Result*:
Again, a default interval of 60s will be used since one was not provided.
The resulting set of metric points will have the same timestamps as Example 1
but the value at each timestamp will be the one minute rate of change of in_pkts.
Example 3 - Single Entity for Multiple Raw Time Series Example:
Using the same params as Example 1 above but this time replace metric_names with:
metric_names = ["in_pkts", "in_discards", "out_pkts"]
*Result*:
Three time series for the entity following the same conventions established in the
previous examples.
Example 4 - Multiple Entity for Single Raw Time Series Example:
In this case we do not want a unique identier but instead a tag which applies to
any time series which share a metric name and a tag.
Using the same params as in Example 1 above but this time omit entity_id param and add:
tags = [{"switch_oid", "2:222222"}]
*Result*:
210 of 340