Skip to content

Commit

Permalink
[Infra UI] Make queries more robust against missing indices (#38976)
Browse files Browse the repository at this point in the history
This fixes several queries that failed when indices didn't exist and were not specified using a wildcard at the same time.
  • Loading branch information
weltenwort authored Jun 17, 2019
1 parent 2228863 commit 5b9c231
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const checkValidNode = async (
id: string
): Promise<boolean> => {
const params = {
allowNoIndices: true,
ignoreUnavailable: true,
index: indexPattern,
terminateAfter: 1,
body: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5b9c231

Please sign in to comment.