mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Stack Monitoring] separate out mb and legacy index patterns from requests (#120841)
* seprate out mb and legacy index patterns from requests * use config for metricbeat index
This commit is contained in:
parent
9875ecb448
commit
58f2dc9e9f
2 changed files with 26 additions and 3 deletions
|
@ -86,7 +86,12 @@ export function handleMbLastRecoveries(resp: ElasticsearchResponse, start: numbe
|
|||
return filtered;
|
||||
}
|
||||
|
||||
export async function getLastRecovery(req: LegacyRequest, esIndexPattern: string, size: number) {
|
||||
export async function getLastRecovery(
|
||||
req: LegacyRequest,
|
||||
esIndexPattern: string,
|
||||
mbIndexPattern: string,
|
||||
size: number
|
||||
) {
|
||||
checkParam(esIndexPattern, 'esIndexPattern in elasticsearch/getLastRecovery');
|
||||
|
||||
const start = req.payload.timeRange.min;
|
||||
|
@ -105,7 +110,7 @@ export async function getLastRecovery(req: LegacyRequest, esIndexPattern: string
|
|||
},
|
||||
};
|
||||
const mbParams = {
|
||||
index: esIndexPattern,
|
||||
index: mbIndexPattern,
|
||||
size,
|
||||
ignore_unavailable: true,
|
||||
body: {
|
||||
|
|
|
@ -40,6 +40,19 @@ export function esOverviewRoute(server) {
|
|||
const ccs = req.payload.ccs;
|
||||
const clusterUuid = req.params.clusterUuid;
|
||||
const esIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_ELASTICSEARCH, ccs);
|
||||
const esLegacyIndexPattern = prefixIndexPattern(
|
||||
config,
|
||||
INDEX_PATTERN_ELASTICSEARCH,
|
||||
ccs,
|
||||
true
|
||||
);
|
||||
const mbIndexPattern = prefixIndexPattern(
|
||||
config,
|
||||
config.get('monitoring.ui.metricbeat.index'),
|
||||
ccs,
|
||||
true
|
||||
);
|
||||
|
||||
const filebeatIndexPattern = prefixIndexPattern(
|
||||
config,
|
||||
config.get('monitoring.ui.logs.index'),
|
||||
|
@ -54,7 +67,12 @@ export function esOverviewRoute(server) {
|
|||
const [clusterStats, metrics, shardActivity, logs] = await Promise.all([
|
||||
getClusterStats(req, esIndexPattern, clusterUuid),
|
||||
getMetrics(req, esIndexPattern, metricSet),
|
||||
getLastRecovery(req, esIndexPattern, config.get('monitoring.ui.max_bucket_size')),
|
||||
getLastRecovery(
|
||||
req,
|
||||
esLegacyIndexPattern,
|
||||
mbIndexPattern,
|
||||
config.get('monitoring.ui.max_bucket_size')
|
||||
),
|
||||
getLogs(config, req, filebeatIndexPattern, { clusterUuid, start, end }),
|
||||
]);
|
||||
const indicesUnassignedShardStats = await getIndicesUnassignedShardStats(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue