mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Add hints for level-like labels (#52414)
* Loki: Add hint for level-like label * Add test to addToQuery * Add tests * Update tests * Update copy * Get log position in metrics query and add test * Update
This commit is contained in:
@@ -295,15 +295,13 @@ function getLineFormat(expr: string, node: SyntaxNode): QueryBuilderOperation {
|
||||
|
||||
function getLabelFormat(expr: string, node: SyntaxNode): QueryBuilderOperation {
|
||||
const id = 'label_format';
|
||||
const identifier = node.getChild('Identifier');
|
||||
const op = identifier!.nextSibling;
|
||||
const value = op!.nextSibling;
|
||||
|
||||
let valueString = handleQuotes(getString(expr, value));
|
||||
const renameTo = node.getChild('Identifier');
|
||||
const op = renameTo!.nextSibling;
|
||||
const originalLabel = op!.nextSibling;
|
||||
|
||||
return {
|
||||
id,
|
||||
params: [getString(expr, identifier), valueString],
|
||||
params: [getString(expr, originalLabel), handleQuotes(getString(expr, renameTo))],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user