Updated on 2024-01-12 GMT+08:00

Querying Flow Metrics

Function

This API is used to query flow metrics.

URI

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

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

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.

metric_type

No

String

Metric type. If this parameter is left blank or invalid, all metrics are queried. Options: totalCount (number of invocations), errorCount (number of errors), averageDuration (average duration), running (ongoing executions), and rejectCount (number of throttles).

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 function flow metrics.

GET /v2/{projectId}/fgs/workflow-statistic

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.