mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Implement decolorize logql operation (#68972)
* Loki: Implement decolorize operation * Fix tests
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user