Help Center/ Data Admin Service/ API Reference/ APIs (in OBT)/ Intelligent O&M/ Obtaining an Instance Diagnosis Report
Updated on 2025-05-19 GMT+08:00

Obtaining an Instance Diagnosis Report

Function

This API is used to obtain an instance diagnosis report.

URI

GET /v3/{project_id}/instances/{instance_id}/get-instance-health-report

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation:

Project ID of a tenant in a region

To obtain this value, see Obtaining a Project ID.

Constraints:

N/A

Values:

The value can contain 32 characters. Only letters and digits are allowed.

Default value:

N/A

instance_id

Yes

String

Explanation:

Unique ID of an instance

Constraints:

N/A

Values:

The value can contain 32 characters. Only letters and digits are allowed.

Default value:

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Explanation:

Task ID

Constraints:

N/A

Values:

N/A

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

success

Boolean

Explanation:

Whether the diagnosis in a daily report is successful

Values:

N/A

start_at

Long

Explanation:

Diagnosis start time (in Unix timestamp format) in a daily report, in milliseconds

Values:

N/A

end_at

Long

Explanation:

Diagnosis end time (in Unix timestamp format) in a daily report, in milliseconds

Values:

N/A

task_id

String

Explanation:

Report ID

Values:

N/A

summary_info

Objects in Table 4

Explanation:

Daily report abstract

Values:

N/A

instance_info

Table 8 object

Explanation:

Instance information list

Values:

N/A

performance_stat

Table 9 object

Explanation:

Performance statistics and analysis list

Values:

N/A

disk_stat

Table 10 object

Explanation:

Disk statistics and analysis list

Values:

N/A

table_space_stat

Table 13 object

Explanation:

Tablespace statistics and analysis list

Values:

N/A

slow_log_stat

Table 16 object

Explanation:

Statistics and analysis list of slow query logs

Values:

N/A

full_sql_stat

Table 17 object

Explanation:

Statistics and analysis list of all query logs

Values:

N/A

inspection_stat

Table 19 object

Explanation:

Statistics and analysis list of preventive maintenance inspection scores

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 4 HealthReportSummaryInfo

Parameter

Type

Description

analysis_results

Array of Table 5 objects

Explanation:

Analysis results

Values:

N/A

Table 5 HealthReportAnalysisResult

Parameter

Type

Description

risk_code

String

Explanation:

Risk code

Values:

N/A

risk_level

String

Explanation:

Risk level

Values:

N/A

risk_content

String

Explanation:

Risk content

Values:

N/A

reasons

Array of Table 6 objects

Explanation:

Possible causes

Values:

N/A

Table 6 HealthReportRiskReason

Parameter

Type

Description

reason_code

String

Explanation:

Possible cause code

Values:

N/A

reason_content

String

Explanation:

Possible cause

Values:

N/A

suggestions

Array of Table 7 objects

Explanation:

Suggestions

Values:

N/A

Table 7 HealthReportRiskSuggestion

Parameter

Type

Description

suggestion_code

String

Explanation:

Suggestion codes

Values:

N/A

suggestion_content

String

Explanation:

Suggestions

Values:

N/A

Table 8 HealthReportInstanceInfo

Parameter

Type

Description

tenant_id

String

Explanation:

Account ID

Values:

N/A

project_id

String

Explanation:

Project ID

Values:

N/A

instance_id

String

Explanation:

Instance ID

Values:

N/A

master_node_id

String

Explanation:

Primary node ID

Values:

N/A

instance_name

String

Explanation:

Instance name

Values:

N/A

cpu

Integer

Explanation:

Number of CPU cores of an instance

Values:

N/A

mem

Integer

Explanation:

Instance memory size

Values:

N/A

disk_size

Integer

Explanation:

Disk size

Values:

N/A

disk_type

String

Explanation:

Disk type

Values:

N/A

engine

String

Explanation:

DB engine

Values:

N/A

engine_version

String

Explanation:

DB engine kernel version

Values:

N/A

Table 9 HealthReportPerformanceStat

Parameter

Type

Description

peak_stats

Array of Table 11 objects

Explanation:

Peak statistics

Values:

N/A

ratio_stats

Array of Table 12 objects

Explanation:

Ratio data

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 10 HealthReportDiskStat

Parameter

Type

Description

peak_stats

Array of Table 11 objects

Explanation:

Peak statistics

Values:

N/A

ratio_stats

Array of Table 12 objects

Explanation:

Ratio data

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 11 HealthReportSingleValueStat

Parameter

Type

Description

metric

String

Explanation:

Metric name

Values:

N/A

value

Double

Explanation:

Value

Values:

N/A

max_value

Double

Explanation:

Maximum value

Values:

N/A

normalized

Double

Explanation:

Normalized value

Values:

N/A

stage

String

Explanation:

Current status

Values:

N/A

timestamp

Long

Explanation:

Metric collection time

Values:

N/A

Table 12 HealthReportRatioStat

Parameter

Type

Description

metric

String

Explanation:

Metric name

Values:

N/A

max_value

Double

Explanation:

Maximum value

Values:

N/A

critical_ratio

Double

Explanation:

Critical ratio

Values:

N/A

medium_ratio

Double

Explanation:

Medium ratio

Values:

N/A

light_ratio

Double

Explanation:

Light ratio

Values:

N/A

Table 13 HealthReportTableSpaceStat

Parameter

Type

Description

size_top

Array of Table 14 objects

Explanation:

Top tables in size

Values:

N/A

rows_top

Array of Table 14 objects

Explanation:

Top table rows

Values:

N/A

size_incr_top

Array of Table 15 objects

Explanation:

Top tables in size with the highest growth rate

Values:

N/A

rows_incr_top

Array of Table 15 objects

Explanation:

Top rows with the highest growth rate

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 14 HealthReportTableSpaceInfo

Parameter

Type

Description

database

String

Explanation:

Database name

Values:

N/A

table

String

Explanation:

Table name

Values:

N/A

db_engine

String

Explanation:

DB engine

Values:

N/A

table_size

Long

Explanation:

Table size

Values:

N/A

data_size

Long

Explanation:

Data size

Values:

N/A

index_size

Long

Explanation:

Index size

Values:

N/A

rows

Long

Explanation:

Number of rows

Values:

N/A

Table 15 HealthReportTableSpaceIncrInfo

Parameter

Type

Description

database

String

Explanation:

Database name

Values:

N/A

table

String

Explanation:

Table name

Values:

N/A

increment

Long

Explanation:

Increment

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 16 HealthReportSlowLogStat

Parameter

Type

Description

collect_slow_log

Boolean

Explanation:

Whether slow query logs are collected

Values:

N/A

top_execute_slow_logs

Array of Table 18 objects

Explanation:

Top slow SQL queries executed

Values:

N/A

top_avg_query_time_slow_logs

Array of Table 18 objects

Explanation:

Top slow SQL queries taking average time

Values:

N/A

top_max_query_time_slow_logs

Array of Table 18 objects

Explanation:

Top slow SQL queries taking longest

Values:

N/A

rows_examined_exceeding

Array of Table 18 objects

Explanation:

Top slow SQL queries which return rows

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 17 HealthReportFullSqlStat

Parameter

Type

Description

collect_full_sql

Boolean

Explanation:

Whether all query logs are collected

Values:

N/A

execute_top_templates

Array of Table 18 objects

Explanation:

Top SQL queries executed

Values:

N/A

sum_rows_examined_top_templates

Array of Table 18 objects

Explanation:

Top rows scanned for all SQL queries

Values:

N/A

avg_cost_top_templates

Array of Table 18 objects

Explanation:

Top average execution durations of all SQL queries

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 18 HealthReportSqlTemplate

Parameter

Type

Description

template_id

String

Explanation:

Template ID

Values:

N/A

template

String

Explanation:

Template content

Values:

N/A

databases

Array of strings

Explanation:

Database list

Values:

N/A

times

Long

Explanation:

Execution times

Values:

N/A

avg_query_time

Double

Explanation:

Average execution duration

Values:

N/A

max_query_time

Double

Explanation:

Maximum execution duration

Values:

N/A

avg_rows_examined

Double

Explanation:

Average rows scanned

Values:

N/A

max_rows_examined

Double

Explanation:

Maximum rows scanned

Values:

N/A

sum_rows_examined

Double

Explanation:

Total rows scanned

Values:

N/A

avg_rows_sent

Double

Explanation:

Average rows returned

Values:

N/A

max_rows_sent

Double

Explanation:

Maximum rows returned

Values:

N/A

Table 19 HealthReportInspectionStat

Parameter

Type

Description

inspection_score

Array of Table 20 objects

Explanation:

Inspection score

Values:

N/A

analyze_success

Boolean

Explanation:

Whether analytical and statistical data is collected

Values:

N/A

error_message

String

Explanation:

Error message

Values:

N/A

Table 20 HealthReportInspectionScore

Parameter

Type

Description

score

Double

Explanation:

Score

Values:

N/A

critical

Integer

Explanation:

Major event

Values:

N/A

medium

Integer

Explanation:

Warning

Values:

N/A

light

Integer

Explanation:

Optimization

Values:

N/A

cpu_usage

Double

Explanation:

CPU usage

Values:

N/A

mem_usage

Double

Explanation:

Memory usage

Values:

N/A

space_usage

Double

Explanation:

Space usage

Values:

N/A

connection_rate

Double

Explanation:

Connection usage

Values:

N/A

iops_usage

Double

Explanation:

IOPS usage

Values:

N/A

thread_running

Double

Explanation:

Active session

Values:

N/A

slow_sql_total

Long

Explanation:

Number of slow query logs

Values:

N/A

lost_points_detail_list

Array of Table 21 objects

Explanation:

Score deduction details

Values:

N/A

Table 21 HealthReportLostPointsDetail

Parameter

Type

Description

metric

String

Explanation:

Score deduction item

Values:

N/A

lost_points

Double

Explanation:

Deducted score

Values:

N/A

risk_level

String

Explanation:

Event level

Values:

N/A

Example Request

Obtaining an instance diagnosis report

GET https://das.cn-north-7.myhuaweicloud.com/v3/052041494800d57c2f02c00275b4c247/instances/bcfa975193f1402fa11a6d4fd6baf5fbin01/get-instance-health-report?task_id=bb252ed0-3d06-489a-a662-6609e054e91c

Example Response

Status code: 200

Successful request

{ 
  "success" : true, 
  "summary_info" : { 
    "analysis_results" : [ { 
      "risk_code" : "SLOW_LOG_ISSUE", 
      "risk_level" : "WARNING", 
      "risk_content": "Slow SQL queries",
      "reasons" : [ { 
        "reason_code" : "SLOW_LOG_EXIST", 
      reason_content": "Slow SQL queries",
        "suggestions" : [ { 
          "suggestion_code" : "ANALYZE_SLOW_LOG", 
           "suggestion_content":"Analyzes slow SQL statements to locate the root cause."
        } ] 
      } ] 
    } ] 
  }, 
  "instance_info" : { 
    "tenant_id" : "05204146e600d48f0f02c002850ec340", 
    "project_id" : "052041494800d57c2f02c00275b4c247", 
    "instance_id" : "bcfa975193f1402fa11a6d4fd6baf5fbin01", 
    "instance_name" : "rds-sql-Do not delete 1.",
    "cpu" : 2, 
    "mem" : 8, 
    "disk_size" : 60, 
    "disk_type" : "CLOUDSSD", 
    "engine" : "mysql", 
    "engine_version" : "5.7" 
  }, 
  "performance_stat" : { 
    "analyze_success" : true, 
    "peak_stats" : [ { 
      "metric" : "qps", 
      "value" : 64.88, 
      "max_value" : 11178, 
      "normalized" : 0.005804258364644837, 
      "stage" : "LIGHT", 
      "timestamp" : 1728756000 
    } ], 
    "ratio_stats" : [ { 
      "metric" : "qps", 
      "max_value" : 11178, 
      "critical_ratio" : 0, 
      "medium_ratio" : 0, 
      "light_ratio" : 1 
    } ] 
  }, 
  "disk_stat" : { 
    "analyze_success" : true, 
    "peak_stats" : [ { 
      "metric" : "iops", 
      "value" : 91.9, 
      "max_value" : 4500, 
      "normalized" : 0.020422222222222224, 
      "stage" : "LIGHT", 
      "timestamp" : 1728750600 
    } ], 
    "ratio_stats" : [ { 
      "metric" : "iops", 
      "max_value" : 4500, 
      "critical_ratio" : 0, 
      "medium_ratio" : 0, 
      "light_ratio" : 1 
    } ] 
  }, 
  "table_space_stat" : { 
    "analyze_success" : true 
  }, 
  "slow_log_stat" : { 
    "analyze_success" : true, 
    "collect_slow_log" : true, 
    "top_execute_slow_logs" : [ { 
      "template_id" : "5B20B6BF446F926F", 
      "template" : "INSERT INTO test123 VALUES (?);", 
      "databases" : [ "test_db" ], 
      "times" : 83, 
      "avg_query_time" : 0.9021538595657752, 
      "max_query_time" : 45.08398997783661, 
      "avg_rows_examined" : 0, 
      "sum_rows_examined" : 0, 
      "avg_rows_sent" : 0 
    } ], 
    "rows_examined_exceeding" : [ ] 
  }, 
  "full_sql_stat" : { 
    "analyze_success" : true, 
    "collect_full_sql" : true, 
    "execute_top_templates" : [ { 
      "template_id" : "B38F825636B24B7", 
      "template" : "CREATE TABLE IF NOT EXISTS table_001 (id int)", 
      "databases" : [ "test_db" ], 
      "times" : 1, 
      "avg_query_time" : 5, 
      "avg_rows_examined" : 0, 
      "sum_rows_examined" : 0 
    } ] 
  }, 
  "inspection_stat" : { 
    "analyze_success" : true, 
    "inspection_score" : [ { 
      "score" : 100, 
      "critical" : 0, 
      "medium" : 0, 
      "light" : 0, 
      "cpu_usage" : 3.93, 
      "mem_usage" : 22.91, 
      "space_usage" : 8.66, 
      "connection_rate" : 0.54, 
      "iops_usage" : 0.28, 
      "thread_running" : 4, 
      "slow_sql_total" : 0, 
      "lost_points_detail_list" : [ { 
        "metric" : "memUsage", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "cpuUsage", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "spaceUsage", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "iopsUsage", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "connectionRate", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "threadRunning", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      }, { 
        "metric" : "slowSqlTotal", 
        "lost_points" : 0, 
        "risk_level" : "NORMAL" 
      } ] 
    } ] 
  } 
}

Status Codes

Status Code

Description

200

Successful request

400

Client error

500

Server error

Error Codes

See Error Codes.