Graphite to CAQL Conversion

Supported Functions

Below you’ll find the Graphite functions that we directly support and their CAQL equivalents.

Graphite Function CAQL Equivalent Notes
absolute(seriesList) math:abs()
add(seriesList, constant) `find(…) each:add(x)`
aggregate(seriesList, func, xFilesFactor=None) `find(…) stats:(‘VIEW_PERIOD’)`
alias(seriesList, newName) `find(…) label(“new_label”)`
aliasByMetric(seriesList) `tag:synth label`
aliasByNode(seriesList, *nodes) `find(…) graphite:aliasbynode()`
aliasSub(seriesList, search, replace) `find(…) graphite:aliasSub(‘search’, ‘replace’)`
asPercent(seriesList, total=None, *nodes) op:prod(100){op:div{vector{find(...)}, find(...)}} third arg not supported
averageAbove(seriesList, n) `find(…) filter:mean:gt(x)`
averageBelow(seriesList, n) `find(…) filter:mean:lt(x)`
averageSeries(*seriesLists) `find(…) stats:mean`
avg(*seriesLists) alias for averageSeries(*seriesLists)
consolidateBy(seriesList, consolidationFunc) `find(…) window:<sum
countSeries(*seriesLists) ` count()`
cumulative(seriesList) `find(…) window:sum(‘VIEW_PERIOD’)`
derivative(seriesList) `find(…) diff()`
diffSeries(*seriesLists) `find(…) op:sub()`
divideSeries(dividendSeriesList, divisorSeries) op:div { find("dividend"), find("divisor") }
exclude(seriesList, pattern) exclude:label queries with exclude should be rewritten to not request the things being excluded
group(*seriesLists) pass{}
groupByNode(seriesList, nodeNum, callback='average') group_by::<agg>(__tag)
groupByNodes(seriesList, callback, *nodes) group_by::<agg>(__tag)
highestAverage(seriesList, n) ` top(1)`
highestMax(seriesList, n) ` top(1, method=“max”)`
hitcount(seriesList, intervalString, alignToInterval=False) ` window:sum(interval)
integral(seriesList) `find(…) integrate`
invert(seriesList) op:exp(-1)
isNonNull(seriesList) ` count()`
keepLastValue(seriesList, limit=inf) `find(…) fill:forward`
limit(seriesList, n) filter:limit()
maximumAbove(seriesList, n) filter::all:gt
maximumBelow(seriesList, n) filter:all:lt
maxSeries(*seriesLists) `find(…) stats:max()`
minimumAbove(seriesList, n) filter:all:gt
minimumBelow(seriesList, n) filter:all:lt
minMax(seriesList) normalize()
movingAverage(seriesList, windowSize, xFilesFactor=None) `find(…) rolling:mean(<window_duration>)`
movingMax(seriesList, windowSize, xFilesFactor=None) `find(…) rolling:max(<window_dur>)`
movingMedian(seriesList, windowSize, xFilesFactor=None) `find(…) rolling:percentile(<window_dur>, 50)`
movingSum(seriesList, windowSize, xFilesFactor=None) `find(…) rolling:sum(<window_duration>)`
multiplySeries(*seriesLists) op:prod{ find("metric1"), find("metric2"), find("metricN") }
nonNegativeDerivative(seriesList, maxValue=None, minValue=None) ` counter()
offset(seriesList, factor) `find(…) each:add(x)`
perSecond(seriesList, maxValue=None, minValue=None) `find() counter()`
removeAbovePercentile(seriesList, n) filter:values:percentile:lt
removeAboveValue(seriesList, n) `find(…) filter:all:lt([filter_value])`
removeBelowPercentile(seriesList, n) filter:values:percentile:gt
removeBelowValue(seriesList, n) `find(…) filter:all:gt([filter_value])`
removeEmptySeries(seriesList, xFilesFactor=None) filter:all:<>:missing for the second arg, only 0 or 1 is supported
scale(seriesList, factor) `find(…) each:mul(x)`
scaleToSeconds(seriesList, seconds) ` each:mul(x)
smartSummarize(seriesList, intervalString, func='sum', alignTo=None) `find(…) window:<sum
sortByMaxima(seriesList) pass{} no need to sort in CAQL - passthrough
sortByName(seriesList, natural=False, reverse=False) pass{} no need to sort in CAQL - passthrough
summarize(seriesList, intervalString, func='sum', alignToFrom=False) `find(…) window:sum()`
sum() alias for sumSeries()
sumSeries(*seriesLists) `find(…) stats:sum()`
sumSeriesWithWildcards(seriesList, *position) ` graphite:tagbynode('__gbtag',position)
timeShift(seriesList, timeShift, resetEnd=True, alignDST=False) ` delay()`
transformNull(seriesList, default=0, referenceSeries=None) `find(…) fill([value])`

Functions Not Yet Supported

The following Graphite functions are not currently available in CAQL but can be implemented.

Graphite Function
aggregateLine(seriesList, func='average', keepStep=False)
aggregateWithWildcards(seriesList, func, *positions)
aliasByTags(seriesList, *tags)
aliasQuery(seriesList, search, replace, newName)
alpha(seriesList, alpha)
applyByNode(seriesList, nodeNum, templateFunction, newName=None)
areaBetween(seriesList)
averageOutsidePercentile(seriesList, n)
averageSeriesWithWildcards(seriesList, *position)
cactiStyle(seriesList, system=None, units=None)
changed(seriesList)
color(seriesList, theColor)
constantLine(value)
currentAbove(seriesList, n)
currentBelow(seriesList, n)
dashed(seriesList, dashLength=5)
delay(seriesList, steps)
divideSeriesLists(dividendSeriesList, divisorSeriesList)
drawAsInfinite(seriesList)
events(*tags)
exp(seriesList)
exponentialMovingAverage(seriesList, windowSize)
fallbackSeries(seriesList, fallback)
filterSeries(seriesList, func, operator, threshold)
grep(seriesList, pattern)
groupByTags(seriesList, callback, *tags)
highest(seriesList, n=1, func='average')
highestCurrent(seriesList, n)
holtWintersAberration(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d')
holtWintersConfidenceArea(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d')
holtWintersConfidenceBands(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d')
holtWintersForecast(seriesList, bootstrapInterval='7d', seasonality='1d')
identity(name)
integralByInterval(seriesList, intervalUnit)
interpolate(seriesList, limit=inf)
legendValue(seriesList, *valueTypes)
linearRegression(seriesList, startSourceAt=None, endSourceAt=None)
linearRegressionAnalysis(series)
lineWidth(seriesList, width)
logarithm(seriesList, base=10)
logit(seriesList)
lowest(seriesList, n=1, func='average')
lowestAverage(seriesList, n)
lowestCurrent(seriesList, n)
mapSeries(seriesList, *mapNodes)
minSeries(*seriesLists)
mostDeviant(seriesList, n)
movingMin(seriesList, windowSize, xFilesFactor=None)
movingWindow(seriesList, windowSize, func='average', xFilesFactor=None)
multiplySeriesWithWildcards(seriesList, *position)
nPercentile(seriesList, n)
offsetToZero(seriesList)
percentileOfSeries(seriesList, n, interpolate=False)
pieAverage(series)
pieMaximum(series)
pieMinimum(series)
pow(seriesList, factor)
powSeries(*seriesLists)
randomWalkFunction(name, step=60)
rangeOfSeries(*seriesLists)
reduceSeries(seriesLists, reduceFunction, reduceNode, *reduceMatchers)
removeBetweenPercentile(seriesList, n)
roundFunction(seriesList, precision=None)
secondYAxis(seriesList)
seriesByTag(*tagExpressions)
setXFilesFactor(seriesList, xFilesFactor)
sigmoid(seriesList)
sinFunction(name, amplitude=1, step=60)
sortBy(seriesList, func='average', reverse=False)
sortByMinima(seriesList)
sortByTotal(seriesList)
squareRoot(seriesList)
stacked(seriesLists, stackName='__DEFAULT__')
stddevSeries(*seriesLists)
stdev(seriesList, points, windowTolerance=0.1)
substr(seriesList, start=0, stop=0)
threshold(value, label=None, color=None)
timeFunction(name, step=60)
timeSlice(seriesList, startSliceAt, endSliceAt='now')
timeStack(seriesList, timeShiftUnit='1d', timeShiftStart=0, timeShiftEnd=7)
unique(*seriesLists)
useSeriesAbove(seriesList, value, search, replace)
verticalLine(ts, label=None, color=None)
weightedAverage(seriesListAvg, seriesListWeight, *nodes)