(feat/explore): Support for new LogQL filtering syntax (#16674)

* (feat/explore): Support for new LogQL filtering syntax

Loki is adding syntax to support chained filtering.
This PR adapts Grafana to support this.

- Send only `query` parameter in loki request
- Automatically wrap search text in simple syntax, e.g., `{} foo` is
sent as `{} |~ "foo"`.


* Adapted to regexp parameter staying on in Loki

* Dont wrap single regexp in new filter syntax

* Fix datasource test

* Fallback regexp parameter for legacy queries

* Fix search highlighting

* Make highlighting work for filter chains

* Fix datasource test
This commit is contained in:
David
2019-05-13 09:58:26 +02:00
committed by GitHub
parent bf5b60f74a
commit 927e1cbd27
11 changed files with 122 additions and 35 deletions

View File

@@ -21,7 +21,7 @@ export interface QueryResultMeta {
requestId?: string;
// Used in Explore for highlighting
search?: string;
searchWords?: string[];
// Used in Explore to show limit applied to search result
limit?: number;

View File

@@ -194,7 +194,7 @@ export abstract class ExploreDataSourceApi<
TOptions extends DataSourceJsonData = DataSourceJsonData
> extends DataSourceApi<TQuery, TOptions> {
modifyQuery?(query: TQuery, action: QueryFixAction): TQuery;
getHighlighterExpression?(query: TQuery): string;
getHighlighterExpression?(query: TQuery): string[];
languageProvider?: any;
}