Explore: display log line context (#17097)

* Extend DataSourceAPI to enable log row context retrieval

* Add react-use package

* Display log row context in UI

* Make Loki datasource return "after" log context in correct order

* Don't show Load more context links  when there are no more new results

* Update getLogRowContext to return DataQueryResponse

* Use DataQueryResponse in log row context provider, filter out original row  being duplicated in context
This commit is contained in:
Dominik Prokop
2019-05-20 08:44:37 +02:00
committed by GitHub
parent ae1df1cf89
commit 12e0616413
12 changed files with 785 additions and 63 deletions

View File

@@ -172,6 +172,11 @@ export abstract class DataSourceApi<
*/
getQueryDisplayText?(query: TQuery): string;
/**
* Retrieve context for a given log row
*/
getLogRowContext?(row: any, limit?: number): Promise<DataQueryResponse>;
/**
* Set after constructor call, as the data source instance is the most common thing to pass around
* we attach the components to this instance for easy access
@@ -282,6 +287,10 @@ export interface DataQueryResponse {
data: DataQueryResponseData[];
}
export interface LogRowContextQueryResponse {
data: Array<Array<string | DataQueryError>>;
}
export interface DataQuery {
/**
* A - Z