From 392e0a655475eea83fb71e822aad94dc86dbe86c Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 6 Sep 2024 21:47:35 +0200 Subject: [PATCH] Signed-off-by: Julius Volz --- web/api/v1/{ast_to_json.go => translate_ast.go} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename web/api/v1/{ast_to_json.go => translate_ast.go} (96%) diff --git a/web/api/v1/ast_to_json.go b/web/api/v1/translate_ast.go similarity index 96% rename from web/api/v1/ast_to_json.go rename to web/api/v1/translate_ast.go index c5f0d08dc..afa11f16b 100644 --- a/web/api/v1/ast_to_json.go +++ b/web/api/v1/translate_ast.go @@ -20,8 +20,10 @@ import ( "github.com/prometheus/prometheus/promql/parser" ) -// Take a Go PromQL AST and translate it to a JSON object for the tree view in the UI. -// TODO: Could it make sense to do this via the normal JSON marshalling methods? +// Take a Go PromQL AST and translate it to an object that's nicely JSON-serializable +// for the tree view in the UI. +// TODO: Could it make sense to do this via the normal JSON marshalling methods? Maybe +// too UI-specific though. func translateAST(node parser.Expr) interface{} { if node == nil { return nil