Repository navigation
OU-481: use natural sort for label columns in metrics query table - #17565
etmurasaki wants to merge 1 commit into
Conversation
The metrics table sorted label columns lexicographically, causing incorrect ordering for numeric values (e.g., 1, 10, 2, 20 instead of 1, 2, 10, 20). Port numbers, memory values, and other numeric labels were affected. Add a naturalSort utility that uses localeCompare with numeric:true so that embedded numbers are compared by value, not by character code. Update the QueryTable sorting to use naturalSort for all label columns while keeping the dedicated numeric sort for the Values column. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
@etmurasaki: This pull request references OU-481 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target only the "4.14.z" version, but multiple target versions were set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
naturalSortutility function inmonitoring/utils.tsusinglocaleComparewithnumeric: trueoptionmetrics.tsxto usenaturalSortfor all label columns (keeps dedicated numeric sort for the Values column)Problem
The metrics query table sorted label columns lexicographically, producing incorrect ordering for columns containing numeric values. For example, labels with values
1,10,2,20were sorted as1,10,2,20instead of the expected1,2,10,20. Port numbers, memory values, CPU counts, and any other numeric data in query result labels were affected.Fixes: #13543
This is the console
release-4.14backport. The same fix is in monitoring-plugin (openshift/monitoring-plugin#1462) for OCP 4.14+ with COO/CMO.Test plan
upquery, click a label column header, verify port numbers sort numerically (9090, 9091, 9100 not 9090, 9100, 9091)🤖 Generated with Claude Code