get_metric_data
Retrieve monitoring metrics and data points for ZStack resources. Filter by namespace, metric, time range, labels, and optionally get summary statistics only.
Instructions
获取 ZStack 监控数据
Args: namespace: 命名空间,如 "ZStack/VM", "ZStack/Host" metric_name: 指标名称,如 "CPUUsedUtilization" start_time: 开始时间(ISO 或秒级时间戳) end_time: 结束时间(ISO 或秒级时间戳) period: 采样周期(秒),默认 60 labels: 标签过滤,如 ["VMUuid=xxx"] 或 {"VMUuid":"xxx"} summary_only: 仅返回统计信息(点数/最大/最小/平均/方差/标准差)
注意: 返回数据量与时间跨度和 period 成正比。可用估算公式: 点数 ≈ ceil((end_time - start_time) / period) * series_count series_count 为不同 label 组合数量;若不传 labels,可能返回多组系列 (例如指标包含 CPUNum/VMUuid 等 label 时每个组合都会产出一组序列)。 为避免输出过大:缩短时间范围、增大 period 或增加 labels 过滤。
Returns: 监控数据点列表
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | ||
| metric_name | Yes | ||
| start_time | No | ||
| end_time | No | ||
| period | No | ||
| labels | No | ||
| summary_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |