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

[8.x](backport #41698) metricbeat: add integration TestIndexTotalFieldsLimitNotReached #41759

Open
wants to merge 1 commit into
base: 8.x
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 22, 2024

Proposed commit message

metricbeat: add integration TestIndexTotalFieldsLimitNotReached

The new integration test TestIndexTotalFieldsLimitNotReached ensures events with at least 500 new dynamically mapped fields can be ingested.

This new test will start failing when the metricbeat mapping has increased to the point it isn't possible to add a new event with 500 dynamically mapped fields. It should act as a safe guard to prevent us from releasing a version where the static mapping is too close to the total fields limit.

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.

Disruptive User Impact

  • N/A

How to test this PR locally

  • build x-pack/metricbeat
    • cd x-pack/metricbeat
    • go build .
  • adjust metricbeat.yml to point to your stack and make sure to include setup.kibana.host
  • run ./metricbeat setup
  • generate an event with 500 dynamic fields. Just use the same for loop the test uses
  • ingest the event:
POST metricbeat-9.0.0/_doc
{ 
   ...
}
  • it should succeed
  • change the index.mapping.total_fields.limit for the metricbeat index template:
    • go to your-kibna/app/management/data/index_management/templates/metricbeat-9.0.0
    • metricbeat-9.0.0 > Manage > Edit > 3 Index settings
    • change index.mapping.total_fields.limit to 10000:
"mapping": {
      "total_fields": {
        "limit": "10000"
      }
  • rollover the index
POST metricbeat-9.0.0/_rollover
  • try to ingest the same event again, you should get an error like:
{
  "error": {
    "root_cause": [
      {
        "type": "document_parsing_exception",
        "reason": "[1:378] failed to parse: Limit of total fields [10000] has been exceeded while adding new fields [11]"
      }
    ],
    "type": "document_parsing_exception",
    "reason": "[1:378] failed to parse: Limit of total fields [10000] has been exceeded while adding new fields [11]",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Limit of total fields [10000] has been exceeded while adding new fields [11]"
    },
    "failure_store": "not_enabled"
  },
  "status": 400
}

Related issues


This is an automatic backport of pull request #41698 done by [Mergify](https://mergify.com).

The new integration test TestIndexTotalFieldsLimitNotReached ensures events with at least 500 new dynamically mapped fields can be ingested.

(cherry picked from commit 8a2724a)
@mergify mergify bot added the backport label Nov 22, 2024
@mergify mergify bot requested a review from a team as a code owner November 22, 2024 21:38
@mergify mergify bot requested review from mauri870 and khushijain21 and removed request for a team November 22, 2024 21:38
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 22, 2024
Copy link
Contributor Author

mergify bot commented Nov 25, 2024

This pull request has not been merged yet. Could you please review and merge it @AndersonQ? 🙏

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Nov 25, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 25, 2024
@pierrehilbert pierrehilbert requested review from AndersonQ and removed request for mauri870 and khushijain21 November 25, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants