get_metric_summary
Retrieve the top N metric values aggregated by a label key for monitoring resources like VMs or hosts, using customizable time range, aggregation method, and threshold filters.
Instructions
获取监控指标的聚合 TopN(按 label_key 分组)
Args: namespace: 命名空间,如 "ZStack/VM", "ZStack/Host" metric_name: 指标名称,如 "CPUOccupiedByVm" label_key: 标签键,如 "VMUuid", "HostUuid" metric_names: 可选,多指标合并(如 in/out) start_time: 开始时间(ISO 或秒级时间戳) end_time: 结束时间(ISO 或秒级时间戳) period: 采样周期(秒),默认 60 aggregate: 单指标聚合方式,可选 "max"|"avg"|"sum"|"min" combine: 多指标合并方式,可选 "sum"|"avg"|"max"|"min" threshold_op: 阈值比较符,如 >,>=,<,<=,==,!= threshold_value: 阈值数值 top_n: 返回条数,默认 10 resolve_resource: 可选 "vm" 或 "host",用于解析名称
Returns: 聚合后的 TopN 列表
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | ||
| metric_name | Yes | ||
| label_key | Yes | ||
| metric_names | No | ||
| start_time | No | ||
| end_time | No | ||
| period | No | ||
| aggregate | No | max | |
| combine | No | sum | |
| threshold_op | No | ||
| threshold_value | No | ||
| top_n | No | ||
| resolve_resource | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |