Diag
1:自动诊断产品日志中的报错信息,进行知识库比对,并给出解决方案 \n 2:prometheus 本地数据 api 拉取展示,应对 sm0.2 版本或者无法上报指标的场景 \n
示例
[PROD Orz sa_cluster@hybrid01 Diag]$ go run main.go -h
SRE Auxiliary Tool
Usage:
sreadmin [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
logcheck matching knowledge's error,auto give you answers!
prometheus Get Prometheus Local Data
Flags:
-h, --help help for sreadmin
Use "sreadmin [command] --help" for more information about a command.
1:自动诊断功能
[PROD Orz sa_cluster@hybrid01 Diag]$ go run main.go logcheck -p sdf -h
matching knowledge's error,auto give you answers!
Usage:
sreadmin logcheck -p [production] [flags]
Flags:
-h, --help help for logcheck
-m, --match_rate string matching rate, default 80% (default "80")
-p, --production string production name (default "sdf")
-s, --skip_words string skip the number of different words (default "3")
2:prometheus 本地数据 api 拉取展示
[PROD Orz sa_cluster@hybrid01 Diag]$ go run main.go prometheus -h
Get Prometheus Local Data
Usage:
sreadmin prometheus -b '2021-12-05 08:00:00' -e '2021-12-05 11:11:00' -s 5m [flags]
Flags:
-b, --begin_time string start_time (default "2021-12-02 08:00:00")
-e, --end_time string end_time (default "2021-12-02 10:00:00")
-h, --help help for prometheus
-s, --step string step (default "5m")