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

improve autopilot logging when it starts up #27464

Merged
merged 2 commits into from
Jun 12, 2024
Merged

improve autopilot logging when it starts up #27464

merged 2 commits into from
Jun 12, 2024

Conversation

raskchanky
Copy link
Contributor

@raskchanky raskchanky commented Jun 12, 2024

Description

While dealing with an autopilot escalation, I noticed that the logging when autopilot starts up is suboptimal, for a few reasons.

  • The struct that is written to the logs is fairly useless, as you only see values, not struct member names
  • If the autopilot reconcile interval hasn't been modified via the config (which is the case the overwhelming majority of the time, I imagine) then reconcile_interval 0s is printed to the logs, which is incorrect, and actually alarming. What's happening is it's printing out the value of the reconcile interval as it exists on the raft backend, which is 0 by default, but that's not actually the value autopilot is using. This is misleading.

This makes the autopilot config struct print in a better way and also updates the logging to not actually print the values for reconcile interval or update interval unless they were actually changed from their defaults.

TODO only if you're a HashiCorp employee

  • Labels: If this PR is the CE portion of an ENT change, and that ENT change is
    getting backported to N-2, use the new style backport/ent/x.x.x+ent labels
    instead of the old style backport/x.x.x labels.
  • Labels: If this PR is a CE only change, it can only be backported to N, so use
    the normal backport/x.x.x label (there should be only 1).
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jun 12, 2024
@raskchanky raskchanky added this to the 1.17.1 milestone Jun 12, 2024
Copy link

github-actions bot commented Jun 12, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

github-actions bot commented Jun 12, 2024

Build Results:
All builds succeeded! ✅

@raskchanky raskchanky merged commit f33f1b1 into main Jun 12, 2024
83 checks passed
@raskchanky raskchanky deleted the ap-fixes branch June 12, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants