-
Notifications
You must be signed in to change notification settings - Fork 146
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
Include upgrade details in diagnostics bundle during ongoing upgrade #3624
Include upgrade details in diagnostics bundle during ongoing upgrade #3624
Conversation
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
NOTE: |
🌐 Coverage report
|
This pull request is now in conflicts. Could you fix it? 🙏
|
081d5ec
to
eebc69e
Compare
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
FleetMessage: s.FleetMessage, | ||
LogLevel: s.LogLevel, | ||
Components: compStates, | ||
UpgradeDetails: s.UpgradeDetails, |
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.
When is this field present? Do we get details about the upgrade after a failure ? Or those get cleared as soon as the grace period is over ?
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.
When is this field present?
This field is populated when the upgrade process starts:
elastic-agent/internal/pkg/agent/application/coordinator/coordinator.go
Lines 475 to 476 in 2a93086
det := details.NewDetails(version, details.StateRequested, actionID) | |
det.RegisterObserver(c.SetUpgradeDetails) |
Do we get details about the upgrade after a failure ?
Yes, if the upgrade process fails at any point, this field will continue to remain populated.
Or those get cleared as soon as the grace period is over ?
I assume you are referring to the Upgrade Watcher's grace period.
Exactly when we clear it out after that is not yet implemented. We need to decide whether we want to clear it out based on some timeout (maybe the grace period or maybe something even beyond that) or due to some user intervention (which could be retrying the upgrade or something else just to clear the upgrade details, not sure yet) or either (whichever happens first).
FleetMessage string `yaml:"fleet_message"` | ||
LogLevel logp.Level `yaml:"log_level"` | ||
Components []StateComponentOutput `yaml:"components"` | ||
UpgradeDetails *details.Details `yaml:"upgrade_details,omitempty"` |
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.
I don't see any changes in the tests related to this change... could you please add a unit test to document what we can expect in the hook output when UpgradeDetails is populated ?
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.
Thanks. Added in 02625e8.
eebc69e
to
5b1db16
Compare
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.
Nice! Great this is added to the diagnostics.
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.
LGTM
5b1db16
to
a8aed84
Compare
SonarQube Quality Gate |
What does this PR do?
This PR enhances the diagnostics bundle to include upgrade details when Agent is being upgraded.
Why is it important?
To gain more visibility into the Agent upgrade process.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolI have added an integration test or an E2E testHow to test this PR locally
elastic-agent
from this PR's branch and install it.elastic-agent diagnostics
, expand the resulting archive, and check the bundledstate.yaml
file. Verify that NO upgrade details are included in it by checking that there is noupgrade_details
field.elastic-agent diagnostics
again, expand the resulting archive, and check the bundledstate.yaml
file. Verify that upgrade details are included in it by checking that there is anupgrade_details
field.Related issues