Skip to content

Commit ab952f9

Browse files
committed
PromQL: Add holt_winters alias
Signed-off-by: Arve Knudsen <[email protected]>
1 parent 279fac9 commit ab952f9

File tree

2 files changed

+50
-42
lines changed

2 files changed

+50
-42
lines changed

promql/functions.go

+44-42
Original file line numberDiff line numberDiff line change
@@ -1668,48 +1668,50 @@ var FunctionCalls = map[string]FunctionCall{
16681668
"histogram_stddev": funcHistogramStdDev,
16691669
"histogram_stdvar": funcHistogramStdVar,
16701670
"double_exponential_smoothing": funcDoubleExponentialSmoothing,
1671-
"hour": funcHour,
1672-
"idelta": funcIdelta,
1673-
"increase": funcIncrease,
1674-
"info": nil,
1675-
"irate": funcIrate,
1676-
"label_replace": nil, // evalLabelReplace not called via this map.
1677-
"label_join": nil, // evalLabelJoin not called via this map.
1678-
"ln": funcLn,
1679-
"log10": funcLog10,
1680-
"log2": funcLog2,
1681-
"last_over_time": funcLastOverTime,
1682-
"mad_over_time": funcMadOverTime,
1683-
"max_over_time": funcMaxOverTime,
1684-
"min_over_time": funcMinOverTime,
1685-
"minute": funcMinute,
1686-
"month": funcMonth,
1687-
"pi": funcPi,
1688-
"predict_linear": funcPredictLinear,
1689-
"present_over_time": funcPresentOverTime,
1690-
"quantile_over_time": funcQuantileOverTime,
1691-
"rad": funcRad,
1692-
"rate": funcRate,
1693-
"resets": funcResets,
1694-
"round": funcRound,
1695-
"scalar": funcScalar,
1696-
"sgn": funcSgn,
1697-
"sin": funcSin,
1698-
"sinh": funcSinh,
1699-
"sort": funcSort,
1700-
"sort_desc": funcSortDesc,
1701-
"sort_by_label": funcSortByLabel,
1702-
"sort_by_label_desc": funcSortByLabelDesc,
1703-
"sqrt": funcSqrt,
1704-
"stddev_over_time": funcStddevOverTime,
1705-
"stdvar_over_time": funcStdvarOverTime,
1706-
"sum_over_time": funcSumOverTime,
1707-
"tan": funcTan,
1708-
"tanh": funcTanh,
1709-
"time": funcTime,
1710-
"timestamp": funcTimestamp,
1711-
"vector": funcVector,
1712-
"year": funcYear,
1671+
// Keep an alias for Mimir users using holt_winters.
1672+
"holt_winters": funcDoubleExponentialSmoothing,
1673+
"hour": funcHour,
1674+
"idelta": funcIdelta,
1675+
"increase": funcIncrease,
1676+
"info": nil,
1677+
"irate": funcIrate,
1678+
"label_replace": nil, // evalLabelReplace not called via this map.
1679+
"label_join": nil, // evalLabelJoin not called via this map.
1680+
"ln": funcLn,
1681+
"log10": funcLog10,
1682+
"log2": funcLog2,
1683+
"last_over_time": funcLastOverTime,
1684+
"mad_over_time": funcMadOverTime,
1685+
"max_over_time": funcMaxOverTime,
1686+
"min_over_time": funcMinOverTime,
1687+
"minute": funcMinute,
1688+
"month": funcMonth,
1689+
"pi": funcPi,
1690+
"predict_linear": funcPredictLinear,
1691+
"present_over_time": funcPresentOverTime,
1692+
"quantile_over_time": funcQuantileOverTime,
1693+
"rad": funcRad,
1694+
"rate": funcRate,
1695+
"resets": funcResets,
1696+
"round": funcRound,
1697+
"scalar": funcScalar,
1698+
"sgn": funcSgn,
1699+
"sin": funcSin,
1700+
"sinh": funcSinh,
1701+
"sort": funcSort,
1702+
"sort_desc": funcSortDesc,
1703+
"sort_by_label": funcSortByLabel,
1704+
"sort_by_label_desc": funcSortByLabelDesc,
1705+
"sqrt": funcSqrt,
1706+
"stddev_over_time": funcStddevOverTime,
1707+
"stdvar_over_time": funcStdvarOverTime,
1708+
"sum_over_time": funcSumOverTime,
1709+
"tan": funcTan,
1710+
"tanh": funcTanh,
1711+
"time": funcTime,
1712+
"timestamp": funcTimestamp,
1713+
"vector": funcVector,
1714+
"year": funcYear,
17131715
}
17141716

17151717
// AtModifierUnsafeFunctions are the functions whose result

promql/parser/functions.go

+6
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ var Functions = map[string]*Function{
208208
ReturnType: ValueTypeVector,
209209
Experimental: true,
210210
},
211+
// Keep an alias for Mimir users using holt_winters.
212+
"holt_winters": {
213+
Name: "holt_winters",
214+
ArgTypes: []ValueType{ValueTypeMatrix, ValueTypeScalar, ValueTypeScalar},
215+
ReturnType: ValueTypeVector,
216+
},
211217
"hour": {
212218
Name: "hour",
213219
ArgTypes: []ValueType{ValueTypeVector},

0 commit comments

Comments
 (0)