DescribeDBInstancePerformance

Updated at:

Queries the performance data of an ApsaraDB for MongoDB instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dds:DescribeDBInstancePerformance

get

*dbinstance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

  • dds:ResourceTag
None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

Note

If you specify the ID of a sharded cluster instance for this parameter, you must also specify the NodeId parameter.

dds-bp2635****

NodeId

string

No

Instance ID of the mongos or shard node in a sharded cluster instance. You can use this parameter to query the performance of a single node.

Note

This parameter is available only when you specify instance ID of a sharded cluster instance for the DBInstanceId parameter.

d-bp2287****

Key

string

Yes

The performance metrics. For more information, see Monitoring metrics.

Note

To specify multiple metrics, separate them with commas (,).

CpuUsage

StartTime

string

Yes

The start time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2022-06-13T10:58Z

EndTime

string

Yes

The end time of the query. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2022-06-13T11:58Z

RoleId

string

No

The instance ID of the node in a standalone instance or replica set instance. You can call the DescribeReplicaSetRole operation to query the instance ID.

Note

This parameter is available only when you specify the ID of a standalone instance or replica set instance for the DBInstanceId parameter.

6025****

Interval

string

No

The data granularity. Valid values: 5, 30, 60, 600, 1800, 3600, and 86400.

60

ReplicaSetRole

string

No

The role of the node in a standalone instance or replica set instance. Valid values:

  • Primary: The primary node.

  • Secondary: The secondary node.

Note
  • This parameter is available only when you specify instance ID of a standalone instance or replica set instance for the DBInstanceId parameter.

  • When you specify instance ID of a standalone instance for the DBInstanceId parameter, you can set this parameter only to Primary.

Valid values:

  • Secondary :

    The secondary node.

  • Readonly :

    The read-only node.

  • Primary :

    The primary node.

Primary

SearchId

string

No

The ID of the search node.

Note
  • This parameter is available only when the search feature is enabled for the instance.

dds-2zec12675c9e****-search

Response elements

Element

Type

Description

Example

object

PerformanceKeys

object

PerformanceKey

array<object>

The list of performance metric information.

array<object>

Key

string

The performance metric.

CpuUsage

Unit

string

The unit of the performance metric.

%

ValueFormat

string

The format of the performance metric value. If the performance metric contains multiple fields, the fields are usually separated by ampersands (&).

For example, if you query the disk space usage, the returned ValueFormat is ins_size&data_size&log_size.

cpu_usage

PerformanceValues

object

PerformanceValue

array<object>

The list of performance metric values.

object

Value

string

The performance metric value.

0.23

Date

string

The date when the performance metric value was generated.

The time is in the ISO 8601 (RFC 3339) format in UTC. Example: 2022-06-13T10:58:00Z.

2022-06-13T10:58:00Z

EndTime

string

The end time of the query. The time is displayed in the yyyy-MM-ddTHH:mmZ format in UTC.

2022-06-13T11:58Z

RequestId

string

The request ID.

4A300BC7-6D8F-527F-A2DB-A7768D26E9AC

StartTime

string

The start time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2022-06-13T10:58Z

Examples

Success response

JSON format

{
  "PerformanceKeys": {
    "PerformanceKey": [
      {
        "Key": "CpuUsage",
        "Unit": "%",
        "ValueFormat": "cpu_usage",
        "PerformanceValues": {
          "PerformanceValue": [
            {
              "Value": "0.23",
              "Date": "2022-06-13T10:58:00Z"
            }
          ]
        }
      }
    ]
  },
  "EndTime": "2022-06-13T11:58Z",
  "RequestId": "4A300BC7-6D8F-527F-A2DB-A7768D26E9AC",
  "StartTime": "2022-06-13T10:58Z"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidPerformanceKey.Malformed The specified parameter Key is not valid.
400 InvalidStartTime.Malformed The specified parameter StartTime is not valid.
400 InvalidEndTime.Malformed The specified parameter EndTime is not valid.
400 InvalidStartTimeAndEndTime.Malformed The end time must be greater than the start time The end time cannot be earlier than the start time.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.