[7.x] [Infra UI] Make queries more robust against missing indices (#38976) (#39066)

Backports the following commits to 7.x:
 - [Infra UI] Make queries more robust against missing indices  (#38976)
This commit is contained in:
Felix Stürmer 2019-06-17 08:33:47 -04:00 committed by GitHub
parent 6ec87ea297
commit 29fa71c889
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -28,6 +28,8 @@ export class ElasticsearchMetadataAdapter implements InfraMetadataAdapter {
): Promise<InfraMetricsAdapterResponse> {
const idFieldName = getIdFieldName(sourceConfiguration, nodeType);
const metricQuery = {
allowNoIndices: true,
ignoreUnavailable: true,
index: sourceConfiguration.metricAlias,
body: {
query: {
@ -80,6 +82,8 @@ export class ElasticsearchMetadataAdapter implements InfraMetadataAdapter {
): Promise<InfraMetricsAdapterResponse> {
const idFieldName = getIdFieldName(sourceConfiguration, nodeType);
const logQuery = {
allowNoIndices: true,
ignoreUnavailable: true,
index: sourceConfiguration.logAlias,
body: {
query: {

View file

@ -13,6 +13,8 @@ export const checkValidNode = async (
id: string
): Promise<boolean> => {
const params = {
allowNoIndices: true,
ignoreUnavailable: true,
index: indexPattern,
terminateAfter: 1,
body: {

View file

@ -32,6 +32,8 @@ export const getGroupings = async (
}
const limit = options.limit || 9;
const params = {
allowNoIndices: true,
ignoreUnavailable: true,
index: options.indexPattern,
body: {
size: 0,