Skip to main content

MetricTimeSeries

Introduction​

Metric Timeseries represent a timeseries of metrics from various metric providers.

A metric timeseries consists of the following:

Provider​

The name of the metric provider

Metric​

The name of the metric to read from the provider

info

See Metrics for full details on providers and metric names

Filter​

An optional filter to filter the metrics in the value calculation

Calendar​

This is the interval frequencies for value aggregation, usually one of:

  • #PT1M - 1 minutely
  • #PT5M - 5 minutely
  • #PT15M - 15 minutely
  • #PT30M - 30 minutely
  • #PT1H - hourly
  • #PT6H - 6 hourly
  • #PT12H - 12 hourly
  • #P1D - daily

Observed​

The aggregation method, usually one of:

  • summed - Sum up all the values for the interval
  • averaged - Average the values for the interval
  • high - The maximum value during the interval
  • low - The minimum value during the interval

Creating a MetricTimeSeries​

Azure Service Bus Metrics​

An example of creating a metric timeseries for the average number of active messages on a queue named etrm aggregated 5 minutely

ActiveMessages_1h = MetricTimeSeries("AzureServiceBus", "ActiveMessages")
ActiveMessages_1h.calendar = ${calendar:"#PT5M"}
ActiveMessages_1h.queue = "etrm"
ActiveMessages_1h.observed="averaged"

ODSL User Request Metrics​

An example of creating metric timeseries for the total user read requests for the service 'user' aggregated hourly

ReadRequests_1h = MetricTimeSeries("ODSLRequest", "ReadRequests")
ReadRequests_1h.calendar = ${calendar:"#PT1H"}
ReadRequests_1h.observed = "summed"
ReadRequests_1h.filter = ?service='user'

Properties​

NameDescriptionType
calendarThe calendar that this timeseries usesCalendar
currencyThe ISO currency of this timeseriesString
descriptionThe description of this timeseriesString
filterFilter the metricsString
identityThe configured identitiesObject
localValuesThe list of time observations for this timeseries, returned as a list of TimeValues in the local timezone of this TimeSeriesList
metricThe name of the metricString
nameThe name of the timeseriesString
observationsThe list of values for this timeseries, returned as a list of VarsList
observedThe observed setting of the timeseries used for aggregatingTimeSeriesObserved
precisionThe precision configuration for this timeseriesPrecision
providerThe name of the metric providerString
sourceThe source of this timeseriesString
startThe starting date/time of the timeseriesDate
tenorThe tenor of this timeseriesString
timezoneThe timezone of this timeseries, defaults to UTCString
unitsThe ISO units of this timeseriesString
valueTypeThe value type of the timeseries (TRACKED or BASIC)TimeValueType
valuesThe list of time observations for this timeseries, returned as a list of TimeValuesList

Methods​

NameDescriptionReturn Type
addCheck(check)Add a quality check directly to this TimeseriesTimeSeries
addValue(value)Adds a new value to the end of the timeseries using the calendarTimeSeries
applyPrecision()Apply the precision defined to all the observations of this timeseriesVoid
convert(currency, units)Convert this timeseries using currency and unitsTimeSeries
from(start)Creates a new TimeSeries from a specified start dateTimeSeries
getLast(date)Get the value at the supplied date or the latest value before that dateVar
getLastNValues(n)Returns a list of the last N values from this TimeSeriesList
last(n)Creates a new TimeSeries using the last n values from this TimeSeriesTimeSeries
range(start, end)Creates a new TimeSeries from a range of values from this TimeSeriesTimeSeries
withRange(start, end)Changes this timeseries to match the provided date rangeVoid