Loki: Implement decolorize logql operation (#68972)

* Loki: Implement decolorize operation

* Fix tests
This commit is contained in:
Ivana Huckova
2023-05-24 15:23:54 +02:00
committed by GitHub
parent 6c4cf4f8b9
commit ca44164bea
8 changed files with 81 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import {
Bool,
By,
ConvOp,
Decolorize,
Filter,
FilterOp,
Grouping,
@@ -176,6 +177,11 @@ export function handleExpression(expr: string, node: SyntaxNode, context: Contex
break;
}
case Decolorize: {
visQuery.operations.push(getDecolorize());
break;
}
case RangeAggregationExpr: {
visQuery.operations.push(handleRangeAggregation(expr, node, context));
break;
@@ -368,6 +374,15 @@ function getLabelFormat(expr: string, node: SyntaxNode): QueryBuilderOperation {
};
}
function getDecolorize(): QueryBuilderOperation {
const id = LokiOperationId.Decolorize;
return {
id,
params: [],
};
}
function handleUnwrapExpr(
expr: string,
node: SyntaxNode,