cls_list_metrics
Lists available metric names within a specified topic and time range to identify what metrics can be queried before executing metric queries.
Instructions
列出指标主题下的所有指标名称。用于在查询指标前了解有哪些可用指标。
参数说明
topic_id: 指标主题 ID(必填),注意是时序指标主题 ID,非普通日志主题 ID
start_time: 起始时间,Unix 时间戳(秒)
end_time: 结束时间,Unix 时间戳(秒)
region: 地域(可选),如 ap-guangzhou、na-ashburn,不传则使用默认地域,可通过 cls_describe_regions 查询所有可用地域
使用场景
在使用 cls_query_metric / cls_query_range_metric 查询指标前,先列出可用指标
了解某个指标主题下上报了哪些指标
注意事项
⏰ start_time/end_time 为秒级时间戳,请先调用 cls_convert_time 工具转换,不要手动计算
返回的是指定时间范围内有数据的指标名称,建议查询最近 15 分钟即可
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic_id | Yes | ||
| start_time | Yes | ||
| end_time | Yes | ||
| region | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |