Skip to content

Metrics-related API

POST /metric/observice

Data loading:

Indicator name Indicator name parameter Meaning
Number of file completions PipelineLoadFileCount Number of files successfully loaded in a period of time
File Load Size PipelineLoadFileSize Total file size successfully loaded over a period of time
Number of tasks completed PipelineLoadTaskCount Number of tasks successfully completed in a period of time
File Load Delay PipelineLoadFileLatency Average Time for each file from start to successful loading over a period of time
File load throughput PipelineLoadFileThroughput The amount of data successfully loaded in unit time (bytes/s)
Number of files loaded per second PipelineLoadFilePerSecond Number of files successfully processed in unit time (number of files/s)
Average task latency PipelineLoadTaskLatency Average completion time for each task over a period of time
File success rate PipelineLoadFileSuccessRate File loading success rate over a period of time
Task timeout rate PipelineLoadTaskTimeoutRate Timeout rate for loading tasks over a period of time

Data Processing:

Indicator name Indicator name parameter Meaning
Number of jobs completed PipelineProcessFinishJobCount Number of processing jobs executed in a period of time
Job processing delay PipelineProcessFinishJobLatency Average time to execute processing jobs over a period of time
Workflow success rate PipelineProcessWorkflowSuccessRate Workflow execution processing job success rate over a period of time
Workflow timeout rate PipelineProcessWorkflowTimeoutRate Timeout rate for workflow execution processing jobs over a period of time

Input parameters:

Parameters Required Meaning
acconut Yes Workspace id
metrics Yes metric name, you can fill in multiple
start Yes Statistics start time
end Yes Statistical end time
interval Yes Time interval, seconds

Example:

import requests
import json

url = "https://freetier-01.cn-hangzhou.cluster.cn-dev.matrixone.tech/metric/observice"
headers = {
    "user-id":"0194dfaa-3eda-7ea5-b47c-b4f4f594xxxx",
    "Access-Token": "xxxx",
    "uid": "c0db5e70-8828-425f-bcd2-341b6e5321ba-0194dfaa-3eda-7ea5-b47c-b4f4f594xxxx:admin:accountadmin"
}

body={
  "account": "0194dfaa-3eda-7ea5-b47c-b4f4f594xxxx",
  "start": "2025-02-10T09:40:24+08:00",
  "end": "2025-02-10T10:00:24+08:00",
  "interval": 60,
  "metrics": [
    {
      "name": "PipelineProcessFinishJobCount"
    }
  ]
}

response = requests.post(url, headers=headers,json=body)
print("Response Body:", json.dumps(response.json(), indent=4, ensure_ascii=False))

return:

Response Body: {
    "code": "OK",
    "msg": "OK",
    "data": {
        "start": "2025-02-10T01:41:24Z",
        "end": "2025-02-10T02:00:24Z",
        "metrics": [
            {
                "name": "PipelineProcessFinishJobCount",
                "agg": "",
                "labels": [
                    {
                        "labelKey": "user_id",
                        "labelValue": "0194dfaa-3eda-7ea5-b47c-b4f4f5940e97"
                    }
                ],
                "values": [
                    {
                        "timestamp": "2025-02-10T01:41:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:42:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:43:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:44:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:45:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:46:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:47:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:48:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:49:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:50:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:51:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:52:00Z",
                        "value": 2
                    },
                    {
                        "timestamp": "2025-02-10T01:53:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:54:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:55:00Z","value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:56:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:57:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:58:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T01:59:00Z",
                        "value": null
                    },
                    {
                        "timestamp": "2025-02-10T02:00:00Z",
                        "value": null
                    }
                ]
            }
        ]
    }
}