From cd39ebe7c65c55571479800c763c48ce1bf6f01d Mon Sep 17 00:00:00 2001 From: Tobias Guggenmos Date: Mon, 9 Dec 2019 15:33:43 +0000 Subject: [PATCH] PromQL: export function list (#6434) This PR exports the list of supported PromQL functions and their signatures. The reason for that is that the PromQL language server likes to use that list. Signed-off-by: Tobias Guggenmos --- promql/functions.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/promql/functions.go b/promql/functions.go index 4bb3f8f43..f88fd58d4 100644 --- a/promql/functions.go +++ b/promql/functions.go @@ -907,7 +907,8 @@ func funcYear(vals []Value, args Expressions, enh *EvalNodeHelper) Vector { }) } -var functions = map[string]*Function{ +// Functions is a list of all functions supported by PromQL, including their types. +var Functions = map[string]*Function{ "abs": { Name: "abs", ArgTypes: []ValueType{ValueTypeVector}, @@ -1197,7 +1198,7 @@ var functions = map[string]*Function{ // getFunction returns a predefined Function object for the given name. func getFunction(name string) (*Function, bool) { - function, ok := functions[name] + function, ok := Functions[name] return function, ok }