本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
GetSeries
此 GetSeries
作業會擷取符合特定標籤集的時間序列清單。
- 有效的 HTTP 動詞:
-
GET
,POST
- 有效 URI:
-
/workspaces/
workspaceId
/api/v1/series - URL 查詢參數:
-
match[]=<series_selector>
重複序列選擇器參數,選擇要傳回的序列。至少必須提供一個match[]
引數。start=<rfc3339 | unix_timestamp>
開始時間戳記。選用end=<rfc3339 | unix_timestamp>
結束時間戳記。選用
請求範例
POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/series --data-urlencode 'match[]=node_cpu_seconds_total{app="prometheus"}' --data-urlencode 'start=1634936400' --data-urlencode 'end=1634939100' HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0
回應範例
HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon content-encoding: gzip { "status": "success", "data": [ { "__name__": "node_cpu_seconds_total", "app": "prometheus", "app_kubernetes_io_managed_by": "Helm", "chart": "prometheus-11.12.1", "cluster": "cluster-1", "component": "node-exporter", "cpu": "0", "heritage": "Helm", "instance": "10.0.100.36:9100", "job": "kubernetes-service-endpoints", "kubernetes_name": "servicesstackprometheuscf14a6d7-node-exporter", "kubernetes_namespace": "default", "kubernetes_node": "ip-10-0-100-36.us-west-2.compute.internal", "mode": "idle", "release": "servicesstackprometheuscf14a6d7" }, { "__name__": "node_cpu_seconds_total", "app": "prometheus", "app_kubernetes_io_managed_by": "Helm", "chart": "prometheus-11.12.1", "cluster": "cluster-1", "component": "node-exporter", "cpu": "0", "heritage": "Helm", "instance": "10.0.100.36:9100", "job": "kubernetes-service-endpoints", "kubernetes_name": "servicesstackprometheuscf14a6d7-node-exporter", "kubernetes_namespace": "default", "kubernetes_node": "ip-10-0-100-36.us-west-2.compute.internal", "mode": "iowait", "release": "servicesstackprometheuscf14a6d7" }, ... ] }