Help Center/ ROMA Connect/ API Reference/ Service Integration APIs/ Querying Metrics/ Querying Statistics of Application Metrics by Integration Application
Updated on 2025-03-26 GMT+08:00

Querying Statistics of Application Metrics by Integration Application

Function

This API is used to query metrics of different API products requested by an application within a specified period.

This function is restricted for use. If you have any questions, contact technical support.

URI

GET /v2/{project_id}/apic/instances/{instance_id}/statistics/apps/{consumer_app_id}/roma-apps

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference.

instance_id

Yes

String

Instance ID.

consumer_app_id

Yes

String

Application ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

roma_app_ids

Yes

String

Integration application ID of the string type. A maximum of five integration applications can be queried at a time. Use commas (,) to separate multiple integration application IDs.

cycle

No

String

Statistical period.

  • minute

  • hour

  • day

    If cycle is set to minute, data of the last 3 hours can be queried.

    If cycle is set to hour, data of the last 3 days can be queried.

    If cycle is set to day, data of the last 90 days can be queried.

start_time

No

String

Start time, for example, 2020-06-18 10:00:01.

end_time

No

String

End time, for example, 2020-06-18 23:00:00.

duration

No

String

The measurement duration is in the format of "integer+unit (m or h)". m indicates minute, and h indicates hour. The combination of hour and minute is supported. For example, 1h or 2h45m.

  • If both start_time and end_time are specified, the query time range is [start_time, end_time].

  • If start_time does not exist, but end_time and duration exist and are valid, the query time range is [end_time – duration, end_time].

  • If start_time and end_time do not exist, duration exists and is valid, and end_time is now, the query time range is [end_time – duration, end_time].

  • If end_time does not exist, start_time and duration exist and are valid, and end_time is now, the query time range is [end_time – duration, end_time].

  • If start_time, end_time, and duration do not exist, the error message "missing time range parameters" is displayed.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

code

String

Response code.

start_time

Long

Timestamp (UTC) of the statistics start time.

end_time

Long

End time (UTC).

roma_apps

Array of RomaAppDetail objects

Integration application statistics.

Table 5 RomaAppDetail

Parameter

Type

Description

roma_app_id

String

Integration application ID.

roma_app_name

String

Integration application name.

list

Array of Statistics objects

List of KPIs in different periods in an integration application.

Table 6 Statistics

Parameter

Type

Description

max_latency

Integer

Maximum latency.

avg_latency

Float

Average latency.

req_count

Integer

Total number of requests.

req_count2xx

Integer

Total number of 2xx response codes.

req_count4xx

Integer

Total number of 4xx response codes.

req_count5xx

Integer

Total number of 5xx response codes.

req_count_error

Integer

Number of errors.

max_inner_latency

Integer

Maximum gateway latency.

avg_inner_latency

Float

Average gateway latency.

max_backend_latency

Integer

Maximum backend latency.

avg_backend_latency

Float

Average backend latency.

output_throughput

Long

Downstream throughput (bytes).

input_throughput

Long

Upstream throughput (bytes).

current_minute

Long

Current timestamp in UTC format.

req_time

String

Request time.

Reserved field, not supported yet.

register_time

String

Request time.

Reserved field, not supported yet.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "code" : "APIG.0000",
  "start_time" : 1599508511,
  "end_time" : 1599616511,
  "roma_apps" : [ {
    "roma_app_id" : "1a7b421c-6103-4fcb-a0d7-3e322e863cb0",
    "roma_app_name" : "ycs-product",
    "list" : [ {
      "max_latency" : 0,
      "avg_latency" : 0,
      "max_inner_latency" : 0,
      "avg_inner_latency" : 0,
      "max_backend_latency" : 0,
      "avg_backend_latency" : 0,
      "req_count" : 0,
      "req_count2xx" : 0,
      "req_count4xx" : 0,
      "req_count5xx" : 0,
      "req_count_error" : 0,
      "output_throughput" : 0,
      "input_throughput" : 0,
      "current_minute" : 0
    } ]
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "APIG.2012",
  "error_msg" : "Invalid parameter value,parameterName:api_id. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3002",
  "error_msg" : "API 39bce6d25a3f470e8cf7b2c97174f7d9 does not exist"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.