-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[azure-eventhub] Update input v1 status on start, failure, and stop #41469
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
@@ -105,9 +109,11 @@ func (in *eventHubInputV1) Run( | |||
err = in.run(ctx) | |||
if err != nil { | |||
in.log.Errorw("error running input", "error", err) | |||
inputContext.UpdateStatus(status.Failed, err.Error()) |
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.
Hey @faec, I missed the opportunity to report the input status to the Elastic Agent when I updated the input to the Input API v2.
I am trying to address scenarios (like elastic/integrations#9659) where the input starts, and after a while, it encounters a fatal error, and the SDK worker shuts down.
What are your recommendations for reporting input status to the agent? Which input should I use as a reference?
🙇
f112711
to
9412dd2
Compare
When I update the input to the Input API v2, I missed the opportunity to report the input status back to the Elastic Agent.
Now also cover the following phases: - pipeline creation - sanitizers creation - input setup
9412dd2
to
c631779
Compare
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
Tested on a custom build of the Elastic Agent. We set an invalid event hub connection string and an invalid storage account key to trigger fatal errors during the input setup and run phases. |
…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)
…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)
…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)
…41469) (#41547) 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) Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
…41469) (#41546) 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) Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
…art, failure, and stop (#41545) * [azure-eventhub] Update input v1 status on start, failure, and stop (#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) * Drop unintentional changelog entries --------- Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
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
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
setup()
failuresrun()
failuresRelated issues
Screenshots
Fatal error during
setup()
caused by an invalid event hub connection string:Fatal error during
run()
caused by an invalid storage account key: