mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[APM] Add range query to terms enum call (#162614)
Closes https://github.com/elastic/kibana/issues/159202
This commit is contained in:
parent
7277dba30f
commit
28800ef35e
4 changed files with 27 additions and 3 deletions
|
@ -112,12 +112,14 @@ export function ServicesTable() {
|
|||
environment,
|
||||
kuery,
|
||||
indexLifecyclePhase,
|
||||
start,
|
||||
end,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[environment, kuery, indexLifecyclePhase, useOptimizedSorting]
|
||||
[useOptimizedSorting, environment, kuery, indexLifecyclePhase, start, end]
|
||||
);
|
||||
|
||||
const serviceStatisticsFetch = useProgressiveFetcher(
|
||||
|
|
|
@ -15,10 +15,14 @@ export async function getServiceNamesFromTermsEnum({
|
|||
apmEventClient,
|
||||
environment,
|
||||
maxNumberOfServices,
|
||||
start,
|
||||
end,
|
||||
}: {
|
||||
apmEventClient: APMEventClient;
|
||||
environment: Environment;
|
||||
maxNumberOfServices: number;
|
||||
start: number;
|
||||
end: number;
|
||||
}) {
|
||||
if (environment !== ENVIRONMENT_ALL.value) {
|
||||
return [];
|
||||
|
@ -36,6 +40,15 @@ export async function getServiceNamesFromTermsEnum({
|
|||
},
|
||||
size: maxNumberOfServices,
|
||||
field: SERVICE_NAME,
|
||||
index_filter: {
|
||||
range: {
|
||||
['@timestamp']: {
|
||||
gte: start,
|
||||
lte: end,
|
||||
format: 'epoch_millis',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -323,7 +323,12 @@ const storageExplorerGetServices = createApmServerRoute({
|
|||
tags: ['access:apm'],
|
||||
},
|
||||
params: t.type({
|
||||
query: t.intersection([indexLifecyclePhaseRt, environmentRt, kueryRt]),
|
||||
query: t.intersection([
|
||||
indexLifecyclePhaseRt,
|
||||
environmentRt,
|
||||
kueryRt,
|
||||
rangeRt,
|
||||
]),
|
||||
}),
|
||||
handler: async (
|
||||
resources
|
||||
|
@ -333,7 +338,7 @@ const storageExplorerGetServices = createApmServerRoute({
|
|||
}>;
|
||||
}> => {
|
||||
const {
|
||||
query: { environment, kuery, indexLifecyclePhase },
|
||||
query: { environment, kuery, indexLifecyclePhase, start, end },
|
||||
} = resources.params;
|
||||
|
||||
if (
|
||||
|
@ -352,6 +357,8 @@ const storageExplorerGetServices = createApmServerRoute({
|
|||
apmEventClient,
|
||||
environment,
|
||||
maxNumberOfServices: 500,
|
||||
start,
|
||||
end,
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
@ -37,6 +37,8 @@ export default function ApiTest({ getService }: FtrProviderContext) {
|
|||
environment,
|
||||
kuery,
|
||||
indexLifecyclePhase,
|
||||
start,
|
||||
end,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue