openGauss学习笔记-302 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Anomaly-analysis-多指标关联分析
302.1 概述
Anomaly analysis 多指标关联模块主要基于分析时序数据的Pearson相关系数来发现与已知异常关联性最强的指标。该模块框架解耦,支持的时序数据库包括Prometheus和InfluxDB。
302.2 使用指导
假设指标采集系统运行正常,并且用户已经初始化了配置文件目录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秒以上。
302.3 获取帮助
模块命令行说明:
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.
302.4 命令参考
表 1 命令行参数说明
参数 | 参数说明 | 取值范围 |
---|---|---|
-h, --help | 帮助命令 | - |
-c,--conf | 配置文件目录 | - |
-m,--metric | 指定显示指标名 | - |
-H, --host | 指定数据来源地址信息,通过地址信息进行过滤 | -ip地址或者ip地址加端口号 |
-s, --start-time | 显示开始时间的时间戳,单位毫秒;或日期时间格式为 %Y-%m-%d %H:%M:%S. | 正整数或日期时间格式 |
-e, --end-time | 显示开始时间的时间戳,单位毫秒;或日期时间格式为 %Y-%m-%d %H:%M:%S. | 正整数或日期时间格式 |
--csv-dump-path | 结果导出的csv文件路径 | - |
302.5 常见问题处理
- 分析场景失败,请检查配置文件路径是否正确,且配置文件信息完整。检查指标名称是否准确,检查host地址是否正确,检查起止时间内指标是否存在对应数据。
原文来源于:https://mp.weixin.qq.com/s?__biz=MzkxNzI1OTE3Mw==&mid=2247491538&idx=1&sn=c6ef9c2a60af9cfa67852fa44141fa66&chksm=c1420918f635800ec076187820d63c3e21a10cf5a2d9951ac315a1172da1597a5c1ccf1328d9&token=1998272153&lang=zh_CN#rd
👍 点赞,你的认可是我创作的动力!
⭐️ 收藏,你的青睐是我努力的方向!
✏️ 评论,你的意见是我进步的财富!