-
Notifications
You must be signed in to change notification settings - Fork 5k
[Filebeat] Correctly report V2 inputs as failed to the Manager #47905
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
[Filebeat] Correctly report V2 inputs as failed to the Manager #47905
Conversation
This commit updates the status of V2 Inputs managed by the input-cursor.managedInput when the pipeline fails to connect. One of the instances where the pipeline fails to connect is when invalid processors are defined in the input configuration.
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
…led-when-pipeline-fails-to-start
…led-when-pipeline-fails-to-start
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
AndersonQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure we're on the same page. I don't see it recovering from the degraded/failed state. Is is so because those error are irrecoverable?
changelog/fragments/1765204121-Correctly-report-V2-inputs-as-failed-to-the-Manager.yaml
Show resolved
Hide resolved
Kinda. It depends on how the input was started. The parts of the codebase I changed are not responsible for restarting failed/degraded inputs, that's the manager or the input runner responsibility. Aside from that, all the cases I can think of are not recoverable. The error is coming from connecting to the publishing pipeline, as far as I know, only configuration errors will cause issues and those are not recoverable. |
|
@Mergifyio backport 8.19 9.1 9.2 |
✅ Backports have been createdDetails
|
Correctly report V2 inputs as failed to the manager. If a V2 input Run method returns an error, it is now correctly reported to the input manager. The Filestream input reports the input as degraded if the pipeline fails to connect. (cherry picked from commit 462751c) # Conflicts: # x-pack/filebeat/tests/integration/managerV2_test.go
Correctly report V2 inputs as failed to the manager. If a V2 input Run method returns an error, it is now correctly reported to the input manager. The Filestream input reports the input as degraded if the pipeline fails to connect. (cherry picked from commit 462751c)
Correctly report V2 inputs as failed to the manager. If a V2 input Run method returns an error, it is now correctly reported to the input manager. The Filestream input reports the input as degraded if the pipeline fails to connect. (cherry picked from commit 462751c)
… (#48060) Correctly report V2 inputs as failed to the manager. If a V2 input Run method returns an error, it is now correctly reported to the input manager. The Filestream input reports the input as degraded if the pipeline fails to connect. (cherry picked from commit 462751c) Co-authored-by: Tiago Queiroz <[email protected]>
Proposed commit message
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Run the tests
Manual test
1. Download Elastic Agent snapthost
Make sure to download the latest snapshot in the correct version for your OS/Architecture
2. Build Agentbeat
3. Extract Elastic Agent and copy the Agentbeat binary
4. Copy the Agentbeat binary you built, replacing the one from the archive
5.Create a log file for Filestream to ingest
Using flog
6.Create the
elastic-agent.ymlThe connection credentials to Elasticsearch are irrelevant, no data will be shipped, so they can point to an inexistent Elasticsearch host.
elastic-agent.yml
7.Look for the logs showing Filestream and Cel input failing
Filestream:
{ "@timestamp": "2025-12-08T09:56:57.403-0500", "component": { "id": "filestream-default", "state": "HEALTHY" }, "ecs.version": "1.6.0", "log": { "source": "elastic-agent" }, "log.level": "warn", "log.origin": { "file.line": 1040, "file.name": "coordinator/coordinator.go", "function": "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator.logComponentStateChange" }, "message": "Unit state changed filestream-default-filestream-unit-id (HEALTHY->DEGRADED): Harvester for Filestream input \"filestream-input-id\" failed: error while connecting to output with pipeline: unexpected INVALID_CONFIG_KEY option in processors.6.add_fields", "unit": { "id": "filestream-default-filestream-unit-id", "old_state": "HEALTHY", "state": "DEGRADED", "type": "input" } }Cel:
{ "@timestamp": "2025-12-08T09:56:57.761-0500", "component": { "id": "cel-default", "state": "HEALTHY" }, "ecs.version": "1.6.0", "log": { "source": "elastic-agent" }, "log.level": "error", "log.origin": { "file.line": 1040, "file.name": "coordinator/coordinator.go", "function": "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator.logComponentStateChange" }, "message": "Unit state changed cel-default-cel-unit-id (HEALTHY->FAILED): Input 'cel' failed with: input cel-input-id failed: unexpected INVALID_CONFIG_KEY option in processors.6.add_fields", "unit": { "id": "cel-default-cel-unit-id", "old_state": "HEALTHY", "state": "FAILED", "type": "input" } }8.Look at the Elastic Agent status
The Filestream input must be in a degraded state and Cel in a failed state. Both inputs must have errored with
Related issues
## Use cases## Screenshots## Logs