openGauss学习笔记-302 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Anomaly-analysis-多指标关联分析302.1 概述302.2 使用指导302.3 获取帮助302.4 命令参考302.5 常见问题处理
Anomaly analysis 多指标关联模块主要基于分析时序数据的Pearson相关系数来发现与已知异常关联性最强的指标。该模块框架解耦,支持的时序数据库包括Prometheus和InfluxDB。
假设指标采集系统运行正常,并且用户已经初始化了配置文件目录confpath,则可以通过下述命令实现本特性的功能:
对于某一指标,在特定节点上,分析其他指标与该指标从timestamps1到timestamps1时间段内的数据的相关性:
gs_dbmind component anomaly_analysis --conf confpath --metric metric_name --start-time timestamps1 --end-time timestamps2 --host ip_address
对于某一指标,在特定节点上,分析其他指标与该指标从timestamps1到timestamps1时间段内的数据的相关性,并将分析结果保存至为csv文件:
gs_dbmind component anomaly_analysis --conf confpath --metric metric_name --start-time timestamps1 --end-time timestamps2 --host ip_address --csv-dump-path csv_path
说明: 在输入anomaly_analysis的参数时,start-time至少要比end-time早30秒以上。
模块命令行说明:
gs_dbmind component anomaly_detection --help
显示如下帮助信息:
usage: anomaly_analysis.py [-h] -c CONF -m METRIC -s START_TIME -e END_TIME -H
HOST [--csv-dump-path CSV_DUMP_PATH]
Workload Anomaly analysis: Anomaly analysis of monitored metric.
optional arguments:
-h, --help show this help message and exit
-c CONF, --conf CONF set the directory of configuration files
-m METRIC, --metric METRIC
set the metric name you want to retrieve
-s START_TIME, --start-time START_TIME
set the start time of for retrieving in ms, supporting
UNIX-timestamp with microsecond or datetime format
-e END_TIME, --end-time END_TIME
set the end time of for retrieving in ms, supporting
UNIX-timestamp with microsecond or datetime format
-H HOST, --host HOST set a host of the metric, ip only or ip and port.
--csv-dump-path CSV_DUMP_PATH
dump the result csv file to the dump path if it is
specified.
表 1 命令行参数说明
分析场景失败,请检查配置文件路径是否正确,且配置文件信息完整。检查指标名称是否准确,检查host地址是否正确,检查起止时间内指标是否存在对应数据。
👍 点赞,你的认可是我创作的动力!
⭐️ 收藏,你的青睐是我努力的方向!
✏️ 评论,你的意见是我进步的财富!
PS:因为公众号平台更改了推送规则,如果不想错过内容,记得读完点一下“在看”,加个“星标”,这样每次新文章推送才会第一时间出现在你的订阅列表里。点“在看”支持我吧!

原文作者:超哥的IT私房菜;如有侵权,请联系管理员删除。