Skip to content

Add a log statement showing the count returned by each autoscaler check.#1235

Open
nathanmonteleone wants to merge 5 commits intohashicorp:mainfrom
simplifi:main
Open

Add a log statement showing the count returned by each autoscaler check.#1235
nathanmonteleone wants to merge 5 commits intohashicorp:mainfrom
simplifi:main

Conversation

@nathanmonteleone
Copy link
Copy Markdown

@nathanmonteleone nathanmonteleone commented Jan 21, 2026

When troubleshooting more complex autoscaler policies, it can be useful to know what target count/reason each check is returning. That information was not available in the log previously. This changeset adds it as a Debug-level log.

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

no.

@nathanmonteleone nathanmonteleone requested review from a team as code owners January 21, 2026 20:07
@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

1 similar comment
@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

Copy link
Copy Markdown
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @nathanmonteleone!

I know it's a bit of a pain but can you please sign the CLA? Because you git history is dirty with a merge from main you've got commits from dependabot in here and that might confuse the CLA bot. You might want to rebase to clean that up as well.

Comment thread policy/check.go
Comment on lines +81 to +82
} else {
ch.log.Debug("check returned count", "strategy", ch.check.Strategy.Name, "check", ch.check.Name, "count", a.Count, "reason", a.Reason)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Style nitpick: we don't need to guard this in the else because all code paths in the if err != nil return.

Suggested change
} else {
ch.log.Debug("check returned count", "strategy", ch.check.Strategy.Name, "check", ch.check.Name, "count", a.Count, "reason", a.Reason)
}
ch.log.Debug("check returned count", "strategy", ch.check.Strategy.Name, "check", ch.check.Name, "count", a.Count, "reason", a.Reason)

@tgross tgross moved this from Needs Triage to In Progress in Nomad - Community Issues Triage Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants