时序日志主题查询

最近更新时间: 2026-10-10 00:14:48

1. 接口描述

接口请求域名: cls.api3.fincloud.tencent.com。

时序日志主题查询

默认接口请求频率限制:20次/秒。

接口更新时间:2026-02-03 15:41:26。

接口既验签名又鉴权。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。

参数名称 必选 允许NULL 类型 描述
Action 是 否 String 公共参数,本接口取值:QueryMetric
Version 是 否 String 公共参数,本接口取值:2020-10-16
Region 是 否 String 公共参数,地域信息可通过DescribeRegions接口查看产品支持的地域列表
Query 是 否 String Prometheus语法规则查询语句
示例值: access_evaluation_duration_bucket
Time 否 否 Uint64 时间戳
示例值: 1695197431
TopicId 是 否 String 时序主题ID
示例值: 57f5808c-4a55-11eb-b378-0242ac130002

3. 输出参数

参数名称 类型 描述
ResultType String 指标查询结果类型
示例值: vector
Result String 指标查询结果
示例值: [{"metric":{"code":"InternalError","region":"region","service_name":"service1","url":"api1"},"value":[1735040730,"412"]}]
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。

4. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码。

错误码 描述
OperationDenied.AccountNotExists 账户不存在。

5. 示例

示例1 查询指标最新值

输入示例

POST / HTTP/1.1
Host: cls.api3.fincloud.tencent.com
Content-Type: application/json
X-TC-Action:  QueryMetric
<Common Parameters>

{
  "TopicId": "8e7c3bd9-4a0d-4a0d-4a0d-207971e1f80f",
  "Query": "access_evaluation_duration_bucket",
  "Time": 1695197431
}

输出示例

{
  "Response": {
    "RequestId": "1ee38aa1-4a0d-4a0d-4a0d-b1961a464c99",
    "ResultType": "vector",
    "Result": "[{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00064\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.01024\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.04096\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.65536\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"2.62144\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00016\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5805\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"+Inf\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00256\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.16384\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"1e-05\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5593\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"4e-05\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5787\"]}]"
  }
}