mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Discover] Cancel long running requests in Discover alert (#130077)
* [Discover] improve long running requests for search source within alert rule * [Discover] add tests * [Discover] fix linting * [Discover] fix unit test * [Discover] add getMetrics test * [Discover] fix unit test * [Discover] merge search clients metrics * [Discover] wrap searchSourceClient * [Discover] add unit tests * [Discover] replace searchSourceUtils with searchSourceClient in tests * [Discover] apply suggestions
This commit is contained in:
parent
5ecde4b053
commit
fdf2086eb0
14 changed files with 622 additions and 42 deletions
|
@ -51,10 +51,7 @@ export async function executor(
|
|||
alertId,
|
||||
params as OnlySearchSourceAlertParams,
|
||||
latestTimestamp,
|
||||
{
|
||||
searchSourceClient,
|
||||
logger,
|
||||
}
|
||||
{ searchSourceClient, logger }
|
||||
);
|
||||
|
||||
// apply the alert condition
|
||||
|
|
|
@ -20,12 +20,12 @@ export async function fetchSearchSourceQuery(
|
|||
latestTimestamp: string | undefined,
|
||||
services: {
|
||||
logger: Logger;
|
||||
searchSourceClient: Promise<ISearchStartSearchSource>;
|
||||
searchSourceClient: ISearchStartSearchSource;
|
||||
}
|
||||
) {
|
||||
const { logger, searchSourceClient } = services;
|
||||
const client = await searchSourceClient;
|
||||
const initialSearchSource = await client.create(params.searchConfiguration);
|
||||
|
||||
const initialSearchSource = await searchSourceClient.create(params.searchConfiguration);
|
||||
|
||||
const { searchSource, dateStart, dateEnd } = updateSearchSource(
|
||||
initialSearchSource,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue