Help Center/ FunctionGraph/ API Reference/ APIs/ Function Flows/ Querying Metrics of a Flow
Updated on 2024-01-12 GMT+08:00

Querying Metrics of a Flow

Function

This API is used to query the metrics of a flow.

URI

GET /v2/{project_id}/fgs/workflow-statistic/{workflow_urn}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Minimum: 1

Maximum: 64

workflow_urn

Yes

String

Flow URN. Format:urn:fss:<region_id>:<project_id>:workflow:<package>:<workflow_name>:<version>Currently, package and version can only be set to default and latest, respectively.

Minimum: 1

Maximum: 128

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

period

No

String

Time period, in minutes.

start_time

No

String

Timestamp of the start time, precise to milliseconds.

end_time

No

String

Timestamp of the end time, precise to milliseconds.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

count

Array of SlaReportsValue objects

Number of executions.

duration

Array of SlaReportsValue objects

Average latency, in milliseconds.

fail_count

Array of SlaReportsValue objects

Number of errors.

running_count

Array of SlaReportsValue objects

Number of running flows.

Table 4 SlaReportsValue

Parameter

Type

Description

timestamp

Long

Timestamp.

value

Double

Value.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 36

error_msg

String

Error description.

Minimum: 2

Maximum: 512

request_id

String

Request ID.

Minimum: 2

Maximum: 512

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 36

error_msg

String

Error description.

Minimum: 2

Maximum: 512

request_id

String

Request ID.

Minimum: 2

Maximum: 512

Example Requests

Query the metrics of a function flow.

GET /v2/{project_id}/fgs/workflow-statistic/{workflow_urn}

Example Responses

Status code: 200

Function flow statistics.

{
  "count" : [ {
    "timestamp" : 0,
    "value" : 0
  } ],
  "duration" : [ {
    "timestamp" : 0,
    "value" : 0
  } ],
  "fail_count" : [ {
    "timestamp" : 0,
    "value" : 0
  } ],
  "running_count" : [ {
    "timestamp" : 0,
    "value" : 0
  } ]
}

Status Codes

Status Code

Description

200

Function flow statistics.

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.