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

[Eleasticsearch] Remove hidden field from indice metricset docs #39165

Conversation

crespocarlos
Copy link
Contributor

@crespocarlos crespocarlos commented Apr 23, 2024

Proposed commit message

This PR removes the hidden flag introduced by #18639. The SM UI doesn't use this flag, and retrieving which indices are hidden is an expensive operation that can sometimes cause problems such as timeouts depending on how large a cluster is.

elasticsearch": {
  "cluster": {
    "id": "5QYQ1YeeRjy9MJtahqzY6w",
    "name": "elasticsearch"
  },
  "index": {
    "status": "green",
    "hidden": false,
    "shards": {
      "total": 1,
      "primaries": 1
    }

   ...
  }
  ...
}
"elasticsearch": {
  "cluster": {
    "id": "5QYQ1YeeRjy9MJtahqzY6w",
    "name": "elasticsearch"
  },
  "index": {
    "status": "green",
    "shards": {
      "total": 1,
      "primaries": 1
    }
   ...
  }
 ...
}

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • Start a local ES and kibana instances
  • Start metricbeat with elasticsearch module enabled
  • Run the query below and check if there is no hidden field in the index object
GET .monitoring-es-*,metrics-*/_search
{
  "size": 5,
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "should": [
              {
                "term": {
                  "data_stream.dataset": "elasticsearch.stack_monitoring.index"
                }
              },
              {
                "term": {
                  "metricset.name": "index"
                }
              },
              {
                "term": {
                  "type": "index_stats"
                }
              }
            ]
          }
        },
        {
          "range": {
            "timestamp": {
              "gte": "now-15m",
              "lte": "now"
            }
          }
        }
      ]
    }
  },
  "collapse": {
    "field": "index_stats.index",
    "inner_hits": {
      "name": "earliest",
      "size": 1,
      "sort": [
        {
          "timestamp": {
            "order": "asc",
            "unmapped_type": "long"
          }
        }
      ]
    }
  },
  "sort": [
    {
      "timestamp": {
        "order": "desc",
        "unmapped_type": "long"
      }
    }
  ]
}

Related issues

closes #39161

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 23, 2024
Copy link
Contributor

mergify bot commented Apr 23, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @crespocarlos? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 23, 2024

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-04-25T01:42:06.842+0000

  • Duration: 126 min 38 sec

Test stats 🧪

Test Results
Failed 0
Passed 4625
Skipped 915
Total 5540

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from 158da0a to ea358f7 Compare April 24, 2024 12:59
@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from ea358f7 to 1beefae Compare April 24, 2024 13:14
@crespocarlos crespocarlos added enhancement Module:elasticsearch Elasticsearch Beats modules Team:Monitoring Stack Monitoring team labels Apr 24, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 24, 2024
@crespocarlos crespocarlos added the backport-v8.14.0 Automated backport with mergify label Apr 24, 2024
@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from 10c61eb to de3555a Compare April 24, 2024 18:24
@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from de3555a to 472e183 Compare April 24, 2024 18:25
@crespocarlos crespocarlos marked this pull request as ready for review April 24, 2024 19:23
@crespocarlos crespocarlos requested a review from a team as a code owner April 24, 2024 19:23
@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from e7d0a26 to e29c8a9 Compare April 25, 2024 00:32
@crespocarlos crespocarlos force-pushed the 39161-remove-hidden-flag-from-es-indice-metricset branch from e29c8a9 to ab566c6 Compare April 25, 2024 01:41
@crespocarlos crespocarlos requested a review from klacabane April 25, 2024 10:23
@@ -368,61 +367,6 @@ func GetXPack(http *helper.HTTP, resetURI string) (XPack, error) {
return xpack, err
}

type boolStr bool

func (b *boolStr) UnmarshalJSON(raw []byte) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this only used by hidden flag ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I couldn't find other usages of that function

Copy link
Contributor

@klacabane klacabane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crespocarlos crespocarlos merged commit de23b1a into elastic:main Apr 25, 2024
37 checks passed
@crespocarlos crespocarlos deleted the 39161-remove-hidden-flag-from-es-indice-metricset branch April 25, 2024 15:45
mergify bot pushed a commit that referenced this pull request Apr 25, 2024
…9165)

* Remove  field

* fix lint and tests

* remove hidden from Index struct

* more lint

* Update CHANGELOG

* More lint stuff and test

(cherry picked from commit de23b1a)
crespocarlos added a commit that referenced this pull request Apr 29, 2024
…9165) (#39220)

* Remove  field

* fix lint and tests

* remove hidden from Index struct

* more lint

* Update CHANGELOG

* More lint stuff and test

(cherry picked from commit de23b1a)

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.14.0 Automated backport with mergify enhancement Module:elasticsearch Elasticsearch Beats modules Team:Monitoring Stack Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[elasticsearch] Remove hidden info from indice information
3 participants