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.16](backport #41469) [azure-eventhub] Update input v1 status on start, failure, and stop #41546

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 7, 2024

Proposed commit message

Update the Elastic Agent status by calling inputContext.UpdateStatus(status.Failed, err.Error()) during the main input lifecycle phases (set up and run). If any of the setup, startup, and run steps fail, the input reports the fatal issue before shutting down.

Without reporting the fatal error, the input logs the error and stops, but users continue to see it as "healthy" in Fleet, causing confusion and making troubleshooting much harder.

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.

Author's Checklist

  • Test with wrong event hub credentials (for example, use a connection string from a different namespace)
  • Test with wrong storage account credentials (for example, a key from a different storage account or a random string)

How to test this PR locally

  • Build a custom agent
  • Install the Azure Logs integration
    • set an invalid connection string to test setup() failures
    • set an invalid storage account key to test run() failures

Related issues

Screenshots

Fatal error during setup() caused by an invalid event hub connection string:

CleanShot 2024-11-06 at 22 58 15@2x

Fatal error during run() caused by an invalid storage account key:

CleanShot 2024-11-06 at 19 37 33@2x


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

…41469)

Update the Elastic Agent status by calling `inputContext.UpdateStatus(status.Failed, err.Error())` during the main input lifecycle phases (set up and run). If any setup, startup, and run steps fail, the input reports the fatal issue before shutting down.

Without reporting the fatal error, the input logs the error and stops, but users continue to see it as "healthy" in Fleet, causing confusion and making troubleshooting much harder.

(cherry picked from commit 882c854)
@mergify mergify bot added the backport label Nov 7, 2024
@mergify mergify bot requested a review from a team as a code owner November 7, 2024 00:38
@mergify mergify bot assigned zmoog Nov 7, 2024
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 7, 2024
@botelastic
Copy link

botelastic bot commented Nov 7, 2024

This pull request doesn't have a Team:<team> label.

@zmoog
Copy link
Contributor

zmoog commented Nov 7, 2024

/test

@zmoog zmoog enabled auto-merge (squash) November 7, 2024 06:51
@zmoog
Copy link
Contributor

zmoog commented Nov 7, 2024

The error on "check-logs" seems unrelated to this change.

@zmoog zmoog merged commit dd62122 into 8.16 Nov 7, 2024
21 of 22 checks passed
@zmoog zmoog deleted the mergify/bp/8.16/pr-41469 branch November 7, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant