Align cost report codebundles#624
Merged
stewartshea merged 6 commits intorunwhen-contrib:mainfrom Feb 26, 2026
Merged
Conversation
…features - Added new variables for output format, cost budget, and cost concentration threshold in the AWS cost report script. - Implemented daily cost querying for the last 7 days to improve cost trend analysis. - Enhanced the cost report generation to include high-cost contributors and services under $1. - Updated runbook templates to incorporate new variables for better configurability and clarity. - Removed obsolete SLI scripts to streamline the codebase.
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Outdated
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Outdated
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
- Updated logging messages to include relevant emojis for better visual cues. - Enhanced report formatting with improved table structures and clearer section headers. - Added detailed breakdowns for cost analysis, including daily spend and anomaly detection. - Improved overall readability and user experience in the generated cost reports.
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
…agement - Updated AWS cost report script to enhance sorting logic for cost changes. - Improved Azure cost historical report script to parse API responses more robustly, accommodating varying column orders. - Refactored GKE version support check script to use location parameter instead of zone for better compatibility. - Enhanced runbook to include detailed issue reporting for GKE version checks, improving clarity on potential failures.
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
… threshold - Modified AWS cost report script to use a variable for the cost concentration threshold, enhancing flexibility in high-cost contributor reporting. - Updated Azure cost historical report script to ensure cost values are parsed as numbers, improving data accuracy in reports.
Contributor
Author
|
bugbot review |
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
codebundles/azure-aks-cost-optimization/analyze_aks_node_pool_optimization.sh
Show resolved
Hide resolved
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Outdated
Show resolved
Hide resolved
- Updated AWS cost report script to correct sorting logic for cost changes by using absolute values. - Enhanced Azure AKS cost optimization script to filter VMSS list based on node pool name more effectively. - Modified Azure cost historical report script to utilize a configurable cost concentration threshold for identifying high-cost contributors. - Improved anomaly detection logic to avoid false positives when daily averages are zero. - Added cleanup logic in GKE version support check script to ensure temporary files are removed after execution.
codebundles/azure-subscription-cost-report/azure_cost_historical_report.sh
Show resolved
Hide resolved
codebundles/aws-account-cost-health/.runwhen/templates/aws-account-cost-health-sli.yaml
Show resolved
Hide resolved
…ng in cost report - Updated AKS version check script to handle missing JSON file gracefully by providing an empty issues array. - Improved date formatting in Azure cost historical report script to convert date strings from 'YYYYMMDD' to 'YYYY-MM-DD' format, enhancing readability and consistency in reports.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if [[ -n "$node_resource_group" ]]; then | ||
| progress " Finding VMSS for node pool: $node_pool_name..." | ||
| local vmss_list=$(az vmss list --resource-group "$node_resource_group" --subscription "$subscription_id" \ | ||
| -o json 2>/dev/null | jq --arg pool "$node_pool_name" '[.[] | select(.name | contains($pool)) | {name: .name, id: .id}]' 2>/dev/null || echo '[]') |
There was a problem hiding this comment.
VMSS substring matching can select wrong node pool
Medium Severity
The VMSS discovery uses jq's contains($pool) for substring matching, which can match the wrong VMSS when node pool names are prefixes of each other. For example, a pool named pool1 would match both aks-pool1-xxxxx-vmss and aks-pool10-xxxxx-vmss. Since .[0] picks the first match, the wrong VMSS metrics may be returned, leading to inaccurate utilization data and incorrect cost optimization recommendations.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Note
Medium Risk
Adds new scheduled execution paths and expands cost/version analysis logic that affects alert/issue generation across AWS/Azure/GCP; failures or threshold mistakes could cause missed or noisy cost/health signals.
Overview
SLI execution model is reworked to use a shared cron scheduler wrapper. Multiple SLI templates (AWS account cost health, EKS health, AKS triage, GKE cluster health) now point to
rw-workspace-utilscodebundles/cron-scheduler-sli/sli.robot, switch display units to Execution Status, introduceCRON_SCHEDULE/TARGET_SLX/DRY_RUNconfig, drop embedded auth secrets, and remove the per-bundlesli.robotimplementations.Cost reporting is expanded with daily/anomaly/budget/concentration analysis.
aws_cost_report.shadds daily spend (last 7 days), anomaly detection, budget and cost-concentration checks, optional CSV/JSON exports, and a sharedadd_issueaccumulator; the AWS cost runbook exposes new variables (OUTPUT_FORMAT,COST_BUDGET,COST_CONCENTRATION_THRESHOLD).azure_cost_historical_report.shsimilarly adds daily spend/anomaly reporting plus budget and concentration issue generation, and refactors report generation to use temp files to avoidARG_MAXlimits; its runbook wires the new budget/concentration variables.Kubernetes version support checks are added for managed clusters. New scripts/runbook tasks validate version support and quantify extended-support cost impact for
EKS,AKS, andGKE, emitting structured issue JSON that the runbooks translate into platform issues..gitignorenow ignores**/debug/**.Written by Cursor Bugbot for commit 80e02de. This will update automatically on new commits. Configure here.