/api/query/gexp

    TSDB implements a subset of Graphite functions though we hope to add more in the future. For a list of Graphite functions and descriptions, see the Documentation. TSD supported functions appear below.

    Note

    Supported as of version 2.3

    Queries can only be executed via GET using the URI at this time. (In the future, the endpoint will support more flexibility.) This is an extension of the main /api/query endpoint so parameters in the request table are also supported here. Additional parameters include:

    The output is identical to .

    Functions that accept a single metric query will operate across each time series result. E.g. if a query includes a group by on host such as scale(sum:if.bytes_in{host=*},1024), and multiple hosts exist with that metric, then a series for each host will be emitted and the function applied. For functions that take multiple metrics, a union is performed across each metric and the function is executed across each resulting series with matching tags. E.g with the query , assume two hosts exist, web01 and web02. In this case, the output will be if.bytes_in{host=web01} + if.bytes_out{host=web01} and if.bytes_in{host=web02} + if.bytes_out{host=web02}. Missing series in any metric result set will be filled with the default fill value of the function.

    Currently supported expressions include:

    absolute(<metric>)

    diffSeries(<metric>[,<metricN>])

    Returns the difference of all series in the list. Performs a UNION across tags in each metric result sets, defaulting to a fill value of zero. A maximum of 26 series are supported at this time.

    Returns the quotient of all series in the list. Performs a UNION across tags in each metric result sets, defaulting to a fill value of zero. A maximum of 26 series are supported at this time.

    highestCurrent(<metric>,<n>)

    Sorts all resulting time series by their most recent value and emits n number of series with the highest values. must be a positive integer value.

    highestMax(<metric>,<n>)

    Sorts all resulting time series by the maximum value for the time span and emits n number of series with the highest values. n must be a positive integer value.

    Emits a sliding window moving average for each data point and series in the metric. The window parameter may either be a positive integer that reflects the number of data points to maintain in the window (non-timed) or a time span specified by an integer followed by time unit such as `60s` or `60m` or . Timed windows must be in single quotes.

    multiplySeries(<metric>[,<metricN>])

    Returns the product of all series in the list. Performs a UNION across tags in each metric result sets, defaulting to a fill value of zero. A maximum of 26 series are supported at this time.

    scale(<metric>,<factor>)

    Multiplies each series by the factor where the factor can be a positive or negative floating point or integer value.

    Returns the sum of all series in the list. Performs a UNION across tags in each metric result sets, defaulting to a fill value of zero. A maximum of 26 series are supported at this time.