[Core][Autoscaler] Refactor v2 Log Formatting #49350
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Currently the V2 Autoscaler formats logs by converting the V2 data structure
ClusterStatus
to the V1 structuresAutoscalerSummary
andLoadMetricsSummary
and then passing them to the legacyformat_info_string
. It'd be useful for the V2 autoscaler to directly formatClusterStatus
to the correct output log format. This PR refactorsutils.py
to directly formatClusterStatus
. Additionally, this PR changes the node reports to outputinstance_id
rather thanip_address
, since the latter is not necessarily unique for failed nodes.Related issue number
Closes #37856
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.