All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeSlowLogRecords

Last Updated:Jun 10, 2026

Mengkueri entri log kueri lambat untuk instans MongoDB.

Deskripsi operasi

  • This operation is applicable only to general-purpose local-disk and dedicated local-disk instances.

  • You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see Manage a Logstore.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

dds:DescribeSlowLogRecords

get

*Instance

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

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

ID Instans.

Catatan

Jika Anda menetapkan parameter ini ke ID instans kluster sharded, Anda juga harus menentukan parameter NodeId.

dds-bp1fc7e65108****

NodeId

string

No

ID node shard.

Catatan

Parameter ini hanya diperlukan ketika Anda menetapkan parameter DBInstanceId ke ID instans kluster sharded.

d-bp18b06ebc21****

StartTime

string

Yes

Awal rentang pengatur waktu yang akan dikueri. Tentukan pengatur waktu dalam standar ISO 8601 dengan format yyyy-MM-ddTHH:mmZ. Pengatur waktu harus dalam UTC.

2021-08-15T14:13Z

EndTime

string

Yes

Akhir rentang waktu yang akan dikueri. Tentukan waktu dalam standar ISO 8601 dengan format yyyy-MM-ddTHH:mmZ. Waktu harus dalam UTC.

Catatan
  • Waktu akhir harus lebih lambat pengatur waktu mulai.

  • Waktu akhir harus dalam 24 jam pengatur waktu mulai. Jika tidak, kueri akan gagal.

2021-08-16T14:13Z

DBName

string

No

Nama database.

mongodbtest

QueryKeywords

string

No

Kata kunci yang digunakan untuk kueri. Anda dapat memasukkan hingga 10 kata kunci dalam satu pengatur waktu. Pisahkan beberapa kata kunci dengan spasi.

test test1

LogicalOperator

string

No

Hubungan logis di antara beberapa kata kunci.

  • or

  • and (nilai default).

and

PageSize

integer

No

Jumlah entri per halaman. Nilai valid: 30 hingga 100.

30

PageNumber

integer

No

Nomor halaman. Nilai harus berupa bilangan bulat positif yang tidak melebihi nilai maksimum tipe data INTEGER. Nilai default: 1.

1

OrderType

string

No

Pesanan pengurutan entri log berdasarkan pengatur waktu. Nilai valid:

  • asc: urutan menaik.

  • desc: urutan menurun.

asc

ResourceGroupId

string

No

ID kelompok sumber daya tempat instans yang ingin Anda kueri berada.

rg-acfmyiu4ekp****

Elemen respons

Element

Type

Description

Example

object

TotalRecordCount

integer

The total number of returned entries.

1

PageRecordCount

integer

The number of slow query log entries returned on the page.

1

RequestId

string

The request ID.

8076C4BA-DDBD-529C-BFF4-D8620C3F****

PageNumber

integer

The page number of the returned page. The value is a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.

1

Items

object

LogRecords

array<object>

An array that consists of the information about each slow query.

object

ExecutionStartTime

string

The start time of the operation. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2019-02-25T 01:41:28Z

HostAddress

string

The host IP address that is used to connect to the database.

192.168.XX.XX

QueryTimes

string

The execution time of the statement. Unit: milliseconds.

600

TableName

string

The name of the collection.

C1

SQLText

string

The SQL statement that is executed during the slow operation.

{\"op\":\"query\",\"ns\":\"mongodbtest.customer\",\"query\":{\"find\":\"customer\",\"filter\":{\"name\":\"jack\"}}}

ReturnRowCounts

integer

The number of rows returned by the SQL statement.

0

KeysExamined

integer

The number of rows involved in index scans.

0

DBName

string

The name of the database.

mongodbtest

DocsExamined

integer

The number of documents that are scanned during the operation.

1000000

AccountName

string

The username of the database account that performs the operation.

test

Engine

string

The database engine.

MongoDB

Contoh

Respons sukses

JSONformat

{
  "TotalRecordCount": 1,
  "PageRecordCount": 1,
  "RequestId": "8076C4BA-DDBD-529C-BFF4-D8620C3F****",
  "PageNumber": 1,
  "Items": {
    "LogRecords": [
      {
        "ExecutionStartTime": "2019-02-25T 01:41:28Z",
        "HostAddress": "192.168.XX.XX",
        "QueryTimes": "600",
        "TableName": "C1",
        "SQLText": "{\\\"op\\\":\\\"query\\\",\\\"ns\\\":\\\"mongodbtest.customer\\\",\\\"query\\\":{\\\"find\\\":\\\"customer\\\",\\\"filter\\\":{\\\"name\\\":\\\"jack\\\"}}}",
        "ReturnRowCounts": 0,
        "KeysExamined": 0,
        "DBName": "mongodbtest",
        "DocsExamined": 1000000,
        "AccountName": "test"
      }
    ]
  },
  "Engine": "MongoDB"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 IncorrectCharacterType Current DB instance CharacterType does not support this operation.
400 InvalidParameterCombination The end time must be greater than the start time
400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid.
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid.
403 LogApiFrequencyExceeded Exceeding the allowed frequency of log api.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.