Skip to content

libbeat: increase total_fields.limit to 12500 #41640

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

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

AndersonQ
Copy link
Member

@AndersonQ AndersonQ commented Nov 14, 2024

Proposed commit message

libbeat: increase index template total_fields.limit to 12500

It increased the index.mapping.total_fields.limit from 10000 to 12500 in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

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

Whereas the index.mapping.total_fields.limit might impact Elasticsearch's performance, see here, we do not anticipate any significant impact.

How to test this PR locally

check for errors

Follow the tutorial for system metrics integration: https://YOUR_CLUSTER/app/home#/tutorial/systemMetrics

  • configure the elasticsearch output
  • the run the following
./metricbeat modules enable system
./metricbeat setup
./metricbeat -e | grep -e 'has been exceeded while adding new fields'
  • you should not see any log

check the new index settings

GET /metricbeat-9.0.0/_settings

you should get an answer like:

{
  ".ds-metricbeat-9.0.0-2024.11.14-000001": {
    "settings": {
      "index": {
        "mapping": {
          "total_fields": {
            "limit": "12500"
          }
        },

without the fix, it'd be 10000.

Related issues

Logs

error log before the fix:

# failed to parse: Limit of total fields [10000] has been exceeded while adding new fields [1]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Limit of total fields [10000] has been exceeded while adding new fields [1]\"

{"log.level":"warn","@timestamp":"2024-08-13T14:04:46.708Z","log.logger":"elasticsearch","log.origin":{"function":"github.com/elastic/beats/v7/libbeat/outputs/elasticsearch.(*Client).applyItemStatus","file.name":"elasticsearch/client.go","file.line":489},"message":"Cannot index event publisher.Event{Content:beat.Event{Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), Meta:null, Fields:null, Private:interface {}(nil), TimeSeries:false}, Flags:0x0, Cache:publisher.EventCache{m:mapstr.M(nil)}, EncodedEvent:(*elasticsearch.encodedEvent)(0xc003933700)} (status=400): {\"type\":\"document_parsing_exception\",\"reason\":\"[1:2756] failed to parse: Limit of total fields [10000] has been exceeded while adding new fields [1]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Limit of total fields [10000] has been exceeded while adding new fields [1]\"}}, dropping event!","service.name":"metricbeat","log.type":"event","ecs.version":"1.6.0"}

@AndersonQ AndersonQ added the bug label Nov 14, 2024
@AndersonQ AndersonQ self-assigned this Nov 14, 2024
@AndersonQ AndersonQ requested a review from a team as a code owner November 14, 2024 11:01
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 14, 2024
@AndersonQ AndersonQ added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-8.16 Automated backport with mergify labels Nov 14, 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 14, 2024
@AndersonQ AndersonQ added the backport-8.x Automated backport to the 8.x branch with mergify label Nov 14, 2024
Copy link
Contributor

mergify bot commented Nov 14, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.
@AndersonQ AndersonQ force-pushed the 3786-field-limit-exceed branch from 7f2e12b to e5ec5a0 Compare November 14, 2024 11:07
@pierrehilbert
Copy link
Collaborator

Looks like you need also to change

"limit": 10000,

@AndersonQ AndersonQ merged commit 42dd93b into elastic:main Nov 18, 2024
142 checks passed
@AndersonQ AndersonQ deleted the 3786-field-limit-exceed branch November 18, 2024 08:16
mergify bot pushed a commit that referenced this pull request Nov 18, 2024
* libbeat: increase index template total_fields.limit to 12500

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)

# Conflicts:
#	CHANGELOG.asciidoc
mergify bot pushed a commit that referenced this pull request Nov 18, 2024
* libbeat: increase index template total_fields.limit to 12500

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)

# Conflicts:
#	CHANGELOG.asciidoc
@cmacknz cmacknz added the backport-8.15 Automated backport to the 8.15 branch with mergify label Nov 18, 2024
@cmacknz
Copy link
Member

cmacknz commented Nov 18, 2024

There is a planned 8.15.5 with feature freeze on Nov 19

@cmacknz
Copy link
Member

cmacknz commented Nov 18, 2024

Added 8.15 backport label

mergify bot pushed a commit that referenced this pull request Nov 18, 2024
* libbeat: increase index template total_fields.limit to 12500

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)

# Conflicts:
#	CHANGELOG.asciidoc
pierrehilbert pushed a commit that referenced this pull request Nov 19, 2024
…41657)

* libbeat: increase total_fields.limit to 12500 (#41640)

* libbeat: increase index template total_fields.limit to 12500

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)

# Conflicts:
#	CHANGELOG.asciidoc

* adjust changelog

* fix changelog

---------

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Nov 19, 2024
…#41672)

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)
---------

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Nov 22, 2024
…#41656)

It increased the `index.mapping.total_fields.limit` from `10000` to `12500` in order to avoid ingestion failures caused by too many field in the index. Since 8.15.0 the limit started to be hit.
The field count being exceeded is on the index, counting all mapped fields and the dynamic fields. That's why a small event might trigger the error, the event contains new fields to be mapped which would exceed the total field limit if mapped.

(cherry picked from commit 42dd93b)
---------

Co-authored-by: Anderson Queiroz <[email protected]>
antoineco added a commit to deviantony/docker-elk that referenced this pull request Mar 10, 2025
The current configuration requires a number of fields which exceeds the
current limit. From the Metricbeat event logs:

  Limit of total fields [10200] has been exceeded while adding new
  fields [7]

We raised this limit from its default of 10000 to 10200 in the commit
035a0e7, but it was since raised to
1250 upstream in v8.16.2 (elastic/beats#41640), making that
configuration unnecessary.

Ref. #1059
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.15 Automated backport to the 8.15 branch with mergify backport-8.16 Automated backport with mergify bug 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.

6 participants