Skip to content

[9.1](backport #45128) [kafka] Handle configuration errors#45283

Merged
khushijain21 merged 2 commits into9.1from
mergify/bp/9.1/pr-45128
Jul 10, 2025
Merged

[9.1](backport #45128) [kafka] Handle configuration errors#45283
khushijain21 merged 2 commits into9.1from
mergify/bp/9.1/pr-45128

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jul 10, 2025

Proposed commit message

This PR handles kafka configuration errors by dropping the message. Since configuration errors are of permanent error type and should not be retried.

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

Bring kafka server up using following command

cd filebeat
mage docker:composeUp

Use following filebeat.yml

filebeat.inputs:
  - type: filestream
    id: filestream-input-id
    enabled: true
    paths:
      - ./test.log
    file_identity.native: ~
    prospector.scanner.fingerprint.enabled: false      

output:
  kafka:
    hosts: ["localhost:9092", "localhost:9094"]
    topic: beats
    max_message_bytes: 10

and you can see this error

{
  "log.level": "error",
  "@timestamp": "2025-07-02T15:28:04.373+0530",
  "log.logger": "kafka",
  "log.origin": {
    "function": "github.com/elastic/beats/v7/libbeat/outputs/kafka.(*msgRef).fail",
    "file.name": "kafka/client.go",
    "file.line": 396
  },
  "message": "Kafka (topic=beats): dropping message due to invalid configuration kafka: invalid configuration (Attempt to produce message larger than configured Producer.MaxMessageBytes: 851 > 10)",
  "service.name": "filebeat",
  "ecs.version": "1.6.0"
}

Related issues


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

* [kafka] Handle configuration errors

(cherry picked from commit 23f4491)
@mergify mergify Bot added the backport label Jul 10, 2025
@mergify mergify Bot requested a review from a team as a code owner July 10, 2025 06:38
@mergify mergify Bot requested review from AndersonQ and rdner and removed request for a team July 10, 2025 06:38
@mergify mergify Bot added the backport label Jul 10, 2025
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 10, 2025
@mergify mergify Bot mentioned this pull request Jul 10, 2025
6 tasks
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@github-actions github-actions Bot added bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jul 10, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 10, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@khushijain21 khushijain21 enabled auto-merge (squash) July 10, 2025 16:08
@khushijain21 khushijain21 merged commit 7597661 into 9.1 Jul 10, 2025
201 of 204 checks passed
@khushijain21 khushijain21 deleted the mergify/bp/9.1/pr-45128 branch July 10, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 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.

2 participants