analyze-costs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Analyze Costs

成本分析

Analyze cloud costs and identify savings using Harness Cloud Cost Management (CCM) via MCP.
通过MCP使用Harness Cloud Cost Management (CCM)分析云成本并识别节省空间。

Instructions

操作说明

Step 1: Get Cost Overview

步骤1:获取成本概览

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_account_overview"
Returns total spend, provider breakdown, and trend vs previous period.
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_account_overview"
返回总支出、供应商明细以及与上期对比的趋势。

Step 2: Get Cost Breakdown

步骤2:获取成本细分

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_breakdown"
Multi-dimensional breakdown by service, environment, team, region.
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_breakdown"
按服务、环境、团队、区域进行多维度细分。

Step 3: Explore Perspectives

步骤3:查看视角

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_perspective"
Then get detailed data for a specific perspective:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_perspective"
  resource_id: "<perspective_id>"
Call MCP tool: harness_list
Parameters:
  resource_type: "cost_perspective"
然后获取特定视角的详细数据:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_perspective"
  resource_id: "<perspective_id>"

Step 4: Get Cost Trends

步骤4:获取成本趋势

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_timeseries"
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_timeseries"

Step 5: Get Optimization Recommendations

步骤5:获取优化建议

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_recommendation"
For detailed recommendation info:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_detail"
  resource_id: "<recommendation_id>"
Summary statistics:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_stats"
Call MCP tool: harness_list
Parameters:
  resource_type: "cost_recommendation"
如需详细建议信息:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_detail"
  resource_id: "<recommendation_id>"
汇总统计:
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_stats"

Step 6: Check for Anomalies

步骤6:检查异常情况

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_anomaly"
To dismiss a known anomaly:
Call MCP tool: harness_execute
Parameters:
  resource_type: "cost_anomaly"
  action: "report_feedback"
  resource_id: "<anomaly_id>"
  body: { feedback: "FALSE_ANOMALY" }  # or TRUE_ANOMALY / NOT_RESPONDED
Call MCP tool: harness_list
Parameters:
  resource_type: "cost_anomaly"
如需标记已知异常为误报:
Call MCP tool: harness_execute
Parameters:
  resource_type: "cost_anomaly"
  action: "report_feedback"
  resource_id: "<anomaly_id>"
  body: { feedback: "FALSE_ANOMALY" }  # 或 TRUE_ANOMALY / NOT_RESPONDED

Step 7: Commitment Analysis

步骤7:承诺用量分析

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_commitment"
Call MCP tool: harness_get
Parameters:
  resource_type: "cost_commitment"

Report Format

报告格式

undefined
undefined

Cloud Cost Analysis

云成本分析

Period: Last 30 Days
周期: 过去30天

Summary

摘要

ProviderSpendvs Previous
AWS$X+X%
GCP$X+X%
Azure$X-X%
供应商支出与上期对比
AWS$X+X%
GCP$X+X%
Azure$X-X%

Top Recommendations

重点建议

  1. Rightsize <resource> - Save $X/month (95% confidence)
  2. Convert to Reserved - Save $X/month
  3. Delete unused resources - Save $X/month
  1. 调整<资源>规格 - 每月节省$X(95%置信度)
  2. 转换为预留实例 - 每月节省$X
  3. 删除未使用资源 - 每月节省$X

Anomalies

异常情况

  • <date>: <service> spiked $X above expected
  • <日期>: <服务>支出超出预期$X

Actions

待执行操作

  • Rightsize instance X
  • Purchase reserved capacity
  • Clean up unused volumes
undefined
  • 调整实例X的规格
  • 购买预留容量
  • 清理未使用的存储卷
undefined

Cost Resource Types Reference

成本资源类型参考

Resource TypeOperationsDescription
cost_account_overview
getAccount-level total spend summary
cost_summary
getPerspective-scoped cost summary
cost_timeseries
getCost trends over time
cost_breakdown
getMulti-dimensional breakdown
cost_perspective
list, getCustom cost views
cost_recommendation
listOptimization suggestions
cost_recommendation_detail
getDetailed recommendation
cost_recommendation_stats
getSummary statistics
cost_anomaly
list, get, execute(report_feedback)Cost spikes
cost_anomaly_summary
getAnomaly aggregate summary
cost_category
list, getCost allocation
cost_commitment
getCommitment coverage/utilisation/savings
cost_filter_value
getAvailable filter values
资源类型操作描述
cost_account_overview
get账户级总支出汇总
cost_summary
get视角范围内的成本汇总
cost_timeseries
get随时间变化的成本趋势
cost_breakdown
get多维度细分
cost_perspective
list, get自定义成本视图
cost_recommendation
list优化建议
cost_recommendation_detail
get详细建议内容
cost_recommendation_stats
get汇总统计数据
cost_anomaly
list, get, execute(report_feedback)成本突增情况
cost_anomaly_summary
get异常情况汇总
cost_category
list, get成本分配
cost_commitment
get承诺用量覆盖/利用率/节省情况
cost_filter_value
get可用筛选值

Examples

示例

  • "How much are we spending on cloud?" - Get cost_account_overview
  • "Find $5,000 in monthly savings" - List cost_recommendations, prioritize by savings
  • "Why did our bill spike last week?" - List cost_anomaly
  • "Break down costs by team" - Get cost_breakdown or cost_perspective
  • "Are we using our reserved instances?" - Get cost_commitment
  • "我们的云支出是多少?" - 获取cost_account_overview
  • "找到每月5000美元的节省空间" - 列出cost_recommendations,按节省金额排序
  • "为什么上周账单突增?" - 列出cost_anomaly
  • "按团队细分成本" - 获取cost_breakdown或cost_perspective
  • "我们是否在使用预留实例?" - 获取cost_commitment

Performance Notes

性能注意事项

  • Gather data from all relevant perspectives before drawing cost conclusions. Partial data leads to incorrect recommendations.
  • Cross-reference recommendations with anomaly data to distinguish trends from spikes.
  • Quality of cost analysis is more important than speed. Verify savings estimates before presenting.
  • 在得出成本结论前,收集所有相关视角的数据。部分数据会导致错误的建议。
  • 将建议与异常数据交叉参考,区分趋势和突增情况。
  • 成本分析的质量比速度更重要。在呈现前验证节省估算值。

Troubleshooting

故障排除

No Cost Data

无成本数据

  • Check cloud connectors are configured and syncing
  • Initial sync takes 24-48 hours
  • Verify billing access permissions (Cost Explorer, Billing API)
  • 检查云连接器是否已配置并同步
  • 初始同步需要24-48小时
  • 验证账单访问权限(Cost Explorer、Billing API)

No Recommendations

无建议内容

  • Resources need sufficient usage history for analysis
  • Small savings may be filtered out
  • Check minimum running time requirements
  • 资源需要足够的使用历史才能进行分析
  • 小额节省可能被过滤掉
  • 检查最低运行时间要求