Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stack Monitoring] separate out mb and legacy index patterns from requests #120841

Merged
merged 2 commits into from
Dec 9, 2021

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Dec 8, 2021

Addresses slow loading in the ES overview page #117885.

In 7.14, the shard activity for getting the latest recovery was changed to have 2 separate requests in order to accommodate the introduction of metricbeat-* index pattern. One for metricbeat-* and the other for .monitoring-*. The metricbeat docs are different and the query needs to get 10k documents, but it also still includes the .monitoring index patterns in its search which isn't necessary. The same holds true for the legacy requests querying metricbeat-* index. This separates them out. So a user who has no metricbeat-* indices isn't suddenly going to have a performance issue.

legacy query params before
{
  "index": ".monitoring-es-6-*,.monitoring-es-7-*,metricbeat-*",
  "size": 1,
  "ignore_unavailable": true,
  "body": {
    "_source": [
      "index_recovery.shards"
    ],
    "sort": {
      "timestamp": {
        "order": "desc",
        "unmapped_type": "long"
      }
    },
    "query": {
      "bool": {
        "filter": [
          {
            "bool": {
              "should": [
                {
                  "term": {
                    "type": "index_recovery"
                  }
                },
                {
                  "term": {
                    "metricset.name": "index_recovery"
                  }
                }
              ]
            }
          },
          {
            "term": {
              "cluster_uuid": "sVkxxtOdQe-TNy3ECQ0bmQ"
            }
          },
          {
            "range": {
              "timestamp": {
                "format": "epoch_millis",
                "gte": 1638979303889,
                "lte": 1638980203889
              }
            }
          }
        ]
      }
    }
  }
}

legacy query params after
{
  "index": ".monitoring-es-6-*,.monitoring-es-7-*",
  "size": 1,
  "ignore_unavailable": true,
  "body": {
    "_source": [
      "index_recovery.shards"
    ],
    "sort": {
      "timestamp": {
        "order": "desc",
        "unmapped_type": "long"
      }
    },
    "query": {
      "bool": {
        "filter": [
          {
            "bool": {
              "should": [
                {
                  "term": {
                    "type": "index_recovery"
                  }
                },
                {
                  "term": {
                    "metricset.name": "index_recovery"
                  }
                }
              ]
            }
          },
          {
            "term": {
              "cluster_uuid": "sVkxxtOdQe-TNy3ECQ0bmQ"
            }
          },
          {
            "range": {
              "timestamp": {
                "format": "epoch_millis",
                "gte": 1638995534235,
                "lte": 1638996434235
              }
            }
          }
        ]
      }
    }
  }
}
metricbeat query params before
{
  "index": ".monitoring-es-6-*,.monitoring-es-7-*,metricbeat-*",
  "size": 10000,
  "ignore_unavailable": true,
  "body": {
    "_source": [
      "elasticsearch.index.recovery",
      "@timestamp"
    ],
    "sort": {
      "timestamp": {
        "order": "desc",
        "unmapped_type": "long"
      }
    },
    "query": {
      "bool": {
        "filter": [
          {
            "bool": {
              "should": [
                {
                  "term": {
                    "type": "index_recovery"
                  }
                },
                {
                  "term": {
                    "metricset.name": "index_recovery"
                  }
                }
              ]
            }
          },
          {
            "term": {
              "cluster_uuid": "sVkxxtOdQe-TNy3ECQ0bmQ"
            }
          },
          {
            "range": {
              "timestamp": {
                "format": "epoch_millis",
                "gte": 1638979270889,
                "lte": 1638980170889
              }
            }
          }
        ]
      }
    },
    "aggs": {
      "max_timestamp": {
        "max": {
          "field": "@timestamp"
        }
      }
    }
  }
}
metricbeat query params after
{
  "index": "metricbeat-*",
  "size": 10000,
  "ignore_unavailable": true,
  "body": {
    "_source": [
      "elasticsearch.index.recovery",
      "@timestamp"
    ],
    "sort": {
      "timestamp": {
        "order": "desc",
        "unmapped_type": "long"
      }
    },
    "query": {
      "bool": {
        "filter": [
          {
            "bool": {
              "should": [
                {
                  "term": {
                    "type": "index_recovery"
                  }
                },
                {
                  "term": {
                    "metricset.name": "index_recovery"
                  }
                }
              ]
            }
          },
          {
            "term": {
              "cluster_uuid": "sVkxxtOdQe-TNy3ECQ0bmQ"
            }
          },
          {
            "range": {
              "timestamp": {
                "format": "epoch_millis",
                "gte": 1638995534235,
                "lte": 1638996434235
              }
            }
          }
        ]
      }
    },
    "aggs": {
      "max_timestamp": {
        "max": {
          "field": "@timestamp"
        }
      }
    }
  }
}

@neptunian neptunian added bug Fixes for quality problems that affect the customer experience v8.0.0 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.1.0 v7.16.1 labels Dec 8, 2021
@neptunian neptunian self-assigned this Dec 8, 2021
@neptunian neptunian requested a review from a team as a code owner December 8, 2021 21:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@neptunian neptunian added the auto-backport Deprecated: Automatically backport this PR after it's merged label Dec 8, 2021
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @neptunian

@neptunian neptunian merged commit 58f2dc9 into elastic:main Dec 9, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 9, 2021
…uests (elastic#120841)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 9, 2021
…uests (elastic#120841)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0
7.16

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Dec 9, 2021
…uests (#120841) (#120856)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index

Co-authored-by: Sandra G <neptunian@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Dec 9, 2021
…uests (#120841) (#120857)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index

Co-authored-by: Sandra G <neptunian@users.noreply.github.com>
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
…uests (elastic#120841)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index
gbamparop pushed a commit to gbamparop/kibana that referenced this pull request Jan 12, 2022
…uests (elastic#120841)

* seprate out mb and legacy index patterns from requests

* use config for metricbeat index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring release_note:fix Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.16.1 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants