文档首页/ 数据管理服务 DAS/ API参考/ API(公测中)/ 云DBA/ 获取实例健康诊断报告内容
更新时间:2025-05-19 GMT+08:00
分享

获取实例健康诊断报告内容

功能介绍

获取实例健康诊断报告内容。

调试

您可以在API Explorer中调试该接口。

URI

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

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释

租户在某一Region下的项目ID。

获取方法请参见获取项目ID

约束限制:

不涉及。

取值范围:

只能由英文字母、数字组成,且长度为32个字符。

默认取值:

不涉及。

instance_id

String

参数解释:

实例ID。标识实例的唯一标识。

约束限制:

不涉及。

取值范围:

只能由英文字母、数字组成,且长度为32个字符。

默认取值:

不涉及。

表2 Query参数

参数

是否必选

参数类型

描述

task_id

String

参数解释:

任务ID。

约束限制:

不涉及。

取值范围:

不涉及。

默认取值:

不涉及。

请求参数

无。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

success

Boolean

参数解释:

日报诊断是否成功。

取值范围:

不涉及。

start_at

Long

参数解释:

日报诊断区间的起始时间(Unix timestamp),单位:毫秒。

取值范围:

不涉及。

end_at

Long

参数解释:

日报诊断区间的结束时间(Unix timestamp),单位:毫秒。

取值范围:

不涉及。

task_id

String

参数解释:

报告ID。

取值范围:

不涉及。

summary_info

表4 object

参数解释:

日报内容摘要信息

取值范围:

不涉及。

instance_info

表8 object

参数解释:

实例信息列表。

取值范围:

不涉及。

performance_stat

表9 object

参数解释:

性能统计分析列表。

取值范围:

不涉及。

disk_stat

表10 object

参数解释:

磁盘统计分析列表。

取值范围:

不涉及。

table_space_stat

表13 object

参数解释:

表空间统计分析列表。

取值范围:

不涉及。

slow_log_stat

表16 object

参数解释:

慢SQL统计分析列表。

取值范围:

不涉及。

full_sql_stat

表17 object

参数解释:

全量SQL统计分析列表。

取值范围:

不涉及。

inspection_stat

表19 object

参数解释:

巡检评分统计分析列表。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表4 HealthReportSummaryInfo

参数

参数类型

描述

analysis_results

Array of 表5 objects

参数解释:

分析结果列表。

取值范围:

不涉及。

表5 HealthReportAnalysisResult

参数

参数类型

描述

risk_code

String

参数解释:

风险点编码。

取值范围:

不涉及。

risk_level

String

参数解释:

风险点级别。

取值范围:

不涉及。

risk_content

String

参数解释:

风险点内容。

取值范围:

不涉及。

reasons

Array of 表6 objects

参数解释:

可能原因列表。

取值范围:

不涉及。

表6 HealthReportRiskReason

参数

参数类型

描述

reason_code

String

参数解释:

可能原因编码。

取值范围:

不涉及。

reason_content

String

参数解释:

可能原因内容。

取值范围:

不涉及。

suggestions

Array of 表7 objects

参数解释:

建议优化措施列表。

取值范围:

不涉及。

表7 HealthReportRiskSuggestion

参数

参数类型

描述

suggestion_code

String

参数解释:

建议优化措施编码。

取值范围:

不涉及。

suggestion_content

String

参数解释:

建议优化措施。

取值范围:

不涉及。

表8 HealthReportInstanceInfo

参数

参数类型

描述

tenant_id

String

参数解释:

账号ID。

取值范围:

不涉及。

project_id

String

参数解释:

项目ID。

取值范围:

不涉及。

instance_id

String

参数解释:

实例ID。

取值范围:

不涉及。

master_node_id

String

参数解释:

主节点ID。

取值范围:

不涉及。

instance_name

String

参数解释:

实例名称。

取值范围:

不涉及。

cpu

Integer

参数解释:

实例cpu核数。

取值范围:

不涉及。

mem

Integer

参数解释:

实例内存大小。

取值范围:

不涉及。

disk_size

Integer

参数解释:

磁盘大小。

取值范围:

不涉及。

disk_type

String

参数解释:

磁盘类型。

取值范围:

不涉及。

engine

String

参数解释:

实例引擎类型。

取值范围:

不涉及。

engine_version

String

参数解释:

引擎内核版本。

取值范围:

不涉及。

表9 HealthReportPerformanceStat

参数

参数类型

描述

peak_stats

Array of 表11 objects

参数解释:

峰值统计信息列表。

取值范围:

不涉及。

ratio_stats

Array of 表12 objects

参数解释:

比率值数据列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表10 HealthReportDiskStat

参数

参数类型

描述

peak_stats

Array of 表11 objects

参数解释:

峰值统计信息列表。

取值范围:

不涉及。

ratio_stats

Array of 表12 objects

参数解释:

比率值数据列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表11 HealthReportSingleValueStat

参数

参数类型

描述

metric

String

参数解释:

指标名。

取值范围:

不涉及。

value

Double

参数解释:

数值。

取值范围:

不涉及。

max_value

Double

参数解释:

最大值。

取值范围:

不涉及。

normalized

Double

参数解释:

归一化值。

取值范围:

不涉及。

stage

String

参数解释:

当前状态。

取值范围:

不涉及。

timestamp

Long

参数解释:

指标采集时间。

取值范围:

不涉及。

表12 HealthReportRatioStat

参数

参数类型

描述

metric

String

参数解释:

指标名。

取值范围:

不涉及。

max_value

Double

参数解释:

最大值。

取值范围:

不涉及。

critical_ratio

Double

参数解释:

高水位占比。

取值范围:

不涉及。

medium_ratio

Double

参数解释:

中水位占比。

取值范围:

不涉及。

light_ratio

Double

参数解释:

低水位占比。

取值范围:

不涉及。

表13 HealthReportTableSpaceStat

参数

参数类型

描述

size_top

Array of 表14 objects

参数解释:

表大小Top列表。

取值范围:

不涉及。

rows_top

Array of 表14 objects

参数解释:

表行数量Top列表。

取值范围:

不涉及。

size_incr_top

Array of 表15 objects

参数解释:

表大小增长Top列表。

取值范围:

不涉及。

rows_incr_top

Array of 表15 objects

参数解释:

表行数量增长Top列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表14 HealthReportTableSpaceInfo

参数

参数类型

描述

database

String

参数解释:

数据库名。

取值范围:

不涉及。

table

String

参数解释:

表名。

取值范围:

不涉及。

db_engine

String

参数解释:

数据库引擎。

取值范围:

不涉及。

table_size

Long

参数解释:

表大小。

取值范围:

不涉及。

data_size

Long

参数解释:

数据大小。

取值范围:

不涉及。

index_size

Long

参数解释:

索引大小。

取值范围:

不涉及。

rows

Long

参数解释:

行数量。

取值范围:

不涉及。

表15 HealthReportTableSpaceIncrInfo

参数

参数类型

描述

database

String

参数解释:

数据库名。

取值范围:

不涉及。

table

String

参数解释:

表名。

取值范围:

不涉及。

increment

Long

参数解释:

增长量。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表16 HealthReportSlowLogStat

参数

参数类型

描述

collect_slow_log

Boolean

参数解释:

是否收集慢SQL。

取值范围:

不涉及。

top_execute_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top执行次数列表。

取值范围:

不涉及。

top_avg_query_time_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top平均执行时间列表。

取值范围:

不涉及。

top_max_query_time_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top最大执行时间列表。

取值范围:

不涉及。

rows_examined_exceeding

Array of 表18 objects

参数解释:

慢SQL Top扫描返回比列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表17 HealthReportFullSqlStat

参数

参数类型

描述

collect_full_sql

Boolean

参数解释:

是否收集全量SQL。

取值范围:

不涉及。

execute_top_templates

Array of 表18 objects

参数解释:

全量SQL Top总执行次数列表。

取值范围:

不涉及。

sum_rows_examined_top_templates

Array of 表18 objects

参数解释:

全量SQL Top总扫描行数列表。

取值范围:

不涉及。

avg_cost_top_templates

Array of 表18 objects

参数解释:

全量SQL Top平均执行耗时列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表18 HealthReportSqlTemplate

参数

参数类型

描述

template_id

String

参数解释:

模板ID。

取值范围:

不涉及。

template

String

参数解释:

模板内容。

取值范围:

不涉及。

databases

Array of strings

参数解释:

数据库列表。

取值范围:

不涉及。

times

Long

参数解释:

执行次数。

取值范围:

不涉及。

avg_query_time

Double

参数解释:

平均执行时间。

取值范围:

不涉及。

max_query_time

Double

参数解释:

最大执行时间。

取值范围:

不涉及。

avg_rows_examined

Double

参数解释:

平均扫描行数。

取值范围:

不涉及。

max_rows_examined

Double

参数解释:

最大扫描行数。

取值范围:

不涉及。

sum_rows_examined

Double

参数解释:

总扫描行数。

取值范围:

不涉及。

avg_rows_sent

Double

参数解释:

平均返回行数。

取值范围:

不涉及。

max_rows_sent

Double

参数解释:

最大返回行数。

取值范围:

不涉及。

表19 HealthReportInspectionStat

参数

参数类型

描述

inspection_score

Array of 表20 objects

参数解释:

巡检评分。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表20 HealthReportInspectionScore

参数

参数类型

描述

score

Double

参数解释:

得分。

取值范围:

不涉及。

critical

Integer

参数解释:

严重事件。

取值范围:

不涉及。

medium

Integer

参数解释:

警告事件。

取值范围:

不涉及。

light

Integer

参数解释:

优化事件。

取值范围:

不涉及。

cpu_usage

Double

参数解释:

CPU使用率。

取值范围:

不涉及。

mem_usage

Double

参数解释:

内存使用率。

取值范围:

不涉及。

space_usage

Double

参数解释:

空间使用率。

取值范围:

不涉及。

connection_rate

Double

参数解释:

连接使用率。

取值范围:

不涉及。

iops_usage

Double

参数解释:

IOPS使用率。

取值范围:

不涉及。

thread_running

Double

参数解释:

活跃会话。

取值范围:

不涉及。

slow_sql_total

Long

参数解释:

慢SQL数量。

取值范围:

不涉及。

lost_points_detail_list

Array of 表21 objects

参数解释:

扣分详情。

取值范围:

不涉及。

表21 HealthReportLostPointsDetail

参数

参数类型

描述

metric

String

参数解释:

扣分项。

取值范围:

不涉及。

lost_points

Double

参数解释:

所扣分数。

取值范围:

不涉及。

risk_level

String

参数解释:

事件等级。

取值范围:

不涉及。

请求示例

获取实例健康诊断报告内容。

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

响应示例

状态码: 200

Success.

{ 
  "success" : true, 
  "summary_info" : { 
    "analysis_results" : [ { 
      "risk_code" : "SLOW_LOG_ISSUE", 
      "risk_level" : "WARNING", 
      "risk_content" : "慢SQL问题", 
      "reasons" : [ { 
        "reason_code" : "SLOW_LOG_EXIST", 
        "reason_content" : "存在慢SQL", 
        "suggestions" : [ { 
          "suggestion_code" : "ANALYZE_SLOW_LOG", 
          "suggestion_content" : "分析慢SQL查找问题根源" 
        } ] 
      } ] 
    } ] 
  }, 
  "instance_info" : { 
    "tenant_id" : "05204146e600d48f0f02c002850ec340", 
    "project_id" : "052041494800d57c2f02c00275b4c247", 
    "instance_id" : "bcfa975193f1402fa11a6d4fd6baf5fbin01", 
    "instance_name" : "rds-sql-勿删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" 
      } ] 
    } ] 
  } 
}

状态码

状态码

描述

200

Success.

400

Client error.

500

Server error.

错误码

请参见错误码

相关文档