Skip to content

Conversation

Kavindu-Dodan
Copy link
Contributor

Proposed commit message

Improve how stopped status get reported in S3 & CloudWatch inputs.

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.

@Kavindu-Dodan Kavindu-Dodan requested review from a team as code owners October 2, 2025 21:11
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 2, 2025
Copy link
Contributor

github-actions bot commented Oct 2, 2025

🤖 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!)

Copy link
Contributor

mergify bot commented Oct 2, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @Kavindu-Dodan? 🙏.
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-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Signed-off-by: Kavindu Dodanduwa <[email protected]>
@Kavindu-Dodan Kavindu-Dodan force-pushed the chore/fix-defer-usage-for-status-reporting branch from df63bde to 55c7298 Compare October 2, 2025 21:14
@Kavindu-Dodan Kavindu-Dodan added Team:obs-ds-hosted-services Label for the Observability Hosted Services team backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch labels Oct 2, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Oct 2, 2025
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Oct 3, 2025
@elasticmachine
Copy link
Collaborator

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

@pierrehilbert pierrehilbert requested a review from mauri870 October 3, 2025 07:20
@cmacknz
Copy link
Member

cmacknz commented Oct 3, 2025

Thanks, the reason the Stopped state shows as healthy is because the block below doesn't consider the Stopped state when aggregating the status of streams up into the parent input (the health protocol only understands inputs and not streams right now).

// inputLevelState state is marked as running, check the stream states
reportedStatus := status.Running
reportedMsg := "Healthy"
for _, streamState := range u.streamStates {
switch streamState.state {
case status.Degraded:
if reportedStatus != status.Degraded {
reportedStatus = status.Degraded
reportedMsg = streamState.msg
}
case status.Failed:
// return the first failed stream
return streamState.state, streamState.msg
}
}

Copy link
Contributor

@joecompute joecompute left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

I think the data plane team is only requested here because we are default code owners of the new changelog/fragments directory. #46931 should fix that.

So approving that part. We aren't code owners of the s3 or cloudwatch inputs, but if we were I'd ask for a unit test of this change ;)

@Kavindu-Dodan
Copy link
Contributor Author

@joecompute @cmacknz thank you for the review and explanation on why state doesn't get updated.

Regarding unit tests, I checked into this. But currently we do not have any unit tests targeting Input.run. Given this PR focus on a fix for incorrect reporting and the time investment to add all mocks needed to test the method, I will skip the unit test on this PR.

@Kavindu-Dodan
Copy link
Contributor Author

Update : I wil merge this on 06.10.2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants