diff --git a/.code.yml b/.code.yml index b53d93970a..894d4c84d1 100644 --- a/.code.yml +++ b/.code.yml @@ -1,3 +1,59 @@ +######## Code generated by gonote. DO NOT EDIT. >>>>> + +# [!勿修改模板!] 生成了默认值模板,请根据实际情况调整对应的配置值 +# [!最高优先级!] 本项目的特殊配置,会覆盖命令行输入的参数 +gonote: + split_ch_and_en: false # [选项开关] 修复行注释(//...)中英文词没有空格间隔,但不修复注释块(/*...*/) + without_import: true # [选项开关] 关闭 import 强制分组功能 + no_line_break: false # [选项开关] 关闭过长自动换行功能 + no_complete_general: false # [选项开关] 关闭补全通用注释,默认填充 ServeHTTP/String/Error 等通用注释 + complete_general_config: # 内置了腾讯代码规范中的例外函数,你可以覆盖或添加更多配置 + - pattern: "Run()" + annotation: Command Run + limits: + - type_func + - pattern: "Init()" + annotation: prepare run env + limits: + - type_func + - pattern: "Validate()" + annotation: run selfdefine validate function + limits: + - type_func + - pattern: "Example()" + annotation: subcommand example input + limits: + - type_func + - pattern: "PreCheck()" + annotation: pre run pre check + limits: + - type_func + - pattern: "New.*Command" + annotation: create new subcommand + limits: + - func + - pattern: "Install()" + annotation: install + limits: + - type_func + - func + # - pattern: '(.*)Req' # 匹配该正则所有的关键词 + # annotation: '函数 $1 入参' # 参考 nginx 的 URL 重写 ListReq =正则匹配并解析group=> (List)Req =取出group=> ($1)Req =group替换=> 函数 List 入参 + # limits: + # - func # 函数注释 + # - type_func # 类型函数注释,常见结构体函数 + # - type # 类型,常见结构体注释 + linters: + disable_all: false + enable: + - oversize_func_arg # 函数入参过多,不能超过5个 + - large_file # 超大文件检查,普通<800行,单测<1600行 + - large_func # 超长函数体检查,普通<80行,单测<160行 + - switch_default # switch 需要 default 分支 + - bad_name # 不符合规范的命名 + +######## Code generated by gonote. DO NOT EDIT. <<<<< + source: # 文件或目录使用绝对路径,绝对路径按代码库根目录计算,以/开头。 # 提供产品代码库中编写的测试代码存放目录或文件名格式,以便后续代码统计环节进行排除等特殊处理 @@ -8,10 +64,10 @@ source: filepath_regex: [".*/test.py"] # 提供产品代码库中工具或框架自动生成的且在代码库中的代码,没有可为空。以便后续代码统计环节进行排除等特殊处理。 auto_generate_source: - # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 + # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 filepath_regex: [".*/migrations/.*"] # 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。 # 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空 third_party_source: #第三方代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 - filepath_regex: \ No newline at end of file + filepath_regex: diff --git a/.github/workflows/python_unit_test.yml b/.github/workflows/python_unit_test.yml index 030af30a19..b7251b5332 100644 --- a/.github/workflows/python_unit_test.yml +++ b/.github/workflows/python_unit_test.yml @@ -44,6 +44,7 @@ jobs: source ./dbm-ui/scripts/ci/env.sh export DBA_APP_BK_BIZ_ID=0 export DB_PASSWORD=root + export REPORT_DB_PASSWORD=root export REDIS_HOST="localhost" export REDIS_PORT=6379 export BROKER_URL="redis://localhost:6379/0" diff --git a/dbm-services/bigdata/db-tools/dbactuator/go.mod b/dbm-services/bigdata/db-tools/dbactuator/go.mod index 3405b1145f..8cc8aff466 100644 --- a/dbm-services/bigdata/db-tools/dbactuator/go.mod +++ b/dbm-services/bigdata/db-tools/dbactuator/go.mod @@ -9,6 +9,7 @@ require ( github.com/golang/glog v1.1.1 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 + github.com/shirou/gopsutil/v3 v3.23.8 github.com/spf13/cobra v1.7.0 go.uber.org/zap v1.24.0 gopkg.in/ini.v1 v1.67.0 @@ -18,9 +19,13 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kr/fs v0.1.0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/sys v0.7.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect ) @@ -42,7 +47,6 @@ require ( github.com/pkg/sftp v1.13.5 github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/russross/blackfriday v1.6.0 - github.com/shirou/gopsutil v3.21.11+incompatible go.uber.org/atomic v1.9.0 // indirect go.uber.org/goleak v1.1.12 // indirect go.uber.org/multierr v1.8.0 // indirect diff --git a/dbm-services/bigdata/db-tools/dbactuator/go.sum b/dbm-services/bigdata/db-tools/dbactuator/go.sum index 306bd28377..84e17c3504 100644 --- a/dbm-services/bigdata/db-tools/dbactuator/go.sum +++ b/dbm-services/bigdata/db-tools/dbactuator/go.sum @@ -29,6 +29,9 @@ github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/golang/glog v1.1.1 h1:jxpi2eWoU84wbX9iIEyAeeoac3FLuifZpY9tcNUD9kw= github.com/golang/glog v1.1.1/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= @@ -49,6 +52,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -63,6 +68,8 @@ github.com/pkg/sftp v1.13.5 h1:a3RLUqkyjYRtBTZJZ1VRrKbN3zhuPLlUc3sphVz81go= github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -71,8 +78,10 @@ github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6po github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= +github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -84,11 +93,16 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -120,6 +134,7 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -128,8 +143,9 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -143,6 +159,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/dbm-services/bigdata/db-tools/dbactuator/pkg/util/esutil/es_operate.go b/dbm-services/bigdata/db-tools/dbactuator/pkg/util/esutil/es_operate.go index 2319df7854..0efec1ccfa 100644 --- a/dbm-services/bigdata/db-tools/dbactuator/pkg/util/esutil/es_operate.go +++ b/dbm-services/bigdata/db-tools/dbactuator/pkg/util/esutil/es_operate.go @@ -12,7 +12,7 @@ import ( "dbm-services/bigdata/db-tools/dbactuator/pkg/util/osutil" "dbm-services/common/go-pubpkg/logger" - "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/v3/mem" ) // DiskTypePath TODO diff --git a/dbm-services/bigdata/db-tools/dbactuator/pkg/util/pulsarutil/pulsar_operate.go b/dbm-services/bigdata/db-tools/dbactuator/pkg/util/pulsarutil/pulsar_operate.go index ae879a08b9..14fb4f8271 100644 --- a/dbm-services/bigdata/db-tools/dbactuator/pkg/util/pulsarutil/pulsar_operate.go +++ b/dbm-services/bigdata/db-tools/dbactuator/pkg/util/pulsarutil/pulsar_operate.go @@ -8,7 +8,7 @@ import ( "dbm-services/common/go-pubpkg/logger" "github.com/go-ini/ini" - "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/v3/mem" ) // GetMemSizeInMi TODO diff --git a/dbm-services/common/celery-service/go.mod b/dbm-services/common/celery-service/go.mod index 84834d7376..1e46429099 100644 --- a/dbm-services/common/celery-service/go.mod +++ b/dbm-services/common/celery-service/go.mod @@ -1,17 +1,16 @@ module celery-service -go 1.19 +go 1.21 require ( github.com/alecthomas/kingpin/v2 v2.3.2 github.com/gin-gonic/gin v1.9.1 - github.com/go-playground/validator/v10 v10.14.0 - github.com/google/uuid v1.3.0 + github.com/go-playground/validator/v10 v10.15.4 + github.com/google/uuid v1.3.1 github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 - golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 gopkg.in/natefinch/lumberjack.v2 v2.2.1 - gopkg.in/yaml.v2 v2.2.2 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/dbm-services/common/celery-service/go.sum b/dbm-services/common/celery-service/go.sum index 28cf160eec..f07a9c7405 100644 --- a/dbm-services/common/celery-service/go.sum +++ b/dbm-services/common/celery-service/go.sum @@ -18,20 +18,21 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -77,8 +78,6 @@ golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 h1:/yRP+0AN7mf5DkD3BAI6TOFnd51gEoDEb8o35jIFtgw= -golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -87,6 +86,7 @@ golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= @@ -95,8 +95,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/dbm-services/common/celery-service/pkg/handler/async_query_status.go b/dbm-services/common/celery-service/pkg/handler/async_query_status.go index 7db7d6ae35..21fd43d5da 100644 --- a/dbm-services/common/celery-service/pkg/handler/async_query_status.go +++ b/dbm-services/common/celery-service/pkg/handler/async_query_status.go @@ -3,10 +3,10 @@ package handler import ( "fmt" "io" + "log/slog" "net/http" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" "celery-service/pkg/asyncsession" ) @@ -20,7 +20,7 @@ func HandleAsyncQuery(engine *gin.Engine) { } if err := ctx.ShouldBindJSON(&postArg); err != nil && err != io.EOF { - logger.Error("bind post args", slog.Any("error", err)) + logger.Error("bind post args", slog.String("error", err.Error())) ctx.JSON( http.StatusBadRequest, gin.H{ diff --git a/dbm-services/common/celery-service/pkg/handler/externalhandler/execute.go b/dbm-services/common/celery-service/pkg/handler/externalhandler/execute.go index 3bbc7b37ce..ae59eb8d57 100644 --- a/dbm-services/common/celery-service/pkg/handler/externalhandler/execute.go +++ b/dbm-services/common/celery-service/pkg/handler/externalhandler/execute.go @@ -1,8 +1,9 @@ package externalhandler import ( + "log/slog" + "github.com/pkg/errors" - "golang.org/x/exp/slog" ) func (h *Handler) execute() (string, error) { diff --git a/dbm-services/common/celery-service/pkg/handler/externalhandler/external_item.go b/dbm-services/common/celery-service/pkg/handler/externalhandler/external_item.go index 76e5d02098..e57085abad 100644 --- a/dbm-services/common/celery-service/pkg/handler/externalhandler/external_item.go +++ b/dbm-services/common/celery-service/pkg/handler/externalhandler/external_item.go @@ -2,13 +2,13 @@ package externalhandler import ( "fmt" + "log/slog" "os" "path/filepath" "strings" "github.com/go-playground/validator/v10" "github.com/pkg/errors" - "golang.org/x/exp/slog" "gopkg.in/yaml.v2" "celery-service/pkg/config" diff --git a/dbm-services/common/celery-service/pkg/handler/externalhandler/impl_ihandler.go b/dbm-services/common/celery-service/pkg/handler/externalhandler/impl_ihandler.go index 6a37763728..d104dca410 100644 --- a/dbm-services/common/celery-service/pkg/handler/externalhandler/impl_ihandler.go +++ b/dbm-services/common/celery-service/pkg/handler/externalhandler/impl_ihandler.go @@ -3,11 +3,10 @@ package externalhandler import ( "context" "encoding/json" + "log/slog" "os/exec" "strings" - "golang.org/x/exp/slog" - "celery-service/pkg/log" ) diff --git a/dbm-services/common/celery-service/pkg/handler/externalhandler/init.go b/dbm-services/common/celery-service/pkg/handler/externalhandler/init.go index 00283088c0..2c828d3917 100644 --- a/dbm-services/common/celery-service/pkg/handler/externalhandler/init.go +++ b/dbm-services/common/celery-service/pkg/handler/externalhandler/init.go @@ -1,7 +1,7 @@ package externalhandler import ( - "golang.org/x/exp/slog" + "log/slog" "celery-service/pkg/log" ) diff --git a/dbm-services/common/celery-service/pkg/handler/externalhandler/output_stream.go b/dbm-services/common/celery-service/pkg/handler/externalhandler/output_stream.go index 045261375f..ca801bcfec 100644 --- a/dbm-services/common/celery-service/pkg/handler/externalhandler/output_stream.go +++ b/dbm-services/common/celery-service/pkg/handler/externalhandler/output_stream.go @@ -3,8 +3,7 @@ package externalhandler import ( "bufio" "io" - - "golang.org/x/exp/slog" + "log/slog" ) func (h *Handler) setupOutputStream() error { diff --git a/dbm-services/common/celery-service/pkg/handler/init.go b/dbm-services/common/celery-service/pkg/handler/init.go index e9a3e2ab52..64db601b92 100644 --- a/dbm-services/common/celery-service/pkg/handler/init.go +++ b/dbm-services/common/celery-service/pkg/handler/init.go @@ -3,10 +3,10 @@ package handler import ( "context" "encoding/json" + "log/slog" + "slices" "github.com/pkg/errors" - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" "celery-service/pkg/handler/externalhandler" "celery-service/pkg/handler/internalhandler" diff --git a/dbm-services/common/celery-service/pkg/handler/internalhandler/democounter/counter.go b/dbm-services/common/celery-service/pkg/handler/internalhandler/democounter/counter.go index b04ff5d7a5..a605cb74dd 100644 --- a/dbm-services/common/celery-service/pkg/handler/internalhandler/democounter/counter.go +++ b/dbm-services/common/celery-service/pkg/handler/internalhandler/democounter/counter.go @@ -3,10 +3,10 @@ package democounter import ( "context" "encoding/json" + "log/slog" "time" "github.com/pkg/errors" - "golang.org/x/exp/slog" "celery-service/pkg/config" "celery-service/pkg/log" diff --git a/dbm-services/common/celery-service/pkg/handler/ping.go b/dbm-services/common/celery-service/pkg/handler/ping.go new file mode 100644 index 0000000000..4b3a7aa26e --- /dev/null +++ b/dbm-services/common/celery-service/pkg/handler/ping.go @@ -0,0 +1,15 @@ +package handler + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func HandlePing(engine *gin.Engine) { + engine.GET("ping", + func(ctx *gin.Context) { + ctx.String(http.StatusOK, "pong") + return + }) +} diff --git a/dbm-services/common/celery-service/pkg/log/init.go b/dbm-services/common/celery-service/pkg/log/init.go index 3d62ff4bc9..ced4c2416a 100644 --- a/dbm-services/common/celery-service/pkg/log/init.go +++ b/dbm-services/common/celery-service/pkg/log/init.go @@ -3,11 +3,11 @@ package log import ( "fmt" "io" + "log/slog" "os" "path/filepath" "github.com/iancoleman/strcase" - "golang.org/x/exp/slog" "gopkg.in/natefinch/lumberjack.v2" "celery-service/pkg/config" diff --git a/dbm-services/common/celery-service/pkg/service/init.go b/dbm-services/common/celery-service/pkg/service/init.go index 0c68708945..6fab870022 100644 --- a/dbm-services/common/celery-service/pkg/service/init.go +++ b/dbm-services/common/celery-service/pkg/service/init.go @@ -3,10 +3,10 @@ package service import ( "bytes" "io" + "log/slog" "time" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" "celery-service/pkg/handler" "celery-service/pkg/log" @@ -50,6 +50,7 @@ func Init() error { handler.HandleAsyncQuery(r) handler.HandleList(r) handler.HandleDiscovery(r) + handler.HandlePing(r) for _, rt := range r.Routes() { logger.Info( diff --git a/dbm-services/common/celery-service/pkg/service/start.go b/dbm-services/common/celery-service/pkg/service/start.go index 8567e014cc..c1c38f7b99 100644 --- a/dbm-services/common/celery-service/pkg/service/start.go +++ b/dbm-services/common/celery-service/pkg/service/start.go @@ -1,10 +1,9 @@ package service import ( + "log/slog" "time" - "golang.org/x/exp/slog" - "celery-service/pkg/asyncsession" ) diff --git a/dbm-services/common/db-config/Dockerfile b/dbm-services/common/db-config/Dockerfile index e87e32ff19..8f7664e48a 100644 --- a/dbm-services/common/db-config/Dockerfile +++ b/dbm-services/common/db-config/Dockerfile @@ -5,6 +5,7 @@ RUN echo "Asia/Shanghai" > /etc/timezone ADD conf /conf/ ADD bkconfigsvr / +ADD bkconfigcli / WORKDIR / CMD /bkconfigsvr \ No newline at end of file diff --git a/dbm-services/common/db-config/Makefile b/dbm-services/common/db-config/Makefile index dc932ad1b7..1c90f09d1a 100644 --- a/dbm-services/common/db-config/Makefile +++ b/dbm-services/common/db-config/Makefile @@ -17,9 +17,16 @@ CMD_HOME = bk-dbconfig/cmd/ all: build api: go build -o ./${SRV_NAME_CMD} -v ${CMD_HOME}/${SRV_NAME_CMD} + go build -o ./${CLI_NAME_CMD} -v ${CMD_HOME}/${CLI_NAME_CMD} + +client: + CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o ./$(CLI_NAME_CMD) -v ${CMD_HOME}/${CLI_NAME_CMD} +server: + CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o ./$(SRV_NAME_CMD) -v ${CMD_HOME}/${SRV_NAME_CMD} build:clean CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o ./$(SRV_NAME_CMD) -v ${CMD_HOME}/${SRV_NAME_CMD} + CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o ./$(CLI_NAME_CMD) -v ${CMD_HOME}/${CLI_NAME_CMD} publish:build docker build --build-arg SRV_NAME=$(SRV_NAME) --rm -t $(SRV_NAME):$(CURRENT_VERSION) . diff --git a/dbm-services/common/db-config/assets/migrations/000011_es_data.up.sql b/dbm-services/common/db-config/assets/migrations/000011_es_data.up.sql index 32b2f7ad09..8e92716c1a 100644 --- a/dbm-services/common/db-config/assets/migrations/000011_es_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000011_es_data.up.sql @@ -25,6 +25,7 @@ -- WHERE: namespace='es' INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (74,'es','dbconf','7.10.2','elasticsearch.yml配置','ES-7.10','plat,app,cluster','cluster',1,1,0,NULL,5,365,0,'es配置文件','2022-09-05 17:00:13','2023-06-30 17:27:03',''); +INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (264,'es','dbconf','7.14.2','elasticsearch.yml配置','ES-7.14.2','plat,app,cluster','cluster',1,1,0,NULL,5,365,0,'es配置文件','2022-09-05 17:00:13','2023-06-30 17:27:03',''); /*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; /*!50112 PREPARE s FROM @disable_bulk_load */; /*!50112 EXECUTE s */; @@ -91,6 +92,35 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12413,'es','dbconf','7.10.2','username','STRING','{{username}}',NULL,'',0,0,0,0,1,'{{username}}',NULL,NULL,-1,NULL,'es配置','2022-10-25 10:21:35','2022-11-18 11:30:10',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (8848,'es','dbconf','7.10.2','xpack.monitoring.collection.enabled','STRING','false','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (8839,'es','dbconf','7.10.2','xpack.security.enabled','STRING','false','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18005,'es','dbconf','7.14.2','bootstrap.memory_lock','STRING','true','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18006,'es','dbconf','7.14.2','bootstrap.system_call_filter','STRING','false','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18007,'es','dbconf','7.14.2','cluster.initial_master_nodes','STRING','{{master_nodename}}',NULL,'',2,0,0,0,1,'{{master_nodename}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18008,'es','dbconf','7.14.2','cluster.name','STRING','{{cluster_name}}',NULL,'',2,0,0,0,1,'{{cluster_name}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 17:24:58','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18009,'es','dbconf','7.14.2','cluster.routing.allocation.same_shard.host','STRING','true','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:42','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18010,'es','dbconf','7.14.2','discovery.seed_hosts','STRING','{{master_ip}}',NULL,'',2,0,0,0,1,'{{master_ip}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18011,'es','dbconf','7.14.2','http.max_content_length','STRING','2048mb',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18012,'es','dbconf','7.14.2','http.port','INT','9200',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18014,'es','dbconf','7.14.2','indices.recovery.max_bytes_per_sec','STRING','200mb',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18015,'es','dbconf','7.14.2','network.host','STRING','{{host}}',NULL,'',2,0,0,0,1,'{{host}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18016,'es','dbconf','7.14.2','network.publish_host','STRING','{{host}}',NULL,'',2,0,0,0,1,'{{host}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18017,'es','dbconf','7.14.2','node.attr.rack_id','INT','1',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18018,'es','dbconf','7.14.2','node.attr.tag','STRING','hot','hot | cold','ENUM',1,0,0,0,1,'hot',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18019,'es','dbconf','7.14.2','node.data','STRING','{{isdata}}',NULL,'',2,0,0,0,1,'{{isdata}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18020,'es','dbconf','7.14.2','node.ingest','STRING','true','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18021,'es','dbconf','7.14.2','node.master','STRING','{{ismaster}}',NULL,'',2,0,0,0,1,'{{ismaster}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18022,'es','dbconf','7.14.2','node.ml','STRING','true','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18023,'es','dbconf','7.14.2','node.name','STRING','{{node_name}}',NULL,'',2,0,0,0,1,'{{node_name}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:31','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18024,'es','dbconf','7.14.2','password','STRING','{{password}}',NULL,'',0,0,0,1,1,'{{password}}',NULL,NULL,-1,NULL,'es配置','2022-10-25 10:21:35','2023-03-22 18:11:33',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18025,'es','dbconf','7.14.2','path_data','STRING','/data/esdata','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','数据路径','2023-03-30 08:33:44','2023-03-30 08:33:44',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18026,'es','dbconf','7.14.2','path_log','STRING','/data/eslog','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','日志路径','2023-03-30 08:35:33','2023-03-30 08:35:33',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18027,'es','dbconf','7.14.2','processors','STRING','{{processors}}',NULL,'',2,0,0,0,1,'{{processors}}',NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2023-04-17 17:10:41',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18028,'es','dbconf','7.14.2','search.default_search_timeout','STRING','60s',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18029,'es','dbconf','7.14.2','superpassword','STRING','{{superpassword}}',NULL,'',0,0,0,1,1,'{{superpassword}}',NULL,NULL,-1,NULL,'es配置','2022-10-25 10:23:49','2023-03-22 18:11:36',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18030,'es','dbconf','7.14.2','superuser','STRING','{{superuser}}',NULL,'',0,0,0,0,1,'{{superuser}}',NULL,NULL,-1,NULL,'es配置','2022-10-25 10:23:49','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18031,'es','dbconf','7.14.2','thread_pool.write.queue_size','STRING','1000',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18033,'es','dbconf','7.14.2','username','STRING','{{username}}',NULL,'',0,0,0,0,1,'{{username}}',NULL,NULL,-1,NULL,'es配置','2022-10-25 10:21:35','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18034,'es','dbconf','7.14.2','xpack.monitoring.collection.enabled','STRING','false','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18035,'es','dbconf','7.14.2','xpack.security.enabled','STRING','false','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'es配置','2022-09-05 21:31:41','2022-11-18 11:30:10',0); /*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; /*!50112 PREPARE s FROM @disable_bulk_load */; /*!50112 EXECUTE s */; diff --git a/dbm-services/common/db-config/assets/migrations/000013_kafka_data.up.sql b/dbm-services/common/db-config/assets/migrations/000013_kafka_data.up.sql index 86dfeb94da..e1bc3472bb 100644 --- a/dbm-services/common/db-config/assets/migrations/000013_kafka_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000013_kafka_data.up.sql @@ -24,6 +24,7 @@ -- -- WHERE: namespace='kafka' +INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (265,'kafka','dbconf','0.10.2','kafka配置','kafka-0.10.2','plat,app,cluster','cluster',1,1,0,NULL,5,365,0,'kafka配置文件','2022-09-20 15:17:36','2023-06-30 17:27:00',''); INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (84,'kafka','dbconf','2.4.0','kafka配置','kafka-2.4','plat,app,cluster','cluster',1,1,0,NULL,5,365,0,'kafka配置文件','2022-09-20 15:17:36','2023-06-30 17:27:00',''); /*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; /*!50112 PREPARE s FROM @disable_bulk_load */; @@ -62,6 +63,16 @@ INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` -- -- WHERE: namespace='kafka' AND (flag_encrypt!=1 or value_default like '{{%') +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18037,'kafka','dbconf','0.10.2','adminUser','STRING','kafka','NULL','',1,0,0,0,1,'kafka','NULL',NULL,-1,NULL,'kafka配置','2022-09-20 15:28:01','2022-11-18 11:30:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18038,'kafka','dbconf','0.10.2','factor','STRING','3','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-11-24 11:46:20','2022-11-24 11:46:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18039,'kafka','dbconf','0.10.2','jmx_port','INT','9999',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'kafka配置','2023-03-06 01:12:50','2023-03-06 11:27:24',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18040,'kafka','dbconf','0.10.2','no_security','INT','0','NULL','',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'默认0,表示开启鉴权','2023-08-31 16:21:47','2023-09-04 15:38:49',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18041,'kafka','dbconf','0.10.2','partition_num','STRING','1','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-10-10 15:54:23','2022-11-18 11:30:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18043,'kafka','dbconf','0.10.2','port','STRING','9092','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-10-08 15:26:51','2022-11-18 11:30:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18044,'kafka','dbconf','0.10.2','replication_num','STRING','1','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-10-10 15:54:23','2022-11-18 11:30:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18045,'kafka','dbconf','0.10.2','retention_hours','STRING','1','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-10-10 15:54:23','2022-11-18 11:30:20',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18046,'kafka','dbconf','0.10.2','username','STRING','kafka','NULL','',1,0,0,0,1,NULL,'NULL','NULL',-1,'NULL','kafka配置','2022-12-01 11:01:43','2022-12-01 11:01:43',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18047,'kafka','dbconf','0.10.2','zookeeper_conf','STRING','1','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-11-14 17:41:55','2022-11-18 11:30:20',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (8891,'kafka','dbconf','2.4.0','adminUser','STRING','kafka','NULL','',1,0,0,0,1,'kafka','NULL',NULL,-1,NULL,'kafka配置','2022-09-20 15:28:01','2022-11-18 11:30:20',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12972,'kafka','dbconf','2.4.0','factor','STRING','3','NULL','',1,0,0,0,1,'NULL','NULL','NULL',-1,'NULL','kafka配置','2022-11-24 11:46:20','2022-11-24 11:46:20',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14105,'kafka','dbconf','2.4.0','jmx_port','INT','9999',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,'kafka配置','2023-03-06 01:12:50','2023-03-06 11:27:24',0); diff --git a/dbm-services/common/db-config/assets/migrations/000018_tendb_data.up.sql b/dbm-services/common/db-config/assets/migrations/000018_tendb_data.up.sql index ea63851061..886287d2b7 100644 --- a/dbm-services/common/db-config/assets/migrations/000018_tendb_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000018_tendb_data.up.sql @@ -74,31 +74,34 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (8864,'tendb','init_user','mysql#user','yw_user','STRING','yw','','STRING',1,0,1,0,0,NULL,'','',-1,NULL,'','2022-05-23 15:54:15','2022-09-19 13:16:16',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (8860,'tendb','init_user','proxy#user','proxy_admin_user','STRING','proxy','','STRING',1,0,1,0,0,NULL,'','',-1,NULL,'','2022-05-23 15:54:15','2023-03-24 17:30:13',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15825,'tendb','init_user','spider#user','tdbctl_user','STRING','tdbctl','','STRING',1,0,1,0,0,NULL,'','',-1,NULL,'','2023-03-09 17:36:33','2023-03-24 17:30:47',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16571,'tendb','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16594,'tendb','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16575,'tendb','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16576,'tendb','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"schedule\":\"0 0 16 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16577,'tendb','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16578,'tendb','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"master\",\"repeater\",\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-07-28 14:29:33',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16579,'tendb','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16582,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"schedule\":\"0 40 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16581,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"schedule\":\"0 30 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16580,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16584,'tendb','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16583,'tendb','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16589,'tendb','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16588,'tendb','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16590,'tendb','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16591,'tendb','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16592,'tendb','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"schedule\":\"0 55 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16572,'tendb','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16593,'tendb','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"slave\",\"repeater\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16587,'tendb','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16585,'tendb','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16586,'tendb','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16595,'tendb','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16574,'tendb','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16573,'tendb','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:19:36','2023-06-30 17:19:36',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18133,'tendb','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"name\":\"character-consistency\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18156,'tendb','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"name\":\"ctl-replicate\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18159,'tendb','mysql_monitor','items-config.yaml','dbha-heartbeat','STRING','{\"enable\":true,\"name\":\"dbha-heartbeat\",\"role\":[],\"machine_type\":[\"spider\",\"remote\",\"backend\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18137,'tendb','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"name\":\"engine\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18138,'tendb','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"name\":\"ext3-check\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 16 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18139,'tendb','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"name\":\"ibd-statistic\",\"role\":[\"slave\"],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18140,'tendb','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"name\":\"master-slave-heartbeat\",\"role\":[\"master\",\"repeater\",\"slave\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18141,'tendb','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"name\":\"mysql-config-diff\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18144,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"name\":\"mysql-connlog-report\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 40 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18143,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"name\":\"mysql-connlog-rotate\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 30 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18142,'tendb','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"name\":\"mysql-connlog-size\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18146,'tendb','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"name\":\"mysql-err-critical\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18145,'tendb','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"name\":\"mysql-err-notice\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18151,'tendb','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"name\":\"mysql-inject\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18150,'tendb','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"name\":\"mysql-lock\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18152,'tendb','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"name\":\"proxy-backend\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18153,'tendb','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"name\":\"proxy-user-list\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18154,'tendb','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"name\":\"rotate-slowlog\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 55 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18134,'tendb','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"name\":\"routine-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18155,'tendb','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"name\":\"slave-status\",\"role\":[\"slave\",\"repeater\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18149,'tendb','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"name\":\"spider-err-critical\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18147,'tendb','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"name\":\"spider-err-notice\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18148,'tendb','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"name\":\"spider-err-warn\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18157,'tendb','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"name\":\"spider-remote\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18158,'tendb','mysql_monitor','items-config.yaml','spider-table-schema-consistency','STRING','{\"enable\":true,\"name\":\"spider-table-schema-consistency\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"0 10 1 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18136,'tendb','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"name\":\"trigger-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18160,'tendb','mysql_monitor','items-config.yaml','unique-ctl-master','STRING','{\"enable\":true,\"name\":\"unique-ctl-master\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18135,'tendb','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"name\":\"view-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:19:04','2023-10-10 15:19:04',0); /*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; /*!50112 PREPARE s FROM @disable_bulk_load */; /*!50112 EXECUTE s */; diff --git a/dbm-services/common/db-config/assets/migrations/000019_tendbcluster_data.up.sql b/dbm-services/common/db-config/assets/migrations/000019_tendbcluster_data.up.sql index c30fe3ef18..b3c3ea4c81 100644 --- a/dbm-services/common/db-config/assets/migrations/000019_tendbcluster_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000019_tendbcluster_data.up.sql @@ -103,6 +103,8 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14164,'tendbcluster','backup','dbbackup.ini','LogicalBackup.FlushRetryCount','INT','3','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2023-03-09 17:36:33','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14168,'tendbcluster','backup','dbbackup.ini','LogicalBackup.Regex','STRING','{{.LogicalBackup.Regex}}','','STRING',2,0,0,0,0,NULL,'','',-1,NULL,'','2023-03-09 17:36:33','2023-04-17 17:10:41',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16359,'tendbcluster','backup','dbbackup.ini','LogicalBackup.Threads','INT','4','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:42:40',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17761,'tendbcluster','backup','dbbackup.ini','LogicalLoad.CreateTableIfNotExists','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17764,'tendbcluster','backup','dbbackup.ini','LogicalLoad.DBListDropIfExists','STRING','','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-09-07 21:05:47',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16349,'tendbcluster','backup','dbbackup.ini','LogicalLoad.EnableBinlog','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16357,'tendbcluster','backup','dbbackup.ini','LogicalLoad.ExtraOpt','STRING','','','',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:46:16',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14170,'tendbcluster','backup','dbbackup.ini','LogicalLoad.IndexFilePath','STRING','/data/dbbak/xxxxx','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2023-03-09 17:36:33','2023-03-22 12:23:33',0); @@ -1607,31 +1609,34 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16289,'tendbcluster','deploy','deploy_info','spider_version','STRING','Spider-3','Spider-3 | Spider-1','ENUM',1,0,0,0,1,NULL,NULL,'容灾级别',-1,NULL,NULL,'2023-03-09 17:36:33','2023-05-22 17:04:31',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15066,'tendbcluster','deploy','deploy_info','storage_engine','STRING','InnoDB','InnoDB','',1,0,0,0,1,NULL,NULL,'存储引擎',-1,NULL,NULL,'2023-03-09 17:36:33','2023-03-09 17:36:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15067,'tendbcluster','deploy','deploy_info','tolerance_level','STRING','compus','idc|compus|city','ENUM',-1,0,0,0,1,NULL,NULL,'容灾级别',-1,NULL,NULL,'2023-03-09 17:36:33','2023-03-09 17:36:33',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16721,'tendbcluster','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16744,'tendbcluster','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16725,'tendbcluster','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16726,'tendbcluster','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"schedule\":\"0 0 16 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16727,'tendbcluster','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16728,'tendbcluster','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"master\",\"repeater\",\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-07-28 14:29:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16729,'tendbcluster','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16732,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"schedule\":\"0 40 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16731,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"schedule\":\"0 30 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16730,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16734,'tendbcluster','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16733,'tendbcluster','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16739,'tendbcluster','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16738,'tendbcluster','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16740,'tendbcluster','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16741,'tendbcluster','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16742,'tendbcluster','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"schedule\":\"0 55 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16722,'tendbcluster','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16743,'tendbcluster','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"slave\",\"repeater\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16737,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16735,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16736,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16745,'tendbcluster','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16724,'tendbcluster','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16723,'tendbcluster','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18049,'tendbcluster','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"name\":\"character-consistency\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18072,'tendbcluster','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"name\":\"ctl-replicate\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18075,'tendbcluster','mysql_monitor','items-config.yaml','dbha-heartbeat','STRING','{\"enable\":true,\"name\":\"dbha-heartbeat\",\"role\":[],\"machine_type\":[\"spider\",\"remote\",\"backend\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18053,'tendbcluster','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"name\":\"engine\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18054,'tendbcluster','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"name\":\"ext3-check\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 16 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18055,'tendbcluster','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"name\":\"ibd-statistic\",\"role\":[\"slave\"],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18056,'tendbcluster','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"name\":\"master-slave-heartbeat\",\"role\":[\"master\",\"repeater\",\"slave\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18057,'tendbcluster','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"name\":\"mysql-config-diff\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18060,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"name\":\"mysql-connlog-report\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 40 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18059,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"name\":\"mysql-connlog-rotate\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 30 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18058,'tendbcluster','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"name\":\"mysql-connlog-size\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18062,'tendbcluster','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"name\":\"mysql-err-critical\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18061,'tendbcluster','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"name\":\"mysql-err-notice\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18067,'tendbcluster','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"name\":\"mysql-inject\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18066,'tendbcluster','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"name\":\"mysql-lock\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18068,'tendbcluster','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"name\":\"proxy-backend\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18069,'tendbcluster','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"name\":\"proxy-user-list\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18070,'tendbcluster','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"name\":\"rotate-slowlog\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 55 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18050,'tendbcluster','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"name\":\"routine-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18071,'tendbcluster','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"name\":\"slave-status\",\"role\":[\"slave\",\"repeater\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18065,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"name\":\"spider-err-critical\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18063,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"name\":\"spider-err-notice\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18064,'tendbcluster','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"name\":\"spider-err-warn\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18073,'tendbcluster','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"name\":\"spider-remote\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18074,'tendbcluster','mysql_monitor','items-config.yaml','spider-table-schema-consistency','STRING','{\"enable\":true,\"name\":\"spider-table-schema-consistency\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"0 10 1 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18052,'tendbcluster','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"name\":\"trigger-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18076,'tendbcluster','mysql_monitor','items-config.yaml','unique-ctl-master','STRING','{\"enable\":true,\"name\":\"unique-ctl-master\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18051,'tendbcluster','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"name\":\"view-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:31','2023-10-10 15:18:31',0); /*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; /*!50112 PREPARE s FROM @disable_bulk_load */; /*!50112 EXECUTE s */; diff --git a/dbm-services/common/db-config/assets/migrations/000020_tendbha_data.up.sql b/dbm-services/common/db-config/assets/migrations/000020_tendbha_data.up.sql index 57916402a8..e1513c61fc 100644 --- a/dbm-services/common/db-config/assets/migrations/000020_tendbha_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000020_tendbha_data.up.sql @@ -105,6 +105,8 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13009,'tendbha','backup','dbbackup.ini','LogicalBackup.FlushRetryCount','INT','3','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13007,'tendbha','backup','dbbackup.ini','LogicalBackup.Regex','STRING','{{.LogicalBackup.Regex}}','','STRING',2,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-04-17 17:10:41',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13008,'tendbha','backup','dbbackup.ini','LogicalBackup.Threads','INT','4','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:42:40',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17762,'tendbha','backup','dbbackup.ini','LogicalLoad.CreateTableIfNotExists','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17765,'tendbha','backup','dbbackup.ini','LogicalLoad.DBListDropIfExists','STRING','','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-09-07 21:05:51',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13020,'tendbha','backup','dbbackup.ini','LogicalLoad.EnableBinlog','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16321,'tendbha','backup','dbbackup.ini','LogicalLoad.ExtraOpt','STRING','','','',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:46:16',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13157,'tendbha','backup','dbbackup.ini','LogicalLoad.IndexFilePath','STRING','/data/dbbak/xxxxx','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); @@ -999,31 +1001,34 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (467,'tendbha','deploy','deploy_info','db_version','STRING','MySQL-5.7','MySQL-5.5 | MySQL-5.6 | MySQL-5.7 | MySQL-8.0','ENUM',1,0,0,0,1,NULL,NULL,'DB版本',-1,NULL,NULL,'2022-04-25 10:00:47','2022-09-13 17:28:25',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (468,'tendbha','deploy','deploy_info','storage_engine','STRING','InnoDB','InnoDB','',1,0,0,0,1,NULL,NULL,'存储引擎',-1,NULL,NULL,'2022-04-25 10:00:47','2022-09-13 15:03:55',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (470,'tendbha','deploy','deploy_info','tolerance_level','STRING','compus','idc|compus|city','ENUM',-1,0,0,0,1,NULL,NULL,'容灾级别',-1,NULL,NULL,'2022-04-25 10:00:47','2022-10-20 12:26:09',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16671,'tendbha','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16694,'tendbha','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16675,'tendbha','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16676,'tendbha','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"schedule\":\"0 0 16 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16677,'tendbha','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16678,'tendbha','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"master\",\"repeater\",\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-07-28 14:29:22',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16679,'tendbha','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16682,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"schedule\":\"0 40 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16681,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"schedule\":\"0 30 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16680,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16684,'tendbha','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16683,'tendbha','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16689,'tendbha','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16688,'tendbha','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16690,'tendbha','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16691,'tendbha','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16692,'tendbha','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"schedule\":\"0 55 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16672,'tendbha','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16693,'tendbha','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"slave\",\"repeater\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16687,'tendbha','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16685,'tendbha','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16686,'tendbha','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16695,'tendbha','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16674,'tendbha','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16673,'tendbha','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18105,'tendbha','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"name\":\"character-consistency\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18128,'tendbha','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"name\":\"ctl-replicate\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18131,'tendbha','mysql_monitor','items-config.yaml','dbha-heartbeat','STRING','{\"enable\":true,\"name\":\"dbha-heartbeat\",\"role\":[],\"machine_type\":[\"spider\",\"remote\",\"backend\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18109,'tendbha','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"name\":\"engine\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18110,'tendbha','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"name\":\"ext3-check\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 16 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18111,'tendbha','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"name\":\"ibd-statistic\",\"role\":[\"slave\"],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18112,'tendbha','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"name\":\"master-slave-heartbeat\",\"role\":[\"master\",\"repeater\",\"slave\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18113,'tendbha','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"name\":\"mysql-config-diff\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18116,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"name\":\"mysql-connlog-report\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 40 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18115,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"name\":\"mysql-connlog-rotate\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 30 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18114,'tendbha','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"name\":\"mysql-connlog-size\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18118,'tendbha','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"name\":\"mysql-err-critical\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18117,'tendbha','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"name\":\"mysql-err-notice\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18123,'tendbha','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"name\":\"mysql-inject\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18122,'tendbha','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"name\":\"mysql-lock\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18124,'tendbha','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"name\":\"proxy-backend\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18125,'tendbha','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"name\":\"proxy-user-list\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18126,'tendbha','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"name\":\"rotate-slowlog\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 55 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18106,'tendbha','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"name\":\"routine-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18127,'tendbha','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"name\":\"slave-status\",\"role\":[\"slave\",\"repeater\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18121,'tendbha','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"name\":\"spider-err-critical\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18119,'tendbha','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"name\":\"spider-err-notice\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18120,'tendbha','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"name\":\"spider-err-warn\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18129,'tendbha','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"name\":\"spider-remote\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18130,'tendbha','mysql_monitor','items-config.yaml','spider-table-schema-consistency','STRING','{\"enable\":true,\"name\":\"spider-table-schema-consistency\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"0 10 1 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18108,'tendbha','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"name\":\"trigger-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18132,'tendbha','mysql_monitor','items-config.yaml','unique-ctl-master','STRING','{\"enable\":true,\"name\":\"unique-ctl-master\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18107,'tendbha','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"name\":\"view-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:55','2023-10-10 15:18:55',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (715,'tendbha','proxyconf','default','conn_log','STRING','true','true|false','ENUM',1,0,1,0,0,NULL,'','',-1,NULL,'','2022-05-23 15:51:24','2022-05-23 15:55:10',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (716,'tendbha','proxyconf','default','daemon','STRING','true','true|false','ENUM',1,0,1,0,0,NULL,'','',-1,NULL,'','2022-05-23 15:51:24','2022-05-23 15:55:10',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (719,'tendbha','proxyconf','default','event-threads','INT','7','[1,10]','RANGE',1,0,1,0,0,NULL,'','',-1,NULL,'','2022-05-23 15:51:24','2022-05-23 15:55:10',0); diff --git a/dbm-services/common/db-config/assets/migrations/000021_tendbsingle_data.up.sql b/dbm-services/common/db-config/assets/migrations/000021_tendbsingle_data.up.sql index d573df8bf5..5d37901b7e 100644 --- a/dbm-services/common/db-config/assets/migrations/000021_tendbsingle_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000021_tendbsingle_data.up.sql @@ -86,6 +86,7 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14127,'tendbsingle','backup','binlog_rotate.yaml','report.log_maxage','INT','30','[1, 60]','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,'Controls whether to produce additional warning messages.','2023-03-09 17:34:12','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14128,'tendbsingle','backup','binlog_rotate.yaml','report.log_maxbackups','INT','10','[1, 30]','RANGE',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,'Controls whether to produce additional warning messages.','2023-03-09 17:34:12','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (14129,'tendbsingle','backup','binlog_rotate.yaml','report.log_maxsize','INT','5','[1, 10]','RANGE',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,'Controls whether to produce additional warning messages.','2023-03-09 17:34:12','2023-03-22 12:23:33',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18004,'tendbsingle','backup','dbbackup.ini','BackupClient.BackupClientBin','STRING','/usr/local/backup_client/bin/backup_client','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-09-06 11:11:41',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13048,'tendbsingle','backup','dbbackup.ini','BackupClient.DoChecksum','STRING','true','true | false','ENUM',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16932,'tendbsingle','backup','dbbackup.ini','BackupClient.Enable','STRING','true','true | false','ENUM',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-09-06 11:11:15',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13049,'tendbsingle','backup','dbbackup.ini','BackupClient.FileTag','STRING','MYSQL_FULL_BACKUP','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); @@ -97,6 +98,8 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13051,'tendbsingle','backup','dbbackup.ini','LogicalBackup.FlushRetryCount','INT','3','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13055,'tendbsingle','backup','dbbackup.ini','LogicalBackup.Regex','STRING','{{.LogicalBackup.Regex}}','','STRING',2,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-04-17 17:10:41',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16401,'tendbsingle','backup','dbbackup.ini','LogicalBackup.Threads','INT','4','','INT',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:42:40',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17763,'tendbsingle','backup','dbbackup.ini','LogicalLoad.CreateTableIfNotExists','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17766,'tendbsingle','backup','dbbackup.ini','LogicalLoad.DBListDropIfExists','STRING','','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-09-07 21:05:54',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16391,'tendbsingle','backup','dbbackup.ini','LogicalLoad.EnableBinlog','STRING','false','false | true','BOOL',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 22:01:31',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16399,'tendbsingle','backup','dbbackup.ini','LogicalLoad.ExtraOpt','STRING','','','',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-05-24 21:46:16',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13156,'tendbsingle','backup','dbbackup.ini','LogicalLoad.IndexFilePath','STRING','/data/dbbak/xxxxx','','STRING',1,0,0,0,0,NULL,'','',-1,NULL,'','2022-05-26 20:11:23','2023-03-22 12:23:33',0); @@ -968,31 +971,34 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12418,'tendbsingle','deploy','deploy_info','db_version','STRING','MySQL-5.7','MySQL-5.5 | MySQL-5.6 | MySQL-5.7 | MySQL-8.0','ENUM',1,0,0,0,1,NULL,NULL,'DB版本',-1,NULL,NULL,'2022-10-27 11:03:11','2022-10-27 11:03:11',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12419,'tendbsingle','deploy','deploy_info','storage_engine','STRING','InnoDB','InnoDB','',1,0,0,0,1,NULL,NULL,'存储引擎',-1,NULL,NULL,'2022-10-27 11:03:11','2022-10-27 11:03:11',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12420,'tendbsingle','deploy','deploy_info','tolerance_level','STRING','compus','idc|compus|city','ENUM',-1,0,0,0,1,NULL,NULL,'容灾级别',-1,NULL,NULL,'2022-10-27 11:03:11','2022-10-27 11:03:11',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16696,'tendbsingle','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16719,'tendbsingle','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16700,'tendbsingle','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16701,'tendbsingle','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"schedule\":\"0 0 16 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16702,'tendbsingle','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"schedule\":\"0 0 14 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16703,'tendbsingle','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"master\",\"repeater\",\"slave\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-07-28 14:29:47',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16704,'tendbsingle','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16707,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"schedule\":\"0 40 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16706,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"schedule\":\"0 30 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16705,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"schedule\":\"0 0 12 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16709,'tendbsingle','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16708,'tendbsingle','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16714,'tendbsingle','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16713,'tendbsingle','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16715,'tendbsingle','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16716,'tendbsingle','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"proxy\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16717,'tendbsingle','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"schedule\":\"0 55 23 * * *\",\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16697,'tendbsingle','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16718,'tendbsingle','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"backend\",\"remote\"],\"role\":[\"slave\",\"repeater\"]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16712,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16710,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16711,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16720,'tendbsingle','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"schedule\":\"@every 1m\",\"machine_type\":[\"spider\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:13','2023-06-30 17:21:13',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16699,'tendbsingle','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); -INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (16698,'tendbsingle','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"schedule\":\"0 0 15 * * 1\",\"machine_type\":[\"single\",\"backend\",\"remote\"],\"role\":[]}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-06-30 17:21:12','2023-06-30 17:21:12',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18077,'tendbsingle','mysql_monitor','items-config.yaml','character-consistency','STRING','{\"enable\":true,\"name\":\"character-consistency\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18100,'tendbsingle','mysql_monitor','items-config.yaml','ctl-replicate','STRING','{\"enable\":true,\"name\":\"ctl-replicate\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18103,'tendbsingle','mysql_monitor','items-config.yaml','dbha-heartbeat','STRING','{\"enable\":true,\"name\":\"dbha-heartbeat\",\"role\":[],\"machine_type\":[\"spider\",\"remote\",\"backend\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:48','2023-10-10 15:18:48',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18081,'tendbsingle','mysql_monitor','items-config.yaml','engine','STRING','{\"enable\":true,\"name\":\"engine\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18082,'tendbsingle','mysql_monitor','items-config.yaml','ext3-check','STRING','{\"enable\":true,\"name\":\"ext3-check\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 16 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18083,'tendbsingle','mysql_monitor','items-config.yaml','ibd-statistic','STRING','{\"enable\":true,\"name\":\"ibd-statistic\",\"role\":[\"slave\"],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 14 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18084,'tendbsingle','mysql_monitor','items-config.yaml','master-slave-heartbeat','STRING','{\"enable\":true,\"name\":\"master-slave-heartbeat\",\"role\":[\"master\",\"repeater\",\"slave\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18085,'tendbsingle','mysql_monitor','items-config.yaml','mysql-config-diff','STRING','{\"enable\":true,\"name\":\"mysql-config-diff\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18088,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-report','STRING','{\"enable\":true,\"name\":\"mysql-connlog-report\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 40 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18087,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-rotate','STRING','{\"enable\":true,\"name\":\"mysql-connlog-rotate\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 30 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18086,'tendbsingle','mysql_monitor','items-config.yaml','mysql-connlog-size','STRING','{\"enable\":true,\"name\":\"mysql-connlog-size\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 0 12 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18090,'tendbsingle','mysql_monitor','items-config.yaml','mysql-err-critical','STRING','{\"enable\":true,\"name\":\"mysql-err-critical\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18089,'tendbsingle','mysql_monitor','items-config.yaml','mysql-err-notice','STRING','{\"enable\":true,\"name\":\"mysql-err-notice\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18095,'tendbsingle','mysql_monitor','items-config.yaml','mysql-inject','STRING','{\"enable\":true,\"name\":\"mysql-inject\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18094,'tendbsingle','mysql_monitor','items-config.yaml','mysql-lock','STRING','{\"enable\":true,\"name\":\"mysql-lock\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18096,'tendbsingle','mysql_monitor','items-config.yaml','proxy-backend','STRING','{\"enable\":true,\"name\":\"proxy-backend\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18097,'tendbsingle','mysql_monitor','items-config.yaml','proxy-user-list','STRING','{\"enable\":true,\"name\":\"proxy-user-list\",\"role\":[],\"machine_type\":[\"proxy\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18098,'tendbsingle','mysql_monitor','items-config.yaml','rotate-slowlog','STRING','{\"enable\":true,\"name\":\"rotate-slowlog\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\",\"spider\"],\"schedule\":\"0 55 23 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18078,'tendbsingle','mysql_monitor','items-config.yaml','routine-definer','STRING','{\"enable\":true,\"name\":\"routine-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18099,'tendbsingle','mysql_monitor','items-config.yaml','slave-status','STRING','{\"enable\":true,\"name\":\"slave-status\",\"role\":[\"slave\",\"repeater\"],\"machine_type\":[\"backend\",\"remote\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18093,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-critical','STRING','{\"enable\":true,\"name\":\"spider-err-critical\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18091,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-notice','STRING','{\"enable\":true,\"name\":\"spider-err-notice\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18092,'tendbsingle','mysql_monitor','items-config.yaml','spider-err-warn','STRING','{\"enable\":true,\"name\":\"spider-err-warn\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18101,'tendbsingle','mysql_monitor','items-config.yaml','spider-remote','STRING','{\"enable\":true,\"name\":\"spider-remote\",\"role\":[],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18102,'tendbsingle','mysql_monitor','items-config.yaml','spider-table-schema-consistency','STRING','{\"enable\":true,\"name\":\"spider-table-schema-consistency\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"0 10 1 * * *\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:48','2023-10-10 15:18:48',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18080,'tendbsingle','mysql_monitor','items-config.yaml','trigger-definer','STRING','{\"enable\":true,\"name\":\"trigger-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18104,'tendbsingle','mysql_monitor','items-config.yaml','unique-ctl-master','STRING','{\"enable\":true,\"name\":\"unique-ctl-master\",\"role\":[\"spider_master\"],\"machine_type\":[\"spider\"],\"schedule\":\"@every 1m\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:48','2023-10-10 15:18:48',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (18079,'tendbsingle','mysql_monitor','items-config.yaml','view-definer','STRING','{\"enable\":true,\"name\":\"view-definer\",\"role\":[],\"machine_type\":[\"single\",\"backend\",\"remote\"],\"schedule\":\"0 0 15 * * 1\"}','','MAP',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-10-10 15:18:47','2023-10-10 15:18:47',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (11726,'tendbsingle','proxyconf','default','conn_log','STRING','true','true|false','ENUM',1,0,1,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-09-27 11:52:55','2022-09-27 11:52:55',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (11727,'tendbsingle','proxyconf','default','daemon','STRING','true','true|false','ENUM',1,0,1,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-09-27 11:52:55','2022-09-27 11:52:55',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (11728,'tendbsingle','proxyconf','default','event-threads','INT','7','[1,10]','RANGE',1,0,1,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-09-27 11:52:55','2022-09-27 11:52:55',0); diff --git a/dbm-services/common/db-config/assets/migrations/000026_TwemproxyRedisInstance_data.up.sql b/dbm-services/common/db-config/assets/migrations/000026_TwemproxyRedisInstance_data.up.sql index f800ac50ab..ab676444e8 100644 --- a/dbm-services/common/db-config/assets/migrations/000026_TwemproxyRedisInstance_data.up.sql +++ b/dbm-services/common/db-config/assets/migrations/000026_TwemproxyRedisInstance_data.up.sql @@ -70,6 +70,7 @@ INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, ` INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12936,'TwemproxyRedisInstance','config','binlogbackup','cron','STRING','@every 10m','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:44','2022-11-22 08:55:44',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12935,'TwemproxyRedisInstance','config','binlogbackup','old_file_left_day','INT','2','[0,365]','RANGE',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:43','2022-11-22 08:55:43',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12934,'TwemproxyRedisInstance','config','binlogbackup','to_backup_system','STRING','yes','yes|no','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:43','2022-11-22 08:55:43',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (17767,'TwemproxyRedisInstance','config','fullbackup','cache_backup_mode','STRING','aof','aof|rdb','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-09-09 11:03:50','2023-09-09 11:03:50',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12931,'TwemproxyRedisInstance','config','fullbackup','cron','STRING','0 5,13,21 * * *','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:43','2022-11-22 08:55:43',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12930,'TwemproxyRedisInstance','config','fullbackup','old_file_left_day','INT','2','[0,365]','RANGE',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:43','2022-11-22 08:55:43',0); INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12932,'TwemproxyRedisInstance','config','fullbackup','tar_split','BOOL','true','true|false','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-22 08:55:43','2022-11-22 08:55:43',0); diff --git a/dbm-services/common/db-config/cmd/bkconfigcli/bkconfigcli.go b/dbm-services/common/db-config/cmd/bkconfigcli/bkconfigcli.go index b53f149831..3f03359d64 100644 --- a/dbm-services/common/db-config/cmd/bkconfigcli/bkconfigcli.go +++ b/dbm-services/common/db-config/cmd/bkconfigcli/bkconfigcli.go @@ -1,2 +1,336 @@ -// Package bkconfigcli TODO -package bkconfigcli +package main + +import ( + "encoding/json" + "fmt" + "strings" + + "bk-dbconfig/internal/pkg/errno" + "bk-dbconfig/internal/repository/model" + "bk-dbconfig/pkg/constvar" + "bk-dbconfig/pkg/core/config" + "bk-dbconfig/pkg/util/crypt" + + "github.com/jinzhu/copier" + "github.com/manifoldco/promptui" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "gorm.io/gorm" +) + +var queryCmd = &cobra.Command{ + Use: "query", + Short: "query sensitive values such as password", + Long: `query sensitive values such as password, may use with --decrypt`, + RunE: func(cmd *cobra.Command, args []string) error { + confItems := make([]*ConfItemsResp, 0) + var err error + decrypt := config.GetBool("decrypt") + // 查询密码解密 key 优先从命令行 old-key 获取,如果为空,则从配置文件 encrypt.keyPrefix 获取 + keyPrefix := config.GetString("old-key") + if keyPrefix == "" { + keyPrefix = config.GetString("encrypt.keyPrefix") + } + BkBizId := config.GetInt("bk-biz-id") + if BkBizId == 0 { + fmt.Printf("query plat's default config values(tb_config_name_def) using key=%s\n", keyPrefix) + confItems, err = queryEncryptConfNames(decrypt, keyPrefix, model.DB.Self) + } else { + fmt.Printf("query bk_biz_id=%d config values (tb_config_node) using key=%s\n", BkBizId, keyPrefix) + confItems, err = queryEncryptConfValues(decrypt, keyPrefix, model.DB.Self) + } + var jsonBytes []byte + jsonBytes, _ = json.Marshal(confItems) + fmt.Printf("\n%+v\n", string(jsonBytes)) + + if err != nil { + return err + } + return nil + }, +} + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update password with new encrypt key. you should backup it with query command", + Long: `update password with new encrypt key, may use with --old-key xxx --new-key yyy`, + RunE: func(cmd *cobra.Command, args []string) error { + var err error + var confItems []*ConfItemsResp + var rowsAffected int64 + // 旧 key 从命令行参数 --old-key 获取 + // 新 key 会优先从从命令参数 --new-key 获取,如果为空,则从配置文件获取 encrypt.keyPrefix + oldKeyPrefix := config.GetString("old-key") + newKeyPrefix := config.GetString("new-key") + if newKeyPrefix == "" { + newKeyPrefix = config.GetString("encrypt.keyPrefix") + } + if oldKeyPrefix == newKeyPrefix { + return errors.Errorf("old key and new key is the same: %s", oldKeyPrefix) + } + BkBizId := config.GetInt("bk-biz-id") + if BkBizId == 0 { + fmt.Printf("query plat's default config values(tb_config_name_def) using key=%s\n", oldKeyPrefix) + confItems, err = queryEncryptConfNames(true, oldKeyPrefix, model.DB.Self) + if err != nil { + return err + } + if err = updateDefaultValue(newKeyPrefix, confItems); err != nil { + return err + } + fmt.Printf("update plat's default config values(tb_config_name_def), Count:%d\n", len(confItems)) + promptRes := runPrompt(newKeyPrefix, oldKeyPrefix) + if promptRes == "y" { + rowsAffected, err = updateDbEncryptDefaultValue(confItems, model.DB.Self) + } else { + fmt.Println("quit") + } + } else { + fmt.Printf("query bk_biz_id=%d config values (tb_config_node) using key=%s\n", BkBizId, oldKeyPrefix) + confItems, err = queryEncryptConfValues(true, oldKeyPrefix, model.DB.Self) + if err != nil { + return err + } + if err = updateConfValue(newKeyPrefix, confItems); err != nil { + return err + } + fmt.Printf("update bk_biz_id=%d config values (tb_config_node) Count:%d\n", BkBizId, len(confItems)) + promptRes := runPrompt(newKeyPrefix, oldKeyPrefix) + if promptRes == "y" { + rowsAffected, err = updateDbEncryptConfValues(confItems, model.DB.Self) + } else { + fmt.Println("quit") + } + } + fmt.Printf("rowsAffected:%d\n", rowsAffected) + return err + }, +} + +func runPrompt(newKey, oldKey string) string { + prompt := promptui.Prompt{ + Label: fmt.Sprintf("Are you sure to update key with new=%s, old=%s ", newKey, oldKey), + IsConfirm: true, + Default: "N", + } + promptRes, _ := prompt.Run() + return strings.ToLower(promptRes) +} + +// ConfItemsResp copied from model.ConfigNameDefModel +type ConfItemsResp struct { + ID uint64 `json:"id"` + Namespace string `json:"namespace"` + ConfType string `json:"conf_type"` + ConfFile string `json:"conf_file"` + BkBizId string `json:"bk_biz_id"` + ConfName string `json:"conf_name"` + ValueDefault string `json:"value_default"` + ValueType string `json:"value_type"` + ValueTypeSub string `json:"value_type_sub"` + //ValueAllowed string `json:"value_allowed"` + FlagEncrypt int8 `json:"flag_encrypt"` + //FlagLocked int8 `json:"flag_locked"` + //FlagStatus int8 `json:"flag_status"` + + ConfValue string `json:"conf_value"` + LevelName string `json:"level_name"` + LevelValue string `json:"level_value"` + + // DecryptValue decrypted from ValueDefault or ConfValue + DecryptValue string `json:"decrypt_value"` +} + +func (r *ConfItemsResp) String() string { + return fmt.Sprintf("{ID:%d Namespace:%s ConfType:%s ConfFile:%s BkBizId:%s ConfName:%s Level:%s=%s, "+ + "ValueDefault:%s ConfValue:%s DecryptValue:%s}", + r.ID, r.Namespace, r.ConfType, r.ConfFile, r.BkBizId, r.ConfName, r.LevelName, r.LevelValue, + r.ValueDefault, r.ConfValue, r.DecryptValue) +} + +func queryEncryptConfNames(decrypt bool, keyPrefix string, db *gorm.DB) ([]*ConfItemsResp, error) { + confNames := make([]*model.ConfigNameDefModel, 0) + sqlRes := db.Model(model.ConfigNameDefModel{}). + Select("id", "namespace", "conf_type", "conf_file", "conf_name", "value_default"). + Where("flag_encrypt = 1 and value_default not like '{{%'") + if namespace := config.GetString("namespace"); namespace != "" { + sqlRes = sqlRes.Where("namespace = ?", namespace) + } + if confType := config.GetString("conf-type"); confType != "" { + sqlRes = sqlRes.Where("conf_type = ?", confType) + } + if confFile := config.GetString("conf-file"); confFile != "" { + sqlRes = sqlRes.Where("conf_file = ?", confFile) + } + if names := config.GetStringSlice("conf-name"); len(names) != 0 { + sqlRes = sqlRes.Where("conf_name in ?", names) + } + + var err error + if err = sqlRes.Find(&confNames).Error; err != nil { + return nil, err + } + confItems := make([]*ConfItemsResp, 0) + var errDecrypt bool + for _, cn := range confNames { + decryptValue := "" + if decrypt { + key := fmt.Sprintf("%s%s", keyPrefix, constvar.BKBizIDForPlat) + decryptValue, err = crypt.DecryptString(cn.ValueDefault, key, constvar.EncryptEnableZip) + if err != nil { + fmt.Printf("error %s: %+v\n", err.Error(), cn) + errDecrypt = true + continue + } + } + var one = &ConfItemsResp{} + copier.Copy(one, cn) + one.DecryptValue = decryptValue + confItems = append(confItems, one) + } + if errDecrypt { + return confItems, errno.ErrDecryptValue + } + + return confItems, nil +} + +func queryEncryptConfValues(decrypt bool, keyPrefix string, db *gorm.DB) ([]*ConfItemsResp, error) { + confItems := make([]*model.ConfigModel, 0) + sqlRes := db.Model(model.ConfigModel{}). + Select("id", "namespace", "conf_type", "conf_file", "bk_biz_id", + "conf_name", "conf_value", "level_name", "level_value"). + Where("conf_value like '**%'") + if namespace := config.GetString("namespace"); namespace != "" { + sqlRes = sqlRes.Where("namespace = ?", namespace) + } + if confType := config.GetString("conf-type"); confType != "" { + sqlRes = sqlRes.Where("conf_type = ?", confType) + } + if confFile := config.GetString("conf-file"); confFile != "" { + sqlRes = sqlRes.Where("conf_file = ?", confFile) + } + BkBizId := config.GetInt("bk-biz-id") + if BkBizId != -1 { // bk-biz-id(bk_biz_id) = -1 means query all + sqlRes = sqlRes.Where("bk_biz_id = ?", BkBizId) + } else if BkBizId == 0 { + return nil, errors.Errorf("bk_biz_id cannot be 0 when quering tb_config_node") + } + + if names := config.GetStringSlice("conf-name"); len(names) != 0 { + sqlRes = sqlRes.Where("conf_name in ?", names) + } + if levelInfo := config.GetString("level-value"); levelInfo != "" { + level := strings.SplitN(levelInfo, ":", 2) + if len(level) == 2 { + sqlRes = sqlRes.Where("level_name = ? and level_value = ?", level[0], level[1]) + } else { + return nil, errors.Errorf("level-value info error:%s", levelInfo) + } + } + + var err error + if err = sqlRes.Find(&confItems).Error; err != nil { + return nil, err + } + + confValues := make([]*ConfItemsResp, 0) + var errDecrypt bool + for _, cn := range confItems { + decryptValue := "" + if decrypt { + key := fmt.Sprintf("%s%s", keyPrefix, cn.LevelValue) + decryptValue, err = crypt.DecryptString(cn.ConfValue, key, constvar.EncryptEnableZip) + if err != nil { + fmt.Printf("error %s: %+v\n", err.Error(), cn) + errDecrypt = true + continue + } + } + var one = &ConfItemsResp{} + copier.Copy(one, cn) + one.DecryptValue = decryptValue + confValues = append(confValues, one) + } + if errDecrypt { + return confValues, errno.ErrDecryptValue + } + return confValues, nil +} + +// updateConfValue 更新 confItems ConfValue +func updateConfValue(keyPrefix string, confItems []*ConfItemsResp) error { + for _, conf := range confItems { + newKey := fmt.Sprintf("%s%s", keyPrefix, conf.LevelValue) + newValue, err := crypt.EncryptString(conf.DecryptValue, newKey, constvar.EncryptEnableZip) + if err != nil { + return errors.Wrapf(err, "%+v", conf) + } + fmt.Printf("%d %s,%s,%s,%s,%s=%s:\t%s\told=%s,new=%s\n", + conf.ID, conf.Namespace, conf.ConfType, conf.ConfFile, conf.BkBizId, conf.LevelName, conf.LevelValue, + conf.DecryptValue, conf.ConfValue, newValue) + conf.ConfValue = newValue // 使用新的替代旧的 + } + return nil +} + +// updateDefaultValue 更新 confItems ValueDefault +func updateDefaultValue(keyPrefix string, confItems []*ConfItemsResp) error { + newKey := fmt.Sprintf("%s%s", keyPrefix, constvar.BKBizIDForPlat) + for _, conf := range confItems { + newValue, err := crypt.EncryptString(conf.DecryptValue, newKey, constvar.EncryptEnableZip) + if err != nil { + return errors.Wrapf(err, "%+v", conf) + } + fmt.Printf("id=%d %s,%s,%s,%s,%s=%s:\t%s\told=%s,new=%s\n", + conf.ID, conf.Namespace, conf.ConfType, conf.ConfFile, conf.BkBizId, "bk_biz_id", "0", + conf.DecryptValue, conf.ValueDefault, newValue) + conf.ValueDefault = newValue // 使用新的替代旧的 + } + return nil +} + +// updateDbEncryptDefaultValue 更新 db +// confItems ValueDefault 中是新的已经加密过的值 +func updateDbEncryptDefaultValue(confItems []*ConfItemsResp, db *gorm.DB) (int64, error) { + var err error + var rowsAffected int64 + err = db.Transaction(func(tx *gorm.DB) error { + for _, conf := range confItems { + updateVal := tx.Model(model.ConfigNameDefModel{}).Where("id = ?", conf.ID). + UpdateColumn("value_default", conf.ValueDefault) + if updateVal.Error != nil { + return errors.Wrapf(updateVal.Error, "%+v", conf) + } + if updateVal.RowsAffected != 1 { + return errors.Errorf("expect 1 row affected, but got %d: %+v", updateVal.RowsAffected, conf) + } else { + rowsAffected += updateVal.RowsAffected + } + } + return nil + }) + return rowsAffected, err +} + +// updateDbEncryptConfValues 更新 db +// confItems ConfValue 中是新的已经加密过的值 +func updateDbEncryptConfValues(confItems []*ConfItemsResp, db *gorm.DB) (int64, error) { + var rowsAffected int64 + err := db.Transaction(func(tx *gorm.DB) error { + for _, conf := range confItems { + updateVal := tx.Model(model.ConfigModel{}).Where("id = ?", conf.ID). + UpdateColumn("conf_value", conf.ConfValue) + if updateVal.Error != nil { + return errors.Wrapf(updateVal.Error, "%+v", conf) + } + if updateVal.RowsAffected != 1 { + return errors.Errorf("expect 1 row affected, but got %d: %+v", updateVal.RowsAffected, conf) + } else { + rowsAffected += updateVal.RowsAffected + } + } + return nil + }) + return rowsAffected, err +} diff --git a/dbm-services/common/db-config/cmd/bkconfigcli/main.go b/dbm-services/common/db-config/cmd/bkconfigcli/main.go index 1db1507db4..581cc55539 100644 --- a/dbm-services/common/db-config/cmd/bkconfigcli/main.go +++ b/dbm-services/common/db-config/cmd/bkconfigcli/main.go @@ -1 +1,71 @@ -package bkconfigcli +package main + +import ( + "os" + + "bk-dbconfig/internal/repository/model" + "bk-dbconfig/pkg/core/config" + + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +// main bkconfigcli command +func main() { + model.DB.Init() + defer model.DB.Close() + Execute() +} + +var rootCmd = &cobra.Command{ + Use: "bkconfigcli", + Short: "bkconfigcli go binary", + Long: "bkconfigcli go binary", +} + +func Execute() { + err := rootCmd.Execute() + if err != nil { + _, _ = os.Stderr.WriteString(err.Error() + "\n") + os.Exit(1) + } +} + +func init() { + // init db config + config.InitConfig("config") + + // rootCmd global flags + rootCmd.PersistentFlags().String("namespace", "", "namespace") + _ = viper.BindPFlag("namespace", rootCmd.PersistentFlags().Lookup("namespace")) + + rootCmd.PersistentFlags().String("conf-type", "", "conf_type") + _ = viper.BindPFlag("conf-type", rootCmd.PersistentFlags().Lookup("conf-type")) + + rootCmd.PersistentFlags().String("conf-file", "", "conf_file") + _ = viper.BindPFlag("conf-file", rootCmd.PersistentFlags().Lookup("conf-file")) + + rootCmd.PersistentFlags().Int("bk-biz-id", 0, "0 means plat, -1 means all bk_biz_id/cluster's password") + _ = viper.BindPFlag("bk-biz-id", rootCmd.PersistentFlags().Lookup("bk-biz-id")) + + rootCmd.PersistentFlags().StringSlice("conf-name", []string{}, "conf_name") + _ = viper.BindPFlag("conf-name", rootCmd.PersistentFlags().Lookup("conf-name")) + + rootCmd.PersistentFlags().String("level-value", "", + "level_name:level_value, example --level-value=cluster:a.b.c, only work when bk-biz-id!=0") + _ = viper.BindPFlag("level-value", rootCmd.PersistentFlags().Lookup("level-value")) + + rootCmd.PersistentFlags().String("old-key", "", "old key") + _ = viper.BindPFlag("old-key", rootCmd.PersistentFlags().Lookup("old-key")) + + // queryCmd flags + queryCmd.Flags().Bool("decrypt", false, "wait task done") + _ = viper.BindPFlag("decrypt", queryCmd.Flags().Lookup("decrypt")) + + // updateCmd flags + updateCmd.Flags().String("new-key", "", "new-key") + _ = viper.BindPFlag("new-key", updateCmd.Flags().Lookup("new-key")) + + rootCmd.AddCommand(queryCmd) + rootCmd.AddCommand(updateCmd) +} diff --git a/dbm-services/common/db-config/docs/design/encrypt.md b/dbm-services/common/db-config/docs/design/encrypt.md index 4b2a894144..1f53ce7b60 100644 --- a/dbm-services/common/db-config/docs/design/encrypt.md +++ b/dbm-services/common/db-config/docs/design/encrypt.md @@ -35,4 +35,30 @@ curl --location --request POST 'http://bkdbm-dbconfig/bkconfig/v1/confitem/query "format": "map", "conf_name": "xx" }' +``` + +# 修改加密 key +修改加密秘钥,一定要备份之前的秘钥和已生成的加密串(包括平台默认和业务密码),一旦秘钥丢失将无法拿到明文。 +## 平台默认密码 +``` +### 用旧key来解密出明文密码 +./bkconfigcli query --decrypt --old-key="xx" +./bkconfigcli query --decrypt --namespace=influxdb --old-key="xx" + +### 修改key +./bkconfigcli update --old-key="xx" --new-key="xxxx" +./bkconfigcli update --namespace=influxdb --old-key="xx" --new-key="xxxx" +``` + +## 业务或者集群默认密码 + +``` +### 查询某个业务所有相关密码 +./bkconfigcli query --decrypt --old-key="xx" --bk-biz-id=123 + +### 用新key更新 业务 123 的相关密码,可用于先验证是否正确 +./bkconfigcli update --old-key="xx" --new-key="xxxx" --bk-biz-id=123 + +### 用新key更新所有业务的相关密码 +./bkconfigcli update --old-key="xx" --new-key="xxxx" --bk-biz-id=-1 ``` \ No newline at end of file diff --git a/dbm-services/common/db-config/docs/swagger.json b/dbm-services/common/db-config/docs/swagger.json index 0c0f0c7755..6332dbb578 100644 --- a/dbm-services/common/db-config/docs/swagger.json +++ b/dbm-services/common/db-config/docs/swagger.json @@ -4,8 +4,8 @@ ], "swagger": "2.0", "info": { - "description": "This is a bkconfigsvr celler server.", - "title": "bkconfigsvr API", + "description": "This is a dbactuator command collection.", + "title": "dbactuator API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", @@ -18,201 +18,98 @@ }, "version": "0.0.1" }, - "host": "localhost:8080", + "host": "./dbactuator", "basePath": "/", "paths": { - "/bkconfig/v1/conffile/add": { + "/common/file-server": { "post": { - "description": "新增平台级配置文件,定义允许的配置名。指定 req_type 为 `SaveOnly` 仅保存, `SaveAndPublish` 保存并发布。保存并发布 也必须提供全量,而不能是前面保存基础上的增量\nreq_type=`SaveOnly` 已废弃\n第一次保存时,会返回 `file_id`,下次 保存/发布 需传入 `file_id`\nnamespace,conf_type,conf_file 唯一确定一个配置文件,不同DB版本信息体现在 conf_file 里 (如MySQL-5.7), namespace_info 可以存前端传入的 数据库版本,只用于在展示\nHTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员", + "description": "通过 http 暴露指定目录可用于下载,可用于在重建备库时,从其它机器下载备份\n在 OS 不允许 ssh 登录(scp/sftp)时,可以临时启动该服务来获取备份文件", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "plat_config" + "common" ], - "summary": "新增平台级配置文件", + "summary": "简单文件服务", "parameters": [ { - "description": "ConfName for ConfType", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/api.UpsertConfFilePlatReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServerComp" } } ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.UpsertConfFilePlatResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" - } - } - } + "responses": {} } }, - "/bkconfig/v1/conffile/list": { - "get": { - "description": "查询配置文件模板列表。只有平台和业务才有配置文件列表\n返回的 updated_by 代表操作人", - "produces": [ + "/common/rm-file": { + "post": { + "consumes": [ "application/json" ], "tags": [ - "plat_config" + "common" ], - "summary": "查询配置文件列表", + "summary": "限速删除大文件", "parameters": [ { - "type": "string", - "description": "业务id, bk_biz_id=0 代表平台配置", - "name": "bk_biz_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "如果指定了 conf_file 则只查这一个文件信息", - "name": "conf_file", - "in": "query" - }, - { - "type": "string", - "example": "dbconf", - "name": "conf_type", - "in": "query", - "required": true - }, - { - "enum": [ - "plat", - "app", - "module", - "cluster" - ], - "type": "string", - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "name": "level_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "配置层级值", - "name": "level_value", - "in": "query" - }, - { - "type": "string", - "description": "命名空间,一般指DB类型", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/api.ListConfFileResp" - } - } - }, - "400": { - "description": "Bad Request", + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/internal_subcmd_commoncmd.RMLargeFileParam" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/conffile/query": { - "get": { - "description": "查询 平台配置 某个配置类型/配置文件的所有配置名列表", - "produces": [ + "/download/http": { + "post": { + "description": "支持限速、basicAuth 认证. 一般配合 common fileserver 使用\n# server1\n./dbactuator common file-server \\\n--payload-format raw \\\n--payload '{\"extend\":{\"bind_address\":\":8082\",\"mount_path\":\"/data/dbbak\",\"user\":\"xiaog\",\"password\":\"xxxx\",\"proc_maxidle_duration\":\"60s\"}}'\n\n# server2\ncurl -u 'xiaog:xxxx' 'http://server1:8082/datadbbak8082/dbactuator' -o dbactuator.bin --limit-rate 10k", + "consumes": [ "application/json" ], "tags": [ - "plat_config" + "download" ], - "summary": "查询平台配置项列表", + "summary": "http下载文件", "parameters": [ { - "type": "string", - "example": "MySQL-5.7", - "name": "conf_file", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "如果设置,会根据前缀模糊匹配搜索", - "name": "conf_name", - "in": "query" - }, - { - "type": "string", - "example": "dbconf", - "name": "conf_type", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "tendbha", - "name": "namespace", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/QueryConfigNamesResp" - } - }, - "400": { - "description": "Bad Request", + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/conffile/update": { + "/download/ibs-query": { "post": { - "description": "编辑平台级配置文件。指定 req_type 为 `SaveOnly` 仅保存, `SaveAndPublish` 保存并发布\nHTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员\n编辑平台配置时,如果设置 flag_disable=1 时,该配置不会显示在平台配置项列表,相当于管理 所有允许的配置项列表\n保存时会校验输入的 value_default, value_type, value_allowed\n1. value_type 目前允许 STRING, INT, FLOAT, NUMBER\n2. value_type_sub 允许 ENUM, ENUMS, RANGE, STRING, JSON, REGEX(一种特殊的STRING,会验证 value_default 是否满足 value_allowed 正则)\n3. value_allowed 允许 枚举: 例如`0|1|2`, `ON|OFF` 格式, 范围: 例如`(0, 1000]`", + "description": "filename 会进行模糊匹配,返回 task_id 用于下载", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "plat_config" + "download" ], - "summary": "编辑平台级配置文件", + "summary": "从 ieg 备份系统查询文件", "parameters": [ { - "description": "ConfName for ConfType", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/api.UpsertConfFilePlatReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryComp" } } ], @@ -220,39 +117,30 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.UpsertConfFilePlatResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryResult" } } } } }, - "/bkconfig/v1/confitem/query": { + "/download/ibs-recover": { "post": { - "description": "根据业务/模块/集群的信息,获取某个配置文件的配置项。一般用户前端请求、再编辑的场景,后端服务直接获取配置文件使用 /version/generate 接口\nconf_file 可以是,号分隔的多个文件名,返回结果是一个按照配置文件名组合的一个 list\n需要指定返回格式 format, 可选值 map, list.\nmap 格式会丢弃 conf_item 的其它信息,只保留 conf_name=conf_value, 一般用于后台服务\nlist 格式会保留 conf_items 的其它信息,conf_name=conf_item,一般用于前端展示\n获取cluster级别配置时,需要提供 level_info:{\"module\":\"xxx\"} 模块信息", + "description": "提供 task_id,从 ieg 备份系统下载文件\ntask_files_wild: 模糊搜索文件并下载, task_files: 精确文件查询并下载\ntask_files_wild, task_files 二选一\n启用 skip_local_exists=true 时,如果目标目录已存在要下载的文件,会自动跳过", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "config_item" + "download" ], - "summary": "获取配置文件配置项列表", + "summary": "从 ieg 备份系统下载文件", "parameters": [ { - "description": "GetConfigItemsReq", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/GetConfigItemsReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverComp" } } ], @@ -260,64 +148,63 @@ "200": { "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetConfigItemsResp" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverTask" } } } } }, - "/bkconfig/v1/confitem/save": { + "/download/scp": { "post": { - "description": "编辑层级配置,层级包括业务app、模块module、集群cluster,需要指定修改哪个级别的配置,通过 level_name, level_value 来区分\n针对编辑的配置类型 conf_type 无版本化的概念,即保存生效,无需发布\n保存 cluster级别配置时,需要提供 level_info:{\"module\":\"xxx\"} 模块信息", + "description": "支持限速", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "config_item" + "download" ], - "summary": "编辑配置(无版本概念)", + "summary": "scp下载文件", "parameters": [ { - "description": "SaveConfItemsReq", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/api.SaveConfItemsReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFScpParam" } } ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.UpsertConfItemsResp" - } - }, - "400": { - "description": "Bad Request", + "responses": {} + } + }, + "/mysql/change-master": { + "post": { + "description": "执行 change master to", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "建立主从关系", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationComp" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/confitem/upsert": { + "/mysql/clean-mysql": { "post": { - "description": "编辑层级配置,层级包括业务app、模块module、集群cluster,需要指定修改哪个级别的配置,通过 level_name, level_value 来区分\n例1: level_name=app, level_value=testapp 表示修改业务 bk_biz_id=testapp 的配置\n例2: level_name=module, level_value=account 表示某业务 bk_biz_id 的模块 module=account 的配置\nHTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员\n获取cluster级别配置时,需要提供 level_info:{\"module\":\"xxx\"} 模块信息", + "description": "清空本地实例,保留系统库", "consumes": [ "application/json" ], @@ -325,1501 +212,3075 @@ "application/json" ], "tags": [ - "config_item" + "mysql" ], - "summary": "编辑发布层级配置", + "summary": "清空实例,高危", "parameters": [ { - "description": "UpsertConfItemsReq", + "description": "description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/api.UpsertConfItemsReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlComp" } } ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.UpsertConfItemsResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" - } - } - } + "responses": {} } }, - "/bkconfig/v1/confname/list": { - "get": { - "description": "查询某个配置类型/配置文件的配置名列表,会排除 已锁定的平台配置", - "produces": [ + "/mysql/deploy": { + "post": { + "description": "部署 mysql 实例说明", + "consumes": [ "application/json" ], "tags": [ - "config_meta" + "mysql" ], - "summary": "查询预定义的配置名列表", + "summary": "部署 mysql 实例", "parameters": [ { - "type": "string", - "example": "MySQL-5.7", - "name": "conf_file", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "如果设置,会根据前缀模糊匹配搜索", - "name": "conf_name", - "in": "query" - }, - { - "type": "string", - "example": "dbconf", - "name": "conf_type", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "tendbha", - "name": "namespace", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/QueryConfigNamesResp" - } - }, - "400": { - "description": "Bad Request", + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/simpleitem/list": { - "get": { - "description": "请勿使用", - "produces": [ + "/mysql/deploy-dbbackup": { + "post": { + "description": "部署GO版本备份程序", + "consumes": [ "application/json" ], "tags": [ - "simple_item" + "mysql" ], - "summary": "查询配置项列表通用接口", + "summary": "部署备份程序", "parameters": [ { - "type": "string", - "name": "bk_biz_id", - "in": "query" - }, - { - "type": "string", - "name": "cluster", - "in": "query" - }, - { - "type": "string", - "name": "conf_file", - "in": "query" - }, - { - "type": "string", - "name": "conf_name", - "in": "query" - }, - { - "type": "string", - "name": "conf_type", - "in": "query" - }, - { - "type": "string", - "name": "conf_value", - "in": "query" - }, - { - "type": "string", - "name": "created_at", - "in": "query" - }, - { - "type": "string", - "name": "created_by", - "in": "query" - }, - { - "type": "string", - "name": "description", - "in": "query" - }, - { - "type": "string", - "name": "format", - "in": "query" - }, - { - "type": "string", - "name": "inherit_from", - "in": "query" - }, - { - "type": "string", - "name": "level_name", - "in": "query" - }, - { - "type": "string", - "name": "level_value", - "in": "query" - }, - { - "type": "string", - "name": "module", - "in": "query" - }, - { - "type": "string", - "name": "namespace", - "in": "query" - }, - { - "type": "string", - "name": "revision", - "in": "query" - }, - { - "type": "string", - "name": "updated_at", - "in": "query" - }, - { - "type": "string", - "name": "updated_by", - "in": "query" - }, - { - "type": "string", - "name": "view", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ConfigModel" - } - } - }, - "400": { - "description": "Bad Request", + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupComp" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/version/detail": { - "get": { - "description": "查询历史配置版本的详情", - "produces": [ + "/mysql/find-local-backup": { + "post": { + "description": "查找本地备份", + "consumes": [ "application/json" ], "tags": [ - "config_version" + "mysql" ], - "summary": "查询版本的详细信息", + "summary": "查找本地备份", "parameters": [ { - "type": "string", - "example": "testapp", - "description": "业务ID,必选项", - "name": "bk_biz_id", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "MySQL-5.7", - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "name": "conf_file", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "dbconf", - "description": "配置类型,如 dbconf,backup", - "name": "conf_type", - "in": "query", - "required": true - }, - { - "enum": [ - "plat", - "app", - "module", - "cluster" - ], - "type": "string", - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "name": "level_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "配置层级值", - "name": "level_value", - "in": "query" - }, - { - "type": "string", - "example": "tendbha", - "description": "命名空间,一般指DB类型", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "v_20220309215824", - "name": "revision", - "in": "query" + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupParam" + } } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.GetVersionedDetailResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupResp" } } } } }, - "/bkconfig/v1/version/generate": { + "/mysql/flashback-binlog": { "post": { - "description": "从现有配置项直接生成配置文件并返回,每次调用会生成一个新版本,可以选择是否直接发布。这个接口一般用户后台服务查询配置\n修改配置并发布,使用 /confitem/upsert 接口\n直接查询配置文件内容,使用 /confitem/query 接口\n根据 `method` 生成方式不同,可以生成配置并存储 `GenerateAndSave`、生成配置并存储且发布`GenerateAndPublish`\n使用 `GenerateAndSave` 方式需要进一步调用 PublishConfigFile 接口进行发布", + "description": "通过 `mysqlbinlog --flashback xxx | mysql` 导入 binlog", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "config_version" + "mysql" ], - "summary": "生成并获取配置文件新版本", + "summary": "导入 binlog", "parameters": [ { - "description": "Generate config file versioned", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/GenerateConfigReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.FlashbackComp" } } ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GenerateConfigResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" - } - } - } + "responses": {} } }, - "/bkconfig/v1/version/list": { - "get": { - "description": "Get config file versions list", - "produces": [ + "/mysql/grant-repl": { + "post": { + "description": "在目标机器新建 repl 账号", + "consumes": [ "application/json" ], "tags": [ - "config_version" + "mysql" ], - "summary": "查询历史配置版本名列表", + "summary": "建立复制账号", "parameters": [ { - "type": "string", - "example": "testapp", - "description": "业务ID,必选项", - "name": "bk_biz_id", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "MySQL-5.7", - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "name": "conf_file", - "in": "query", - "required": true - }, - { - "type": "string", - "example": "dbconf", - "description": "配置类型,如 dbconf,backup", - "name": "conf_type", - "in": "query", - "required": true - }, - { - "enum": [ - "plat", - "app", - "module", - "cluster" - ], - "type": "string", - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "name": "level_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "配置层级值", - "name": "level_value", - "in": "query" - }, - { - "type": "string", - "example": "tendbha", - "description": "命名空间,一般指DB类型", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ListConfigVersionsResp" - } - }, - "400": { - "description": "Bad Request", + "description": "short description", + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplComp" } } - } + ], + "responses": {} } }, - "/bkconfig/v1/version/publish": { + "/mysql/init-cluster-routing": { "post": { - "description": "发布指定版本的配置文件,未发布状态的配置文件是不能使用的\n发布操作会把已有 published 状态的配置文件下线;同一个 revision 版本的配置无法重复发布\n发布时带上 patch 参数可以覆盖配置中心该版本的配置项(只有配置项值是`{{`开头的才能被覆盖)", + "description": "初始化tendb cluster 集群的路由关系说明", "consumes": [ "application/json" ], - "produces": [ - "application/json" - ], "tags": [ - "config_version" + "spiderctl" ], - "summary": "直接发布一个版本[废弃]", + "summary": "初始化tendb cluster 集群的路由关系", "parameters": [ { - "description": "Publish config file versioned", + "description": "short description", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PublishConfigFileReq" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp" } } ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.HTTPOkNilResp" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api.HTTPClientErrResp" - } - } - } + "responses": {} + } + }, + "/mysql/install-checksum": { + "post": { + "description": "安装mysql校验", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "安装mysql校验", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumComp" + } + } + ], + "responses": {} + } + }, + "/mysql/install-dbatoolkit": { + "post": { + "description": "部署 /home/mysql/dba_toolkit,覆盖", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "部署DBA工具箱", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitComp" + } + } + ], + "responses": {} + } + }, + "/mysql/mycnf-change": { + "post": { + "description": "修改mysql配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "修改mysql配置", + "parameters": [ + { + "description": "description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeComp" + } + } + ], + "responses": {} + } + }, + "/mysql/mycnf-clone": { + "post": { + "description": "用于 slave 重建或迁移,保持新实例与 my.cnf 实例关键参数相同的场景\n默认 clone 参数:", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "从源实例克隆 my.cnf 部分参数到目标实例", + "parameters": [ + { + "description": "description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneComp" + } + } + ], + "responses": {} + } + }, + "/mysql/oscmd-run": { + "post": { + "description": "执行os简单命令", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "执行os简单命令", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp" + } + } + } + } + }, + "/mysql/parse-binlog-time": { + "post": { + "description": "获取 binlog FileDescriptionFormat 和 RotateEvent 事件", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "获取 binlog 的开始和结束时间", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeComp" + } + } + ], + "responses": {} + } + }, + "/mysql/pt-table-checksum": { + "post": { + "description": "数据校验", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "数据校验", + "parameters": [ + { + "description": "description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp" + } + } + ], + "responses": {} + } + }, + "/mysql/recover-binlog": { + "post": { + "description": "通过 `mysqlbinlog xxx | mysql` 导入 binlog", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "导入 binlog", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlogComp" + } + } + ], + "responses": {} + } + }, + "/mysql/restore-dr": { + "post": { + "description": "物理备份、逻辑备份恢复", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "备份恢复", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreDRComp" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_util_mysqlutil.ChangeMaster" + } + } + } + } + }, + "/mysql/semantic-dumpschema": { + "post": { + "description": "运行语义检查", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "运行语义检查", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp" + } + } + ], + "responses": {} + } + }, + "/spdierctl/deploy": { + "post": { + "description": "部署 spider ctl 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "spiderctl" + ], + "summary": "部署 spider ctl 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" + } + } + ], + "responses": {} + } + }, + "/spider/deploy": { + "post": { + "description": "部署 spider 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "spider" + ], + "summary": "部署 spider 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/deploy": { + "post": { + "description": "部署 tbinlogdumper 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "部署 tbinlogdumper 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/semantic-dumpschema": { + "post": { + "description": "备份表结构并导入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "备份表结构并导入", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/uninstall": { + "post": { + "description": "卸载 tbinlogdumper 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "卸载 tbinlogdumper 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp" + } + } + ], + "responses": {} } } }, "definitions": { - "GenerateConfigReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam": { + "type": "object", + "properties": { + "runtime_account": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeAccountParam" + }, + "runtime_extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeExtend" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeAccountParam": { + "type": "object", + "properties": { + "admin_pwd": { + "description": "mysql admin 密码,环境变量 GENERAL_ACCOUNT_admin_pwd", + "type": "string" + }, + "admin_user": { + "description": "mysql admin 账户,环境变量 GENERAL_ACCOUNT_admin_user", + "type": "string" + }, + "backup_pwd": { + "description": "dbbackup pwd", + "type": "string" + }, + "backup_user": { + "description": "dbbackup user", + "type": "string" + }, + "monitor_access_all_pwd": { + "description": "mysql monitor@% 密码", + "type": "string" + }, + "monitor_access_all_user": { + "description": "mysql monitor@%", + "type": "string" + }, + "monitor_pwd": { + "description": "mysql monitor 密码,环境变量 GENERAL_ACCOUNT_monitor_pwd", + "type": "string" + }, + "monitor_user": { + "description": "mysql monitor 账户,环境变量 GENERAL_ACCOUNT_monitor_user", + "type": "string" + }, + "proxy_admin_pwd": { + "description": "proxy admin pwd", + "type": "string" + }, + "proxy_admin_user": { + "description": "proxy admin user", + "type": "string" + }, + "repl_pwd": { + "description": "repl pwd, 环境变量 GENERAL_ACCOUNT_repl_pwd", + "type": "string" + }, + "repl_user": { + "description": "repl user, 环境变量 GENERAL_ACCOUNT_repl_user", + "type": "string" + }, + "tdbctl_pwd": { + "type": "string" + }, + "tdbctl_user": { + "type": "string" + }, + "yw_pwd": { + "description": "yw pwd", + "type": "string" + }, + "yw_user": { + "description": "yw user", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeExtend": { + "type": "object", + "properties": { + "mysql_sys_users": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam": { + "type": "object", + "required": [ + "file_list", + "path_tgt", + "server" + ], + "properties": { + "auth_pass": { + "description": "http url basic auth pass", + "type": "string" + }, + "auth_user": { + "description": "http url basic auth user", + "type": "string" + }, + "bk_biz_id": { + "type": "integer" + }, + "bwlimit_mb": { + "description": "单文件下载限速,单位 MB/s", + "type": "integer" + }, + "curl_options": { + "type": "array", + "items": { + "type": "string" + } + }, + "curl_path": { + "description": "curl 命令路径,默认留空. 目前只用于测试 url", + "type": "string" + }, + "file_list": { + "description": "下载哪些文件", + "type": "array", + "items": { + "type": "string" + } + }, + "max_concurrency": { + "description": "并发下载数", + "type": "integer" + }, + "path_tgt": { + "description": "文件存放到本机哪个目录", + "type": "string" + }, + "server": { + "description": "下载 url", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFScpParam": { + "type": "object", + "required": [ + "file_src", + "file_tgt" + ], + "properties": { + "bk_biz_id": { + "type": "integer" + }, + "bwlimit_mb": { + "description": "单文件下载限速,单位 MB/s", + "type": "integer" + }, + "file_src": { + "description": "下载源", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileSrc" + } + ] + }, + "file_tgt": { + "description": "下载目标", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileTgt" + } + ] + }, + "max_concurrency": { + "description": "并发下载数", + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileSrc": { + "type": "object", + "required": [ + "file_list", + "path", + "ssh_host", + "ssh_port", + "ssh_user" + ], + "properties": { + "file_list": { + "description": "源文件名列表,相对上面的 path", + "type": "array", + "items": { + "type": "string" + } + }, + "match": { + "type": "string" + }, + "path": { + "description": "源文件所在目录", + "type": "string" + }, + "ssh_host": { + "type": "string" + }, + "ssh_pass": { + "type": "string" + }, + "ssh_port": { + "type": "string" + }, + "ssh_user": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileTgt": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "文件下载目标目录", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo": { + "type": "object", + "required": [ + "key", + "sys_id", + "url" + ], + "properties": { + "key": { + "description": "16位字串,由备份系统分配,可从环境变量获取 IBS_INFO__key", + "type": "string" + }, + "sys_id": { + "description": "application标识,亦即哪个系统需要访问本接口,可从环境变量获取 IBS_INFO_sys_id", + "type": "string" + }, + "ticket": { + "description": "OA验证的ticket,一个长串,通常附加在访问内网应用的URL上,主要用来验证用户身份,可以留空", + "type": "string" + }, + "url": { + "description": "ieg 备份系统 api url 地址,会在后面拼接 /query /recover 后缀进行请求\n可从环境变量获取 IBS_INFO_url", + "type": "string", + "example": "http://127.0.0.1/backupApi" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryForRecover": { + "type": "object", + "properties": { + "begin_date": { + "description": "查询文件起始时间,备份系统以 file_last_mtime 为条件", + "type": "string" + }, + "end_date": { + "description": "哪一天提交,结束时间,与begin_date形成一个时间范围,建议begin_date与end_date形成的时间范围不要超过3天", + "type": "string" + }, + "source_ip": { + "description": "来源IP,即提交备份任务的机器IP", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryParam": { + "type": "object", + "required": [ + "begin_date", + "end_date", + "filename", + "ibs_info", + "source_ip" + ], + "properties": { + "begin_date": { + "description": "哪一天提交,起始时间", + "type": "string" + }, + "end_date": { + "description": "哪一天提交,结束时间,与begin_date形成一个时间范围,建议begin_date与end_date形成的时间范围不要超过3天", + "type": "string" + }, + "filename": { + "description": "文件名", + "type": "string" + }, + "ibs_info": { + "description": "ieg backup system url and auth params", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo" + } + ] + }, + "source_ip": { + "description": "来源IP,即提交备份任务的机器IP", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryResult": { + "type": "object", + "properties": { + "bkstif": { + "description": "备份状态信息, 'done, success', 'Fail: bad md5' 等", + "type": "string" + }, + "createTime": { + "description": "非备份系统字段,全备(截取文件名中的字段),binlog 打开文件读取", + "type": "string" + }, + "expire_time": { + "type": "string" + }, + "expired": { + "type": "string" + }, + "file_last_mtime": { + "description": "文件最后修改时间", + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_tag": { + "type": "string" + }, + "md5": { + "type": "string" + }, + "path": { + "description": "非备份系统字段", + "type": "string" + }, + "size": { + "description": "文件大小", + "type": "string" + }, + "source_ip": { + "description": "上报该备份任务的IP", + "type": "string" + }, + "source_port": { + "description": "非备份系统字段", + "type": "string" + }, + "status": { + "description": "文件状态", + "type": "string" + }, + "task_id": { + "description": "任务ID,用于下载", + "type": "string" + }, + "uptime": { + "description": "备份任务上报时间", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverParam": { + "type": "object", + "required": [ + "dest_ip", + "diretory", + "ibs_info", + "login_user" + ], + "properties": { + "dest_ip": { + "description": "目标IP,文件恢复到哪一台机器上的", + "type": "string", + "example": "1.1.1.1" + }, + "diretory": { + "description": "diretory 是备份系统参数错误拼写", + "type": "string", + "example": "/data/dbbak" + }, + "ibs_info": { + "description": "ieg backup system url and auth params", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo" + } + ] + }, + "ibs_query": { + "description": "根据文件名下载,或者判断是否跳过下载时,需要提供 ibs_query 参数用于查询", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryForRecover" + } + ] + }, + "login_passwd": { + "description": "登录 dest_ip 的用户名的密码, ieg 传统scp 方式下载才需要。如果是 cos 下载则不需要", + "type": "string" + }, + "login_user": { + "description": "登录 dest_ip 的用户名,下载后的文件属组是该用户", + "type": "string" + }, + "reason": { + "description": "恢复原因(备注用途)", + "type": "string" + }, + "skip_local_exists": { + "description": "如果本地目标目录已经存在对应文件,是否保留(即跳过下载). 默认 false", + "type": "boolean", + "example": false + }, + "task_files": { + "description": "如果是精确文件名下载,用 task_files。提供需要下载的文件列表,提供 task_id 或者完整的 file_name 即可\n如果顺便提供了 size 信息则不用请求备份系统获取大小 来决定文件是否需要重新下载", + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesExact" + } + }, + "task_files_wild": { + "description": "如果是模糊匹配搜索并下载,用 task_files_wild", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesWild" + } + ] + }, + "taskid_list": { + "description": "taskid 列表,,逗号分隔。会根据 task_files 里的信息,追加到这里。这里一般不传值,在 task_files 里提供 task_id 或者 file_name", + "type": "string", + "example": "10000,100001" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverTask": { + "type": "object", + "properties": { + "file_last_mtime": { + "description": "文件最后修改时间", + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_tag": { + "type": "string" + }, + "md5": { + "type": "string" + }, + "size": { + "description": "文件大小", + "type": "string" + }, + "source_ip": { + "description": "上报该备份任务的IP", + "type": "string" + }, + "status": { + "description": "文件状态", + "type": "string" + }, + "task_id": { + "description": "任务ID,用于下载", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesExact": { + "type": "object", + "properties": { + "file_name": { + "type": "string" + }, + "md5": { + "type": "string" + }, + "size": { + "description": "文件大小", + "type": "string" + }, + "task_id": { + "description": "任务ID,用于下载", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesWild": { + "type": "object", + "properties": { + "file_tag": { + "type": "string" + }, + "name_regex": { + "description": "在搜索的结果里面,应用该正则进行过滤", + "type": "string" + }, + "name_search": { + "description": "搜索的模糊条件,不用带 *", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer": { + "type": "object", + "required": [ + "auth_user", + "bind_address", + "mount_path" + ], + "properties": { + "acls": { + "description": "访问来源限制,从前往后匹配。格式 `[\"allow 1.1.1.1/32\", \"deny all\"]`", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "allow all" + ] + }, + "auth_pass": { + "description": "http basic auth pass,为空时会随机生成密码", + "type": "string" + }, + "auth_user": { + "description": "http basic auth user", + "type": "string" + }, + "bind_address": { + "description": "http file-server 监听地址. 不提供端口,会在 12000-19999 之间随机选择一个端口,不提供 ip 时默认 localhost", + "type": "string" + }, + "enable_tls": { + "description": "暂不支持", + "type": "boolean" + }, + "max_connections": { + "description": "限制最大连接数,超过需要等待. 为 0 时表示不限制", + "type": "integer" + }, + "mount_path": { + "description": "将本地哪个目录通过 http 分享", + "type": "string" + }, + "path_prefix": { + "description": "path_prefix 用在生成 url 时的路径前缀. 可留空", + "type": "string" + }, + "print_download": { + "description": "输出 download http 的信息,方便使用", + "type": "boolean" + }, + "proc_maxidle_duration": { + "description": "超过最大空闲时间,自动退出. 示例 3600s, 60m, 1h", + "type": "string", + "example": "1h" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServerComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions": { + "type": "object", + "required": [ + "BackupType", + "CrontabTime", + "Master" + ], + "properties": { + "BackupType": { + "type": "string" + }, + "CrontabTime": { + "type": "string" + }, + "Logical": { + "type": "object", + "properties": { + "ExcludeDatabases": { + "description": "\"mysql,test,db_infobase,information_schema,performance_schema,sys\"", + "type": "string" + }, + "ExcludeTables": { + "type": "string" + } + } + }, + "Master": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption" + }, + "Slave": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeParam": { + "type": "object", + "required": [ + "binlog_dir", + "binlog_files" + ], + "properties": { + "binlog_dir": { + "type": "string" + }, + "binlog_files": { + "type": "array", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "enum": [ + "", + "json", + "dump" + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationParam" + }, + "general": { + "description": "本地使用 ADMIN, change master 使用 repl", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationParam": { + "type": "object", + "required": [ + "bin_file", + "bin_position", + "host", + "master_host", + "master_port", + "port" + ], + "properties": { + "bin_file": { + "description": "binlog 文件名称", + "type": "string" + }, + "bin_position": { + "description": "binlog 位点信息", + "type": "integer", + "minimum": 0 + }, + "force": { + "description": "如果当前实例存在主从关系是否直接reset slave后,强制change master", + "type": "boolean", + "example": false + }, + "host": { + "description": "具体操作内容需要操作的参数", + "type": "string" + }, + "is_gtid": { + "description": "是否启动GID方式进行建立主从", + "type": "boolean" + }, + "master_host": { + "description": "change master to 主库ip", + "type": "string" + }, + "master_port": { + "description": "change master to 主库端口", + "type": "integer", + "maximum": 65535, + "minimum": 3306 + }, + "max_tolerate_delay": { + "description": "最大容忍延迟, 当 主从延迟 小于 该值, 认为建立主从关系成功. 不传或者为 0 时,表示不检查", + "type": "integer" + }, + "not_start_io_thread": { + "description": "不启动 io_thread。默认false 表示启动 io_thread", + "type": "boolean", + "example": false + }, + "not_start_sql_thread": { + "description": "不启动 sql_thread。默认false 表示启动 sql_thread", + "type": "boolean", + "example": false + }, + "port": { + "description": "当前实例的端口", + "type": "integer", + "maximum": 65535, + "minimum": 3306 + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlParam": { + "type": "object", + "required": [ + "tgt_instance" + ], + "properties": { + "check_interval_sec": { + "type": "integer" + }, + "drop_database": { + "description": "是否执行 drop database,这里是确认行为. 如果 false 则只把 drop 命令打印到输出", + "type": "boolean" + }, + "force": { + "description": "当实例不空闲时是否强制清空", + "type": "boolean" + }, + "reset_slave": { + "description": "是否执行 reset slave all", + "type": "boolean" + }, + "restart": { + "description": "drop_database 之后是否重启实例", + "type": "boolean" + }, + "stop_slave": { + "description": "是否执行 stop slave", + "type": "boolean" + }, + "tgt_instance": { + "description": "清空目标实例", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance" + } + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ConfItemOp": { + "type": "object", + "required": [ + "op_type" + ], + "properties": { + "conf_value": { + "description": "ConfName string `json:\"conf_name\" validate:\"required\"`", + "type": "string" + }, + "need_restart": { + "type": "boolean" + }, + "op_type": { + "description": "配置项修改动作,允许值 `upsert`,`remove`", + "type": "string", + "enum": [ + "upsert", + "remove" + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount": { + "type": "object", + "required": [ + "pwd", + "user" + ], + "properties": { + "access_hosts": { + "type": "array", + "items": { + "type": "string" + } + }, + "pwd": { + "type": "string" + }, + "user": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam": { + "type": "object", + "required": [ + "charset", + "host", + "port" + ], + "properties": { + "backup_dir": { + "type": "string" + }, + "backup_file_name": { + "type": "string" + }, + "bk_cloud_id": { + "description": "所在的云区域", + "type": "integer" + }, + "charset": { + "description": "字符集参数", + "type": "string" + }, + "db_cloud_token": { + "description": "云区域token", + "type": "string" + }, + "fileserver": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer" + }, + "host": { + "description": "当前实例的主机地址", + "type": "string" + }, + "port": { + "description": "当前实例的端口", + "type": "integer", + "minimum": 3306 + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer": { + "type": "object", + "properties": { + "bucket": { + "description": "目标bucket", + "type": "string" + }, + "password": { + "description": "制品库 password", + "type": "string" + }, + "project": { + "description": "制品库 project", + "type": "string" + }, + "upload_path": { + "description": "上传路径", + "type": "string" + }, + "url": { + "description": "制品库地址", + "type": "string" + }, + "username": { + "description": "制品库 username", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupParam": { + "type": "object", + "required": [ + "backup_dirs", + "tgt_instance" + ], + "properties": { + "backup_dirs": { + "type": "array", + "items": { + "type": "string" + } + }, + "cluster_id": { + "description": "指定查询哪个 cluster_id 的备份,如果不指定可能查询到其它非法的备份", + "type": "integer" + }, + "file_server": { + "type": "boolean" + }, + "tgt_instance": { + "description": "查找哪个实例的备份", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance" + } + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupResp": { + "type": "object", + "properties": { + "backups": { + "description": "backups key 是 .info 文件", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.LocalBackupObj" + } + }, + "latest": { + "description": "记录上面 backups 最近的一次备份", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitParam": { + "type": "object", + "required": [ + "pkg", + "pkg_md5" + ], + "properties": { + "exec_user": { + "description": "发起执行actor的用户,仅用于审计", + "type": "string" + }, + "pkg": { + "description": "安装包名", + "type": "string" + }, + "pkg_md5": { + "description": "安装包MD5", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumParam": { + "type": "object", + "required": [ + "pkg", + "pkg_md5" + ], + "properties": { + "api_url": { + "type": "string" + }, + "exec_user": { + "type": "string" + }, + "instances_info": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstanceInfo" + } + }, + "pkg": { + "description": "安装包名", + "type": "string" + }, + "pkg_md5": { + "description": "安装包MD5", + "type": "string" + }, + "schedule": { + "type": "string" + }, + "system_dbs": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLParams" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "timeZone": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLParams": { + "type": "object", + "required": [ + "charset", + "host", + "mycnf_configs", + "mysql_version", + "pkg", + "pkg_md5", + "ports" + ], + "properties": { + "allowDiskFileSystemTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "charset": { + "description": "字符集参数", + "type": "string" + }, + "dbha_account": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount" + }, + "host": { + "type": "string" + }, + "inst_mem": { + "description": "安装实例的内存大小,可以不指定,会自动计算", + "type": "integer" + }, + "mycnf_configs": { + "description": "map[port]my.cnf", + "type": "array", + "items": { + "type": "integer" + } + }, + "mysql_version": { + "description": "MySQLVerion 只需5.6 5.7 这样的大版本号", + "type": "string" + }, + "pkg": { + "description": "安装包名", + "type": "string" + }, + "pkg_md5": { + "description": "安装包MD5", + "type": "string" + }, + "ports": { + "description": "Ports", + "type": "array", + "items": { + "type": "integer" + } + }, + "spider_auto_incr_mode_map": { + "type": "array", + "items": { + "type": "integer" + } + }, + "super_account": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupComp": { + "type": "object", + "properties": { + "generalParam": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "params": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupParam": { "type": "object", "required": [ "bk_biz_id", - "conf_file", - "conf_type", - "format", - "level_name", - "method", - "namespace" + "configs", + "host", + "options", + "pkg", + "pkg_md5", + "ports", + "role" ], "properties": { "bk_biz_id": { - "description": "业务ID,必选项", - "type": "string", - "example": "testapp" + "description": "bkbizid", + "type": "integer" }, - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" + "bk_cloud_id": { + "description": "bk_cloud_id", + "type": "integer" }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" + "cluster_address": { + "description": "cluster addresss", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "format": { - "description": "`map.`, `map#`, `map|` 是特殊的map格式,返回结果会以 . 或者 # 或者 | 拆分 conf_name", - "type": "string", + "cluster_id": { + "description": "cluster id", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "cluster_type": { + "type": "string" + }, + "configs": { + "description": "Configs BackupConfig", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "exec_user": { + "description": "执行Job的用户", + "type": "string" + }, + "host": { + "description": "当前实例的主机地址", + "type": "string" + }, + "options": { + "description": "选项参数配置", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions" + } + ] + }, + "pkg": { + "description": "安装包名", + "type": "string" + }, + "pkg_md5": { + "description": "安装包MD5", + "type": "string" + }, + "ports": { + "description": "被监控机器的上所有需要监控的端口", + "type": "array", + "items": { + "type": "integer" + } + }, + "role": { + "description": "当前主机安装的mysqld的角色", + "type": "string" + }, + "shard_value": { + "description": "shard value for spider", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "untar_only": { + "description": "只解压,不校验不渲染配置,不连接 db", + "type": "boolean" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstanceInfo": { + "type": "object", + "properties": { + "bk_biz_id": { + "type": "integer" + }, + "bk_instance_id": { + "description": "0 被视为空, 不序列化", + "type": "integer" + }, + "cluster_id": { + "type": "integer" + }, + "immute_domain": { + "type": "string" + }, + "ip": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "role": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.LocalBackupObj": { + "type": "object", + "properties": { + "backup_dir": { + "description": "备份所在目录", + "type": "string" + }, + "backup_id": { + "type": "string" + }, + "backup_time": { + "description": "备份时间,目前是备份开始时间", + "type": "string" + }, + "backup_type": { + "type": "string" + }, + "bill_id": { + "type": "string" + }, + "bk_biz_id": { + "type": "integer" + }, + "cluster_id": { + "type": "integer" + }, + "data_schema_grant": { + "type": "string" + }, + "db_role": { + "type": "string" + }, + "file_list": { + "description": "InfoFile common.InfoFileDetail `json:\"info_file\"`\n备份文件列表", + "type": "array", + "items": { + "type": "string" + } + }, + "index_file": { + "type": "string" + }, + "inst_host": { + "description": "备份所属 host", + "type": "string" + }, + "inst_port": { + "description": "备份所属 port", + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeParam": { + "type": "object", + "required": [ + "items", + "persistent", + "restart", + "tgt_instance" + ], + "properties": { + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ConfItemOp" + } + }, + "persistent": { + "description": "是否持久化到 my.cnf 文件,-1: 不持久化,1: 持久化, 2: 仅持久化但不修改运行时", + "type": "integer", "enum": [ - "list", - "map", - "map.", - "map#", - "map|" + -1, + 1, + 2 ] }, - "level_info": { - "description": "上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {\"module\": \"m1\"} 提供cluster所属上级 module 的信息\n非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用\ntodo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系", - "type": "object", - "additionalProperties": { + "restart": { + "description": "指定是否 允许重启, -1:不重启, 1: 重启, 2:根据 items need_restart 自动判断是否重启", + "type": "integer", + "enum": [ + -1, + 1, + 2 + ] + }, + "tgt_instance": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneParam": { + "type": "object", + "required": [ + "persistent", + "restart", + "src_instance", + "tgt_instance" + ], + "properties": { + "items": { + "description": "需要克隆哪些变量, 考虑到不同版本参数不一样,这里不要求指定一定存在; 只修改 mysqld 区。即失败忽略\n有些参数是 readonly 的,只会保存到 my.cnf 中,如果与运行值不一样需要用户重启\n默认值见 MycnfCloneItemsDefault", + "type": "array", + "items": { + "type": "string" + } + }, + "persistent": { + "description": "是否持久化到 my.cnf 文件,0: 不持久化,1: 持久化, 2: 仅持久化但不修改运行时", + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "example": 1 + }, + "restart": { + "description": "指定是否 允许重启, 0:不重启, 1: 重启, 2:根据 items need_restart 自动判断是否重启", + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "example": 2 + }, + "src_instance": { + "description": "参数克隆,获取源实例,可以提供 repl 账号权限", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" + } + ] + }, + "tgt_instance": { + "description": "应用到本地目标实例,需要有 ADMIN 权限", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" + } + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult" + } + }, + "message": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds": { + "type": "object", + "properties": { + "cmds": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd" + } + }, + "run_user": { + "type": "string" + }, + "work_dir": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumParam": { + "type": "object", + "properties": { + "bk_biz_id": { + "description": "业务 id", + "type": "integer" + }, + "cluster_id": { + "description": "集群 id", + "type": "integer" + }, + "db_patterns": { + "description": "库表过滤选项", + "type": "array", + "items": { + "type": "string" + } + }, + "ignore_dbs": { + "description": "库表过滤选项", + "type": "array", + "items": { + "type": "string" + } + }, + "ignore_tables": { + "description": "库表过滤选项", + "type": "array", + "items": { + "type": "string" + } + }, + "immute_domain": { + "description": "集群域名", + "type": "string" + }, + "inner_role": { + "description": "执行校验的 db inner role, 应该是[master, repeater]", + "type": "string" + }, + "master_access_slave_password": { + "description": "从 db 访问 slave 的密码", + "type": "string" + }, + "master_access_slave_user": { + "description": "从 db 访问 slave 的用户名", + "type": "string" + }, + "master_ip": { + "description": "执行校验的 db ip", + "type": "string" + }, + "master_port": { + "description": "执行校验的 db port", + "type": "integer" + }, + "replicate_table": { + "description": "结果表, 带库前缀", + "type": "string" + }, + "runtime_hour": { + "description": "校验运行时长", + "type": "integer" + }, + "slaves": { + "description": "slave 列表", + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SlaveInfo" + } + }, + "system_dbs": { + "description": "系统表", + "type": "array", + "items": { + "type": "string" + } + }, + "table_patterns": { + "description": "库表过滤选项", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd": { + "type": "object", + "properties": { + "cmd_args": { + "type": "array", + "items": { "type": "string" } }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" - ] - }, - "level_value": { - "description": "配置层级值", + "cmd_name": { "type": "string" - }, - "method": { - "description": "method must be one of GenerateOnly|GenerateAndSave|GenerateAndPublish\n`GenerateOnly`: generate merged config\n`GenerateAndSave`: generate and save the merged config to db (snapshot).\n`GenerateAndPublish`: generate and save the merged config to db, and mark it as published (release)", - "type": "string", - "enum": [ - "GenerateAndSave", - "GenerateAndPublish" - ] - }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" } } }, - "GenerateConfigResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult": { "type": "object", - "required": [ - "level_name" - ], "properties": { - "bk_biz_id": { + "cmd_stderr": { "type": "string" }, - "conf_file": { + "cmd_stdout": { "type": "string" }, - "content": { - "description": "content is a {conf_name:conf_type} dict like {\"a\":1, \"b\":\"string\"}", - "type": "object", - "additionalProperties": true - }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" - ] - }, - "level_value": { - "description": "配置层级值", + "err_msg": { "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SlaveInfo": { + "type": "object", + "properties": { + "id": { + "description": "slave id", + "type": "integer" }, - "revision": { - "description": "version name for this config_file generation", + "ip": { + "description": "slave ip", "type": "string" + }, + "port": { + "description": "slave port", + "type": "integer" } } }, - "GetConfigItemsReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount": { "type": "object", "required": [ - "bk_biz_id", - "conf_file", - "conf_type", - "format", - "level_name", - "namespace" + "pwd", + "user" ], "properties": { - "bk_biz_id": { - "description": "业务ID,必选项", - "type": "string", - "example": "testapp" - }, - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" - }, - "conf_name": { - "description": "指定要查询的 conf_name, 多个值以,分隔,为空表示查询该 conf_file 的所有conf_name", - "type": "string" - }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" - }, - "format": { - "description": "`map.`, `map#`, `map|` 是特殊的map格式,返回结果会以 . 或者 # 或者 | 拆分 conf_name", - "type": "string", - "enum": [ - "list", - "map", - "map.", - "map#", - "map|" - ] - }, - "level_info": { - "description": "上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {\"module\": \"m1\"} 提供cluster所属上级 module 的信息\n非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用\ntodo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系", - "type": "object", - "additionalProperties": { + "access_hosts": { + "type": "array", + "items": { "type": "string" } }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" - ] - }, - "level_value": { - "description": "配置层级值", + "pwd": { "type": "string" }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" + "user": { + "type": "string" } } }, - "GetConfigItemsResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam": { "type": "object", "required": [ - "conf_file", - "conf_type", - "level_name", - "namespace" + "host", + "ports" ], "properties": { - "bk_biz_id": { - "type": "string" + "force": { + "description": "是否强制下架mysqld", + "type": "boolean" }, - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" - }, - "conf_file_lc": { - "description": "配置文件中文名,也可以是其它 locale 语言类型", - "type": "string", - "example": "5.7_参数配置" - }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" - }, - "conf_type_lc": { - "description": "配置类型中文名", - "type": "string", - "example": "DB参数配置" - }, - "content": { - "description": "content is a {conf_name:conf_type} dict like {\"a\":1, \"b\":\"string\"}", - "type": "object", - "additionalProperties": true - }, - "created_at": { + "host": { "type": "string" }, - "description": { - "description": "配置文件的描述", + "ports": { + "description": "被监控机器的上所有需要监控的端口", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption": { + "type": "object", + "properties": { + "DataSchemaGrant": { + "description": "\"grant,schema,data\"", "type": "string" - }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplComp": { + "type": "object", + "properties": { + "db": { + "description": "本地db链接", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.DbWorker" + } ] }, - "level_value": { - "description": "配置层级值", - "type": "string" - }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" - }, - "namespace_info": { - "description": "namespace信息,比如数据库版本,与 conf_file 对应", - "type": "string", - "example": "MySQL 5.7" + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplParam" }, - "updated_at": { + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplParam": { + "type": "object", + "properties": { + "host": { + "description": "当前实例的主机地址", "type": "string" }, - "updated_by": { - "type": "string" + "port": { + "description": "当前实例的端口", + "type": "integer" + }, + "repl_hosts": { + "description": "slave host", + "type": "array", + "items": { + "type": "string" + } } } }, - "ListConfigVersionsResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLBinlogUtil": { "type": "object", - "required": [ - "level_name" - ], "properties": { - "bk_biz_id": { + "databases": { + "description": "row event 解析指定 databases", + "type": "array", + "items": { + "type": "string" + } + }, + "databases_ignore": { + "description": "row event 解析指定 忽略 databases", + "type": "array", + "items": { + "type": "string" + } + }, + "filter_statement_match_error": { + "description": "匹配字符串成功,则解析 binlog 报错", + "type": "string" + }, + "filter_statement_match_ignore": { + "description": "匹配字符串成功,则忽略语句,加入注释中", "type": "string" }, - "conf_file": { + "filter_statement_match_ignore_force": { + "description": "匹配字符串成功,强制忽略语句,加入注释中。当与 filter_statement_match_error 都匹配时,ignore_force会优先生效\n默认 infodba_schema", "type": "string" }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", + "flashback": { + "description": "是否启用 flashback", + "type": "boolean" + }, + "idempotent_mode": { + "description": "是否开启幂等模式, mysql --slave-exec-mode=idempotent or mysqlbinlog --idempotent", + "type": "boolean" + }, + "mysql_client_opt": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLClientOpt" + }, + "not_write_binlog": { + "description": "导入时是否记录 binlog, mysql sql_log_bin=0 or mysqlbinlog --disable-log-bin. true表示不写", + "type": "boolean" + }, + "query_event_handler": { + "description": "query event 默认处理策略。keep:保留解析出的query event 语句, ignore:注释(丢弃)该 query event, error:认为是不接受的语句,报错\n默认 keep", "type": "string", "enum": [ - "plat", - "app", - "module", - "cluster" + "keep", + "ignore", + "safe", + "error" ] }, - "level_value": { - "description": "配置层级值", + "rewrite_db": { + "description": "--rewrite_db=\"db1-\u003exx_db1,db2-\u003exx_db2\"", "type": "string" }, - "namespace": { + "start_pos": { + "description": "--start-position", + "type": "integer" + }, + "start_time": { + "description": "--start-datetime", "type": "string" }, - "published": { - "description": "version published. empty when published version is not in versions", + "stop_pos": { + "description": "--stop-position", + "type": "integer" + }, + "stop_time": { + "description": "--stop-datetime", "type": "string" }, - "versions": { - "description": "版本列表,格式 [{\"revision\":\"v1\", \"rows_affected\":1},{\"revision\":\"v2\", \"rows_affected\":2}]", + "tables": { + "description": "row event 解析指定 tables", "type": "array", "items": { - "type": "object", - "additionalProperties": true + "type": "string" + } + }, + "tables_ignore": { + "description": "row event 解析指定 忽略 tables", + "type": "array", + "items": { + "type": "string" } } } }, - "PublishConfigFileReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLClientOpt": { + "type": "object", + "properties": { + "binary_mode": { + "description": "是否启用 --binary-mode", + "type": "boolean" + }, + "max_allowed_packet": { + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlog": { "type": "object", "required": [ - "bk_biz_id", - "conf_file", - "conf_type", - "namespace", - "revision" + "binlog_dir", + "binlog_files", + "recover_opt", + "tgt_instance", + "work_dir" ], "properties": { - "bk_biz_id": { - "description": "业务ID,必选项", + "binlog_dir": { + "description": "恢复时 binlog 存放目录,一般是下载目录", "type": "string", - "example": "testapp" + "example": "/data/dbbak/123456/binlog" + }, + "binlog_files": { + "description": "binlog列表", + "type": "array", + "items": { + "type": "string" + } }, - "cluster": { + "binlog_start_file": { + "description": "指定要开始应用的第 1 个 binlog。如果指定,一般要设置 start_pos,如果不指定则使用 start_time", "type": "string" }, - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" + "parse_concurrency": { + "description": "解析的并发度,默认 1", + "type": "integer" }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" + "parse_only": { + "description": "仅解析 binlog,不做导入", + "type": "boolean" + }, + "quick_mode": { + "description": "如果启用 quick_mode,解析 binlog 时根据 filter databases 等选项过滤 row event,对 query event 会全部保留 。需要 mysqlbinlog 工具支持 --tables 选项,可以指定参数的 tools\n当 quick_mode=false 时,recover_opt 里的 databases 等选项无效,会应用全部 binlog", + "type": "boolean" }, - "namespace": { - "description": "命名空间,一般指DB类型", + "recover_opt": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLBinlogUtil" + }, + "source_binlog_format": { "type": "string", - "example": "tendbha" + "enum": [ + "", + "ROW", + "STATEMENT", + "MIXED" + ] }, - "patch": { - "description": "patch will overwrite conf_value to versioned config_file. it's a key-value dict", + "tgt_instance": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" + }, + "tools": { + "description": "外部指定工具路径", "type": "object", "additionalProperties": { "type": "string" } }, - "revision": { - "description": "the version you want to publish", + "work_dir": { + "description": "binlog 解析所在目录,存放运行日志", + "type": "string", + "example": "/data/dbbak/" + }, + "work_id": { "type": "string", - "example": "v_20220309161928" + "example": "123456" } } }, - "QueryConfigNamesResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlogComp": { "type": "object", "properties": { - "conf_file": { - "type": "string" + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlog" }, - "conf_names": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/api.ConfNameDef" - } + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" } } }, - "api.ConfFileDef": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreDRComp": { "type": "object", - "required": [ - "conf_file", - "conf_type", - "namespace" - ], "properties": { - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" - }, - "conf_file_lc": { - "description": "配置文件中文名,也可以是其它 locale 语言类型", - "type": "string", - "example": "5.7_参数配置" - }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" - }, - "conf_type_lc": { - "description": "配置类型中文名", - "type": "string", - "example": "DB参数配置" - }, - "description": { - "description": "配置文件的描述", - "type": "string" + "extend": { + "description": "恢复参数,会复制给具体的 Restore 实现. 见 ChooseType 方法", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreParam" + } + ] }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" + "general": { + "description": "通用参数", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + ] }, - "namespace_info": { - "description": "namespace信息,比如数据库版本,与 conf_file 对应", - "type": "string", - "example": "MySQL 5.7" + "resume": { + "description": "是否是中断后继续执行", + "type": "boolean" } } }, - "api.ConfNameDef": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreOpt": { "type": "object", - "required": [ - "conf_name", - "value_type" - ], "properties": { - "conf_name": { - "description": "配置项,也叫参数项", - "type": "string" - }, - "conf_name_lc": { - "description": "配置项中文名,可不填", - "type": "string" - }, - "description": { - "description": "配置项说明", - "type": "string" - }, - "flag_disable": { - "description": "是否禁用,代表该配置项状态. 默认0启用", - "type": "integer", - "example": 0 + "databases": { + "description": "恢复哪些 db,当前只对 逻辑恢复有效", + "type": "array", + "items": { + "type": "string" + } }, - "flag_locked": { - "description": "是否锁定. 默认0", - "type": "integer", - "example": 0 + "enable_binlog": { + "description": "EnableBinlog 导入数据时是否写binlog,默认不启用", + "type": "boolean" }, - "need_restart": { - "description": "是否需要重启生效. 默认1", - "type": "integer", - "example": 1 + "ignore_databases": { + "type": "array", + "items": { + "type": "string" + } }, - "value_allowed": { - "description": "允许设定值,如枚举/范围等,为空时表示不限制范围\n当 value_type_sub=ENUM 时,value_allowed 格式 0|1 或者 ON|OFF 或者 aaa|bbb|ccc , 会校验value的合法性\n当 value_type_sub=REGEX 时,会根据 value_allowed 进行正则校验\n当 value_type_sub=RANGE 时,也会校验value 范围的合法性.\n - BYTES 是一种特殊的RANGE,value允许1mm 但value_allowed 必须是数字的range", - "type": "string" + "ignore_tables": { + "type": "array", + "items": { + "type": "string" + } }, - "value_default": { - "description": "配置项默认值", - "type": "string", - "example": "1" + "recover_binlog": { + "description": "在指定时间点回档场景才需要,是否恢复 binlog。在 doSlave 场景,是不需要 recover_binlog。这个选项是控制下一步恢复binlog的行为\n当 recover_binlog 时,要确保实例的所有库表结构都恢复。在逻辑回档场景,只回档部分库表数据时,依然要恢复所有表结构", + "type": "boolean" }, - "value_type": { - "description": "配置项的值类型,如 `STRING`,`INT`,`FLOAT`,`NUMBER`", - "type": "string", - "enum": [ - "STRING", - "INT", - "FLOAT", - "NUMBER" - ], - "example": "STRING" + "recover_privs": { + "type": "boolean" }, - "value_type_sub": { - "description": "value_type 的子类型,如果设置则用于校验 value_type 的具体类型,或者返回用于告知前端控件类型,例如 ENUM,RANGE", + "source_binlog_format": { + "description": "在库表级定点回档时有用,如果是 statement/mixed 格式,导入数据时需要全部导入;\n如果是 row,可只导入指定库表数据, 在 recover-binlog 时可指定 quick_mode=true 也恢复指定库表 binlog", "type": "string", "enum": [ "", - "STRING", - "ENUM", - "RANGE", - "BYTES", - "REGEX", - "JSON", - "COMPLEX" - ], - "example": "ENUM" + "ROW", + "STATEMENT", + "MIXED" + ] + }, + "tables": { + "type": "array", + "items": { + "type": "string" + } } } }, - "api.GetVersionedDetailResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreParam": { "type": "object", + "required": [ + "backup_dir", + "backup_files", + "work_dir" + ], "properties": { - "configs": { - "description": "配置项", - "type": "object", - "additionalProperties": true + "backup_dir": { + "description": "备份文件所在本地目录,理论上doDr不会对该目录写入,而是写入 targetDir", + "type": "string", + "example": "/data/dbbak" }, - "configs_diff": { - "description": "与上一个版本的差异", + "backup_files": { + "description": "备份文件名列表,key 是 info|full|priv|index, value 是是相对于 backup_dir 的文件名列表", "type": "object", - "additionalProperties": true - }, - "content": { - "type": "string" - }, - "created_at": { - "description": "发布时间", - "type": "string" - }, - "created_by": { - "description": "发布人", - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } }, - "is_published": { - "type": "integer" + "change_master": { + "description": "恢复完成后是否执行 change master,会 change master 到 src_instance", + "type": "boolean" }, - "pre_revision": { - "description": "上一个版本好", - "type": "string" + "restore_opts": { + "description": "恢复选项,比如恢复库表、是否导入binlog等。目前只对逻辑恢复有效", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreOpt" + } + ] }, - "revision": { - "description": "版本号", - "type": "string" + "src_instance": { + "description": "备份实例的 ip port,用于生产 change master 语句。如果 host 为空,表示不检查、不生成change master,恢复spider节点时使用", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance" + } + ] }, - "rows_affected": { - "description": "相对上一个版本 影响行数", - "type": "integer" - } - } - }, - "api.HTTPClientErrResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 400 + "tgt_instance": { + "description": "恢复本地的目标实例", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" + } + ] }, - "data": {}, - "message": { - "description": "status bad request", + "tools": { + "description": "恢复用到的客户端工具,不提供时会有默认值", + "allOf": [ + { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_tools.ToolSet" + } + ] + }, + "work_dir": { + "description": "备份恢复目录,工作目录", "type": "string", - "example": "输入参数错误" - } - } - }, - "api.HTTPOkNilResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 + "example": "/data1/dbbak" }, - "data": {}, - "message": { + "work_id": { + "description": "work_id 标识本次恢复,若为0则为当前时间戳", "type": "string" } } }, - "api.ListConfFileResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.Flashback": { "type": "object", "required": [ - "conf_file", - "conf_type", - "namespace" + "recover_opt", + "target_time", + "tgt_instance", + "work_dir" ], "properties": { - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" + "binlog_dir": { + "description": "当 binlog_dir 不为空,表示 binlog 已下载;当为空时,目前只从本地软连接", + "type": "string" }, - "conf_file_lc": { - "description": "配置文件中文名,也可以是其它 locale 语言类型", - "type": "string", - "example": "5.7_参数配置" + "binlog_files": { + "description": "binlog列表,如果不提供,则自动从本地查找符合时间范围的 binlog", + "type": "array", + "items": { + "type": "string" + } }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" + "parse_concurrency": { + "description": "解析binlog并发度", + "type": "integer" }, - "conf_type_lc": { - "description": "配置类型中文名", - "type": "string", - "example": "DB参数配置" + "recover_opt": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.RecoverOpt" }, - "created_at": { - "description": "创建时间", + "stop_time": { "type": "string" }, - "description": { - "description": "配置文件的描述", + "target_time": { + "description": "闪回的目标时间点,对应 recover-binlog 的 start_time, 精确到秒。目标实例的时区", "type": "string" }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" + "tgt_instance": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject" }, - "namespace_info": { - "description": "namespace信息,比如数据库版本,与 conf_file 对应", - "type": "string", - "example": "MySQL 5.7" + "tools": { + "description": "外部指定工具路径", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "updated_at": { - "description": "更新时间", + "work_dir": { + "description": "binlog 解析所在目录,存放运行日志", "type": "string" }, - "updated_by": { - "description": "更新人", + "work_id": { "type": "string" } } }, - "api.SaveConfItemsReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.FlashbackComp": { "type": "object", - "required": [ - "bk_biz_id", - "level_name" - ], "properties": { - "bk_biz_id": { - "description": "业务ID,必选项", - "type": "string", - "example": "testapp" + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.Flashback" }, - "conf_file_info": { - "$ref": "#/definitions/api.ConfFileDef" - }, - "conf_items": { + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.RecoverOpt": { + "type": "object", + "properties": { + "databases": { + "description": "row event 解析指定 databases", "type": "array", "items": { - "$ref": "#/definitions/api.UpsertConfItem" + "type": "string" } }, - "confirm": { - "description": "保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求", - "type": "integer" + "databases_ignore": { + "description": "row event 解析指定 忽略 databases", + "type": "array", + "items": { + "type": "string" + } }, - "description": { - "description": "发布描述", + "filter_rows": { + "description": "暂不支持行级闪回", "type": "string" }, - "level_info": { - "description": "上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {\"module\": \"m1\"} 提供cluster所属上级 module 的信息\n非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用\ntodo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系", - "type": "object", - "additionalProperties": { + "tables": { + "description": "row event 解析指定 tables", + "type": "array", + "items": { "type": "string" } }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" - ] + "tables_ignore": { + "description": "row event 解析指定 忽略 tables", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingParam" }, - "level_value": { - "description": "配置层级值", - "type": "string" + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" } } }, - "api.UpsertConfFilePlatReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingParam": { "type": "object", "required": [ - "conf_file", - "conf_type", - "namespace", - "req_type" + "ctl_instances", + "host", + "mysql_instance_tuples", + "port", + "spider_instances", + "tdbctl_pass", + "tdbctl_user" ], "properties": { - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" + "ctl_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance" + } }, - "conf_file_lc": { - "description": "配置文件中文名,也可以是其它 locale 语言类型", - "type": "string", - "example": "5.7_参数配置" + "host": { + "type": "string" }, - "conf_names": { - "description": "如果revision为空,表示第一次保存。每次 update 操作都会返回 revision,确保在这一轮编辑操作下都是操作这个revision\n已发布的 revision 不能编辑\nRevision string `json:\"revision\" form:\"revision\"`", + "mysql_instance_tuples": { "type": "array", "items": { - "$ref": "#/definitions/api.UpsertConfNames" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple" } }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" - }, - "conf_type_lc": { - "description": "配置类型中文名", - "type": "string", - "example": "DB参数配置" + "port": { + "type": "integer", + "minimum": 3306 }, - "confirm": { - "description": "保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求", - "type": "integer" + "spider_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance" + } }, - "description": { - "description": "配置文件的描述", + "tdbctl_pass": { "type": "string" }, - "file_id": { - "description": "新建配置文件,第一次保存返回 file_id, 后续保存/发布 需传入 file_id", - "type": "integer" - }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" - }, - "namespace_info": { - "description": "namespace信息,比如数据库版本,与 conf_file 对应", - "type": "string", - "example": "MySQL 5.7" - }, - "req_type": { - "description": "配置文件修改动作的请求类型,`SaveOnly`: 仅保存, `SaveAndPublish`保存并发布", - "type": "string", - "enum": [ - "SaveOnly", - "SaveAndPublish" - ] + "tdbctl_user": { + "type": "string" } } }, - "api.UpsertConfFilePlatResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance": { "type": "object", "required": [ - "conf_file", - "conf_type", - "namespace" + "host", + "port" ], "properties": { - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" - }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" + "host": { + "type": "string" }, - "file_id": { - "type": "integer" + "port": { + "type": "integer", + "minimum": 3306 }, - "is_published": { + "shard_id": { "type": "integer" - }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" - }, - "revision": { - "description": "编辑配置文件,仅保存时不会产生 revision,保存并发布时才返回", - "type": "string" } } }, - "api.UpsertConfItem": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple": { "type": "object", "required": [ - "conf_name", - "op_type" + "host", + "port", + "shard_id", + "slave_host" ], "properties": { - "conf_name": { - "description": "配置项名称", + "host": { "type": "string" }, - "conf_value": { - "type": "string" + "port": { + "type": "integer" }, - "description": { - "type": "string" + "shard_id": { + "type": "integer" }, - "extra_info": { + "slave_host": { "type": "string" - }, - "flag_disable": { - "description": "是否禁用,默认 0 表示启用. 1表示禁用", - "type": "integer", - "example": 0 - }, - "flag_locked": { - "description": "是否锁定,默认 0 表上不锁定", - "type": "integer", - "example": 0 - }, - "op_type": { - "description": "配置项修改动作,需提供操作类型字段,允许值 `add`,`update`,`remove`", - "type": "string", - "enum": [ - "add", - "update", - "remove" - ] } } }, - "api.UpsertConfItemsReq": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs": { "type": "object", "required": [ - "bk_biz_id", - "level_name", - "req_type" + "dumper_configs" ], "properties": { - "bk_biz_id": { - "description": "业务ID,必选项", - "type": "string", - "example": "testapp" - }, - "conf_file_info": { - "$ref": "#/definitions/api.ConfFileDef" - }, - "conf_items": { + "dumper_configs": { "type": "array", "items": { - "$ref": "#/definitions/api.UpsertConfItem" + "type": "integer" } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam" }, - "confirm": { - "description": "保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求", - "type": "integer" - }, - "description": { - "description": "发布描述", + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam": { + "type": "object", + "required": [ + "charset", + "host", + "port", + "tbinlogdumper_port" + ], + "properties": { + "charset": { + "description": "字符集参数", "type": "string" }, - "level_info": { - "description": "上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {\"module\": \"m1\"} 提供cluster所属上级 module 的信息\n非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用\ntodo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "level_name": { - "description": "配置层级名,当前允许值 `app`,`module`,`cluster`\n配合 flag_locked 锁定标记,可以知道 锁定级别", - "type": "string", - "enum": [ - "plat", - "app", - "module", - "cluster" - ] - }, - "level_value": { - "description": "配置层级值", + "host": { + "description": "当前实例的主机地址", "type": "string" }, - "req_type": { - "description": "配置文件修改动作的请求类型,`SaveOnly`: 仅保存, `SaveAndPublish`保存并发布", - "type": "string", - "enum": [ - "SaveOnly", - "SaveAndPublish" - ] + "port": { + "description": "当前实例的端口", + "type": "integer", + "minimum": 3306 }, - "revision": { - "type": "string" + "tbinlogdumper_port": { + "description": "当前TBinlogdumperPort实例的端口", + "type": "integer", + "minimum": 3306 } } }, - "api.UpsertConfItemsResp": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams": { "type": "object", - "required": [ - "conf_file", - "conf_type", - "namespace" - ], "properties": { - "bk_biz_id": { + "area_name": { "type": "string" }, - "conf_file": { - "description": "配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 MySQL-5.5, MySQL-5.6 两个配置文件", - "type": "string", - "example": "MySQL-5.7" + "dumper_id": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp": { + "type": "object", + "properties": { + "dumperConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams" + } }, - "conf_type": { - "description": "配置类型,如 dbconf,backup", - "type": "string", - "example": "dbconf" + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs" }, - "is_published": { - "type": "integer" + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" }, - "namespace": { - "description": "命名空间,一般指DB类型", - "type": "string", - "example": "tendbha" + "renderConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs" + } }, - "revision": { - "description": "编辑配置文件,第一次保存返回 revision, 后续保存/发布 需传入 revision", + "timeZone": { "type": "string" } } }, - "api.UpsertConfNames": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld": { "type": "object", - "required": [ - "conf_name", - "op_type", - "value_type" - ], "properties": { - "conf_name": { - "description": "配置项,也叫参数项", + "area_name": { "type": "string" }, - "conf_name_lc": { - "description": "配置项中文名,可不填", + "basedir": { "type": "string" }, - "description": { - "description": "配置项说明", + "bind-address": { "type": "string" }, - "flag_disable": { - "description": "是否禁用,代表该配置项状态. 默认0启用", - "type": "integer", - "example": 0 + "character_set_server": { + "type": "string" }, - "flag_locked": { - "description": "是否锁定. 默认0", - "type": "integer", - "example": 0 + "datadir": { + "type": "string" }, - "need_restart": { - "description": "是否需要重启生效. 默认1", - "type": "integer", - "example": 1 + "dumper_id": { + "type": "string" }, - "op_type": { - "description": "配置项修改动作,需提供操作类型字段,允许值 `add`,`update`,`remove`", - "type": "string", - "enum": [ - "add", - "update", - "remove" - ] + "logdir": { + "type": "string" }, - "value_allowed": { - "description": "允许设定值,如枚举/范围等,为空时表示不限制范围\n当 value_type_sub=ENUM 时,value_allowed 格式 0|1 或者 ON|OFF 或者 aaa|bbb|ccc , 会校验value的合法性\n当 value_type_sub=REGEX 时,会根据 value_allowed 进行正则校验\n当 value_type_sub=RANGE 时,也会校验value 范围的合法性.\n - BYTES 是一种特殊的RANGE,value允许1mm 但value_allowed 必须是数字的range", + "port": { "type": "string" }, - "value_default": { - "description": "配置项默认值", - "type": "string", - "example": "1" + "server_id": { + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp": { + "type": "object", + "properties": { + "generalParam": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" }, - "value_type": { - "description": "配置项的值类型,如 `STRING`,`INT`,`FLOAT`,`NUMBER`", - "type": "string", - "enum": [ - "STRING", - "INT", - "FLOAT", - "NUMBER" - ], - "example": "STRING" + "params": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs": { + "type": "object", + "properties": { + "mysqld": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_native.DbWorker": { + "type": "object", + "properties": { + "db": { + "$ref": "#/definitions/sql.DB" }, - "value_type_sub": { - "description": "value_type 的子类型,如果设置则用于校验 value_type 的具体类型,或者返回用于告知前端控件类型,例如 ENUM,RANGE", - "type": "string", - "enum": [ - "", - "STRING", - "ENUM", - "RANGE", - "BYTES", - "REGEX", - "JSON", - "COMPLEX" - ], - "example": "ENUM" + "dsn": { + "type": "string" } } }, - "model.ConfigModel": { + "dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject": { "type": "object", "properties": { - "bk_biz_id": { + "charset": { + "description": "连接字符集", "type": "string" }, - "conf_file": { + "host": { + "description": "当前实例的主机地址", "type": "string" }, - "conf_name": { + "options": { + "description": "其它选项", "type": "string" }, - "conf_type": { + "port": { + "description": "当前实例的端口", + "type": "integer" + }, + "pwd": { + "description": "连接当前实例的User Pwd", "type": "string" }, - "conf_value": { + "socket": { + "description": "连接socket", + "type": "string" + }, + "user": { + "description": "连接当前实例的User", "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance": { + "type": "object", + "properties": { + "host": { + "description": "当前实例的主机地址", + "type": "string", + "example": "1.1.1.1" }, - "created_at": { + "port": { + "description": "当前实例的端口", + "type": "integer", + "example": 33060 + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_tools.ToolSet": { + "type": "object", + "properties": { + "tools": { + "description": "外部指定工具路径", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_util_mysqlutil.ChangeMaster": { + "type": "object", + "required": [ + "master_host", + "master_password", + "master_port", + "master_user" + ], + "properties": { + "change_sql": { "type": "string" }, - "description": { + "channel": { "type": "string" }, - "extra_info": { + "executed_gtid_set": { "type": "string" }, - "flag_disable": { - "type": "integer" + "force": { + "description": "如果当前实例存在主从关系是否直接reset slave后,强制change master", + "type": "boolean" }, - "flag_locked": { - "type": "integer" + "is_gtid": { + "description": "是否启动GID方式进行建立主从", + "type": "boolean" }, - "id": { + "master_auto_position": { "type": "integer" }, - "level_locked": { + "master_host": { + "description": "主库ip", "type": "string" }, - "level_name": { + "master_log_file": { + "description": "binlog 文件名称", "type": "string" }, - "level_value": { + "master_log_pos": { + "description": "binlog 位点信息", + "type": "integer" + }, + "master_password": { "type": "string" }, - "namespace": { + "master_port": { + "description": "主库端口", + "type": "integer", + "minimum": 3306 + }, + "master_user": { "type": "string" }, - "updated_at": { + "max_tolerate_delay": { + "description": "最大容忍延迟,即主从延迟小于该值,认为建立主从关系成功", + "type": "integer" + } + } + }, + "internal_subcmd_commoncmd.RMLargeFileParam": { + "type": "object", + "required": [ + "bw_limit_mb", + "filename" + ], + "properties": { + "bw_limit_mb": { + "description": "删除速度,MB/s,默认 30", + "type": "integer", + "default": 30, + "maximum": 1000, + "minimum": 1 + }, + "filename": { "type": "string" } } - } - }, - "securityDefinitions": { - "BasicAuth": { - "type": "basic" + }, + "sql.DB": { + "type": "object" } } } \ No newline at end of file diff --git a/dbm-services/common/db-config/docs/swagger.yaml b/dbm-services/common/db-config/docs/swagger.yaml index 16711f952a..93b6ddd41d 100644 --- a/dbm-services/common/db-config/docs/swagger.yaml +++ b/dbm-services/common/db-config/docs/swagger.yaml @@ -1,1402 +1,2295 @@ basePath: / definitions: - GenerateConfigReq: + dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam: properties: - bk_biz_id: - description: 业务ID,必选项 - example: testapp + runtime_account: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeAccountParam' + runtime_extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeExtend' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeAccountParam: + properties: + admin_pwd: + description: mysql admin 密码,环境变量 GENERAL_ACCOUNT_admin_pwd type: string - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 + admin_user: + description: mysql admin 账户,环境变量 GENERAL_ACCOUNT_admin_user type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + backup_pwd: + description: dbbackup pwd type: string - format: - description: '`map.`, `map#`, `map|` 是特殊的map格式,返回结果会以 . 或者 # 或者 | 拆分 conf_name' - enum: - - list - - map - - map. - - map# - - map| + backup_user: + description: dbbackup user type: string - level_info: - additionalProperties: - type: string - description: |- - 上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {"module": "m1"} 提供cluster所属上级 module 的信息 - 非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用 - todo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系 - type: object - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + monitor_access_all_pwd: + description: mysql monitor@% 密码 type: string - level_value: - description: 配置层级值 + monitor_access_all_user: + description: mysql monitor@% type: string - method: - description: |- - method must be one of GenerateOnly|GenerateAndSave|GenerateAndPublish - `GenerateOnly`: generate merged config - `GenerateAndSave`: generate and save the merged config to db (snapshot). - `GenerateAndPublish`: generate and save the merged config to db, and mark it as published (release) - enum: - - GenerateAndSave - - GenerateAndPublish + monitor_pwd: + description: mysql monitor 密码,环境变量 GENERAL_ACCOUNT_monitor_pwd type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + monitor_user: + description: mysql monitor 账户,环境变量 GENERAL_ACCOUNT_monitor_user type: string - required: - - bk_biz_id - - conf_file - - conf_type - - format - - level_name - - method - - namespace - type: object - GenerateConfigResp: - properties: - bk_biz_id: + proxy_admin_pwd: + description: proxy admin pwd type: string - conf_file: + proxy_admin_user: + description: proxy admin user type: string - content: - additionalProperties: true - description: content is a {conf_name:conf_type} dict like {"a":1, "b":"string"} - type: object - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + repl_pwd: + description: repl pwd, 环境变量 GENERAL_ACCOUNT_repl_pwd type: string - level_value: - description: 配置层级值 + repl_user: + description: repl user, 环境变量 GENERAL_ACCOUNT_repl_user type: string - revision: - description: version name for this config_file generation + tdbctl_pwd: type: string - required: - - level_name - type: object - GetConfigItemsReq: - properties: - bk_biz_id: - description: 业务ID,必选项 - example: testapp + tdbctl_user: type: string - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 + yw_pwd: + description: yw pwd type: string - conf_name: - description: 指定要查询的 conf_name, 多个值以,分隔,为空表示查询该 conf_file 的所有conf_name + yw_user: + description: yw user type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components.RuntimeExtend: + properties: + mysql_sys_users: + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam: + properties: + auth_pass: + description: http url basic auth pass type: string - format: - description: '`map.`, `map#`, `map|` 是特殊的map格式,返回结果会以 . 或者 # 或者 | 拆分 conf_name' - enum: - - list - - map - - map. - - map# - - map| + auth_user: + description: http url basic auth user type: string - level_info: - additionalProperties: + bk_biz_id: + type: integer + bwlimit_mb: + description: 单文件下载限速,单位 MB/s + type: integer + curl_options: + items: type: string - description: |- - 上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {"module": "m1"} 提供cluster所属上级 module 的信息 - 非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用 - todo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系 - type: object - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + type: array + curl_path: + description: curl 命令路径,默认留空. 目前只用于测试 url type: string - level_value: - description: 配置层级值 + file_list: + description: 下载哪些文件 + items: + type: string + type: array + max_concurrency: + description: 并发下载数 + type: integer + path_tgt: + description: 文件存放到本机哪个目录 type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + server: + description: 下载 url type: string required: - - bk_biz_id - - conf_file - - conf_type - - format - - level_name - - namespace + - file_list + - path_tgt + - server type: object - GetConfigItemsResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFScpParam: properties: bk_biz_id: + type: integer + bwlimit_mb: + description: 单文件下载限速,单位 MB/s + type: integer + file_src: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileSrc' + description: 下载源 + file_tgt: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileTgt' + description: 下载目标 + max_concurrency: + description: 并发下载数 + type: integer + required: + - file_src + - file_tgt + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileSrc: + properties: + file_list: + description: 源文件名列表,相对上面的 path + items: + type: string + type: array + match: type: string - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - type: string - conf_file_lc: - description: 配置文件中文名,也可以是其它 locale 语言类型 - example: 5.7_参数配置 - type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + path: + description: 源文件所在目录 type: string - conf_type_lc: - description: 配置类型中文名 - example: DB参数配置 + ssh_host: type: string - content: - additionalProperties: true - description: content is a {conf_name:conf_type} dict like {"a":1, "b":"string"} - type: object - created_at: + ssh_pass: type: string - description: - description: 配置文件的描述 + ssh_port: type: string - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + ssh_user: type: string - level_value: - description: 配置层级值 + required: + - file_list + - path + - ssh_host + - ssh_port + - ssh_user + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.FileTgt: + properties: + path: + description: 文件下载目标目录 type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + required: + - path + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo: + properties: + key: + description: 16位字串,由备份系统分配,可从环境变量获取 IBS_INFO__key type: string - namespace_info: - description: namespace信息,比如数据库版本,与 conf_file 对应 - example: MySQL 5.7 + sys_id: + description: application标识,亦即哪个系统需要访问本接口,可从环境变量获取 IBS_INFO_sys_id type: string - updated_at: + ticket: + description: OA验证的ticket,一个长串,通常附加在访问内网应用的URL上,主要用来验证用户身份,可以留空 type: string - updated_by: + url: + description: |- + ieg 备份系统 api url 地址,会在后面拼接 /query /recover 后缀进行请求 + 可从环境变量获取 IBS_INFO_url + example: http://127.0.0.1/backupApi type: string required: - - conf_file - - conf_type - - level_name - - namespace + - key + - sys_id + - url type: object - ListConfigVersionsResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryComp: properties: - bk_biz_id: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryForRecover: + properties: + begin_date: + description: 查询文件起始时间,备份系统以 file_last_mtime 为条件 type: string - conf_file: + end_date: + description: 哪一天提交,结束时间,与begin_date形成一个时间范围,建议begin_date与end_date形成的时间范围不要超过3天 type: string - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + source_ip: + description: 来源IP,即提交备份任务的机器IP type: string - level_value: - description: 配置层级值 + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryParam: + properties: + begin_date: + description: 哪一天提交,起始时间 type: string - namespace: + end_date: + description: 哪一天提交,结束时间,与begin_date形成一个时间范围,建议begin_date与end_date形成的时间范围不要超过3天 type: string - published: - description: version published. empty when published version is not in versions + filename: + description: 文件名 + type: string + ibs_info: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo' + description: ieg backup system url and auth params + source_ip: + description: 来源IP,即提交备份任务的机器IP type: string - versions: - description: 版本列表,格式 [{"revision":"v1", "rows_affected":1},{"revision":"v2", - "rows_affected":2}] - items: - additionalProperties: true - type: object - type: array required: - - level_name + - begin_date + - end_date + - filename + - ibs_info + - source_ip type: object - PublishConfigFileReq: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryResult: properties: - bk_biz_id: - description: 业务ID,必选项 - example: testapp + bkstif: + description: '备份状态信息, ''done, success'', ''Fail: bad md5'' 等' type: string - cluster: + createTime: + description: 非备份系统字段,全备(截取文件名中的字段),binlog 打开文件读取 type: string - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 + expire_time: type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + expired: type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + file_last_mtime: + description: 文件最后修改时间 type: string - patch: - additionalProperties: - type: string - description: patch will overwrite conf_value to versioned config_file. it's - a key-value dict - type: object - revision: - description: the version you want to publish - example: v_20220309161928 + file_name: type: string - required: - - bk_biz_id - - conf_file - - conf_type - - namespace - - revision - type: object - QueryConfigNamesResp: - properties: - conf_file: + file_tag: type: string - conf_names: - additionalProperties: - $ref: '#/definitions/api.ConfNameDef' - type: object - type: object - api.ConfFileDef: - properties: - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 + md5: type: string - conf_file_lc: - description: 配置文件中文名,也可以是其它 locale 语言类型 - example: 5.7_参数配置 + path: + description: 非备份系统字段 type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + size: + description: 文件大小 type: string - conf_type_lc: - description: 配置类型中文名 - example: DB参数配置 + source_ip: + description: 上报该备份任务的IP type: string - description: - description: 配置文件的描述 + source_port: + description: 非备份系统字段 type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + status: + description: 文件状态 type: string - namespace_info: - description: namespace信息,比如数据库版本,与 conf_file 对应 - example: MySQL 5.7 + task_id: + description: 任务ID,用于下载 + type: string + uptime: + description: 备份任务上报时间 type: string - required: - - conf_file - - conf_type - - namespace type: object - api.ConfNameDef: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverComp: properties: - conf_name: - description: 配置项,也叫参数项 - type: string - conf_name_lc: - description: 配置项中文名,可不填 - type: string - description: - description: 配置项说明 - type: string - flag_disable: - description: 是否禁用,代表该配置项状态. 默认0启用 - example: 0 - type: integer - flag_locked: - description: 是否锁定. 默认0 - example: 0 - type: integer - need_restart: - description: 是否需要重启生效. 默认1 - example: 1 - type: integer - value_allowed: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverParam: + properties: + dest_ip: + description: 目标IP,文件恢复到哪一台机器上的 + example: 1.1.1.1 + type: string + diretory: + description: diretory 是备份系统参数错误拼写 + example: /data/dbbak + type: string + ibs_info: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSBaseInfo' + description: ieg backup system url and auth params + ibs_query: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryForRecover' + description: 根据文件名下载,或者判断是否跳过下载时,需要提供 ibs_query 参数用于查询 + login_passwd: + description: 登录 dest_ip 的用户名的密码, ieg 传统scp 方式下载才需要。如果是 cos 下载则不需要 + type: string + login_user: + description: 登录 dest_ip 的用户名,下载后的文件属组是该用户 + type: string + reason: + description: 恢复原因(备注用途) + type: string + skip_local_exists: + description: 如果本地目标目录已经存在对应文件,是否保留(即跳过下载). 默认 false + example: false + type: boolean + task_files: description: |- - 允许设定值,如枚举/范围等,为空时表示不限制范围 - 当 value_type_sub=ENUM 时,value_allowed 格式 0|1 或者 ON|OFF 或者 aaa|bbb|ccc , 会校验value的合法性 - 当 value_type_sub=REGEX 时,会根据 value_allowed 进行正则校验 - 当 value_type_sub=RANGE 时,也会校验value 范围的合法性. - - BYTES 是一种特殊的RANGE,value允许1mm 但value_allowed 必须是数字的range - type: string - value_default: - description: 配置项默认值 - example: "1" - type: string - value_type: - description: 配置项的值类型,如 `STRING`,`INT`,`FLOAT`,`NUMBER` - enum: - - STRING - - INT - - FLOAT - - NUMBER - example: STRING - type: string - value_type_sub: - description: value_type 的子类型,如果设置则用于校验 value_type 的具体类型,或者返回用于告知前端控件类型,例如 - ENUM,RANGE - enum: - - "" - - STRING - - ENUM - - RANGE - - BYTES - - REGEX - - JSON - - COMPLEX - example: ENUM + 如果是精确文件名下载,用 task_files。提供需要下载的文件列表,提供 task_id 或者完整的 file_name 即可 + 如果顺便提供了 size 信息则不用请求备份系统获取大小 来决定文件是否需要重新下载 + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesExact' + type: array + task_files_wild: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesWild' + description: 如果是模糊匹配搜索并下载,用 task_files_wild + taskid_list: + description: taskid 列表,,逗号分隔。会根据 task_files 里的信息,追加到这里。这里一般不传值,在 task_files + 里提供 task_id 或者 file_name + example: 10000,100001 type: string required: - - conf_name - - value_type + - dest_ip + - diretory + - ibs_info + - login_user type: object - api.GetVersionedDetailResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverTask: properties: - configs: - additionalProperties: true - description: 配置项 - type: object - configs_diff: - additionalProperties: true - description: 与上一个版本的差异 - type: object - content: + file_last_mtime: + description: 文件最后修改时间 type: string - created_at: - description: 发布时间 + file_name: type: string - created_by: - description: 发布人 + file_tag: type: string - description: + md5: type: string - id: - type: integer - is_published: - type: integer - pre_revision: - description: 上一个版本好 + size: + description: 文件大小 type: string - revision: - description: 版本号 + source_ip: + description: 上报该备份任务的IP type: string - rows_affected: - description: 相对上一个版本 影响行数 - type: integer - type: object - api.HTTPClientErrResp: - properties: - code: - example: 400 - type: integer - data: {} - message: - description: status bad request - example: 输入参数错误 + status: + description: 文件状态 + type: string + task_id: + description: 任务ID,用于下载 type: string type: object - api.HTTPOkNilResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesExact: properties: - code: - example: 200 - type: integer - data: {} - message: + file_name: + type: string + md5: + type: string + size: + description: 文件大小 + type: string + task_id: + description: 任务ID,用于下载 type: string type: object - api.ListConfFileResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.TaskFilesWild: properties: - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - type: string - conf_file_lc: - description: 配置文件中文名,也可以是其它 locale 语言类型 - example: 5.7_参数配置 + file_tag: type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + name_regex: + description: 在搜索的结果里面,应用该正则进行过滤 type: string - conf_type_lc: - description: 配置类型中文名 - example: DB参数配置 + name_search: + description: 搜索的模糊条件,不用带 * type: string - created_at: - description: 创建时间 + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer: + properties: + acls: + description: 访问来源限制,从前往后匹配。格式 `["allow 1.1.1.1/32", "deny all"]` + example: + - allow all + items: + type: string + type: array + auth_pass: + description: http basic auth pass,为空时会随机生成密码 type: string - description: - description: 配置文件的描述 + auth_user: + description: http basic auth user type: string - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + bind_address: + description: http file-server 监听地址. 不提供端口,会在 12000-19999 之间随机选择一个端口,不提供 ip + 时默认 localhost type: string - namespace_info: - description: namespace信息,比如数据库版本,与 conf_file 对应 - example: MySQL 5.7 + enable_tls: + description: 暂不支持 + type: boolean + max_connections: + description: 限制最大连接数,超过需要等待. 为 0 时表示不限制 + type: integer + mount_path: + description: 将本地哪个目录通过 http 分享 type: string - updated_at: - description: 更新时间 + path_prefix: + description: path_prefix 用在生成 url 时的路径前缀. 可留空 type: string - updated_by: - description: 更新人 + print_download: + description: 输出 download http 的信息,方便使用 + type: boolean + proc_maxidle_duration: + description: 超过最大空闲时间,自动退出. 示例 3600s, 60m, 1h + example: 1h type: string required: - - conf_file - - conf_type - - namespace + - auth_user + - bind_address + - mount_path type: object - api.SaveConfItemsReq: + dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServerComp: properties: - bk_biz_id: - description: 业务ID,必选项 - example: testapp + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions: + properties: + BackupType: type: string - conf_file_info: - $ref: '#/definitions/api.ConfFileDef' - conf_items: - items: - $ref: '#/definitions/api.UpsertConfItem' - type: array - confirm: - description: 保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求 - type: integer - description: - description: 发布描述 + CrontabTime: type: string - level_info: - additionalProperties: - type: string - description: |- - 上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {"module": "m1"} 提供cluster所属上级 module 的信息 - 非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用 - todo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系 + Logical: + properties: + ExcludeDatabases: + description: '"mysql,test,db_infobase,information_schema,performance_schema,sys"' + type: string + ExcludeTables: + type: string type: object - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster - type: string - level_value: - description: 配置层级值 - type: string + Master: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption' + Slave: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption' required: - - bk_biz_id - - level_name + - BackupType + - CrontabTime + - Master type: object - api.UpsertConfFilePlatReq: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeComp: properties: - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - type: string - conf_file_lc: - description: 配置文件中文名,也可以是其它 locale 语言类型 - example: 5.7_参数配置 + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeParam: + properties: + binlog_dir: type: string - conf_names: - description: |- - 如果revision为空,表示第一次保存。每次 update 操作都会返回 revision,确保在这一轮编辑操作下都是操作这个revision - 已发布的 revision 不能编辑 - Revision string `json:"revision" form:"revision"` + binlog_files: items: - $ref: '#/definitions/api.UpsertConfNames' + type: string type: array - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf - type: string - conf_type_lc: - description: 配置类型中文名 - example: DB参数配置 - type: string - confirm: - description: 保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求 - type: integer - description: - description: 配置文件的描述 - type: string - file_id: - description: 新建配置文件,第一次保存返回 file_id, 后续保存/发布 需传入 file_id - type: integer - namespace: - description: 命名空间,一般指DB类型 - example: tendbha - type: string - namespace_info: - description: namespace信息,比如数据库版本,与 conf_file 对应 - example: MySQL 5.7 - type: string - req_type: - description: '配置文件修改动作的请求类型,`SaveOnly`: 仅保存, `SaveAndPublish`保存并发布' + format: enum: - - SaveOnly - - SaveAndPublish + - "" + - json + - dump type: string required: - - conf_file - - conf_type - - namespace - - req_type + - binlog_dir + - binlog_files type: object - api.UpsertConfFilePlatResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationComp: properties: - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationParam' + general: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + description: 本地使用 ADMIN, change master 使用 repl + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationParam: + properties: + bin_file: + description: binlog 文件名称 type: string - file_id: + bin_position: + description: binlog 位点信息 + minimum: 0 type: integer - is_published: + force: + description: 如果当前实例存在主从关系是否直接reset slave后,强制change master + example: false + type: boolean + host: + description: 具体操作内容需要操作的参数 + type: string + is_gtid: + description: 是否启动GID方式进行建立主从 + type: boolean + master_host: + description: change master to 主库ip + type: string + master_port: + description: change master to 主库端口 + maximum: 65535 + minimum: 3306 + type: integer + max_tolerate_delay: + description: 最大容忍延迟, 当 主从延迟 小于 该值, 认为建立主从关系成功. 不传或者为 0 时,表示不检查 + type: integer + not_start_io_thread: + description: 不启动 io_thread。默认false 表示启动 io_thread + example: false + type: boolean + not_start_sql_thread: + description: 不启动 sql_thread。默认false 表示启动 sql_thread + example: false + type: boolean + port: + description: 当前实例的端口 + maximum: 65535 + minimum: 3306 type: integer - namespace: - description: 命名空间,一般指DB类型 - example: tendbha - type: string - revision: - description: 编辑配置文件,仅保存时不会产生 revision,保存并发布时才返回 - type: string required: - - conf_file - - conf_type - - namespace + - bin_file + - bin_position + - host + - master_host + - master_port + - port type: object - api.UpsertConfItem: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlParam: + properties: + check_interval_sec: + type: integer + drop_database: + description: 是否执行 drop database,这里是确认行为. 如果 false 则只把 drop 命令打印到输出 + type: boolean + force: + description: 当实例不空闲时是否强制清空 + type: boolean + reset_slave: + description: 是否执行 reset slave all + type: boolean + restart: + description: drop_database 之后是否重启实例 + type: boolean + stop_slave: + description: 是否执行 stop slave + type: boolean + tgt_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance' + description: 清空目标实例 + required: + - tgt_instance + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ConfItemOp: properties: - conf_name: - description: 配置项名称 - type: string conf_value: + description: ConfName string `json:"conf_name" validate:"required"` type: string - description: - type: string - extra_info: - type: string - flag_disable: - description: 是否禁用,默认 0 表示启用. 1表示禁用 - example: 0 - type: integer - flag_locked: - description: 是否锁定,默认 0 表上不锁定 - example: 0 - type: integer + need_restart: + type: boolean op_type: - description: 配置项修改动作,需提供操作类型字段,允许值 `add`,`update`,`remove` + description: 配置项修改动作,允许值 `upsert`,`remove` enum: - - add - - update + - upsert - remove type: string required: - - conf_name - op_type type: object - api.UpsertConfItemsReq: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount: properties: - bk_biz_id: - description: 业务ID,必选项 - example: testapp - type: string - conf_file_info: - $ref: '#/definitions/api.ConfFileDef' - conf_items: + access_hosts: items: - $ref: '#/definitions/api.UpsertConfItem' + type: string type: array - confirm: - description: 保存时如果与下层级存在冲突,提示确认,用 confirm=1 重新请求 - type: integer - description: - description: 发布描述 + pwd: type: string - level_info: - additionalProperties: - type: string - description: |- - 上层级信息,如获取当前层级 cluster=c1 的配置,需要设置 level_info: {"module": "m1"} 提供cluster所属上级 module 的信息 - 非必选项,目前只在查询 cluster 级别配置时需要指定模块信息有用 - todo 将来可能本配置中心,直接请求dbmeta元数据来获取 可能的 app-module-cluster-host-instance 关系 - type: object - level_name: - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster + user: + type: string + required: + - pwd + - user + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam: + properties: + backup_dir: type: string - level_value: - description: 配置层级值 + backup_file_name: type: string - req_type: - description: '配置文件修改动作的请求类型,`SaveOnly`: 仅保存, `SaveAndPublish`保存并发布' - enum: - - SaveOnly - - SaveAndPublish + bk_cloud_id: + description: 所在的云区域 + type: integer + charset: + description: 字符集参数 + type: string + db_cloud_token: + description: 云区域token type: string - revision: + fileserver: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer' + host: + description: 当前实例的主机地址 type: string + port: + description: 当前实例的端口 + minimum: 3306 + type: integer required: - - bk_biz_id - - level_name - - req_type + - charset + - host + - port type: object - api.UpsertConfItemsResp: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer: properties: - bk_biz_id: + bucket: + description: 目标bucket type: string - conf_file: - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 + password: + description: 制品库 password type: string - conf_type: - description: 配置类型,如 dbconf,backup - example: dbconf + project: + description: 制品库 project type: string - is_published: - type: integer - namespace: - description: 命名空间,一般指DB类型 - example: tendbha + upload_path: + description: 上传路径 type: string - revision: - description: 编辑配置文件,第一次保存返回 revision, 后续保存/发布 需传入 revision + url: + description: 制品库地址 type: string + username: + description: 制品库 username + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupParam: + properties: + backup_dirs: + items: + type: string + type: array + cluster_id: + description: 指定查询哪个 cluster_id 的备份,如果不指定可能查询到其它非法的备份 + type: integer + file_server: + type: boolean + tgt_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance' + description: 查找哪个实例的备份 required: - - conf_file - - conf_type - - namespace + - backup_dirs + - tgt_instance type: object - api.UpsertConfNames: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupResp: properties: - conf_name: - description: 配置项,也叫参数项 - type: string - conf_name_lc: - description: 配置项中文名,可不填 + backups: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.LocalBackupObj' + description: backups key 是 .info 文件 + type: object + latest: + description: 记录上面 backups 最近的一次备份 type: string - description: - description: 配置项说明 + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitParam: + properties: + exec_user: + description: 发起执行actor的用户,仅用于审计 type: string - flag_disable: - description: 是否禁用,代表该配置项状态. 默认0启用 - example: 0 - type: integer - flag_locked: - description: 是否锁定. 默认0 - example: 0 - type: integer - need_restart: - description: 是否需要重启生效. 默认1 - example: 1 - type: integer - op_type: - description: 配置项修改动作,需提供操作类型字段,允许值 `add`,`update`,`remove` - enum: - - add - - update - - remove + pkg: + description: 安装包名 type: string - value_allowed: - description: |- - 允许设定值,如枚举/范围等,为空时表示不限制范围 - 当 value_type_sub=ENUM 时,value_allowed 格式 0|1 或者 ON|OFF 或者 aaa|bbb|ccc , 会校验value的合法性 - 当 value_type_sub=REGEX 时,会根据 value_allowed 进行正则校验 - 当 value_type_sub=RANGE 时,也会校验value 范围的合法性. - - BYTES 是一种特殊的RANGE,value允许1mm 但value_allowed 必须是数字的range - type: string - value_default: - description: 配置项默认值 - example: "1" - type: string - value_type: - description: 配置项的值类型,如 `STRING`,`INT`,`FLOAT`,`NUMBER` - enum: - - STRING - - INT - - FLOAT - - NUMBER - example: STRING - type: string - value_type_sub: - description: value_type 的子类型,如果设置则用于校验 value_type 的具体类型,或者返回用于告知前端控件类型,例如 - ENUM,RANGE - enum: - - "" - - STRING - - ENUM - - RANGE - - BYTES - - REGEX - - JSON - - COMPLEX - example: ENUM + pkg_md5: + description: 安装包MD5 type: string required: - - conf_name - - op_type - - value_type + - pkg + - pkg_md5 type: object - model.ConfigModel: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumComp: properties: - bk_biz_id: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumParam: + properties: + api_url: type: string - conf_file: + exec_user: type: string - conf_name: + instances_info: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstanceInfo' + type: array + pkg: + description: 安装包名 type: string - conf_type: + pkg_md5: + description: 安装包MD5 type: string - conf_value: + schedule: type: string - created_at: + system_dbs: + items: + type: string + type: array + required: + - pkg + - pkg_md5 + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLParams' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + timeZone: type: string - description: + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLParams: + properties: + allowDiskFileSystemTypes: + items: + type: string + type: array + charset: + description: 字符集参数 type: string - extra_info: + dbha_account: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount' + host: type: string - flag_disable: + inst_mem: + description: 安装实例的内存大小,可以不指定,会自动计算 type: integer - flag_locked: - type: integer - id: - type: integer - level_locked: - type: string - level_name: - type: string - level_value: + mycnf_configs: + description: map[port]my.cnf + items: + type: integer + type: array + mysql_version: + description: MySQLVerion 只需5.6 5.7 这样的大版本号 type: string - namespace: + pkg: + description: 安装包名 type: string - updated_at: + pkg_md5: + description: 安装包MD5 type: string - type: object -host: localhost:8080 + ports: + description: Ports + items: + type: integer + type: array + spider_auto_incr_mode_map: + items: + type: integer + type: array + super_account: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount' + required: + - charset + - host + - mycnf_configs + - mysql_version + - pkg + - pkg_md5 + - ports + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupComp: + properties: + generalParam: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + params: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupParam: + properties: + bk_biz_id: + description: bkbizid + type: integer + bk_cloud_id: + description: bk_cloud_id + type: integer + cluster_address: + additionalProperties: + type: string + description: cluster addresss + type: object + cluster_id: + additionalProperties: + type: integer + description: cluster id + type: object + cluster_type: + type: string + configs: + additionalProperties: + additionalProperties: + type: string + type: object + description: Configs BackupConfig + type: object + exec_user: + description: 执行Job的用户 + type: string + host: + description: 当前实例的主机地址 + type: string + options: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions' + description: 选项参数配置 + pkg: + description: 安装包名 + type: string + pkg_md5: + description: 安装包MD5 + type: string + ports: + description: 被监控机器的上所有需要监控的端口 + items: + type: integer + type: array + role: + description: 当前主机安装的mysqld的角色 + type: string + shard_value: + additionalProperties: + type: integer + description: shard value for spider + type: object + untar_only: + description: 只解压,不校验不渲染配置,不连接 db + type: boolean + required: + - bk_biz_id + - configs + - host + - options + - pkg + - pkg_md5 + - ports + - role + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstanceInfo: + properties: + bk_biz_id: + type: integer + bk_instance_id: + description: 0 被视为空, 不序列化 + type: integer + cluster_id: + type: integer + immute_domain: + type: string + ip: + type: string + port: + type: integer + role: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.LocalBackupObj: + properties: + backup_dir: + description: 备份所在目录 + type: string + backup_id: + type: string + backup_time: + description: 备份时间,目前是备份开始时间 + type: string + backup_type: + type: string + bill_id: + type: string + bk_biz_id: + type: integer + cluster_id: + type: integer + data_schema_grant: + type: string + db_role: + type: string + file_list: + description: |- + InfoFile common.InfoFileDetail `json:"info_file"` + 备份文件列表 + items: + type: string + type: array + index_file: + type: string + inst_host: + description: 备份所属 host + type: string + inst_port: + description: 备份所属 port + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeParam: + properties: + items: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ConfItemOp' + type: object + persistent: + description: '是否持久化到 my.cnf 文件,-1: 不持久化,1: 持久化, 2: 仅持久化但不修改运行时' + enum: + - -1 + - 1 + - 2 + type: integer + restart: + description: '指定是否 允许重启, -1:不重启, 1: 重启, 2:根据 items need_restart 自动判断是否重启' + enum: + - -1 + - 1 + - 2 + type: integer + tgt_instance: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + required: + - items + - persistent + - restart + - tgt_instance + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneParam: + properties: + items: + description: |- + 需要克隆哪些变量, 考虑到不同版本参数不一样,这里不要求指定一定存在; 只修改 mysqld 区。即失败忽略 + 有些参数是 readonly 的,只会保存到 my.cnf 中,如果与运行值不一样需要用户重启 + 默认值见 MycnfCloneItemsDefault + items: + type: string + type: array + persistent: + description: '是否持久化到 my.cnf 文件,0: 不持久化,1: 持久化, 2: 仅持久化但不修改运行时' + enum: + - 0 + - 1 + - 2 + example: 1 + type: integer + restart: + description: '指定是否 允许重启, 0:不重启, 1: 重启, 2:根据 items need_restart 自动判断是否重启' + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + src_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + description: 参数克隆,获取源实例,可以提供 repl 账号权限 + tgt_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + description: 应用到本地目标实例,需要有 ADMIN 权限 + required: + - persistent + - restart + - src_instance + - tgt_instance + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp: + properties: + code: + type: integer + data: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult' + type: array + message: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds: + properties: + cmds: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd' + type: array + run_user: + type: string + work_dir: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumParam: + properties: + bk_biz_id: + description: 业务 id + type: integer + cluster_id: + description: 集群 id + type: integer + db_patterns: + description: 库表过滤选项 + items: + type: string + type: array + ignore_dbs: + description: 库表过滤选项 + items: + type: string + type: array + ignore_tables: + description: 库表过滤选项 + items: + type: string + type: array + immute_domain: + description: 集群域名 + type: string + inner_role: + description: 执行校验的 db inner role, 应该是[master, repeater] + type: string + master_access_slave_password: + description: 从 db 访问 slave 的密码 + type: string + master_access_slave_user: + description: 从 db 访问 slave 的用户名 + type: string + master_ip: + description: 执行校验的 db ip + type: string + master_port: + description: 执行校验的 db port + type: integer + replicate_table: + description: 结果表, 带库前缀 + type: string + runtime_hour: + description: 校验运行时长 + type: integer + slaves: + description: slave 列表 + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SlaveInfo' + type: array + system_dbs: + description: 系统表 + items: + type: string + type: array + table_patterns: + description: 库表过滤选项 + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd: + properties: + cmd_args: + items: + type: string + type: array + cmd_name: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult: + properties: + cmd_stderr: + type: string + cmd_stdout: + type: string + err_msg: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SlaveInfo: + properties: + id: + description: slave id + type: integer + ip: + description: slave ip + type: string + port: + description: slave port + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount: + properties: + access_hosts: + items: + type: string + type: array + pwd: + type: string + user: + type: string + required: + - pwd + - user + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam: + properties: + force: + description: 是否强制下架mysqld + type: boolean + host: + type: string + ports: + description: 被监控机器的上所有需要监控的端口 + items: + type: integer + type: array + required: + - host + - ports + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption: + properties: + DataSchemaGrant: + description: '"grant,schema,data"' + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplComp: + properties: + db: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.DbWorker' + description: 本地db链接 + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplParam: + properties: + host: + description: 当前实例的主机地址 + type: string + port: + description: 当前实例的端口 + type: integer + repl_hosts: + description: slave host + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLBinlogUtil: + properties: + databases: + description: row event 解析指定 databases + items: + type: string + type: array + databases_ignore: + description: row event 解析指定 忽略 databases + items: + type: string + type: array + filter_statement_match_error: + description: 匹配字符串成功,则解析 binlog 报错 + type: string + filter_statement_match_ignore: + description: 匹配字符串成功,则忽略语句,加入注释中 + type: string + filter_statement_match_ignore_force: + description: |- + 匹配字符串成功,强制忽略语句,加入注释中。当与 filter_statement_match_error 都匹配时,ignore_force会优先生效 + 默认 infodba_schema + type: string + flashback: + description: 是否启用 flashback + type: boolean + idempotent_mode: + description: 是否开启幂等模式, mysql --slave-exec-mode=idempotent or mysqlbinlog --idempotent + type: boolean + mysql_client_opt: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLClientOpt' + not_write_binlog: + description: 导入时是否记录 binlog, mysql sql_log_bin=0 or mysqlbinlog --disable-log-bin. + true表示不写 + type: boolean + query_event_handler: + description: |- + query event 默认处理策略。keep:保留解析出的query event 语句, ignore:注释(丢弃)该 query event, error:认为是不接受的语句,报错 + 默认 keep + enum: + - keep + - ignore + - safe + - error + type: string + rewrite_db: + description: --rewrite_db="db1->xx_db1,db2->xx_db2" + type: string + start_pos: + description: --start-position + type: integer + start_time: + description: --start-datetime + type: string + stop_pos: + description: --stop-position + type: integer + stop_time: + description: --stop-datetime + type: string + tables: + description: row event 解析指定 tables + items: + type: string + type: array + tables_ignore: + description: row event 解析指定 忽略 tables + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLClientOpt: + properties: + binary_mode: + description: 是否启用 --binary-mode + type: boolean + max_allowed_packet: + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlog: + properties: + binlog_dir: + description: 恢复时 binlog 存放目录,一般是下载目录 + example: /data/dbbak/123456/binlog + type: string + binlog_files: + description: binlog列表 + items: + type: string + type: array + binlog_start_file: + description: 指定要开始应用的第 1 个 binlog。如果指定,一般要设置 start_pos,如果不指定则使用 start_time + type: string + parse_concurrency: + description: 解析的并发度,默认 1 + type: integer + parse_only: + description: 仅解析 binlog,不做导入 + type: boolean + quick_mode: + description: |- + 如果启用 quick_mode,解析 binlog 时根据 filter databases 等选项过滤 row event,对 query event 会全部保留 。需要 mysqlbinlog 工具支持 --tables 选项,可以指定参数的 tools + 当 quick_mode=false 时,recover_opt 里的 databases 等选项无效,会应用全部 binlog + type: boolean + recover_opt: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.MySQLBinlogUtil' + source_binlog_format: + enum: + - "" + - ROW + - STATEMENT + - MIXED + type: string + tgt_instance: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + tools: + additionalProperties: + type: string + description: 外部指定工具路径 + type: object + work_dir: + description: binlog 解析所在目录,存放运行日志 + example: /data/dbbak/ + type: string + work_id: + example: "123456" + type: string + required: + - binlog_dir + - binlog_files + - recover_opt + - tgt_instance + - work_dir + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlogComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlog' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreDRComp: + properties: + extend: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreParam' + description: 恢复参数,会复制给具体的 Restore 实现. 见 ChooseType 方法 + general: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + description: 通用参数 + resume: + description: 是否是中断后继续执行 + type: boolean + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreOpt: + properties: + databases: + description: 恢复哪些 db,当前只对 逻辑恢复有效 + items: + type: string + type: array + enable_binlog: + description: EnableBinlog 导入数据时是否写binlog,默认不启用 + type: boolean + ignore_databases: + items: + type: string + type: array + ignore_tables: + items: + type: string + type: array + recover_binlog: + description: |- + 在指定时间点回档场景才需要,是否恢复 binlog。在 doSlave 场景,是不需要 recover_binlog。这个选项是控制下一步恢复binlog的行为 + 当 recover_binlog 时,要确保实例的所有库表结构都恢复。在逻辑回档场景,只回档部分库表数据时,依然要恢复所有表结构 + type: boolean + recover_privs: + type: boolean + source_binlog_format: + description: |- + 在库表级定点回档时有用,如果是 statement/mixed 格式,导入数据时需要全部导入; + 如果是 row,可只导入指定库表数据, 在 recover-binlog 时可指定 quick_mode=true 也恢复指定库表 binlog + enum: + - "" + - ROW + - STATEMENT + - MIXED + type: string + tables: + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreParam: + properties: + backup_dir: + description: 备份文件所在本地目录,理论上doDr不会对该目录写入,而是写入 targetDir + example: /data/dbbak + type: string + backup_files: + additionalProperties: + items: + type: string + type: array + description: 备份文件名列表,key 是 info|full|priv|index, value 是是相对于 backup_dir 的文件名列表 + type: object + change_master: + description: 恢复完成后是否执行 change master,会 change master 到 src_instance + type: boolean + restore_opts: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreOpt' + description: 恢复选项,比如恢复库表、是否导入binlog等。目前只对逻辑恢复有效 + src_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance' + description: 备份实例的 ip port,用于生产 change master 语句。如果 host 为空,表示不检查、不生成change + master,恢复spider节点时使用 + tgt_instance: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + description: 恢复本地的目标实例 + tools: + allOf: + - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_tools.ToolSet' + description: 恢复用到的客户端工具,不提供时会有默认值 + work_dir: + description: 备份恢复目录,工作目录 + example: /data1/dbbak + type: string + work_id: + description: work_id 标识本次恢复,若为0则为当前时间戳 + type: string + required: + - backup_dir + - backup_files + - work_dir + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.Flashback: + properties: + binlog_dir: + description: 当 binlog_dir 不为空,表示 binlog 已下载;当为空时,目前只从本地软连接 + type: string + binlog_files: + description: binlog列表,如果不提供,则自动从本地查找符合时间范围的 binlog + items: + type: string + type: array + parse_concurrency: + description: 解析binlog并发度 + type: integer + recover_opt: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.RecoverOpt' + stop_time: + type: string + target_time: + description: 闪回的目标时间点,对应 recover-binlog 的 start_time, 精确到秒。目标实例的时区 + type: string + tgt_instance: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' + tools: + additionalProperties: + type: string + description: 外部指定工具路径 + type: object + work_dir: + description: binlog 解析所在目录,存放运行日志 + type: string + work_id: + type: string + required: + - recover_opt + - target_time + - tgt_instance + - work_dir + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.FlashbackComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.Flashback' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.RecoverOpt: + properties: + databases: + description: row event 解析指定 databases + items: + type: string + type: array + databases_ignore: + description: row event 解析指定 忽略 databases + items: + type: string + type: array + filter_rows: + description: 暂不支持行级闪回 + type: string + tables: + description: row event 解析指定 tables + items: + type: string + type: array + tables_ignore: + description: row event 解析指定 忽略 tables + items: + type: string + type: array + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingParam: + properties: + ctl_instances: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance' + type: array + host: + type: string + mysql_instance_tuples: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple' + type: array + port: + minimum: 3306 + type: integer + spider_instances: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance' + type: array + tdbctl_pass: + type: string + tdbctl_user: + type: string + required: + - ctl_instances + - host + - mysql_instance_tuples + - port + - spider_instances + - tdbctl_pass + - tdbctl_user + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance: + properties: + host: + type: string + port: + minimum: 3306 + type: integer + shard_id: + type: integer + required: + - host + - port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple: + properties: + host: + type: string + port: + type: integer + shard_id: + type: integer + slave_host: + type: string + required: + - host + - port + - shard_id + - slave_host + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs: + properties: + dumper_configs: + items: + type: integer + type: array + required: + - dumper_configs + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam: + properties: + charset: + description: 字符集参数 + type: string + host: + description: 当前实例的主机地址 + type: string + port: + description: 当前实例的端口 + minimum: 3306 + type: integer + tbinlogdumper_port: + description: 当前TBinlogdumperPort实例的端口 + minimum: 3306 + type: integer + required: + - charset + - host + - port + - tbinlogdumper_port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams: + properties: + area_name: + type: string + dumper_id: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp: + properties: + dumperConfigs: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams' + type: object + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + renderConfigs: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs' + type: object + timeZone: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld: + properties: + area_name: + type: string + basedir: + type: string + bind-address: + type: string + character_set_server: + type: string + datadir: + type: string + dumper_id: + type: string + logdir: + type: string + port: + type: string + server_id: + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp: + properties: + generalParam: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + params: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs: + properties: + mysqld: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_native.DbWorker: + properties: + db: + $ref: '#/definitions/sql.DB' + dsn: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject: + properties: + charset: + description: 连接字符集 + type: string + host: + description: 当前实例的主机地址 + type: string + options: + description: 其它选项 + type: string + port: + description: 当前实例的端口 + type: integer + pwd: + description: 连接当前实例的User Pwd + type: string + socket: + description: 连接socket + type: string + user: + description: 连接当前实例的User + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance: + properties: + host: + description: 当前实例的主机地址 + example: 1.1.1.1 + type: string + port: + description: 当前实例的端口 + example: 33060 + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_tools.ToolSet: + properties: + tools: + additionalProperties: + type: string + description: 外部指定工具路径 + type: object + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_util_mysqlutil.ChangeMaster: + properties: + change_sql: + type: string + channel: + type: string + executed_gtid_set: + type: string + force: + description: 如果当前实例存在主从关系是否直接reset slave后,强制change master + type: boolean + is_gtid: + description: 是否启动GID方式进行建立主从 + type: boolean + master_auto_position: + type: integer + master_host: + description: 主库ip + type: string + master_log_file: + description: binlog 文件名称 + type: string + master_log_pos: + description: binlog 位点信息 + type: integer + master_password: + type: string + master_port: + description: 主库端口 + minimum: 3306 + type: integer + master_user: + type: string + max_tolerate_delay: + description: 最大容忍延迟,即主从延迟小于该值,认为建立主从关系成功 + type: integer + required: + - master_host + - master_password + - master_port + - master_user + type: object + internal_subcmd_commoncmd.RMLargeFileParam: + properties: + bw_limit_mb: + default: 30 + description: 删除速度,MB/s,默认 30 + maximum: 1000 + minimum: 1 + type: integer + filename: + type: string + required: + - bw_limit_mb + - filename + type: object + sql.DB: + type: object +host: ./dbactuator info: contact: email: support@swagger.io name: API Support url: http://www.swagger.io/support - description: This is a bkconfigsvr celler server. + description: This is a dbactuator command collection. license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html termsOfService: http://swagger.io/terms/ - title: bkconfigsvr API + title: dbactuator API version: 0.0.1 paths: - /bkconfig/v1/conffile/add: + /common/file-server: + post: + consumes: + - application/json + description: |- + 通过 http 暴露指定目录可用于下载,可用于在重建备库时,从其它机器下载备份 + 在 OS 不允许 ssh 登录(scp/sftp)时,可以临时启动该服务来获取备份文件 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServerComp' + responses: {} + summary: 简单文件服务 + tags: + - common + /common/rm-file: + post: + consumes: + - application/json + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/internal_subcmd_commoncmd.RMLargeFileParam' + responses: {} + summary: 限速删除大文件 + tags: + - common + /download/http: + post: + consumes: + - application/json + description: |- + 支持限速、basicAuth 认证. 一般配合 common fileserver 使用 + # server1 + ./dbactuator common file-server \ + --payload-format raw \ + --payload '{"extend":{"bind_address":":8082","mount_path":"/data/dbbak","user":"xiaog","password":"xxxx","proc_maxidle_duration":"60s"}}' + + # server2 + curl -u 'xiaog:xxxx' 'http://server1:8082/datadbbak8082/dbactuator' -o dbactuator.bin --limit-rate 10k + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFHttpParam' + responses: {} + summary: http下载文件 + tags: + - download + /download/ibs-query: + post: + consumes: + - application/json + description: filename 会进行模糊匹配,返回 task_id 用于下载 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryComp' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSQueryResult' + summary: 从 ieg 备份系统查询文件 + tags: + - download + /download/ibs-recover: post: consumes: - application/json description: |- - 新增平台级配置文件,定义允许的配置名。指定 req_type 为 `SaveOnly` 仅保存, `SaveAndPublish` 保存并发布。保存并发布 也必须提供全量,而不能是前面保存基础上的增量 - req_type=`SaveOnly` 已废弃 - 第一次保存时,会返回 `file_id`,下次 保存/发布 需传入 `file_id` - namespace,conf_type,conf_file 唯一确定一个配置文件,不同DB版本信息体现在 conf_file 里 (如MySQL-5.7), namespace_info 可以存前端传入的 数据库版本,只用于在展示 - HTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员 + 提供 task_id,从 ieg 备份系统下载文件 + task_files_wild: 模糊搜索文件并下载, task_files: 精确文件查询并下载 + task_files_wild, task_files 二选一 + 启用 skip_local_exists=true 时,如果目标目录已存在要下载的文件,会自动跳过 parameters: - - description: ConfName for ConfType + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/api.UpsertConfFilePlatReq' - produces: - - application/json + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverComp' responses: "200": description: OK schema: - $ref: '#/definitions/api.UpsertConfFilePlatResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 新增平台级配置文件 + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.IBSRecoverTask' + summary: 从 ieg 备份系统下载文件 tags: - - plat_config - /bkconfig/v1/conffile/list: - get: - description: |- - 查询配置文件模板列表。只有平台和业务才有配置文件列表 - 返回的 updated_by 代表操作人 + - download + /download/scp: + post: + consumes: + - application/json + description: 支持限速 parameters: - - description: 业务id, bk_biz_id=0 代表平台配置 - in: query - name: bk_biz_id - required: true - type: string - - description: 如果指定了 conf_file 则只查这一个文件信息 - in: query - name: conf_file - type: string - - example: dbconf - in: query - name: conf_type + - description: short description + in: body + name: body required: true - type: string - - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster - in: query - name: level_name + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_backup_download.DFScpParam' + responses: {} + summary: scp下载文件 + tags: + - download + /mysql/change-master: + post: + consumes: + - application/json + description: 执行 change master to + parameters: + - description: short description + in: body + name: body required: true - type: string - - description: 配置层级值 - in: query - name: level_value - type: string - - description: 命名空间,一般指DB类型 - in: query - name: namespace + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BuildMSRelationComp' + responses: {} + summary: 建立主从关系 + tags: + - mysql + /mysql/clean-mysql: + post: + consumes: + - application/json + description: 清空本地实例,保留系统库 + parameters: + - description: description + in: body + name: body required: true - type: string + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.CleanMysqlComp' produces: - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/api.ListConfFileResp' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询配置文件列表 + responses: {} + summary: 清空实例,高危 tags: - - plat_config - /bkconfig/v1/conffile/query: - get: - description: 查询 平台配置 某个配置类型/配置文件的所有配置名列表 + - mysql + /mysql/deploy: + post: + consumes: + - application/json + description: 部署 mysql 实例说明 parameters: - - example: MySQL-5.7 - in: query - name: conf_file + - description: short description + in: body + name: body required: true - type: string - - description: 如果设置,会根据前缀模糊匹配搜索 - in: query - name: conf_name - type: string - - example: dbconf - in: query - name: conf_type + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' + responses: {} + summary: 部署 mysql 实例 + tags: + - mysql + /mysql/deploy-dbbackup: + post: + consumes: + - application/json + description: 部署GO版本备份程序 + parameters: + - description: short description + in: body + name: body required: true - type: string - - example: tendbha - in: query - name: namespace - type: string - produces: + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallNewDbBackupComp' + responses: {} + summary: 部署备份程序 + tags: + - mysql + /mysql/find-local-backup: + post: + consumes: - application/json + description: 查找本地备份 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupParam' responses: "200": description: OK schema: - $ref: '#/definitions/QueryConfigNamesResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询平台配置项列表 + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FindLocalBackupResp' + summary: 查找本地备份 tags: - - plat_config - /bkconfig/v1/conffile/update: + - mysql + /mysql/flashback-binlog: post: consumes: - application/json - description: |- - 编辑平台级配置文件。指定 req_type 为 `SaveOnly` 仅保存, `SaveAndPublish` 保存并发布 - HTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员 - 编辑平台配置时,如果设置 flag_disable=1 时,该配置不会显示在平台配置项列表,相当于管理 所有允许的配置项列表 - 保存时会校验输入的 value_default, value_type, value_allowed - 1. value_type 目前允许 STRING, INT, FLOAT, NUMBER - 2. value_type_sub 允许 ENUM, ENUMS, RANGE, STRING, JSON, REGEX(一种特殊的STRING,会验证 value_default 是否满足 value_allowed 正则) - 3. value_allowed 允许 枚举: 例如`0|1|2`, `ON|OFF` 格式, 范围: 例如`(0, 1000]` + description: 通过 `mysqlbinlog --flashback xxx | mysql` 导入 binlog parameters: - - description: ConfName for ConfType + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/api.UpsertConfFilePlatReq' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api.UpsertConfFilePlatResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 编辑平台级配置文件 + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_rollback.FlashbackComp' + responses: {} + summary: 导入 binlog tags: - - plat_config - /bkconfig/v1/confitem/query: + - mysql + /mysql/grant-repl: post: consumes: - application/json - description: |- - 根据业务/模块/集群的信息,获取某个配置文件的配置项。一般用户前端请求、再编辑的场景,后端服务直接获取配置文件使用 /version/generate 接口 - conf_file 可以是,号分隔的多个文件名,返回结果是一个按照配置文件名组合的一个 list - 需要指定返回格式 format, 可选值 map, list. - map 格式会丢弃 conf_item 的其它信息,只保留 conf_name=conf_value, 一般用于后台服务 - list 格式会保留 conf_items 的其它信息,conf_name=conf_item,一般用于前端展示 - 获取cluster级别配置时,需要提供 level_info:{"module":"xxx"} 模块信息 + description: 在目标机器新建 repl 账号 parameters: - - description: GetConfigItemsReq + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/GetConfigItemsReq' - produces: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_grant.GrantReplComp' + responses: {} + summary: 建立复制账号 + tags: + - mysql + /mysql/init-cluster-routing: + post: + consumes: - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/GetConfigItemsResp' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 获取配置文件配置项列表 + description: 初始化tendb cluster 集群的路由关系说明 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp' + responses: {} + summary: 初始化tendb cluster 集群的路由关系 tags: - - config_item - /bkconfig/v1/confitem/save: + - spiderctl + /mysql/install-checksum: post: consumes: - application/json - description: |- - 编辑层级配置,层级包括业务app、模块module、集群cluster,需要指定修改哪个级别的配置,通过 level_name, level_value 来区分 - 针对编辑的配置类型 conf_type 无版本化的概念,即保存生效,无需发布 - 保存 cluster级别配置时,需要提供 level_info:{"module":"xxx"} 模块信息 + description: 安装mysql校验 parameters: - - description: SaveConfItemsReq + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/api.SaveConfItemsReq' - produces: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLChecksumComp' + responses: {} + summary: 安装mysql校验 + tags: + - mysql + /mysql/install-dbatoolkit: + post: + consumes: - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api.UpsertConfItemsResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 编辑配置(无版本概念) + description: 部署 /home/mysql/dba_toolkit,覆盖 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallDBAToolkitComp' + responses: {} + summary: 部署DBA工具箱 tags: - - config_item - /bkconfig/v1/confitem/upsert: + - mysql + /mysql/mycnf-change: post: consumes: - application/json - description: |- - 编辑层级配置,层级包括业务app、模块module、集群cluster,需要指定修改哪个级别的配置,通过 level_name, level_value 来区分 - 例1: level_name=app, level_value=testapp 表示修改业务 bk_biz_id=testapp 的配置 - 例2: level_name=module, level_value=account 表示某业务 bk_biz_id 的模块 module=account 的配置 - HTTP Header 指定 `X-Bkapi-User-Name` 请求的操作人员 - 获取cluster级别配置时,需要提供 level_info:{"module":"xxx"} 模块信息 + description: 修改mysql配置 parameters: - - description: UpsertConfItemsReq + - description: description in: body name: body required: true schema: - $ref: '#/definitions/api.UpsertConfItemsReq' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfChangeComp' produces: - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api.UpsertConfItemsResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 编辑发布层级配置 + responses: {} + summary: 修改mysql配置 tags: - - config_item - /bkconfig/v1/confname/list: - get: - description: 查询某个配置类型/配置文件的配置名列表,会排除 已锁定的平台配置 + - mysql + /mysql/mycnf-clone: + post: + consumes: + - application/json + description: |- + 用于 slave 重建或迁移,保持新实例与 my.cnf 实例关键参数相同的场景 + 默认 clone 参数: parameters: - - example: MySQL-5.7 - in: query - name: conf_file - required: true - type: string - - description: 如果设置,会根据前缀模糊匹配搜索 - in: query - name: conf_name - type: string - - example: dbconf - in: query - name: conf_type + - description: description + in: body + name: body required: true - type: string - - example: tendbha - in: query - name: namespace - type: string + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.MycnfCloneComp' produces: - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/QueryConfigNamesResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询预定义的配置名列表 + responses: {} + summary: 从源实例克隆 my.cnf 部分参数到目标实例 tags: - - config_meta - /bkconfig/v1/simpleitem/list: - get: - description: 请勿使用 - parameters: - - in: query - name: bk_biz_id - type: string - - in: query - name: cluster - type: string - - in: query - name: conf_file - type: string - - in: query - name: conf_name - type: string - - in: query - name: conf_type - type: string - - in: query - name: conf_value - type: string - - in: query - name: created_at - type: string - - in: query - name: created_by - type: string - - in: query - name: description - type: string - - in: query - name: format - type: string - - in: query - name: inherit_from - type: string - - in: query - name: level_name - type: string - - in: query - name: level_value - type: string - - in: query - name: module - type: string - - in: query - name: namespace - type: string - - in: query - name: revision - type: string - - in: query - name: updated_at - type: string - - in: query - name: updated_by - type: string - - in: query - name: view - type: string - produces: + - mysql + /mysql/oscmd-run: + post: + consumes: - application/json + description: 执行os简单命令 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds' responses: "200": description: OK schema: - items: - $ref: '#/definitions/model.ConfigModel' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询配置项列表通用接口 + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp' + summary: 执行os简单命令 tags: - - simple_item - /bkconfig/v1/version/detail: - get: - description: 查询历史配置版本的详情 + - mysql + /mysql/parse-binlog-time: + post: + consumes: + - application/json + description: 获取 binlog FileDescriptionFormat 和 RotateEvent 事件 parameters: - - description: 业务ID,必选项 - example: testapp - in: query - name: bk_biz_id - required: true - type: string - - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - in: query - name: conf_file - required: true - type: string - - description: 配置类型,如 dbconf,backup - example: dbconf - in: query - name: conf_type + - description: short description + in: body + name: body required: true - type: string - - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster - in: query - name: level_name + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BinlogTimeComp' + responses: {} + summary: 获取 binlog 的开始和结束时间 + tags: + - mysql + /mysql/pt-table-checksum: + post: + consumes: + - application/json + description: 数据校验 + parameters: + - description: description + in: body + name: body required: true - type: string - - description: 配置层级值 - in: query - name: level_value - type: string - - description: 命名空间,一般指DB类型 - example: tendbha - in: query - name: namespace + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp' + responses: {} + summary: 数据校验 + tags: + - mysql + /mysql/recover-binlog: + post: + consumes: + - application/json + description: 通过 `mysqlbinlog xxx | mysql` 导入 binlog + parameters: + - description: short description + in: body + name: body required: true - type: string - - example: v_20220309215824 - in: query - name: revision - type: string - produces: + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RecoverBinlogComp' + responses: {} + summary: 导入 binlog + tags: + - mysql + /mysql/restore-dr: + post: + consumes: - application/json + description: 物理备份、逻辑备份恢复 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_restore.RestoreDRComp' responses: "200": description: OK schema: - $ref: '#/definitions/api.GetVersionedDetailResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询版本的详细信息 + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_util_mysqlutil.ChangeMaster' + summary: 备份恢复 tags: - - config_version - /bkconfig/v1/version/generate: + - mysql + /mysql/semantic-dumpschema: post: consumes: - application/json - description: |- - 从现有配置项直接生成配置文件并返回,每次调用会生成一个新版本,可以选择是否直接发布。这个接口一般用户后台服务查询配置 - 修改配置并发布,使用 /confitem/upsert 接口 - 直接查询配置文件内容,使用 /confitem/query 接口 - 根据 `method` 生成方式不同,可以生成配置并存储 `GenerateAndSave`、生成配置并存储且发布`GenerateAndPublish` - 使用 `GenerateAndSave` 方式需要进一步调用 PublishConfigFile 接口进行发布 + description: 运行语义检查 parameters: - - description: Generate config file versioned + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/GenerateConfigReq' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp' produces: - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/GenerateConfigResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 生成并获取配置文件新版本 + responses: {} + summary: 运行语义检查 tags: - - config_version - /bkconfig/v1/version/list: - get: - description: Get config file versions list + - mysql + /spdierctl/deploy: + post: + consumes: + - application/json + description: 部署 spider ctl 实例说明 parameters: - - description: 业务ID,必选项 - example: testapp - in: query - name: bk_biz_id - required: true - type: string - - description: 配置文件名,一般配置类型与配置文件一一对应,但如 mysql 5.6, 5.7 两个版本同属 dbconf 配置,所以有 - MySQL-5.5, MySQL-5.6 两个配置文件 - example: MySQL-5.7 - in: query - name: conf_file + - description: short description + in: body + name: body required: true - type: string - - description: 配置类型,如 dbconf,backup - example: dbconf - in: query - name: conf_type + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' + responses: {} + summary: 部署 spider ctl 实例 + tags: + - spiderctl + /spider/deploy: + post: + consumes: + - application/json + description: 部署 spider 实例说明 + parameters: + - description: short description + in: body + name: body required: true - type: string - - description: |- - 配置层级名,当前允许值 `app`,`module`,`cluster` - 配合 flag_locked 锁定标记,可以知道 锁定级别 - enum: - - plat - - app - - module - - cluster - in: query - name: level_name + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' + responses: {} + summary: 部署 spider 实例 + tags: + - spider + /tbinlogdumper/deploy: + post: + consumes: + - application/json + description: 部署 tbinlogdumper 实例说明 + parameters: + - description: short description + in: body + name: body required: true - type: string - - description: 配置层级值 - in: query - name: level_value - type: string - - description: 命名空间,一般指DB类型 - example: tendbha - in: query - name: namespace + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp' + responses: {} + summary: 部署 tbinlogdumper 实例 + tags: + - tbinlogdumper + /tbinlogdumper/semantic-dumpschema: + post: + consumes: + - application/json + description: 备份表结构并导入 + parameters: + - description: short description + in: body + name: body required: true - type: string + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp' produces: - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/ListConfigVersionsResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 查询历史配置版本名列表 + responses: {} + summary: 备份表结构并导入 tags: - - config_version - /bkconfig/v1/version/publish: + - tbinlogdumper + /tbinlogdumper/uninstall: post: consumes: - application/json - description: |- - 发布指定版本的配置文件,未发布状态的配置文件是不能使用的 - 发布操作会把已有 published 状态的配置文件下线;同一个 revision 版本的配置无法重复发布 - 发布时带上 patch 参数可以覆盖配置中心该版本的配置项(只有配置项值是`{{`开头的才能被覆盖) + description: 卸载 tbinlogdumper 实例说明 parameters: - - description: Publish config file versioned + - description: short description in: body name: body required: true schema: - $ref: '#/definitions/PublishConfigFileReq' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api.HTTPOkNilResp' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api.HTTPClientErrResp' - summary: 直接发布一个版本[废弃] + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp' + responses: {} + summary: 卸载 tbinlogdumper 实例 tags: - - config_version + - tbinlogdumper schemes: - http -securityDefinitions: - BasicAuth: - type: basic swagger: "2.0" diff --git a/dbm-services/common/db-config/go.mod b/dbm-services/common/db-config/go.mod index 30454f742c..8397e94ed3 100644 --- a/dbm-services/common/db-config/go.mod +++ b/dbm-services/common/db-config/go.mod @@ -16,12 +16,14 @@ require ( github.com/google/uuid v1.3.0 github.com/jinzhu/copier v0.3.5 github.com/jsternberg/zap-logfmt v1.2.0 + github.com/manifoldco/promptui v0.9.0 github.com/pkg/errors v0.9.1 github.com/robfig/cron v1.2.0 github.com/sethvargo/go-password v0.2.0 github.com/sirupsen/logrus v1.8.1 github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cast v1.3.0 + github.com/spf13/cobra v1.1.3 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 github.com/swaggo/swag v1.8.0 @@ -37,6 +39,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -49,6 +52,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.3 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/dbm-services/common/db-config/go.sum b/dbm-services/common/db-config/go.sum index ea1d2b75e2..55c294d1d8 100644 --- a/dbm-services/common/db-config/go.sum +++ b/dbm-services/common/db-config/go.sum @@ -192,8 +192,11 @@ github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= @@ -689,6 +692,7 @@ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= @@ -829,6 +833,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= @@ -1075,6 +1081,7 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1396,6 +1403,7 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/dbm-services/common/db-config/internal/pkg/errno/code.go b/dbm-services/common/db-config/internal/pkg/errno/code.go index 0697ca8ba4..fe914aa8bc 100644 --- a/dbm-services/common/db-config/internal/pkg/errno/code.go +++ b/dbm-services/common/db-config/internal/pkg/errno/code.go @@ -74,4 +74,5 @@ var ( // ErrOnlyLevelConfigAllowed TODO ErrOnlyLevelConfigAllowed = Errno{Code: 10007, Message: "only level_config is allowed to be applied by default", CNMessage: "只有 level_config 才能直接应用 config"} + ErrDecryptValue = Errno{Code: 10007, Message: "decrypt config value failed", CNMessage: "解密出现异常"} ) diff --git a/dbm-services/common/db-resource/go.mod b/dbm-services/common/db-resource/go.mod index 13c642430f..d81858ea22 100644 --- a/dbm-services/common/db-resource/go.mod +++ b/dbm-services/common/db-resource/go.mod @@ -1,24 +1,24 @@ module dbm-services/common/db-resource -go 1.19 +go 1.21 require ( - github.com/deckarep/golang-set/v2 v2.3.0 + github.com/deckarep/golang-set/v2 v2.3.1 github.com/gin-contrib/pprof v1.4.0 github.com/gin-contrib/requestid v0.0.6 github.com/gin-gonic/gin v1.9.1 github.com/go-redis/redis/v8 v8.11.5 github.com/robfig/cron/v3 v3.0.1 - github.com/spf13/viper v1.15.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.604 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.604 - gorm.io/driver/mysql v1.5.0 - gorm.io/gorm v1.25.0 + github.com/spf13/viper v1.16.0 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.750 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750 + gorm.io/driver/mysql v1.5.1 + gorm.io/gorm v1.25.4 ) require ( - github.com/bytedance/sonic v1.10.0-rc3 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/bytedance/sonic v1.10.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -27,10 +27,10 @@ require ( github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect + github.com/go-playground/validator/v10 v10.15.4 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect @@ -42,19 +42,19 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect - golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/net v0.13.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/arch v0.5.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/dbm-services/common/db-resource/go.sum b/dbm-services/common/db-resource/go.sum index 5535e2230f..743cee8986 100644 --- a/dbm-services/common/db-resource/go.sum +++ b/dbm-services/common/db-resource/go.sum @@ -40,11 +40,11 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= -github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= +github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -62,8 +62,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.3.1 h1:vjmkvJt/IV27WXPyYQpAh4bRyWJc5Y435D17XQ9QU5A= +github.com/deckarep/golang-set/v2 v2.3.1/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -72,7 +72,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= @@ -91,6 +92,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -98,8 +100,8 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= @@ -147,6 +149,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -163,8 +166,9 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -190,8 +194,9 @@ github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgSh github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -212,11 +217,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= @@ -227,18 +235,19 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -254,12 +263,12 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.604 h1:GTPOz3rke4PitOgPZbQ5DaEK3e7zLzm2+r8XzAQgIF4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.604/go.mod h1:UX1a6+JQNYvxr3qg7Wg7ACSDNYP4MeP5Wc2WxyKGYgs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.604 h1:BiuYcs8fINjZT9omCf8tV+rZkrZdf+Hq4TMWUNqYNgY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.604/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.750 h1:ZXvq/25p4Gs3zCY1dGFUq5g8JaVOPVVEBEcMCwAVpYY= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.750/go.mod h1:mVxiZM+aCyewDCzZiQV+aCcqzxLPkg9zzR2lf00oMME= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750 h1:zATJQLrw+i0NRosWvoAZ4FM+GbloqovVJGxLCdcjr/w= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= @@ -277,8 +286,8 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= +golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -287,8 +296,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -354,8 +363,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -415,8 +424,8 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -426,8 +435,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -582,6 +591,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -589,11 +599,11 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= -gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= -gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= +gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/dbm-services/common/db-resource/internal/config/config.go b/dbm-services/common/db-resource/internal/config/config.go index 7720685255..31336479a3 100644 --- a/dbm-services/common/db-resource/internal/config/config.go +++ b/dbm-services/common/db-resource/internal/config/config.go @@ -14,16 +14,16 @@ var AppConfig Config // Config TODO type Config struct { - Gormlog bool `yaml:"gormlog"` - ListenAddress string `yaml:"listenAddress"` + Gormlog bool `yaml:"gormlog"` + ListenAddress string `yaml:"listenAddress"` + // dbmeta: http://bk-dbm + DbMeta string `json:"dbmeta"` Db Db `yaml:"db"` CmdbDb Db `yaml:"cmdb_db" mapstructure:"cmdb_db"` LoggerConfig LoggerConfig `yaml:"loggerConfig"` BkSecretConfig BkSecretConfig `yaml:"bkSecretConfig"` Redis Redis `yaml:"redis"` CloudCertificate *CloudCertificate `yaml:"cloudCertificate"` - // dbmeta: http://bk-dbm - DbMeta string `json:"dbmeta"` } // Db TODO diff --git a/dbm-services/common/db-resource/internal/controller/controller.go b/dbm-services/common/db-resource/internal/controller/controller.go index e3c47780ce..8f09e22430 100644 --- a/dbm-services/common/db-resource/internal/controller/controller.go +++ b/dbm-services/common/db-resource/internal/controller/controller.go @@ -15,6 +15,7 @@ import ( "fmt" "net/http" + "dbm-services/common/db-resource/internal/svr/task" "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/errno" "dbm-services/common/go-pubpkg/logger" @@ -33,7 +34,7 @@ type Response struct { RequestId string `json:"request_id"` } -// Prepare TODO +// Prepare before request prepared func (c *BaseHandler) Prepare(r *gin.Context, schema interface{}) error { requestId := r.GetString("request_id") if cmutil.IsEmpty(requestId) { @@ -50,7 +51,7 @@ func (c *BaseHandler) Prepare(r *gin.Context, schema interface{}) error { return nil } -// SendResponse TODO +// SendResponse retrnurns a response func (c *BaseHandler) SendResponse(r *gin.Context, err error, data interface{}, requestId string) { code, message := errno.DecodeErr(err) r.JSON(http.StatusOK, Response{ @@ -60,3 +61,22 @@ func (c *BaseHandler) SendResponse(r *gin.Context, err error, data interface{}, RequestId: requestId, }) } + +// BackStageHandler BackStageHandler +type BackStageHandler struct { + BaseHandler +} + +// RegisterRouter RegisterRouter +func (c *BackStageHandler) RegisterRouter(engine *gin.Engine) { + r := engine.Group("background") + { + r.POST("/cc/module/check", c.RunModuleCheck) + } +} + +// RunModuleCheck 运行模块检查 +func (c BackStageHandler) RunModuleCheck(r *gin.Context) { + task.InspectCheckResource() + c.SendResponse(r, nil, "Check Success", "") +} diff --git a/dbm-services/common/db-resource/internal/controller/manage/import.go b/dbm-services/common/db-resource/internal/controller/manage/import.go index bd2b50f0e1..ab3a904bd5 100644 --- a/dbm-services/common/db-resource/internal/controller/manage/import.go +++ b/dbm-services/common/db-resource/internal/controller/manage/import.go @@ -142,7 +142,7 @@ type ImportHostResp struct { } func (p ImportMachParam) transParamToBytes() (lableJson, bizJson, rstypes json.RawMessage, err error) { - lableJson = []byte("{}") + // lableJson = []byte("{}") lableJson, err = json.Marshal(cmutil.CleanStrMap(p.Labels)) if err != nil { logger.Error(fmt.Sprintf("ConverLableToJsonStr Failed,Error:%s", err.Error())) diff --git a/dbm-services/common/db-resource/internal/controller/manage/list.go b/dbm-services/common/db-resource/internal/controller/manage/list.go index dc6fcee46d..639b8a2161 100644 --- a/dbm-services/common/db-resource/internal/controller/manage/list.go +++ b/dbm-services/common/db-resource/internal/controller/manage/list.go @@ -124,6 +124,7 @@ func (c *MachineResourceGetterInputParam) matchStorageSpecs(db *gorm.DB) { } func (c *MachineResourceGetterInputParam) queryBs(db *gorm.DB) { + db.Where("status = ? ", model.Unused) if len(c.Hosts) > 0 { db.Where("ip in (?)", c.Hosts) return @@ -139,7 +140,7 @@ func (c *MachineResourceGetterInputParam) queryBs(db *gorm.DB) { } if len(c.RsTypes) > 0 { // 如果参数["all"],表示选择没有任何资源类型标签的资源 - if c.RsTypes[0] == "all" && len(cmutil.RemoveDuplicate(c.ForBizs)) == 1 { + if c.RsTypes[0] == "all" { db.Where("JSON_LENGTH(rs_types) <= 0") } else { db.Where(model.JSONQuery("rs_types").Contains(c.RsTypes)) @@ -148,7 +149,6 @@ func (c *MachineResourceGetterInputParam) queryBs(db *gorm.DB) { c.Cpu.MatchCpu(db) c.Mem.MatchMem(db) c.matchStorageSpecs(db) - db.Where("status = ? ", model.Unused) if len(c.City) > 0 { db.Where(" city in (?) ", c.City) } @@ -160,7 +160,7 @@ func (c *MachineResourceGetterInputParam) queryBs(db *gorm.DB) { } if len(c.ForBizs) > 0 { // 如果参数[0],表示选择没有任何业务标签的资源 - if c.ForBizs[0] == 0 && len(cmutil.RemoveDuplicate(c.ForBizs)) == 1 { + if c.ForBizs[0] == 0 { db.Where("JSON_LENGTH(dedicated_bizs) <= 0") } else { db.Where(model.JSONQuery("dedicated_bizs").Contains(cmutil.IntSliceToStrSlice(c.ForBizs))) diff --git a/dbm-services/common/db-resource/internal/controller/manage/manage.go b/dbm-services/common/db-resource/internal/controller/manage/manage.go index fe704b2c50..8f4eaa4b46 100644 --- a/dbm-services/common/db-resource/internal/controller/manage/manage.go +++ b/dbm-services/common/db-resource/internal/controller/manage/manage.go @@ -1,2 +1,305 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package manage TODO package manage + +import ( + "encoding/json" + "fmt" + + "dbm-services/common/db-resource/internal/controller" + "dbm-services/common/db-resource/internal/middleware" + "dbm-services/common/db-resource/internal/model" + "dbm-services/common/db-resource/internal/svr/bk" + "dbm-services/common/go-pubpkg/cmutil" + "dbm-services/common/go-pubpkg/logger" + + rf "github.com/gin-gonic/gin" +) + +// MachineResourceHandler TODO +type MachineResourceHandler struct { + controller.BaseHandler +} + +func init() { + middleware.RequestLoggerFilter.Add("/resource/import") + middleware.RequestLoggerFilter.Add("/resource/update") + middleware.RequestLoggerFilter.Add("/resource/delete") +} + +// RegisterRouter TODO +func (c *MachineResourceHandler) RegisterRouter(engine *rf.Engine) { + r := engine.Group("resource") + { + r.POST("/list", c.List) + r.POST("/list/all", c.ListAll) + r.POST("/update", c.Update) + r.POST("/batch/update", c.BatchUpdate) + r.POST("/delete", c.Delete) + r.POST("/import", c.Import) + r.POST("/mountpoints", c.GetMountPoints) + r.POST("/disktypes", c.GetDiskTypes) + r.POST("/subzones", c.GetSubZones) + r.POST("/deviceclass", c.GetDeviceClass) + r.POST("/operation/list", c.OperationInfoList) + r.POST("/spec/sum", c.SpecSum) + } +} + +// Delete TODO +func (c *MachineResourceHandler) Delete(r *rf.Context) { + var input MachineDeleteInputParam + if err := c.Prepare(r, &input); err != nil { + logger.Error("Preare Error %s", err.Error()) + return + } + requestId := r.GetString("request_id") + affect_row, err := model.DeleteTbRpDetail(input.BkHostIds) + if err != nil { + logger.Error("failed to delete data:%s", err.Error()) + c.SendResponse(r, err, nil, requestId) + return + } + if affect_row == 0 { + c.SendResponse(r, fmt.Errorf("no data was deleted"), nil, requestId) + return + } + c.SendResponse(r, nil, requestId, "Delete Success") +} + +// BatchUpdateMachineInput TODO +type BatchUpdateMachineInput struct { + BkHostIds []int `json:"bk_host_ids" binding:"required,dive,gt=0" ` + ForBizs []int `json:"for_bizs"` + RsTypes []string `json:"resource_types"` + SetBizEmpty bool `json:"set_empty_biz"` + SetRsTypeEmpty bool `json:"set_empty_resource_type"` + StorageDevice map[string]bk.DiskDetail `json:"storage_device"` +} + +// BatchUpdate TODO +func (c *MachineResourceHandler) BatchUpdate(r *rf.Context) { + var input BatchUpdateMachineInput + requestId := r.GetString("request_id") + if err := c.Prepare(r, &input); err != nil { + logger.Error("Preare Error %s", err.Error()) + return + } + updateMap := make(map[string]interface{}) + if len(input.ForBizs) > 0 { + bizJson, err := json.Marshal(cmutil.IntSliceToStrSlice(input.ForBizs)) + if err != nil { + logger.Error(fmt.Sprintf("conver biz json Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["dedicated_bizs"] = bizJson + } + if input.SetBizEmpty { + updateMap["dedicated_bizs"] = "[]" + } + + if len(input.RsTypes) > 0 { + rstypes, err := json.Marshal(input.RsTypes) + if err != nil { + logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["rs_types"] = rstypes + } + + if input.SetRsTypeEmpty { + updateMap["rs_types"] = "[]" + } + + if len(input.StorageDevice) > 0 { + storageJson, err := json.Marshal(input.StorageDevice) + if err != nil { + logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["storage_device"] = storageJson + } + err := model.DB.Self.Table(model.TbRpDetailName()).Select("dedicated_bizs", "rs_types", "storage_device"). + Where("bk_host_id in (?)", input.BkHostIds).Updates(updateMap).Error + if err != nil { + c.SendResponse(r, err, requestId, err.Error()) + return + } + c.SendResponse(r, nil, "ok", requestId) +} + +// Update TODO +func (c *MachineResourceHandler) Update(r *rf.Context) { + var input MachineResourceInputParam + requestId := r.GetString("request_id") + if err := c.Prepare(r, &input); err != nil { + logger.Error("Preare Error %s", err.Error()) + return + } + logger.Debug(fmt.Sprintf("get params %v", input.Data)) + tx := model.DB.Self.Begin() + for _, v := range input.Data { + updateMap := make(map[string]interface{}) + if len(v.Labels) > 0 { + l, err := cmutil.ConverMapToJsonStr(v.Labels) + if err != nil { + logger.Error(fmt.Sprintf("ConverMapToJsonStr Failed %s", err.Error())) + } + updateMap["lable"] = l + } + if len(v.ForBizs) > 0 { + bizJson, err := json.Marshal(cmutil.IntSliceToStrSlice(v.ForBizs)) + if err != nil { + logger.Error(fmt.Sprintf("conver biz json Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["dedicated_bizs"] = bizJson + } + if len(v.RsTypes) > 0 { + rstypes, err := json.Marshal(v.RsTypes) + if err != nil { + logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["rs_types"] = rstypes + } + if len(v.StorageDevice) > 0 { + storageJson, err := json.Marshal(v.StorageDevice) + if err != nil { + logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + updateMap["storage_device"] = storageJson + } + err := tx.Model(&model.TbRpDetail{}).Table(model.TbRpDetailName()).Select("dedicated_bizs", "rs_types", + "label").Where("bk_host_id=?", v.BkHostID).Updates(updateMap).Error + if err != nil { + tx.Rollback() + logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) + c.SendResponse(r, err, requestId, err.Error()) + return + } + } + if err := tx.Commit().Error; err != nil { + c.SendResponse(r, err, requestId, err.Error()) + return + } + c.SendResponse(r, nil, requestId, "Save Success") +} + +// MachineDeleteInputParam TODO +type MachineDeleteInputParam struct { + BkHostIds []int `json:"bk_host_ids" binding:"required"` +} + +// MachineResourceInputParam TODO +type MachineResourceInputParam struct { + Data []MachineResource `json:"data" binding:"required,dive,gt=0"` +} + +// MachineResource TODO +type MachineResource struct { + BkHostID int `json:"bk_host_id" binding:"required"` + Labels map[string]string `json:"labels"` + ForBizs []int `json:"for_bizs"` + RsTypes []string `json:"resource_types"` + StorageDevice map[string]bk.DiskDetail `json:"storage_device"` +} + +// GetMountPoints TODO +func (c MachineResourceHandler) GetMountPoints(r *rf.Context) { + db := model.DB.Self.Table(model.TbRpDetailName()) + var rs []json.RawMessage + if err := db.Select("json_keys(storage_device)").Where("JSON_LENGTH(storage_device) > 0").Find(&rs).Error; err != nil { + logger.Error("get mountpoints failed %s", err.Error()) + c.SendResponse(r, err, err.Error(), "") + return + } + var mountpoints []string + for _, v := range rs { + var mp []string + if err := json.Unmarshal(v, &mp); err != nil { + logger.Error("unmarshal failed %s", err.Error()) + c.SendResponse(r, err, err.Error(), "") + return + } + if len(mp) > 0 { + mountpoints = append(mountpoints, mp...) + } + } + c.SendResponse(r, nil, cmutil.RemoveDuplicate(mountpoints), r.GetString("request_id")) +} + +// GetDiskTypes TODO +func (c MachineResourceHandler) GetDiskTypes(r *rf.Context) { + db := model.DB.Self.Table(model.TbRpDetailName()) + var rs []json.RawMessage + err := db.Select("json_extract(storage_device,'$.*.\"disk_type\"')").Where("JSON_LENGTH(storage_device) > 0"). + Find(&rs).Error + if err != nil { + logger.Error("get DiskType failed %s", err.Error()) + c.SendResponse(r, err, err.Error(), "") + return + } + var diskTypes []string + for _, v := range rs { + var mp []string + if err := json.Unmarshal(v, &mp); err != nil { + logger.Error("unmarshal failed %s", err.Error()) + c.SendResponse(r, err, err.Error(), "") + return + } + if len(mp) > 0 { + diskTypes = append(diskTypes, mp...) + } + } + c.SendResponse(r, nil, cmutil.RemoveDuplicate(diskTypes), r.GetString("request_id")) +} + +// GetSubZoneParam TODO +type GetSubZoneParam struct { + LogicCitys []string `json:"citys"` +} + +// GetSubZones TODO +func (c MachineResourceHandler) GetSubZones(r *rf.Context) { + var input GetSubZoneParam + if c.Prepare(r, &input) != nil { + return + } + var subZones []string + db := model.DB.Self.Table(model.TbRpDetailName()) + err := db.Distinct("sub_zone").Where("city in ? ", input.LogicCitys).Find(&subZones).Error + if err != nil { + c.SendResponse(r, err, "", err.Error()) + return + } + c.SendResponse(r, nil, subZones, r.GetString("request_id")) +} + +// GetDeviceClass TODO +func (c MachineResourceHandler) GetDeviceClass(r *rf.Context) { + var class []string + db := model.DB.Self.Table(model.TbRpDetailName()) + err := db.Distinct("device_class").Where("device_class !=''").Find(&class).Error + if err != nil { + c.SendResponse(r, err, "", err.Error()) + return + } + c.SendResponse(r, nil, class, r.GetString("request_id")) +} diff --git a/dbm-services/common/db-resource/internal/controller/manage/rs.go b/dbm-services/common/db-resource/internal/controller/manage/rs.go deleted file mode 100644 index dc7d547c00..0000000000 --- a/dbm-services/common/db-resource/internal/controller/manage/rs.go +++ /dev/null @@ -1,304 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package manage - -import ( - "encoding/json" - "fmt" - - "dbm-services/common/db-resource/internal/controller" - "dbm-services/common/db-resource/internal/middleware" - "dbm-services/common/db-resource/internal/model" - "dbm-services/common/db-resource/internal/svr/bk" - "dbm-services/common/go-pubpkg/cmutil" - "dbm-services/common/go-pubpkg/logger" - - rf "github.com/gin-gonic/gin" -) - -// MachineResourceHandler TODO -type MachineResourceHandler struct { - controller.BaseHandler -} - -func init() { - middleware.RequestLoggerFilter.Add("/resource/import") - middleware.RequestLoggerFilter.Add("/resource/update") - middleware.RequestLoggerFilter.Add("/resource/delete") -} - -// RegisterRouter TODO -func (c *MachineResourceHandler) RegisterRouter(engine *rf.Engine) { - r := engine.Group("resource") - { - r.POST("/list", c.List) - r.POST("/list/all", c.ListAll) - r.POST("/update", c.Update) - r.POST("/batch/update", c.BatchUpdate) - r.POST("/delete", c.Delete) - r.POST("/import", c.Import) - r.POST("/mountpoints", c.GetMountPoints) - r.POST("/disktypes", c.GetDiskTypes) - r.POST("/subzones", c.GetSubZones) - r.POST("/deviceclass", c.GetDeviceClass) - r.POST("/operation/list", c.OperationInfoList) - r.POST("/spec/sum", c.SpecSum) - } -} - -// Delete TODO -func (c *MachineResourceHandler) Delete(r *rf.Context) { - var input MachineDeleteInputParam - if err := c.Prepare(r, &input); err != nil { - logger.Error("Preare Error %s", err.Error()) - return - } - requestId := r.GetString("request_id") - affect_row, err := model.DeleteTbRpDetail(input.BkHostIds) - if err != nil { - logger.Error("failed to delete data:%s", err.Error()) - c.SendResponse(r, err, nil, requestId) - return - } - if affect_row == 0 { - c.SendResponse(r, fmt.Errorf("no data was deleted"), nil, requestId) - return - } - c.SendResponse(r, nil, requestId, "Delete Success") -} - -// BatchUpdateMachineInput TODO -type BatchUpdateMachineInput struct { - BkHostIds []int `json:"bk_host_ids" binding:"required,dive,gt=0" ` - ForBizs []int `json:"for_bizs"` - RsTypes []string `json:"resource_types"` - SetBizEmpty bool `json:"set_empty_biz"` - SetRsTypeEmpty bool `json:"set_empty_resource_type"` - StorageDevice map[string]bk.DiskDetail `json:"storage_device"` -} - -// BatchUpdate TODO -func (c *MachineResourceHandler) BatchUpdate(r *rf.Context) { - var input BatchUpdateMachineInput - requestId := r.GetString("request_id") - if err := c.Prepare(r, &input); err != nil { - logger.Error("Preare Error %s", err.Error()) - return - } - updateMap := make(map[string]interface{}) - if len(input.ForBizs) > 0 { - bizJson, err := json.Marshal(cmutil.IntSliceToStrSlice(input.ForBizs)) - if err != nil { - logger.Error(fmt.Sprintf("conver biz json Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["dedicated_bizs"] = bizJson - } - if input.SetBizEmpty { - updateMap["dedicated_bizs"] = "[]" - } - - if len(input.RsTypes) > 0 { - rstypes, err := json.Marshal(input.RsTypes) - if err != nil { - logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["rs_types"] = rstypes - } - - if input.SetRsTypeEmpty { - updateMap["rs_types"] = "[]" - } - - if len(input.StorageDevice) > 0 { - storageJson, err := json.Marshal(input.StorageDevice) - if err != nil { - logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["storage_device"] = storageJson - } - err := model.DB.Self.Table(model.TbRpDetailName()).Select("dedicated_bizs", "rs_types", "storage_device"). - Where("bk_host_id in (?)", input.BkHostIds).Updates(updateMap).Error - if err != nil { - c.SendResponse(r, err, requestId, err.Error()) - return - } - c.SendResponse(r, nil, "ok", requestId) -} - -// Update TODO -func (c *MachineResourceHandler) Update(r *rf.Context) { - var input MachineResourceInputParam - requestId := r.GetString("request_id") - if err := c.Prepare(r, &input); err != nil { - logger.Error("Preare Error %s", err.Error()) - return - } - logger.Debug(fmt.Sprintf("get params %v", input.Data)) - tx := model.DB.Self.Begin() - for _, v := range input.Data { - updateMap := make(map[string]interface{}) - if len(v.Labels) > 0 { - l, err := cmutil.ConverMapToJsonStr(v.Labels) - if err != nil { - logger.Error(fmt.Sprintf("ConverMapToJsonStr Failed %s", err.Error())) - } - updateMap["lable"] = l - } - if len(v.ForBizs) > 0 { - bizJson, err := json.Marshal(cmutil.IntSliceToStrSlice(v.ForBizs)) - if err != nil { - logger.Error(fmt.Sprintf("conver biz json Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["dedicated_bizs"] = bizJson - } - if len(v.RsTypes) > 0 { - rstypes, err := json.Marshal(v.RsTypes) - if err != nil { - logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["rs_types"] = rstypes - } - if len(v.StorageDevice) > 0 { - storageJson, err := json.Marshal(v.StorageDevice) - if err != nil { - logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - updateMap["storage_device"] = storageJson - } - err := tx.Model(&model.TbRpDetail{}).Table(model.TbRpDetailName()).Select("dedicated_bizs", "rs_types", - "label").Where("bk_host_id=?", v.BkHostID).Updates(updateMap).Error - if err != nil { - tx.Rollback() - logger.Error(fmt.Sprintf("conver resource types Failed,Error:%s", err.Error())) - c.SendResponse(r, err, requestId, err.Error()) - return - } - } - if err := tx.Commit().Error; err != nil { - c.SendResponse(r, err, requestId, err.Error()) - return - } - c.SendResponse(r, nil, requestId, "Save Success") -} - -// MachineDeleteInputParam TODO -type MachineDeleteInputParam struct { - BkHostIds []int `json:"bk_host_ids" binding:"required"` -} - -// MachineResourceInputParam TODO -type MachineResourceInputParam struct { - Data []MachineResource `json:"data" binding:"required,dive,gt=0"` -} - -// MachineResource TODO -type MachineResource struct { - BkHostID int `json:"bk_host_id" binding:"required"` - Labels map[string]string `json:"labels"` - ForBizs []int `json:"for_bizs"` - RsTypes []string `json:"resource_types"` - StorageDevice map[string]bk.DiskDetail `json:"storage_device"` -} - -// GetMountPoints TODO -func (c MachineResourceHandler) GetMountPoints(r *rf.Context) { - db := model.DB.Self.Table(model.TbRpDetailName()) - var rs []json.RawMessage - if err := db.Select("json_keys(storage_device)").Where("JSON_LENGTH(storage_device) > 0").Find(&rs).Error; err != nil { - logger.Error("get mountpoints failed %s", err.Error()) - c.SendResponse(r, err, err.Error(), "") - return - } - var mountpoints []string - for _, v := range rs { - var mp []string - if err := json.Unmarshal(v, &mp); err != nil { - logger.Error("unmarshal failed %s", err.Error()) - c.SendResponse(r, err, err.Error(), "") - return - } - if len(mp) > 0 { - mountpoints = append(mountpoints, mp...) - } - } - c.SendResponse(r, nil, cmutil.RemoveDuplicate(mountpoints), r.GetString("request_id")) -} - -// GetDiskTypes TODO -func (c MachineResourceHandler) GetDiskTypes(r *rf.Context) { - db := model.DB.Self.Table(model.TbRpDetailName()) - var rs []json.RawMessage - err := db.Select("json_extract(storage_device,'$.*.\"disk_type\"')").Where("JSON_LENGTH(storage_device) > 0"). - Find(&rs).Error - if err != nil { - logger.Error("get DiskType failed %s", err.Error()) - c.SendResponse(r, err, err.Error(), "") - return - } - var diskTypes []string - for _, v := range rs { - var mp []string - if err := json.Unmarshal(v, &mp); err != nil { - logger.Error("unmarshal failed %s", err.Error()) - c.SendResponse(r, err, err.Error(), "") - return - } - if len(mp) > 0 { - diskTypes = append(diskTypes, mp...) - } - } - c.SendResponse(r, nil, cmutil.RemoveDuplicate(diskTypes), r.GetString("request_id")) -} - -// GetSubZoneParam TODO -type GetSubZoneParam struct { - LogicCitys []string `json:"citys"` -} - -// GetSubZones TODO -func (c MachineResourceHandler) GetSubZones(r *rf.Context) { - var input GetSubZoneParam - if c.Prepare(r, &input) != nil { - return - } - var subZones []string - db := model.DB.Self.Table(model.TbRpDetailName()) - err := db.Distinct("sub_zone").Where("city in ? ", input.LogicCitys).Find(&subZones).Error - if err != nil { - c.SendResponse(r, err, "", err.Error()) - return - } - c.SendResponse(r, nil, subZones, r.GetString("request_id")) -} - -// GetDeviceClass TODO -func (c MachineResourceHandler) GetDeviceClass(r *rf.Context) { - var class []string - db := model.DB.Self.Table(model.TbRpDetailName()) - err := db.Distinct("device_class").Where("device_class !=''").Find(&class).Error - if err != nil { - c.SendResponse(r, err, "", err.Error()) - return - } - c.SendResponse(r, nil, class, r.GetString("request_id")) -} diff --git a/dbm-services/common/db-resource/internal/model/TbRpDetail.go b/dbm-services/common/db-resource/internal/model/TbRpDetail.go index e94afdeb81..9f659af207 100644 --- a/dbm-services/common/db-resource/internal/model/TbRpDetail.go +++ b/dbm-services/common/db-resource/internal/model/TbRpDetail.go @@ -32,6 +32,8 @@ const ( Prepoccupied = "Prepoccupied" // Used TODO Used = "Used" + // UsedByOther 已被其他业务使用 + UsedByOther = "UsedByOther" ) // TbRpDetail 机器资源明细表 diff --git a/dbm-services/common/db-resource/internal/model/model.go b/dbm-services/common/db-resource/internal/model/model.go index d751501edc..d7244f61a7 100644 --- a/dbm-services/common/db-resource/internal/model/model.go +++ b/dbm-services/common/db-resource/internal/model/model.go @@ -38,9 +38,6 @@ type Database struct { // DB TODO var DB *Database -// CMDBDB TODO -var CMDBDB *Database - func init() { createSysDb() orm_db := initSelfDB() @@ -53,16 +50,6 @@ func init() { Self: orm_db, SelfSqlDB: sqlDB, } - d2 := initDBMDB() - d2sqlDb, err := d2.DB() - if err != nil { - logger.Fatal("init db connect failed %s", err.Error()) - return - } - CMDBDB = &Database{ - Self: d2, - SelfSqlDB: d2sqlDb, - } migration() initarchive() } diff --git a/dbm-services/common/db-resource/internal/routers/routers.go b/dbm-services/common/db-resource/internal/routers/routers.go index f433fcfc3a..3aba7244af 100644 --- a/dbm-services/common/db-resource/internal/routers/routers.go +++ b/dbm-services/common/db-resource/internal/routers/routers.go @@ -12,6 +12,8 @@ package routers import ( + "net/http" + "dbm-services/common/db-resource/internal/controller/apply" "dbm-services/common/db-resource/internal/controller/manage" @@ -26,4 +28,7 @@ func RegisterRoutes(engine *gin.Engine) { // 机器资源管理 manage := manage.MachineResourceHandler{} manage.RegisterRouter(engine) + engine.Handle("GET", "/ping", func(context *gin.Context) { + context.String(http.StatusOK, "pong") + }) } diff --git a/dbm-services/common/db-resource/internal/svr/apply/api.go b/dbm-services/common/db-resource/internal/svr/apply/api.go index 3d1e3799bf..969b9ddf20 100644 --- a/dbm-services/common/db-resource/internal/svr/apply/api.go +++ b/dbm-services/common/db-resource/internal/svr/apply/api.go @@ -131,7 +131,7 @@ func (c ApplyRequestInputParam) LockKey() string { const ( // SAME_SUBZONE_CROSS_SWTICH TODO - SAME_SUBZONE_CROSS_SWTICH = "SAME_ZONE_CROSS_SWTICH" + SAME_SUBZONE_CROSS_SWTICH = "SAME_ZONE_CROSS_SWITCH" // SAME_SUBZONE TODO SAME_SUBZONE = "SAME_SUBZONE" // CROS_SUBZONE TODO diff --git a/dbm-services/common/db-resource/internal/svr/apply/apply.go b/dbm-services/common/db-resource/internal/svr/apply/apply.go index 1d11032a48..f0914b5f1c 100644 --- a/dbm-services/common/db-resource/internal/svr/apply/apply.go +++ b/dbm-services/common/db-resource/internal/svr/apply/apply.go @@ -18,6 +18,7 @@ import ( "dbm-services/common/db-resource/internal/model" "dbm-services/common/db-resource/internal/svr/bk" + "dbm-services/common/db-resource/internal/svr/meta" "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/errno" "dbm-services/common/go-pubpkg/logger" @@ -34,20 +35,6 @@ type SearchContext struct { IdcCitys []string } -func getRealCitys(logicCity string) (realCitys []string, err error) { - if cmutil.IsEmpty(logicCity) { - return - } - err = model.CMDBDB.Self.Raw( - "select distinct bk_idc_city_name from db_meta_bkcity where logical_city_id in (select id from db_meta_logicalcity where name = ? ) ", - logicCity).Scan(&realCitys).Error - if err != nil { - logger.Error("from region %s find real city failed %s", logicCity, err.Error()) - return - } - return -} - // CycleApply TODO func CycleApply(param ApplyRequestInputParam) (pickers []*PickerObject, err error) { for _, v := range param.Details { @@ -57,8 +44,9 @@ func CycleApply(param ApplyRequestInputParam) (pickers []*PickerObject, err erro if v.Affinity == "" { v.Affinity = NONE } - idcCitys, errx := getRealCitys(v.LocationSpec.City) + idcCitys, errx := meta.GetIdcCityByLogicCity(v.LocationSpec.City) if errx != nil { + logger.Error("request real citys by logic city %s from bkdbm api failed:%v", v.LocationSpec.City, errx) return pickers, errx } s := &SearchContext{ diff --git a/dbm-services/common/db-resource/internal/svr/bk/cc.go b/dbm-services/common/db-resource/internal/svr/bk/cc.go index f5425e7b5d..7e0169dc2c 100644 --- a/dbm-services/common/db-resource/internal/svr/bk/cc.go +++ b/dbm-services/common/db-resource/internal/svr/bk/cc.go @@ -1,7 +1,18 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package bk import ( "net/url" + "sync" "time" "dbm-services/common/db-resource/internal/config" @@ -69,13 +80,20 @@ func NewGseClient() (*cc.Client, error) { }) } +var once sync.Once +var cli *cc.Client +var clierr error + // NewClient TODO func NewClient() (*cc.Client, error) { - return cc.NewClient(config.AppConfig.BkSecretConfig.BkBaseUrl, cc.Secret{ - BKAppCode: config.AppConfig.BkSecretConfig.BkAppCode, - BKAppSecret: config.AppConfig.BkSecretConfig.BKAppSecret, - BKUsername: config.AppConfig.BkSecretConfig.BkUserName, + once.Do(func() { + cli, clierr = cc.NewClient(config.AppConfig.BkSecretConfig.BkBaseUrl, cc.Secret{ + BKAppCode: config.AppConfig.BkSecretConfig.BkAppCode, + BKAppSecret: config.AppConfig.BkSecretConfig.BKAppSecret, + BKUsername: config.AppConfig.BkSecretConfig.BkUserName, + }) }) + return cli, clierr } // BatchQueryHostsInfo TODO diff --git a/dbm-services/common/db-resource/internal/svr/bk/get_block_info.sh b/dbm-services/common/db-resource/internal/svr/bk/get_block_info.sh index f680209b92..e3be3193db 100644 --- a/dbm-services/common/db-resource/internal/svr/bk/get_block_info.sh +++ b/dbm-services/common/db-resource/internal/svr/bk/get_block_info.sh @@ -54,69 +54,61 @@ do then continue fi - #echo -n "${dname}: " + + raiddev=false + ## 是否存在磁盘做了软raid + if [ -e /proc/mdstat ];then + IFS=' ' read -ra array <<< `cat /proc/mdstat |grep md|awk -F: '{print $2}'| sed 's/\[[0-9]\]//g'` + for raidname in "${array[@]}" + do + if [ ${dname} == ${raidname} ];then + raiddev=true + break + fi + done + fi + if [ "$raiddev" = true ];then + continue + fi + # echo -n "${dname}: " diskType=`getDiskType ${dname}` - #echo "${diskType}" + # echo "${diskType}" rotational=`cat ${SYSBLOCK_DIR}/${dname}/queue/rotational` - #echo ${rotational} + # echo ${rotational} if [ ! $rotational == 1 ] then diskType="SSD" fi - - if [[ ${dname} =~ nvme && ${dname} != nvme ]] || [[ ${dname} =~ ^md[0-9] ]] || [[ ${dname} == "fioa" ]] - then - mp=`getMountPoint ${dname}` - sz=`cat ${SYSBLOCK_DIR}/${dname}/size` - sz=$((sz+0)) - totalSize=`expr $sz \* 512 / 1024 / 1024 / 1024` - sft=`getSysFileType ${dname}` - #echo -n "{\"MountPoint\":\"${mp}\",\"Size\":${totalSize},\"FileType\":\"${sft}\",\"DiskType\":\"${diskType}\"}" - if [ -f ${SYSBLOCK_DIR}/${dname}/serial ] - then - diskId=`cat ${SYSBLOCK_DIR}/${dname}/serial` - fi - tmp_arr[${#tmp_arr[*]}]="{\"mount_point\":\"${mp}\",\"size\":${totalSize},\"file_type\":\"${sft}\",\"disk_type\":\"${diskType}\",\"disk_id\":\"${diskId}\"}" - continue - fi - - pt=0 - for pname in `ls ${SYSBLOCK_DIR}/${dname}` + partitioned=false + parttions=($(lsblk |grep $dname|grep part|awk -F"└─|-" '{print $2}'|awk '{print $1}')) + if [ ${#parttions[*]} -ge 1 ];then + partitioned=true + else + parttions=(${dname}) + fi + for part in ${parttions[*]} do - if [[ ! ${pname} =~ ^${dname} ]] - then - continue - fi - pt=$((pt+1)) - mp=`getMountPoint ${pname}` - sft=`getSysFileType ${pname}` - sz=`cat ${SYSBLOCK_DIR}/${dname}/${pname}/size` - sz=$((sz+0)) - totalSize=`expr $sz \* 512 / 1024 / 1024 / 1024 ` - if [[ ! ${mp} =~ data ]] - then - continue - fi - if [ -f ${SYSBLOCK_DIR}/${dname}/serial ] - then - diskId=`cat ${SYSBLOCK_DIR}/${dname}/serial` - fi - tmp_arr[${#tmp_arr[*]}]="{\"mount_point\":\"${mp}\",\"size\":${totalSize},\"file_type\":\"${sft}\",\"disk_type\":\"${diskType}\",\"disk_id\":\"${diskId}\"}" + # 不采集根目录磁盘的大小 + mp=`getMountPoint ${part}` + if [ ${mp} == "/" ];then + continue + fi + + if [ "$partitioned" = true ];then + sz=`cat ${SYSBLOCK_DIR}/${dname}/${part}/size` + else + sz=`cat ${SYSBLOCK_DIR}/${part}/size` + fi + sz=$((sz+0)) + totalSize=`expr $sz \* 512 / 1024 / 1024 / 1024` + sft=`getSysFileType ${part}` + if [ -f ${SYSBLOCK_DIR}/${dname}/serial ] + then + diskId=`cat ${SYSBLOCK_DIR}/${dname}/serial` + fi + tmp_arr[${#tmp_arr[*]}]="{\"mount_point\":\"${mp}\",\"size\":${totalSize},\"file_type\":\"${sft}\",\"disk_type\":\"${diskType}\",\"disk_id\":\"${diskId}\"}" + continue done - if [[ $pt == 0 ]]; - then - mp=`getMountPoint ${dname}` - sz=`cat ${SYSBLOCK_DIR}/${dname}/size` - sz=$((sz+0)) - totalSize=`expr $sz \* 512 / 1024 / 1024 / 1024` - sft=`getSysFileType ${dname}` - #echo -n "{\"MountPoint\":\"${mp}\",\"Size\":${totalSize},\"FileType\":\"${sft}\",\"DiskType\":\"${diskType}\"}" - if [ -f ${SYSBLOCK_DIR}/${dname}/serial ] - then - diskId=`cat ${SYSBLOCK_DIR}/${dname}/serial` - fi - tmp_arr[${#tmp_arr[*]}]="{\"mount_point\":\"${mp}\",\"size\":${totalSize},\"file_type\":\"${sft}\",\"disk_type\":\"${diskType}\",\"disk_id\":\"${diskId}\"}" - fi done diff --git a/dbm-services/common/db-resource/internal/svr/bk/job_v3.go b/dbm-services/common/db-resource/internal/svr/bk/job_v3.go index 4603e0ed88..88a57f668f 100644 --- a/dbm-services/common/db-resource/internal/svr/bk/job_v3.go +++ b/dbm-services/common/db-resource/internal/svr/bk/job_v3.go @@ -168,7 +168,8 @@ func (g *JobV3) ExecuteJob(param *FastExecuteScriptParam) (data FastExecuteScrip logger.Info("will execute job at %v", param.TargetServer.IPList) resp, err := g.Client.Do(http.MethodPost, g.get_fast_execute_script_url(), param) if err != nil { - logger.Error("call fast_execute_script failed %s", err.Error()) + logger.Error("1 call fast_execute_script failed %s", err.Error()) + g.track(resp) return FastExecuteScriptRpData{}, err } if err = json.Unmarshal(resp.Data, &data); err != nil { @@ -178,11 +179,18 @@ func (g *JobV3) ExecuteJob(param *FastExecuteScriptParam) (data FastExecuteScrip return } +func (g *JobV3) track(resp *cc.Response) { + if resp != nil { + logger.Error("track: request id: %s,respone message:%s,code:%d", resp.RequestId, resp.Message, resp.Code) + } +} + // GetJobStatus TODO func (g *JobV3) GetJobStatus(param *GetJobInstanceStatusParam) (data GetJobInstanceStatusRpData, err error) { resp, err := g.Client.Do(http.MethodPost, g.get_job_status_url(), param) if err != nil { - logger.Error("call get_job_status failed %s", err.Error()) + logger.Error("1 call get_job_status failed %s", err.Error()) + g.track(resp) return GetJobInstanceStatusRpData{}, err } if err = json.Unmarshal(resp.Data, &data); err != nil { @@ -198,6 +206,7 @@ func (g *JobV3) BatchGetJobInstanceIpLog(param *BatchGetJobInstanceIpLogParam) ( resp, err := g.Client.Do(http.MethodPost, g.batch_get_job_instance_ip_log_url(), param) if err != nil { logger.Error("call batch_get_job_instance_ip_log failed %s", err.Error()) + g.track(resp) return BatchGetJobInstanceIpLogRpData{}, err } if err = json.Unmarshal(resp.Data, &data); err != nil { diff --git a/dbm-services/common/db-resource/internal/svr/meta/meta.go b/dbm-services/common/db-resource/internal/svr/meta/meta.go index d5e688cf8f..cf85f86207 100644 --- a/dbm-services/common/db-resource/internal/svr/meta/meta.go +++ b/dbm-services/common/db-resource/internal/svr/meta/meta.go @@ -1,18 +1,39 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package meta TODO package meta import ( "bytes" "encoding/json" + "errors" + "fmt" "io" "net/http" "net/url" + "slices" + "time" "dbm-services/common/db-resource/internal/config" "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/logger" ) +const ( + // DBMCityUrl 查询逻辑城市映射 + DBMCityUrl = "/apis/proxypass/dbmeta/bk_city_name/" + // DBMEnviron 查询DBM环境变量 + DBMEnviron = "/apis/conf/system_settings/environ/" +) + // GetIdcCityByLogicCityParam TODO type GetIdcCityByLogicCityParam struct { LogicCityName string `json:"logic_city_name"` @@ -26,19 +47,83 @@ type IdcCitysResp struct { RequestId string `json:"request_id"` } -func getRequestUrl() (string, error) { +// DbmEnvResp TODO +type DbmEnvResp struct { + Data DbmEnvData `json:"data"` + Code int `json:"code"` + Message string `json:"message"` + RequestId string `json:"request_id"` +} + +// DbmEnvData TODO +type DbmEnvData struct { + BK_DOMAIN string `json:"BK_DOMAIN"` + CC_IDLE_MODULE_ID int `json:"CC_IDLE_MODULE_ID"` + CC_MANAGE_TOPO struct { + SetId int `json:"set_id"` + DirtyModuleId int `json:"dirty_module_id"` + ResourceModuleId int `json:"resource_module_id"` + } `json:"CC_MANAGE_TOPO"` +} + +// GetDbmEnv TODO +func GetDbmEnv() (data DbmEnvData, err error) { + u, err := getRequestUrl(DBMEnviron) + if err != nil { + return DbmEnvData{}, err + } + logger.Info("request url %s", u) + req, err := http.NewRequest(http.MethodGet, u, nil) + if err != nil { + return DbmEnvData{}, err + } + addCookie(req) + var content []byte + resp, err := http.DefaultClient.Do(req) + if resp.Body != nil { + content, err = io.ReadAll(resp.Body) + if err != nil { + logger.Error("read respone body failed %s", err.Error()) + return data, err + } + } + if err != nil { + return DbmEnvData{}, fmt.Errorf("respone body %s,err:%v", string(content), err) + } + defer resp.Body.Close() + var rpdata DbmEnvResp + if err = json.Unmarshal(content, &rpdata); err != nil { + return DbmEnvData{}, err + } + if rpdata.Code != 0 { + return DbmEnvData{}, errors.New(rpdata.Message) + } + logger.Info("get dbm env respone body %s", string(content)) + return rpdata.Data, nil +} + +func addCookie(request *http.Request) { + request.AddCookie(&http.Cookie{Name: "bk_app_code", Path: "/", Value: config.AppConfig.BkSecretConfig.BkAppCode, + MaxAge: 86400}) + request.AddCookie(&http.Cookie{Name: "bk_app_secret", Path: "/", Value: config.AppConfig.BkSecretConfig.BKAppSecret, + MaxAge: 86400}) +} + +func getRequestUrl(apiaddr string) (string, error) { base := config.AppConfig.DbMeta if cmutil.IsEmpty(config.AppConfig.DbMeta) { base = "http://bk-dbm" } - return url.JoinPath(base, "/apis/proxypass/dbmeta/bk_city_name/") + return url.JoinPath(base, apiaddr) } -// GetIdcCityByLogicCity TODO +// GetIdcCityByLogicCity 根据逻辑城市获取实际对应城市列表 func GetIdcCityByLogicCity(logicCity string) (idcCitys []string, err error) { - u, err := getRequestUrl() + var content []byte + var resp *http.Response + u, err := getRequestUrl(DBMCityUrl) if err != nil { - return + return nil, err } p := GetIdcCityByLogicCityParam{ LogicCityName: logicCity, @@ -47,32 +132,37 @@ func GetIdcCityByLogicCity(logicCity string) (idcCitys []string, err error) { body, err := json.Marshal(p) if err != nil { logger.Error("marshal GetIdcCityByLogicCityParam body failed %s ", err.Error()) - return + return nil, err } - request, err := http.NewRequest(u, "application/json;charset=utf-8", - bytes.NewBuffer(body)) + request, err := http.NewRequest(http.MethodPost, u, bytes.NewBuffer(body)) if err != nil { - return + return nil, err } - request.AddCookie(&http.Cookie{Name: "bk_app_code", Path: "/", Value: config.AppConfig.BkSecretConfig.BkAppCode, - MaxAge: 86400}) - request.AddCookie(&http.Cookie{Name: "bk_app_secret", Path: "/", Value: config.AppConfig.BkSecretConfig.BKAppSecret, - MaxAge: 86400}) - resp, err := client.Do(request) - if err != nil { - logger.Error("request /apis/proxypass/dbmeta/bk_city_name/ failed %s", err.Error()) - return + request.Header.Add("content-type", "application/json;charset=utf-8") + addCookie(request) + for i := 0; i <= 5; i++ { + resp, err = client.Do(request) + if err != nil { + if slices.Contains([]int{http.StatusInternalServerError, http.StatusTooManyRequests, http.StatusGatewayTimeout}, + resp.StatusCode) { + time.Sleep(200 * time.Millisecond) + continue + } + logger.Error("request %s failed %s", request.RequestURI, err.Error()) + return nil, err + } + content, err = io.ReadAll(resp.Body) + if err != nil { + logger.Error("read respone body failed %s", err.Error()) + return nil, err + } + break } defer resp.Body.Close() - content, err := io.ReadAll(resp.Body) - if err != nil { - logger.Error("read respone body failed %s", err.Error()) - return - } logger.Info("respone %v", string(content)) var d IdcCitysResp if err = json.Unmarshal(content, &d); err != nil { - return + return nil, err } return d.Data, nil } diff --git a/dbm-services/common/db-resource/internal/svr/task/inspection_task.go b/dbm-services/common/db-resource/internal/svr/task/inspection_task.go new file mode 100644 index 0000000000..ceabebbd4a --- /dev/null +++ b/dbm-services/common/db-resource/internal/svr/task/inspection_task.go @@ -0,0 +1,85 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package task + +import ( + "dbm-services/common/db-resource/internal/model" + "dbm-services/common/db-resource/internal/svr/bk" + "dbm-services/common/db-resource/internal/svr/meta" + "dbm-services/common/go-pubpkg/cc.v3" + "dbm-services/common/go-pubpkg/cmutil" + "dbm-services/common/go-pubpkg/logger" +) + +// InspectCheckResource TODO +func InspectCheckResource() (err error) { + // 获取空闲机器 + var machines []model.TbRpDetail + var allowCCMouduleInfo meta.DbmEnvData + err = model.DB.Self.Table(model.TbRpDetailName()).Find(&machines, "status = ?", model.Unused).Error + if err != nil { + logger.Error("get unused machines failed %s", err.Error()) + return err + } + allowCCMouduleInfo, err = meta.GetDbmEnv() + if err != nil { + logger.Error("get dbm env failed %s", err.Error()) + return err + } + logger.Info("空闲模块id %v", allowCCMouduleInfo.CC_IDLE_MODULE_ID) + logger.Info("资源模块信息 %v", allowCCMouduleInfo.CC_MANAGE_TOPO) + client, err := bk.NewClient() + if err != nil { + logger.Error("new bk client failed %s", err.Error()) + return err + } + hostIdMap := make(map[int][]int) + for _, machine := range machines { + hostIdMap[machine.BkBizId] = append(hostIdMap[machine.BkBizId], machine.BkHostID) + } + for bkBizId, hostIds := range hostIdMap { + for _, hostgp := range cmutil.SplitGroup(hostIds, 100) { + resp, ori, err := cc.NewFindHostTopoRelation(client).Query(&cc.FindHostTopoRelationParam{ + BkBizID: bkBizId, + BkHostIds: hostgp, + Page: cc.BKPage{ + Start: 0, + Limit: 100, + }, + }) + if err != nil { + logger.Error("get host topo relation failed %s", err.Error()) + if ori != nil { + logger.Error("requesty id:%s,code:%d,messgae:%s", ori.RequestId, ori.Code, ori.Message) + } + continue + // return err + } + for _, m := range resp.Data { + if m.BKModuleId == allowCCMouduleInfo.CC_IDLE_MODULE_ID { + continue + } + if m.BKSetId == allowCCMouduleInfo.CC_MANAGE_TOPO.SetId { + continue + } + err = model.DB.Self.Table(model.TbRpDetailName()).Where("bk_biz_id = ? and bk_host_id = ? and status = ? ", + bkBizId, + m.BKHostId, model.Unused). + Update("status", model.UsedByOther).Error + if err != nil { + logger.Error("update machine status failed %s", err.Error()) + return err + } + } + } + } + return nil +} diff --git a/dbm-services/common/db-resource/main.go b/dbm-services/common/db-resource/main.go index ca0245db0f..1b66b63329 100644 --- a/dbm-services/common/db-resource/main.go +++ b/dbm-services/common/db-resource/main.go @@ -53,6 +53,11 @@ func initCron(localcron *cron.Cron) { logger.Error("update gse status %s", err.Error()) } }) + localcron.AddFunc("1 */12 * * *", func() { + if err := task.InspectCheckResource(); err != nil { + logger.Error("inspect check resource %s", err.Error()) + } + }) } // initLogger initialization log diff --git a/dbm-services/common/dbha/ha-module/config/config.go b/dbm-services/common/dbha/ha-module/config/config.go index 5152748483..9ad15d05b9 100644 --- a/dbm-services/common/dbha/ha-module/config/config.go +++ b/dbm-services/common/dbha/ha-module/config/config.go @@ -22,9 +22,11 @@ type Config struct { DBConf DBConfig `yaml:"db_conf"` // configure for SSH detect SSH SSHConfig `yaml:"ssh"` - // configure for DNS API - DNS DNSConfig `yaml:"dns"` - Monitor MonitorConfig `yaml:"monitor"` + // configure for NameServices API + NameServices NameServicesConfig `yaml:"name_services"` + // configure for bk monitor + Monitor MonitorConfig `yaml:"monitor"` + // configure for timezone Timezone TimezoneConfig `yaml:"timezone"` } @@ -143,8 +145,8 @@ type SSHConfig struct { } // DNSConfig dns api configure info -type DNSConfig struct { - BindConf APIConfig `yaml:"bind_conf"` +type NameServicesConfig struct { + DnsConf APIConfig `yaml:"dns_conf"` PolarisConf APIConfig `yaml:"polaris_conf"` ClbConf APIConfig `yaml:"clb_conf"` // TODO need remove from this struct diff --git a/dbm-services/common/dbha/ha-module/dbmodule/dbmysql/MySQL_detect.go b/dbm-services/common/dbha/ha-module/dbmodule/dbmysql/MySQL_detect.go index cc745d757f..3816b84e00 100644 --- a/dbm-services/common/dbha/ha-module/dbmodule/dbmysql/MySQL_detect.go +++ b/dbm-services/common/dbha/ha-module/dbmodule/dbmysql/MySQL_detect.go @@ -13,14 +13,21 @@ import ( "dbm-services/common/dbha/ha-module/types" "dbm-services/common/dbha/ha-module/util" + mysqlDriver "github.com/go-sql-driver/mysql" "gorm.io/driver/mysql" "gorm.io/gorm" ) const ( - replaceSql = "replace into infodba_schema.check_heartbeat(uid) values(1)" + replaceSql = "REPLACE INTO infodba_schema.check_heartbeat(uid) value(@@server_id)" ) +// IgnoreErrorNumber MySQL detect ignore error number +// 1040:ER_CON_COUNT_ERROR +// 1044:ER_DBACCESS_DENIED_ERROR +// 1045:ER_ACCESS_DENIED_ERROR +var IgnoreErrorNumber = []uint16{1040, 1044, 1045} + // MySQLDetectInstance mysql instance detect struct type MySQLDetectInstance struct { dbutil.BaseDetectDB @@ -129,6 +136,16 @@ func (m *MySQLDetectInstance) Detection() error { select { case mysqlErr = <-errChan: if mysqlErr != nil { + if err, ok := mysqlErr.(*mysqlDriver.MySQLError); ok { + for _, num := range IgnoreErrorNumber { + if num == err.Number { + log.Logger.Warnf("ignore error:%d, check mysql ok. ip:%s, port:%d, app:%s", + err.Number, m.Ip, m.Port, m.App) + m.Status = constvar.DBCheckSuccess + return nil + } + } + } log.Logger.Warnf("check mysql failed. ip:%s, port:%d, app:%s", m.Ip, m.Port, m.App) m.Status = constvar.DBCheckFailed needRecheck = false diff --git a/dbm-services/common/dbha/ha-module/dbmodule/redis/redis_base.go b/dbm-services/common/dbha/ha-module/dbmodule/redis/redis_base.go index 35e78a7ff6..15459f4e9e 100644 --- a/dbm-services/common/dbha/ha-module/dbmodule/redis/redis_base.go +++ b/dbm-services/common/dbha/ha-module/dbmodule/redis/redis_base.go @@ -162,6 +162,7 @@ func (ins *RedisProxySwitchInfo) KickOffDns() error { return nil } + // kick off instance from dns return ins.DeleteNameService(dbutil.BindEntry{ Dns: ins.ApiGw.ServiceEntry.Dns, }) @@ -175,11 +176,10 @@ func (ins *RedisProxySwitchInfo) KickOffClb() error { return nil } - /*return ins.DeleteNameService(dbutil.BindEntry{ + // kick off instance from clb + return ins.DeleteNameService(dbutil.BindEntry{ Clb: ins.ApiGw.ServiceEntry.Clb, - })*/ - // cmdb not support fetch clb information - return nil + }) } // KickOffPolaris TODO @@ -190,11 +190,10 @@ func (ins *RedisProxySwitchInfo) KickOffPolaris() error { return nil } - /*return ins.DeleteNameService(dbutil.BindEntry{ + // kick off instance from polaris + return ins.DeleteNameService(dbutil.BindEntry{ Polaris: ins.ApiGw.ServiceEntry.Polaris, - })*/ - // cmdb not support fetch polaris information - return nil + }) } // UnMarshalRedisInstanceByCmdb parse the information from cmdb @@ -298,7 +297,6 @@ func CreateRedisProxySwitchInfo( } if ins.BindEntry.Dns == nil { - log.Logger.Infof("switch info not contain dns") swIns.ApiGw.DNSFlag = false } else { swIns.ApiGw.DNSFlag = true @@ -312,18 +310,16 @@ func CreateRedisProxySwitchInfo( if ins.BindEntry.Polaris != nil && len(ins.BindEntry.Polaris) > 0 { swIns.ApiGw.PolarisFlag = true + swIns.ApiGw.ServiceEntry.Polaris = ins.BindEntry.Polaris } else { - log.Logger.Infof("switch info not contain polaris") swIns.ApiGw.PolarisFlag = false - // clb not support } if ins.BindEntry.Clb != nil && len(ins.BindEntry.Clb) > 0 { swIns.ApiGw.CLBFlag = true + swIns.ApiGw.ServiceEntry.Clb = ins.BindEntry.Clb } else { - log.Logger.Infof("switch info not contain clb") swIns.ApiGw.CLBFlag = false - // polaris not support } return &swIns, nil } diff --git a/dbm-services/common/dbha/ha-module/dbmodule/redis/svr_password.go b/dbm-services/common/dbha/ha-module/dbmodule/redis/svr_password.go index 1467c7d01b..0730815a2c 100644 --- a/dbm-services/common/dbha/ha-module/dbmodule/redis/svr_password.go +++ b/dbm-services/common/dbha/ha-module/dbmodule/redis/svr_password.go @@ -39,7 +39,7 @@ func GetRedisMachinePasswd( passwdMap, err := GetMachinePasswordRemote(app, constvar.ConfOSFile, constvar.ConfOSType, "", constvar.ConfOSApp, app, - constvar.ConfCommon, conf.DNS.RemoteConf, conf.GetCloudId()) + constvar.ConfCommon, conf.NameServices.RemoteConf, conf.GetCloudId()) if err != nil { log.Logger.Errorf("RedisSSHPWD fetch remote err[%s],return conf,pass:%s", err.Error(), conf.SSH.Pass) @@ -76,7 +76,7 @@ func GetMysqlMachinePasswd( passwdMap, err := GetMachinePasswordRemote("0", constvar.ConfMysqlFile, constvar.ConfMysqlType, constvar.ConfMysqlName, constvar.ConfOSPlat, - "0", constvar.ConfMysqlNamespace, conf.DNS.RemoteConf, conf.GetCloudId()) + "0", constvar.ConfMysqlNamespace, conf.NameServices.RemoteConf, conf.GetCloudId()) if err != nil { log.Logger.Errorf("MysqlSSHPWD fetch remote err[%s],return conf,pass:%s", err.Error(), conf.SSH.Pass) @@ -170,7 +170,7 @@ func GetInstancePass(dbType types.DBType, log.Logger.Debugf("PassWDClusters cachePasswd:%v,NeedQuery:%v", clusterPasswd, clusters) - remoteConfigClient := client.NewRemoteConfigClient(&conf.DNS.RemoteConf, conf.GetCloudId()) + remoteConfigClient := client.NewRemoteConfigClient(&conf.NameServices.RemoteConf, conf.GetCloudId()) NewPasswds := QueryPasswords(remoteConfigClient, cFile, cType, cName, lName, clusters, namespace) @@ -229,7 +229,7 @@ func GetInstancePassByCluster(dbType types.DBType, return cachePasswd.(string), nil } - remoteConfigClient := client.NewRemoteConfigClient(&conf.DNS.RemoteConf, conf.GetCloudId()) + remoteConfigClient := client.NewRemoteConfigClient(&conf.NameServices.RemoteConf, conf.GetCloudId()) clusterPasswds := QueryPasswords(remoteConfigClient, cFile, cType, cName, lName, []string{cluster}, namespace) diff --git a/dbm-services/common/dbha/ha-module/dbutil/db_switch.go b/dbm-services/common/dbha/ha-module/dbutil/db_switch.go index 115ed04090..08257bb53a 100644 --- a/dbm-services/common/dbha/ha-module/dbutil/db_switch.go +++ b/dbm-services/common/dbha/ha-module/dbutil/db_switch.go @@ -40,6 +40,9 @@ type PolarisInfo struct { Service string `json:"polaris_name"` Token string `json:"polaris_token"` L5 string `json:"polaris_l5"` + // the ip list bind to clb + BindIps []string `json:"bind_ips"` + BindPort int `json:"bind_port"` } // CLBInfo clb detail info, response by cmdb api @@ -47,6 +50,10 @@ type ClbInfo struct { Region string `json:"clb_region"` LoadBalanceId string `json:"clb_id"` ListenId string `json:"listener_id"` + Ip string `json:"clb_ip"` + // the ip list bind to clb + BindIps []string `json:"bind_ips"` + BindPort int `json:"bind_port"` } // DnsInfo dns detail info, response by cmdb api @@ -62,8 +69,8 @@ type DnsInfo struct { // BindEntry TODO type BindEntry struct { Dns []DnsInfo - Polaris []interface{} - Clb []interface{} + Polaris []PolarisInfo + Clb []ClbInfo } // ProxyInfo TODO @@ -180,7 +187,7 @@ func (ins *BaseSwitch) DeleteNameService(entry BindEntry) error { conf := ins.Config if entry.Dns != nil { ins.ReportLogs(constvar.InfoResult, fmt.Sprintf("try to release dns entry")) - dnsClient := client.NewNameServiceClient(&conf.DNS.BindConf, conf.GetCloudId()) + dnsClient := client.NewNameServiceClient(&conf.NameServices.DnsConf, conf.GetCloudId()) for _, dns := range entry.Dns { for _, ip := range dns.BindIps { if ip == ins.Ip { @@ -200,21 +207,12 @@ func (ins *BaseSwitch) DeleteNameService(entry BindEntry) error { if entry.Clb != nil { ins.ReportLogs(constvar.InfoResult, fmt.Sprintf("try to release clb entry")) - /*clbClient := client.NewNameServiceClient(&conf.DNS.ClbConf, conf.GetCloudId()) + clbClient := client.NewNameServiceClient(&conf.NameServices.ClbConf, conf.GetCloudId()) for _, clb := range entry.Clb { - addr := fmt.Sprintf("%s:%d", ins.Ip, ins.Port) - ips, err := clbClient.ClbGetTargets( - clb.Region, clb.LoadBalanceId, clb.ListenId, - ) - if err != nil { - ins.ReportLogs(constvar.FailResult, - fmt.Sprintf("get Clb[%s:%s:%s] Targets failed:%s", - clb.Region, clb.LoadBalanceId, clb.ListenId, err.Error())) - continue - } - - for _, ip := range ips { - if ip != addr { + addr := fmt.Sprintf("%s:%d", ins.Ip, clb.BindPort) + for _, ip := range clb.BindIps { + // the ip and port of instance should match the clb information + if ip != ins.Ip || clb.BindPort != ins.Port { continue } @@ -229,24 +227,17 @@ func (ins *BaseSwitch) DeleteNameService(entry BindEntry) error { } break } - }*/ + } } if entry.Polaris != nil { ins.ReportLogs(constvar.InfoResult, fmt.Sprintf("try to release polaris entry")) - /*polarisClient := client.NewNameServiceClient(&conf.DNS.PolarisConf, conf.GetCloudId()) + polarisClient := client.NewNameServiceClient(&conf.NameServices.PolarisConf, conf.GetCloudId()) for _, pinfo := range entry.Polaris { - addr := fmt.Sprintf("%s:%d", ins.Ip, ins.Port) - ips, err := polarisClient.GetPolarisTargets(pinfo.Service) - if err != nil { - ins.ReportLogs(constvar.FailResult, - fmt.Sprintf("get Polaris[%s:%s] Targets failed,err:%s", - pinfo.Service, pinfo.Token, err.Error())) - continue - } - - for _, ip := range ips { - if ip != addr { + addr := fmt.Sprintf("%s:%d", ins.Ip, pinfo.BindPort) + for _, ip := range pinfo.BindIps { + // the ip and port of instance should match the polaris information + if ip != ins.Ip || pinfo.BindPort != ins.Port { continue } @@ -260,7 +251,7 @@ func (ins *BaseSwitch) DeleteNameService(entry BindEntry) error { } break } - }*/ + } } if !(dnsFlag && clbFlag && polarisFlag) { diff --git a/dbm-services/common/dbha/ha-module/ha.yaml b/dbm-services/common/dbha/ha-module/ha.yaml index d2f3e0122b..e7146e9f59 100644 --- a/dbm-services/common/dbha/ha-module/ha.yaml +++ b/dbm-services/common/dbha/ha-module/ha.yaml @@ -58,8 +58,8 @@ db_conf: proxy_pass: "proxy-conn-pass" timeout: 10 redis: -dns: - bind_conf: +name_services: + dns_conf: host: "bind-api-host" port: 80 url_pre: "/apis/proxypass" diff --git a/dbm-services/common/dbha/ha-module/monitor/monitor.go b/dbm-services/common/dbha/ha-module/monitor/monitor.go index e41fd1de5d..2d99e29b50 100644 --- a/dbm-services/common/dbha/ha-module/monitor/monitor.go +++ b/dbm-services/common/dbha/ha-module/monitor/monitor.go @@ -81,6 +81,7 @@ func MonitorSendDetect(ins dbutil.DataBaseDetect, eventName string, content stri func MonitorSend(content string, info MonitorInfo) error { addDimension := make(map[string]interface{}) if info.MonitorInfoType == constvar.MonitorInfoSwitch { + // switch monitor information dimension add addDimension["role"] = info.Switch.Role addDimension["bzid"] = info.Switch.Bzid addDimension["server_ip"] = info.Switch.ServerIp @@ -89,6 +90,14 @@ func MonitorSend(content string, info MonitorInfo) error { addDimension["cluster"] = info.Switch.Cluster addDimension["machine_type"] = info.Switch.MachineType addDimension["idc"] = info.Switch.IDC + } else if info.MonitorInfoType == constvar.MonitorInfoDetect { + // detect monitor information dimension add + addDimension["bzid"] = info.Detect.Bzid + addDimension["server_ip"] = info.Detect.ServerIp + addDimension["server_port"] = info.Detect.ServerPort + addDimension["status"] = info.Detect.Status + addDimension["cluster"] = info.Detect.Cluster + addDimension["machine_type"] = info.Detect.MachineType } return SendEvent(info.EventName, content, addDimension) diff --git a/dbm-services/common/go-pubpkg/backupclient/backupclient.go b/dbm-services/common/go-pubpkg/backupclient/backupclient.go index 5dca395174..2217226cfc 100644 --- a/dbm-services/common/go-pubpkg/backupclient/backupclient.go +++ b/dbm-services/common/go-pubpkg/backupclient/backupclient.go @@ -47,7 +47,7 @@ func New(clientPath string, authFile string, fileTag string) (*BackupClient, err clientPath = BackupClientPath } if !cmutil.FileExists(clientPath) { - return nil, errors.Errorf("backup_client not found:%s", clientPath) + return nil, errors.Errorf("backup_client path not found:%s", clientPath) } b := &BackupClient{ diff --git a/dbm-services/common/go-pubpkg/cc.v3/find_host_topo_relation.go b/dbm-services/common/go-pubpkg/cc.v3/find_host_topo_relation.go new file mode 100644 index 0000000000..a32bca41ae --- /dev/null +++ b/dbm-services/common/go-pubpkg/cc.v3/find_host_topo_relation.go @@ -0,0 +1,62 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package cc + +import ( + "encoding/json" + "net/http" +) + +// FindHostTopoRelation TODO +type FindHostTopoRelation struct { + client *Client + url string +} + +// FindHostTopoRelationParam TODO +type FindHostTopoRelationParam struct { + BkBizID int `json:"bk_biz_id"` + BkSetIds []int `json:"bk_set_ids"` + BkModuleIds []int `json:"bk_module_ids"` + BkHostIds []int `json:"bk_host_ids" url:"bk_host_ids"` + // 分页信息 + Page BKPage `json:"page"` +} + +// FindHostTopoRelationResponeData TODO +type FindHostTopoRelationResponeData struct { + Count int `json:"count"` + Data []HostBizModule `json:"data"` + Page BKPage `json:"page"` +} + +// NewFindHostTopoRelation returns a new FindHostTopoRelation server +func NewFindHostTopoRelation(client *Client) *FindHostTopoRelation { + return &FindHostTopoRelation{ + client: client, + url: "/api/c/compapi/v2/cc/find_host_topo_relation/", + } +} + +// Query do query handler +func (h *FindHostTopoRelation) Query(param *FindHostTopoRelationParam) (FindHostTopoRelationResponeData, *Response, + error) { + resp, err := h.client.Do(http.MethodPost, h.url, param) + if err != nil { + return FindHostTopoRelationResponeData{}, resp, err + } + var result FindHostTopoRelationResponeData + err = json.Unmarshal(resp.Data, &result) + if err != nil { + return FindHostTopoRelationResponeData{}, resp, err + } + return result, resp, nil +} diff --git a/dbm-services/common/go-pubpkg/cmutil/command.go b/dbm-services/common/go-pubpkg/cmutil/command.go index 8ce281fbac..4d4432361e 100644 --- a/dbm-services/common/go-pubpkg/cmutil/command.go +++ b/dbm-services/common/go-pubpkg/cmutil/command.go @@ -42,12 +42,10 @@ func ExecShellCommand(isSudo bool, param string) (stdoutStr string, err error) { // return stdout, stderr ,err func ExecCommand(bash bool, cwd string, cmdName string, args ...string) (string, string, error) { stdout, stderr, err := ExecCommandReturnBytes(bash, cwd, cmdName, args...) - if err != nil { - return "", "", err - } stdoutStr := strings.TrimSpace(string(stdout)) stderrStr := strings.TrimSpace(string(stderr)) - return stdoutStr, stderrStr, nil + + return stdoutStr, stderrStr, err } // ExecCommandReturnBytes run exec.Command diff --git a/dbm-services/common/go-pubpkg/cmutil/dir_size.go b/dbm-services/common/go-pubpkg/cmutil/dir_size.go new file mode 100644 index 0000000000..a0fe94af19 --- /dev/null +++ b/dbm-services/common/go-pubpkg/cmutil/dir_size.go @@ -0,0 +1,21 @@ +package cmutil + +import ( + "os" + "path/filepath" +) + +// DirSize get directory size like du +func DirSize(path string) (int64, error) { + var totalSize int64 + err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + totalSize += info.Size() + } + return err + }) + return totalSize, err +} diff --git a/dbm-services/common/go-pubpkg/cmutil/osinfo.go b/dbm-services/common/go-pubpkg/cmutil/osinfo.go new file mode 100644 index 0000000000..890e9431e5 --- /dev/null +++ b/dbm-services/common/go-pubpkg/cmutil/osinfo.go @@ -0,0 +1,124 @@ +package cmutil + +import ( + "strings" + + "github.com/pkg/errors" + "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v3/mem" +) + +// MemoryInfo return memory info +type MemoryInfo struct { + Total uint64 `json:"total"` + Free uint64 `json:"free"` + Shared uint64 `json:"shared"` + Buffer uint64 `json:"buffer"` + SwapTotal uint64 `json:"swap_total"` + SwapFree uint64 `json:"swap_free"` +} + +// GetMemoryInfo Get Memory Info +func GetMemoryInfo() (*MemoryInfo, error) { + memStat, err := mem.VirtualMemory() + if err != nil { + return nil, errors.Wrap(err, "fail to get memory") + } + memInfo := MemoryInfo{ + Total: memStat.Total, + Free: memStat.Free, + Shared: memStat.Shared, + Buffer: memStat.Buffers, + SwapTotal: memStat.SwapTotal, + SwapFree: memStat.SwapFree, + } + return &memInfo, nil +} + +// DiskPartInfo return disk partition info +type DiskPartInfo struct { + Device string `json:"device"` + Mountpoint string `json:"mountpoint"` + Fstype string `json:"fstype"` + + Path string `json:"path"` + Total uint64 `json:"total"` + // Free 真实可用量,不包括 fs reserved 部分,相当于 available + Free uint64 `json:"free"` + // Used 真实使用量, 不包含 fs reserved + Used uint64 `json:"used"` + // UsedTotal 总使用量,Used + Reserved + UsedTotal uint64 `json:"used_total"` + // Reserved = Total - Free - Used + Reserved uint64 `json:"reserved"` + // UsedPercent 在os层面看到的磁盘利用率,包括 reserved (Used + Reserved) / Total + UsedPercent float64 `json:"used_percent"` + // UsedPercentReal Used / (Total - Reserved), stat.UsedPercent + //UsedPercentReal float64 `json:"used_percent_real"` + InodesTotal uint64 `json:"inodes_total"` + InodesUsed uint64 `json:"inodes_used"` + InodesUsedPercent float64 `json:"inodes_used_percent"` +} + +// GetDiskPartInfo 获取目录的信息 +// 空间使用,挂载设备。比如 path = /data/dbbak/123,获取的是目录对应的挂载设备的信息 +func GetDiskPartInfo(path string, checkDevice bool) (*DiskPartInfo, error) { + info := DiskPartInfo{Path: path} + if checkDevice { + // 获取目录对应的挂载点 + osStatArgs := []string{"--format", "%m", path} + if stdout, stderr, err := ExecCommand(false, "", "stat", osStatArgs...); err != nil { + return nil, errors.Wrapf(err, "stat to get path mount %s", stderr) + } else { + info.Mountpoint = strings.TrimSpace(stdout) + } + // get more mountpoint device info + partInfo, err := disk.Partitions(false) + if err != nil { + return nil, errors.Wrap(err, "get disk partitions") + } + for _, p := range partInfo { + if p.Mountpoint == info.Mountpoint { + info.Device = p.Device + info.Fstype = p.Fstype + } + } + if info.Device == "" { + return nil, errors.Errorf("fail to get device(mounted %s) for path %s", info.Mountpoint, info.Path) + } + if info.Mountpoint != info.Path { + // use du to get directory used size? + } + } + + // 获取挂载点的分区使用信息 + pathInfo, err := disk.Usage(path) + if err != nil { + return nil, errors.Wrap(err, "get disk info") + } + info.Total = pathInfo.Total + info.Free = pathInfo.Free + info.Used = pathInfo.Used + info.Reserved = pathInfo.Total - pathInfo.Used - pathInfo.Free + info.UsedTotal = pathInfo.Total - pathInfo.Free // = pathInfo.Used + info.Reserved + info.UsedPercent = float64(info.UsedTotal) / float64(info.Total) // not pathInfo.UsedPercent + info.InodesTotal = pathInfo.InodesTotal + info.InodesUsed = pathInfo.InodesUsed + info.InodesUsedPercent = float64(100.0*pathInfo.InodesUsed) / float64(pathInfo.InodesTotal) + return &info, nil +} + +// CPUInfo return cpu processor info +type CPUInfo struct { + CoresLogical int `json:"cores_logical"` +} + +// GetCPUInfo Get CPU Info +func GetCPUInfo() (*CPUInfo, error) { + cores, err := cpu.Counts(true) + if err != nil { + return nil, errors.Wrap(err, "cpu.Counts") + } + return &CPUInfo{CoresLogical: cores}, nil +} diff --git a/dbm-services/common/go-pubpkg/cmutil/slice.go b/dbm-services/common/go-pubpkg/cmutil/slice.go index 40b6ade003..b0908bc2df 100644 --- a/dbm-services/common/go-pubpkg/cmutil/slice.go +++ b/dbm-services/common/go-pubpkg/cmutil/slice.go @@ -12,6 +12,7 @@ package cmutil import ( "fmt" + "slices" "strconv" "strings" @@ -34,12 +35,7 @@ func FilterOutStringSlice(src []string, filters []string) (dst []string) { // StringsHas check the []string contains the given element func StringsHas(ss []string, val string) bool { - for _, ele := range ss { - if ele == val { - return true - } - } - return false + return slices.Contains(ss, val) } // UniqueInts Returns unique items in a slice @@ -79,10 +75,11 @@ func IntsJoin(intList []int, sep string) string { return strings.Join(strList, sep) } -// SplitGroup TODO -func SplitGroup(laxiconid []string, subGroupLength int64) [][]string { +// SplitGroup 数组切割 +// 将数组laxiconid 按照 subGroupLength 切分成若干个数组 +func SplitGroup[T int | string](laxiconid []T, subGroupLength int64) [][]T { max := int64(len(laxiconid)) - var segmens = make([][]string, 0) + var segmens = make([][]T, 0) quantity := max / subGroupLength remainder := max % subGroupLength if quantity <= 1 { @@ -99,6 +96,7 @@ func SplitGroup(laxiconid []string, subGroupLength int64) [][]string { return segmens } +// CleanStrElems TODO // RemoveEmpty 过滤掉空字符串 func CleanStrElems(elems []string) []string { var result []string @@ -162,6 +160,7 @@ func ArrayInGroupsOf(arr []string, num int64) [][]string { return segments } +// HasElem TODO func HasElem[T int | string](elem T, elems []T) bool { if len(elems) <= 0 { return true diff --git a/dbm-services/common/go-pubpkg/go.mod b/dbm-services/common/go-pubpkg/go.mod index 5579c572e4..2b334c3b8a 100644 --- a/dbm-services/common/go-pubpkg/go.mod +++ b/dbm-services/common/go-pubpkg/go.mod @@ -1,47 +1,56 @@ module dbm-services/common/go-pubpkg -go 1.19 +go 1.21 require ( github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 - github.com/go-playground/validator/v10 v10.12.0 + github.com/go-playground/validator/v10 v10.15.4 github.com/go-sql-driver/mysql v1.7.1 - github.com/golang/glog v1.1.1 + github.com/golang/glog v1.1.2 github.com/google/go-querystring v1.1.0 github.com/jmoiron/sqlx v1.3.5 github.com/juju/ratelimit v1.0.2 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 - github.com/spf13/cast v1.5.0 + github.com/shirou/gopsutil/v3 v3.23.8 + github.com/spf13/cast v1.5.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.2 - go.uber.org/zap v1.24.0 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 + go.uber.org/zap v1.26.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/leodido/go-urn v1.2.3 // indirect - github.com/lib/pq v1.10.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/goleak v1.1.12 // indirect - go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + go.uber.org/goleak v1.2.1 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/dbm-services/common/go-pubpkg/go.sum b/dbm-services/common/go-pubpkg/go.sum index 9dbbe34a8d..5128786331 100644 --- a/dbm-services/common/go-pubpkg/go.sum +++ b/dbm-services/common/go-pubpkg/go.sum @@ -38,7 +38,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -56,25 +55,32 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.1 h1:jxpi2eWoU84wbX9iIEyAeeoac3FLuifZpY9tcNUD9kw= -github.com/golang/glog v1.1.1/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -110,7 +116,9 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -147,81 +155,95 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a h1:N9zuLhTvBSRt0gWSiJswwQ2HqDmtX/ZCDJURnKUt1Ik= +github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= +github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -229,8 +251,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -264,7 +286,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -296,8 +317,9 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -317,7 +339,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -327,6 +348,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -347,17 +369,19 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -367,8 +391,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -419,7 +443,6 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -523,7 +546,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/dbm-services/go.work b/dbm-services/go.work index 92dc9b4e67..8d3276e207 100644 --- a/dbm-services/go.work +++ b/dbm-services/go.work @@ -1,7 +1,8 @@ -go 1.19 +go 1.21 use ( riak/db-tools/dbactuator + riak/db-tools/riak-monitor bigdata/db-tools/dbactuator common/db-config common/db-resource diff --git a/dbm-services/go.work.sum b/dbm-services/go.work.sum index 213d477117..afa18c168b 100644 --- a/dbm-services/go.work.sum +++ b/dbm-services/go.work.sum @@ -1,270 +1,292 @@ bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512 h1:SRsZGA7aFnCZETmov57jwPrWuTmaZK6+4R4v5FUe1/c= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go/accessapproval v1.5.0 h1:/nTivgnV/n1CaAeo+ekGexTYUsKEU9jUVkoY5359+3Q= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accesscontextmanager v1.4.0 h1:CFhNhU7pcD11cuDkQdrE6PQJgv0EXNKNv06jIzbLlCU= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/aiplatform v1.27.0 h1:DBi3Jk9XjCJ4pkkLM4NqKgj3ozUL1wq4l+d3/jTGXAI= -cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= -cloud.google.com/go/analytics v0.12.0 h1:NKw6PpQi6V1O+KsjuTd+bhip9d0REYu4NevC45vtGp8= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/apigateway v1.4.0 h1:IIoXKR7FKrEAQhMTz5hK2wiDz2WNFHS7eVr/L1lE/rM= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigeeconnect v1.4.0 h1:AONoTYJviyv1vS4IkvWzq69gEVdvHx35wKXc+e6wjZQ= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/appengine v1.5.0 h1:lmG+O5oaR9xNwaRBwE2XoMhwQHsHql5IoiGr1ptdDwU= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/area120 v0.6.0 h1:TCMhwWEWhCn8d44/Zs7UCICTWje9j3HuV6nVGMjdpYw= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.9.0 h1:3d0LRAU1K6vfqCahhl9fx2oGHcq+s5gftdix4v8Ibrc= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/asset v1.10.0 h1:aCrlaLGJWTODJX4G56ZYzJefITKEWNfbjjtHSzWpxW0= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/assuredworkloads v1.9.0 h1:hhIdCOowsT1GG5eMCIA0OwK6USRuYTou/1ZeNxCSRtA= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/automl v1.8.0 h1:BMioyXSbg7d7xLibn47cs0elW6RT780IUWr42W8rp2Q= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/baremetalsolution v0.4.0 h1:g9KO6SkakcYPcc/XjAzeuUrEOXlYPnMpuiaywYaGrmQ= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/batch v0.4.0 h1:1jvEBY55OH4Sd2FxEXQfxGExFWov1A/IaRe+Z5Z71Fw= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/beyondcorp v0.3.0 h1:w+4kThysgl0JiKshi2MKDCg2NZgOyqOI0wq2eBZyrzA= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/bigquery v1.44.0 h1:Wi4dITi+cf9VYp4VH2T9O41w0kCW0uQTELq2Z6tukN0= -cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/billing v1.7.0 h1:Xkii76HWELHwBtkQVZvqmSo9GTr0O+tIbRNnMcGdlg4= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/binaryauthorization v1.4.0 h1:pL70vXWn9TitQYXBWTK2abHl2JHLwkFRjYw6VflRqEA= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/certificatemanager v1.4.0 h1:tzbR4UHBbgsewMWUD93JHi8EBi/gHBoSAcY1/sThFGk= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/channel v1.9.0 h1:pNuUlZx0Jb0Ts9P312bmNMuH5IiFWIR4RUtLb70Ke5s= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/cloudbuild v1.4.0 h1:TAAmCmAlOJ4uNBu6zwAjwhyl/7fLHHxIEazVhr3QBbQ= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/clouddms v1.4.0 h1:UhzHIlgFfMr6luVYVNydw/pl9/U5kgtjCMJHnSvoVws= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/cloudtasks v1.8.0 h1:faUiUgXjW8yVZ7XMnKHKm1WE4OldPBUWWfIRN/3z1dc= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go/accessapproval v1.6.0 h1:x0cEHro/JFPd7eS4BlEWNTMecIj2HdXjOVB5BtvwER0= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.7.0 h1:MG60JgnEoawHJrbWw0jGdv6HLNSf6gQvYRiXpuzqgEA= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= +cloud.google.com/go/aiplatform v1.37.0 h1:zTw+suCVchgZyO+k847wjzdVjWmrAuehxdvcZvJwfGg= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= +cloud.google.com/go/analytics v0.19.0 h1:LqAo3tAh2FU9+w/r7vc3hBjU23Kv7GhO/PDIW7kIYgM= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.5.0 h1:ZI9mVO7x3E9RK/BURm2p1aw9YTBSCQe3klmyP1WxWEg= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.5.0 h1:sWOmgDyAsi1AZ48XRHcATC0tsi9SkPT7DA/+VCfkaeA= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.6.0 h1:E43RdhhCxdlV+I161gUY2rI4eOaMzHTA5kNkvRsFXvc= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.6.0 h1:B9CdHFZTFjVti89tmyXXrO+7vSNo2jvZuHG8zD5trdQ= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.7.1 h1:aBGDKmRIaRRoWJ2tAoN0oVSHoWLhtO9aj/NvUyP4aYs= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= +cloud.google.com/go/area120 v0.7.1 h1:ugckkFh4XkHJMPhTIx0CyvdoBxmOpMe8rNs4Ok8GAag= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/artifactregistry v1.13.0 h1:o1Q80vqEB6Qp8WLEH3b8FBLNUCrGQ4k5RFj0sn/sgO8= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= +cloud.google.com/go/asset v1.13.0 h1:YAsssO08BqZ6mncbb6FPlj9h6ACS7bJQUOlzciSfbNk= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= +cloud.google.com/go/assuredworkloads v1.10.0 h1:VLGnVFta+N4WM+ASHbhc14ZOItOabDLH1MSoDv+Xuag= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/automl v1.12.0 h1:50VugllC+U4IGl3tDNcZaWvApHBTrn/TvyHDJ0wM+Uw= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.5.0 h1:2AipdYXL0VxMboelTTw8c1UJ7gYu35LZYUbuRv9Q28s= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.7.0 h1:YbMt0E6BtqeD5FvSv1d56jbVsWEzlGm55lYte+M6Mzs= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.5.0 h1:UkY2BTZkEUAVrgqnSdOJ4p3y9ZRBPEe1LkjgC8Bj/Pc= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= +cloud.google.com/go/bigquery v1.50.0 h1:RscMV6LbnAmhAzD893Lv9nXXy2WCaJmbxYPWDLbGqNQ= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= +cloud.google.com/go/billing v1.13.0 h1:JYj28UYF5w6VBAh0gQYlgHJ/OD1oA+JgW29YZQU+UHM= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= +cloud.google.com/go/binaryauthorization v1.5.0 h1:d3pMDBCCNivxt5a4eaV7FwL7cSH0H7RrEnFrTb1QKWs= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.6.0 h1:5C5UWeSt8Jkgp7OWn2rCkLmYurar/vIWIoSQ2+LaTOc= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.12.0 h1:GpcQY5UJKeOekYgsX3QXbzzAc/kRGtBq43fTmyKe6Uw= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.9.0 h1:GHQCjV4WlPPVU/j3Rlpc8vNIDwThhd1U9qSY/NPZdko= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.5.0 h1:E7v4TpDGUyEm1C/4KIrpVSOCTm0P6vWdHT0I4mostRA= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/cloudtasks v1.10.0 h1:uK5k6abf4yligFgYFnG0ni8msai/dSv6mDmiBulU0hU= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.14.0 h1:hfm2+FfxVmnRlh6LpB7cg1ZNU+5edAHmW679JePztk0= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.4.0 h1:tTQLI/ZvguUf9Hv+36BkG2+/PeC8Ol1q4pBW+tgCx0A= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/container v1.7.0 h1:nbEK/59GyDRKKlo1SqpohY1TK8LmJ2XNcvS9Gyom2A0= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/containeranalysis v0.6.0 h1:2824iym832ljKdVpCBnpqm5K94YT/uHTVhNF+dRTXPI= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.8.0 h1:6kZ4RIOW/uT7QWC5SfPfq/G8sYzr/v+UOmOAxy4Z1TE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/dataflow v0.7.0 h1:CW3541Fm7KPTyZjJdnX6NtaGXYFn5XbFC5UcjgALKvU= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.5.0 h1:vLwowLF2ZB5J5gqiZCzv076lDI/Rd7zYQQFu5XO1PSg= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/datafusion v1.5.0 h1:j5m2hjWovTZDTQak4MJeXAR9yN7O+zMfULnjGw/OOLg= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datalabeling v0.6.0 h1:dp8jOF21n/7jwgo/uuA0RN8hvLcKO4q6s/yvwevs2ZM= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataplex v1.4.0 h1:cNxeA2DiWliQGi21kPRqnVeQ5xFhNoEjPRt1400Pm8Y= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataproc v1.8.0 h1:gVOqNmElfa6n/ccG/QDlfurMWwrK3ezvy2b2eDoCmS0= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataqna v0.6.0 h1:gx9jr41ytcA3dXkbbd409euEaWtofCVXYBvJz3iYm18= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/datastore v1.10.0 h1:4siQRf4zTiAVt/oeH4GureGkApgb2vtPQAtOmhpqQwE= -cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastream v1.5.0 h1:PgIgbhedBtYBU6POGXFMn2uSl9vpqubc3ewTNdcU8Mk= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/deploy v1.5.0 h1:kI6dxt8Ml0is/x7YZjLveTvR7YPzXAUD/8wQZ2nH5zA= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/dialogflow v1.19.0 h1:HYHVOkoxQ9bSfNIelSZYNAtUi4CeSrCnROyOsbOqPq8= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dlp v1.7.0 h1:9I4BYeJSVKoSKgjr70fLdRDumqcUeVmHV4fd5f9LR6Y= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/documentai v1.10.0 h1:jfq09Fdjtnpnmt/MLyf6A3DM3ynb8B2na0K+vSXvpFM= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/domains v0.7.0 h1:pu3JIgC1rswIqi5romW0JgNO6CTUydLYX8zyjiAvO1c= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.2.0 h1:hd6J2n5dBBRuAqnNUEsKWrp6XNPKsaxwwIyzOPZTokk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/contactcenterinsights v1.6.0 h1:jXIpfcH/VYSE1SYcPzO0n1VVb+sAamiLOgCw45JbOQk= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.15.0 h1:NKlY/wCDapfVZlbVVaeuu2UZZED5Dy1z4Zx1KhEzm8c= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= +cloud.google.com/go/containeranalysis v0.9.0 h1:EQ4FFxNaEAg8PqQCO7bVQfWz9NVwZCUKaM1b3ycfx3U= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= +cloud.google.com/go/datacatalog v1.13.0 h1:4H5IJiyUE0X6ShQBqgFFZvGGcrwGVndTwUSLP4c52gw= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= +cloud.google.com/go/dataflow v0.8.0 h1:eYyD9o/8Nm6EttsKZaEGD84xC17bNgSKCu0ZxwqUbpg= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataform v0.7.0 h1:Dyk+fufup1FR6cbHjFpMuP4SfPiF3LI3JtoIIALoq48= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.6.0 h1:sZjRnS3TWkGsu1LjYPFD/fHeMLZNXDK6PDHi2s2s/bk= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datalabeling v0.7.0 h1:ch4qA2yvddGRUrlfwrNJCr79qLqhS9QBwofPHfFlDIk= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.6.0 h1:RvoZ5T7gySwm1CHzAw7yY1QwwqaGswunmqEssPxU/AM= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.12.0 h1:W47qHL3W4BPkAIbk4SWmIERwsWBaNnWm0P2sdx3YgGU= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataqna v0.7.0 h1:yFzi/YU4YAdjyo7pXkBE2FeHbgz5OQQBVDdbErEHmVQ= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/datastore v1.11.0 h1:iF6I/HaLs3Ado8uRKMvZRvF/ZLkWaWE9i8AiHzbC774= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastream v1.7.0 h1:BBCBTnWMDwwEzQQmipUXxATa7Cm7CA/gKjKcR2w35T0= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.8.0 h1:otshdKEbmsi1ELYeCKNYppwV0UH5xD05drSdBm7ouTk= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= +cloud.google.com/go/dialogflow v1.32.0 h1:uVlKKzp6G/VtSW0E7IH1Y5o0H48/UOCmqksG2riYCwQ= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.9.0 h1:1JoJqezlgu6NWCroBxr4rOZnwNFILXr4cB9dMaSKO4A= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/documentai v1.18.0 h1:KM3Xh0QQyyEdC8Gs2vhZfU+rt6OCPF0dwVwxKgLmWfI= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= +cloud.google.com/go/domains v0.8.0 h1:2ti/o9tlWL4N+wIuWUNH+LbfgpwxPr8J1sv9RHA4bYQ= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/edgecontainer v1.0.0 h1:O0YVE5v+O0Q/ODXYsQHmHb+sYM8KNjGZw2pjX2Ws41c= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= cloud.google.com/go/errorreporting v0.3.0 h1:kj1XEWMu8P0qlLhm3FwcaFsUvXChV/OraZwA70trRR0= cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.4.0 h1:b6csrQXCHKQmfo9h3dG/pHyoEh+fQG1Yg78a53LAviY= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/eventarc v1.8.0 h1:AgCqrmMMIcel5WWKkzz5EkCUKC3Rl5LNMMYsS+LvsI0= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/filestore v1.4.0 h1:yjKOpzvqtDmL5AXbKttLc8j0hL20kuC1qPdy5HPcxp0= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/essentialcontacts v1.5.0 h1:gIzEhCoOT7bi+6QZqZIzX1Erj4SswMPIteNvYVlu+pM= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.11.0 h1:fsJmNeqvqtk74FsaVDU6cH79lyZNCYP8Rrv7EhaB/PU= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.6.0 h1:ckTEXN5towyTMu4q0uQ1Mde/JwTHur0gXs8oaIZnKfw= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= cloud.google.com/go/firestore v1.9.0 h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA= cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/functions v1.9.0 h1:35tgv1fQOtvKqH/uxJMzX3w6usneJ0zXpsFr9KAVhNE= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/gaming v1.8.0 h1:97OAEQtDazAJD7yh/kvQdSCQuTKdR0O+qWAJBZJ4xiA= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gkebackup v0.3.0 h1:4K+jiv4ocqt1niN8q5Imd8imRoXBHTrdnJVt/uFFxF4= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkeconnect v0.6.0 h1:zAcvDa04tTnGdu6TEZewaLN2tdMtUOJJ7fEceULjguA= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.10.0 h1:JTcTaYQRGsVm+qkah7WzHb6e9sf1C0laYdRPn9aN+vg= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkemulticloud v0.4.0 h1:8F1NhJj8ucNj7lK51UZMtAjSWTgP1zO18XF6vkfiPPU= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/functions v1.13.0 h1:pPDqtsXG2g9HeOQLoquLbmvmb82Y4Ezdo1GXuotFoWg= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= +cloud.google.com/go/gaming v1.9.0 h1:7vEhFnZmd931Mo7sZ6pJy7uQPDxF7m7v8xtBheG08tc= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.4.0 h1:za3QZvw6ujR0uyqkhomKKKNoXDyqYGPJies3voUK8DA= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkeconnect v0.7.0 h1:gXYKciHS/Lgq0GJ5Kc9SzPA35NGc3yqu6SkjonpEr2Q= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkehub v0.12.0 h1:TqCSPsEBQ6oZSJgEYZ3XT8x2gUadbvfwI32YB0kuHCs= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.5.0 h1:8I84Q4vl02rJRsFiinBxl7WCozfdLlUVBQuSrqr9Wtk= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= cloud.google.com/go/grafeas v0.2.0 h1:CYjC+xzdPvbV65gi6Dr4YowKcmLo045pm18L0DhdELM= -cloud.google.com/go/gsuiteaddons v1.4.0 h1:TGT2oGmO5q3VH6SjcrlgPUWI0njhYv4kywLm6jag0to= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.5.0 h1:1mvhXqJzV0Vg5Fa95QwckljODJJfDFXV4pn+iL50zzA= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iap v1.5.0 h1:BGEXovwejOCt1zDk8hXq0bOhhRu9haXKWXXXp2B4wBM= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/ids v1.2.0 h1:LncHK4HHucb5Du310X8XH9/ICtMwZ2PCfK0ScjWiJoY= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/iot v1.4.0 h1:Y9+oZT9jD4GUZzORXTU45XsnQrhxmDT+TFbPil6pRVQ= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/kms v1.6.0 h1:OWRZzrPmOZUzurjI2FBGtgY2mB1WaJkqhw6oIwSj0Yg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/language v1.8.0 h1:3Wa+IUMamL4JH3Zd3cDZUHpwyqplTACt6UZKRD2eCL4= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/lifesciences v0.6.0 h1:tIqhivE2LMVYkX0BLgG7xL64oNpDaFFI7teunglt1tI= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/logging v1.6.1 h1:ZBsZK+JG+oCDT+vaxwqF2egKNRjz8soXiS6Xv79benI= -cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= -cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iap v1.7.1 h1:PxVHFuMxmSZyfntKXHXhd8bo82WJ+LcATenq7HLdVnU= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.3.0 h1:fodnCDtOXuMmS8LTC2y3h8t24U8F3eKWfhi+3LY6Qf0= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.6.0 h1:39W5BFSarRNZfVG0eXI5LYux+OVQT8GkgpHCnrZL2vM= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.10.1 h1:7hm1bRqGCA1GBRQUrp831TwJ9TWhP+tvLuP497CQS2g= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= +cloud.google.com/go/language v1.9.0 h1:7Ulo2mDk9huBoBi8zCE3ONOoBrL6UXfAI71CLQ9GEIM= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/lifesciences v0.8.0 h1:uWrMjWTsGjLZpCTWEAzYvyXj+7fhiZST45u9AgasasI= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.7.0 h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5I= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/managedidentities v1.4.0 h1:3Kdajn6X25yWQFhFCErmKSYTSvkEd3chJROny//F1A0= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/maps v0.1.0 h1:kLReRbclTgJefw2fcCbdLPLhPj0U6UUWN10ldG8sdOU= -cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= -cloud.google.com/go/mediatranslation v0.6.0 h1:qAJzpxmEX+SeND10Y/4868L5wfZpo4Y3BIEnIieP4dk= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.7.0 h1:yLxUzJkZVSH2kPaHut7k+7sbIBFpvSh1LW9qjM2JDjA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/metastore v1.8.0 h1:3KcShzqWdqxrDEXIBWpYJpOOrgpDj+HlBi07Grot49Y= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/monitoring v1.8.0 h1:c9riaGSPQ4dUKWB+M1Fl0N+iLxstMbCktdEwYSPGDvA= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/networkconnectivity v1.7.0 h1:BVdIKaI68bihnXGdCVL89Jsg9kq2kg+II30fjVqo62E= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkmanagement v1.5.0 h1:mDHA3CDW00imTvC5RW6aMGsD1bH+FtKwZm/52BxaiMg= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networksecurity v0.6.0 h1:qDEX/3sipg9dS5JYsAY+YvgTjPR63cozzAWop8oZS94= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.5.0 h1:AC8RPjNvel3ExgXjO1YOAz+teg9+j+89TNxa7pIZfww= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/optimization v1.2.0 h1:7PxOq9VTT7TMib/6dMoWpMvWS2E4dJEvtYzjvBreaec= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/orchestration v1.4.0 h1:39d6tqvNjd/wsSub1Bn4cEmrYcet5Ur6xpaN+SxOxtY= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orgpolicy v1.5.0 h1:erF5PHqDZb6FeFrUHiYj2JK2BMhsk8CyAg4V4amJ3rE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/osconfig v1.10.0 h1:NO0RouqCOM7M2S85Eal6urMSSipWwHU8evzwS+siqUI= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/oslogin v1.7.0 h1:pKGDPfeZHDybtw48WsnVLjoIPMi9Kw62kUE5TXCLCN4= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/phishingprotection v0.6.0 h1:OrwHLSRSZyaiOt3tnY33dsKSedxbMzsXvqB21okItNQ= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/policytroubleshooter v1.4.0 h1:NQklJuOUoz1BPP+Epjw81COx7IISWslkZubz/1i0UN8= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/privatecatalog v0.6.0 h1:Vz86uiHCtNGm1DeC32HeG2VXmOq5JRYA3VRPf8ZEcSg= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/pubsub v1.27.1 h1:q+J/Nfr6Qx4RQeu3rJcnN48SNC0qzlYzSeqkPq93VHs= -cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= -cloud.google.com/go/pubsublite v1.5.0 h1:iqrD8vp3giTb7hI1q4TQQGj77cj8zzgmMPsTZtLnprM= -cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/managedidentities v1.5.0 h1:ZRQ4k21/jAhrHBVKl/AY7SjgzeJwG1iZa+mJ82P+VNg= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.7.0 h1:mv9YaczD4oZBZkM5XJl6fXQ984IkJNHPwkc8MUsdkBo= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= +cloud.google.com/go/mediatranslation v0.7.0 h1:anPxH+/WWt8Yc3EdoEJhPMBRF7EhIdz426A+tuoA0OU= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/memcache v1.9.0 h1:8/VEmWCpnETCrBwS3z4MhT+tIdKgR1Z4Tr2tvYH32rg= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/metastore v1.10.0 h1:QCFhZVe2289KDBQ7WxaHV2rAmPrmRAdLC6gbjUd3HPo= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.13.0 h1:2qsrgXGVoRXpP7otZ14eE1I568zAa92sJSDPyOJvwjM= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/networkconnectivity v1.11.0 h1:ZD6b4Pk1jEtp/cx9nx0ZYcL3BKqDa+KixNDZ6Bjs1B8= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.6.0 h1:8KWEUNGcpSX9WwZXq7FtciuNGPdPdPN/ruDm769yAEM= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networksecurity v0.8.0 h1:sOc42Ig1K2LiKlzG71GUVloeSJ0J3mffEBYmvu+P0eo= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= +cloud.google.com/go/notebooks v1.8.0 h1:Kg2K3K7CbSXYJHZ1aGQpf1xi5x2GUvQWf2sFVuiZh8M= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.3.1 h1:dj8O4VOJRB4CUwZXdmwNViH1OtI0WtWL867/lnYH248= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.6.0 h1:Vw+CEXo8M/FZ1rb4EjcLv0gJqqw89b7+g+C/EmniTb8= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.10.0 h1:XDriMWug7sd0kYT1QKofRpRHzjad0bK8Q8uA9q+XrU4= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/osconfig v1.11.0 h1:PkSQx4OHit5xz2bNyr11KGcaFccL5oqglFPdTboyqwQ= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/oslogin v1.9.0 h1:whP7vhpmc+ufZa90eVpkfbgzJRK/Xomjz+XCD4aGwWw= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/phishingprotection v0.7.0 h1:l6tDkT7qAEV49MNEJkEJTB6vOO/onbSOcNtAT09HPuA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.6.0 h1:yKAGC4p9O61ttZUswaq9GAn1SZnEzTd0vUYXD7ZBT7Y= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= +cloud.google.com/go/privatecatalog v0.8.0 h1:EPEJ1DpEGXLDnmc7mnCAqFmkwUJbIsaLAiLHVOkkwtc= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= +cloud.google.com/go/pubsub v1.30.0 h1:vCge8m7aUKBJYOgrZp7EsNDf6QMd2CAlXZqWTn3yq6s= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.7.0 h1:cb9fsrtpINtETHiJ3ECeaVzrfIVhcGjhhJEjybHXHao= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= cloud.google.com/go/recaptchaenterprise v1.3.1 h1:u6EznTGzIdsyOsvm+Xkw0aSuKFXQlyjGE9a4exk6iNQ= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0 h1:UqzFfb/WvhwXGDF1eQtdHLrmni+iByZXY4h3w9Kdyv8= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recommendationengine v0.6.0 h1:6w+WxPf2LmUEqX0YyvfCoYb8aBYOcbIV25Vg6R0FLGw= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.8.0 h1:9kMZQGeYfcOD/RtZfcNKGKtoex3DdoB4zRgYU/WaIwE= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/redis v1.10.0 h1:/zTwwBKIAD2DEWTrXZp8WD9yD/gntReF/HkPssVYd0U= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/resourcemanager v1.4.0 h1:NDao6CHMwEZIaNsdWy+tuvHaavNeGP06o1tgrR0kLvU= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcesettings v1.4.0 h1:eTzOwB13WrfF0kuzG2ZXCfB3TLunSHBur4s+HFU6uSM= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/retail v1.11.0 h1:N9fa//ecFUOEPsW/6mJHfcapPV0wBSwIUwpVZB7MQ3o= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/run v0.3.0 h1:AWPuzU7Xtaj3Jf+QarDWIs6AJ5hM1VFQ+F6Q+VZ6OT4= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/scheduler v1.7.0 h1:K/mxOewgHGeKuATUJNGylT75Mhtjmx1TOkKukATqMT8= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/secretmanager v1.9.0 h1:xE6uXljAC1kCR8iadt9+/blg1fvSbmenlsDN4fT9gqw= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/security v1.10.0 h1:KSKzzJMyUoMRQzcz7azIgqAUqxo7rmQ5rYvimMhikqg= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/securitycenter v1.16.0 h1:QTVtk/Reqnx2bVIZtJKm1+mpfmwRwymmNvlaFez7fQY= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/servicecontrol v1.5.0 h1:ImIzbOu6y4jL6ob65I++QzvqgFaoAKgHOG+RU9/c4y8= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicedirectory v1.7.0 h1:f7M8IMcVzO3T425AqlZbP3yLzeipsBHtRza8vVFYMhQ= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicemanagement v1.5.0 h1:TpkCO5M7dhKSy1bKUD9o/sSEW/U1Gtx7opA1fsiMx0c= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/serviceusage v1.4.0 h1:b0EwJxPJLpavSljMQh0RcdHsUrr5DQ+Nelt/3BAs5ro= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/shell v1.4.0 h1:b1LFhFBgKsG252inyhtmsUUZwchqSz3WTvAIf3JFo4g= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/spanner v1.41.0 h1:NvdTpRwf7DTegbfFdPjAWyD7bOVu0VeMqcvR9aCQCAc= -cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= -cloud.google.com/go/speech v1.9.0 h1:yK0ocnFH4Wsf0cMdUyndJQ/hPv02oTJOxzi6AgpBy4s= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0 h1:6iOCujSNJ0YS7oNymI64hXsjGq60T4FK1zdLugxbzvU= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= +cloud.google.com/go/recommendationengine v0.7.0 h1:VibRFCwWXrFebEWKHfZAt2kta6pS7Tlimsnms0fjv7k= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommender v1.9.0 h1:ZnFRY5R6zOVk2IDS1Jbv5Bw+DExCI5rFumsTnMXiu/A= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/redis v1.11.0 h1:JoAd3SkeDt3rLFAAxEvw6wV4t+8y4ZzfZcZmddqphQ8= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.7.0 h1:NRM0p+RJkaQF9Ee9JMnUV9BQ2QBIOq/v8M+Pbv/wmCs= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.5.0 h1:8Dua37kQt27CCWHm4h/Q1XqCF6ByD7Ouu49xg95qJzI= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/retail v1.12.0 h1:1Dda2OpFNzIb4qWgFZjYlpP7sxX3aLeypKG6A3H4Yys= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.9.0 h1:ydJQo+k+MShYnBfhaRHSZYeD/SQKZzZLAROyfpeD9zw= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= +cloud.google.com/go/scheduler v1.9.0 h1:NpQAHtx3sulByTLe2dMwWmah8PWgeoieFPpJpArwFV0= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= +cloud.google.com/go/secretmanager v1.10.0 h1:pu03bha7ukxF8otyPKTFdDz+rr9sE3YauS5PliDXK60= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/security v1.13.0 h1:PYvDxopRQBfYAXKAuDpFCKBvDOWPWzp9k/H5nB3ud3o= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= +cloud.google.com/go/securitycenter v1.19.0 h1:AF3c2s3awNTMoBtMX3oCUoOMmGlYxGOeuXSYHNBkf14= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.11.1 h1:d0uV7Qegtfaa7Z2ClDzr9HJmnbJW7jn0WhZ7wOX6hLE= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= +cloud.google.com/go/servicedirectory v1.9.0 h1:SJwk0XX2e26o25ObYUORXx6torSFiYgsGkWSkZgkoSU= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.8.0 h1:fopAQI/IAzlxnVeiKn/8WiV6zKndjFkvi+gzu+NjywY= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.6.0 h1:rXyq+0+RSIm3HFypctp7WoXxIA563rn206CfMWdqXX4= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.6.0 h1:wT0Uw7ib7+AgZST9eCDygwTJn4+bHMDtZo5fh7kGWDU= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0 h1:7VdjZ8zj4sHbDw55atp5dfY6kn1j9sam9DRNpPQhqR4= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= +cloud.google.com/go/speech v1.15.0 h1:JEVoWGNnTF128kNty7T4aG4eqv2z86yiMJPT9Zjp+iw= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storagetransfer v1.6.0 h1:fUe3OydbbvHcAYp07xY+2UpH4AermGbmnm7qdEj3tGE= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/talent v1.4.0 h1:MrekAGxLqAeAol4Sc0allOVqUGO8j+Iim8NMvpiD7tM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/texttospeech v1.5.0 h1:ccPiHgTewxgyAeCWgQWvZvrLmbfQSFABTMAfrSPLPyY= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/tpu v1.4.0 h1:ztIdKoma1Xob2qm6QwNh4Xi9/e7N3IfvtwG5AcNsj1g= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/trace v1.4.0 h1:qO9eLn2esajC9sxpqp1YKX37nXC3L4BfGnPS0Cx9dYo= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/translate v1.4.0 h1:AOYOH3MspzJ/bH1YXzB+xTE8fMpn3mwhLjugwGXvMPI= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/video v1.9.0 h1:ttlvO4J5c1VGq6FkHqWPD/aH6PfdxujHt+muTJlW1Zk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/videointelligence v1.9.0 h1:RPFgVVXbI2b5vnrciZjtsUgpNKVtHO/WIyXUhEfuMhA= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storagetransfer v1.8.0 h1:5T+PM+3ECU3EY2y9Brv0Sf3oka8pKmsCfpQ07+91G9o= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= +cloud.google.com/go/talent v1.5.0 h1:nI9sVZPjMKiO2q3Uu0KhTDVov3Xrlpt63fghP9XjyEM= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.6.0 h1:H4g1ULStsbVtalbZGktyzXzw6jP26RjVGYx9RaYjBzc= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.5.0 h1:/34T6CbSi+kTv5E19Q9zbU/ix8IviInZpzwz3rsFE+A= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.9.0 h1:olxC0QHC59zgJVALtgqfD9tGk0lfeCP5/AGXL3Px/no= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/translate v1.7.0 h1:GvLP4oQ4uPdChBmBaUSa/SaZxCdyWELtlAaKzpHsXdA= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.15.0 h1:upIbnGI0ZgACm58HPjAeBMleW3sl5cT84AbYQ8PWOgM= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/videointelligence v1.10.0 h1:Uh5BdoET8XXqXX2uXIahGb+wTKbLkGH7s4GXR58RrG8= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= cloud.google.com/go/vision v1.2.0 h1:/CsSTkbmO9HC8iQpxbK8ATms3OQaX3YQUeTMGCxlaK4= -cloud.google.com/go/vision/v2 v2.5.0 h1:TQHxRqvLMi19azwm3qYuDbEzZWmiKJNTpGbkNsfRCik= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vmmigration v1.3.0 h1:A2Tl2ZmwMRpvEmhV2ibISY85fmQR+Y5w9a0PlRz5P3s= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vmwareengine v0.1.0 h1:JMPZaOT/gIUxVlTqSl/QQ32Y2k+r0stNeM1NSqhVP9o= -cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= -cloud.google.com/go/vpcaccess v1.5.0 h1:woHXXtnW8b9gLFdWO9HLPalAddBQ9V4LT+1vjKwR3W8= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/webrisk v1.7.0 h1:ypSnpGlJnZSXbN9a13PDmAYvVekBLnGKxQ3Q9SMwnYY= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/websecurityscanner v1.4.0 h1:y7yIFg/h/mO+5Y5aCOtVAnpGUOgqCH5rXQ2Oc8Oq2+g= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/workflows v1.9.0 h1:7Chpin9p50NTU8Tb7qk+I11U/IwVXmDhEoSsdccvInE= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.7.0 h1:8C8RXUJoflCI4yVdqhTy9tRyygSHmp60aP363z23HKg= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.6.0 h1:Azs5WKtfOC8pxvkyrDvt7J0/4DYBch0cVbuFfCCFt5k= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.3.0 h1:b0NBu7S294l0gmtrT0nOJneMYgZapr5x9tVWvgDoVEM= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.6.0 h1:FOe6CuiQD3BhHJWt7E8QlbBcaIzVRddupwJlp7eqmn4= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/webrisk v1.8.0 h1:IY+L2+UwxcVm2zayMAtBhZleecdIFLiC+QJMzgb0kT0= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.5.0 h1:AHC1xmaNMOZtNqxI9Rmm87IJEyPaRkOxeI0gpAacXGk= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/workflows v1.10.0 h1:FfGp9w0cYnaKZJhUOMqCOJCYT/WlvYBfTQhFWV3sRKI= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= +github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 h1:V8krnnfGj4pV65YLUm3C0/8bl7V5Nry2Pwvy3ru/wLc= github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible h1:KnPIugL51v3N3WwvaSmZbxukD1WuWXOiE9fRdu32f2I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.2/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 h1:T8quHYlUGyb/oqtSTwqlCr1ilJHrDv+ZtpSfo+hm1BU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 h1:u/LLAOFgsMv7HmNL4Qufg58y+qElGOt5qv0z1mURkRY= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0/go.mod h1:2e8rMJtl2+2j+HXbTBwnyGpm5Nou7KhvSfxOq8JpTag= github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= @@ -273,77 +295,114 @@ github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8K github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 h1:oPdPEZFSbl7oSPEAIPMPBMUmiL+mqgzBJwM/9qYcwNg= +github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/ClickHouse/clickhouse-go v1.4.3 h1:iAFMa2UrQdR5bHJ2/yaSLffZkxpcOYQMCUuKeNXGdqc= -github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/HuKeping/rbtree v0.0.0-20200208030951-29f0b79e84ed h1:YKqpA6qf8Bh73vj8Rv9SBB5OU558f2c1A889nCVUSLE= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Microsoft/hcsshim v0.9.2 h1:wB06W5aYFfUB3IvootYAY2WnOmIdgPGfqSI6tufQNnY= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3 h1:4FA+QBaydEHlwxg0lMN3rhwoDaQy6LKhVWR4qvq4BuA= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= -github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f h1:5ZfJxyXo8KyX8DgGXC5B7ILL8y51fci/qYz2B4j8iLY= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= +github.com/Shopify/toxiproxy/v2 v2.5.0/go.mod h1:yhM2epWtAmel9CB8r2+L+PCmhH6yH2pITaPAo7jxJl0= +github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alexflint/go-filemutex v1.1.0 h1:IAWuUuRYL2hETx5b8vCgwnD+xSdlsTQY6s2JjBsqLdg= github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30 h1:HGREIyk0QRPt70R69Gm1JFHDgoiyYpCyuGE8E9k/nf0= +github.com/apache/arrow/go/v10 v10.0.1 h1:n9dERvixoC/1JjDmBcs9FPaEryoANa2sCgVFo6ez9cI= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0 h1:hqauxvFQxww+0mEU/2XHG6LT7eZternCZq+A5Yly2uM= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= +github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.17.7 h1:/4+rDPe0W95KBmNGYCG+NUvdL8ssPYBMxL+aSCg6nIA= -github.com/aws/aws-sdk-go-v2 v1.9.2 h1:dUFQcMNZMLON4BOe273pl0filK9RqyQMhCK/6xssL6s= -github.com/aws/aws-sdk-go-v2/config v1.8.3 h1:o5583X4qUfuRrOGOgmOcDgvr5gJVSu57NK08cWAhIDk= -github.com/aws/aws-sdk-go-v2/credentials v1.4.3 h1:LTdD5QhK073MpElh9umLLP97wxphkgVC/OjQaEbBwZA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0 h1:9tfxW/icbSu98C2pcNynm5jmDwU3/741F11688B6QnU= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4 h1:TnU1cY51027j/MQeFy7DIgk1UuzJY+wLFYqXceY/fiE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4 h1:leSJ6vCqtPpTmBIgE7044B1wql1E4n//McF+mEgNrYg= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0 h1:gceOysEWNNwLd6cki65IMBZ4WAM0MwgBQq2n7kejoT8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2 h1:r7jel2aa4d9Duys7wEmWqDd5ebpC9w6Kxu6wIjjp18E= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2 h1:RnZjLgtCGLsF2xYYksy0yrx6xPvKG9BYv29VfK4p/J8= -github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1 h1:z+P3r4LrwdudLKBoEVWxIORrk4sVg4/iqpG3+CS53AY= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.2 h1:pZwkxZbspdqRGzddDB92bkZBoB7lg85sMRE7OqdB3V0= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.2 h1:ol2Y5DWqnJeKqNd8th7JWzBtqu63xpOfs1Is+n1t8/4= -github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/aws-sdk-go v1.34.0 h1:brux2dRrlwCF5JhTL7MUT3WUwo9zfDHZZp3+g3Mvlmo= +github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go-v2 v1.16.16 h1:M1fj4FE2lB4NzRb9Y0xdWsn2P0+2UHVxwKyOa4YJNjk= +github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8 h1:tcFliCWne+zOuUfKNRn8JdFBuWPDuISDH08wD2ULkhk= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8/go.mod h1:JTnlBSot91steJeti4ryyu/tLd4Sk84O5W22L7O2EQU= +github.com/aws/aws-sdk-go-v2/config v1.17.7 h1:odVM52tFHhpqZBKNjVW5h+Zt1tKHbhdTQRb+0WHrNtw= +github.com/aws/aws-sdk-go-v2/config v1.17.7/go.mod h1:dN2gja/QXxFF15hQreyrqYhLBaQo1d9ZKe/v/uplQoI= +github.com/aws/aws-sdk-go-v2/credentials v1.12.20 h1:9+ZhlDY7N9dPnUmf7CDfW9In4sW5Ff3bh7oy4DzS1IE= +github.com/aws/aws-sdk-go-v2/credentials v1.12.20/go.mod h1:UKY5HyIux08bbNA7Blv4PcXQ8cTkGh7ghHMFklaviR4= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 h1:r08j4sbZu/RVi+BNxkBJwPMUYY3P8mgSDuKkZ/ZN1lE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17/go.mod h1:yIkQcCDYNsZfXpd5UX2Cy+sWA1jPgIhGTw9cOBzfVnQ= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.33 h1:fAoVmNGhir6BR+RU0/EI+6+D7abM+MCwWf8v4ip5jNI= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.33/go.mod h1:84XgODVR8uRhmOnUkKGUZKqIMxmjmLOR8Uyp7G/TPwc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 h1:s4g/wnzMf+qepSNgTvaQQHNxyMLKSawNhKCPNy++2xY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 h1:/K482T5A3623WJgWT8w1yRAFK4RzGzEl7y39yhtn9eA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 h1:wj5Rwc05hvUSvKuOF29IYb9QrCLjU+rHAy/x/o0DK2c= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24/go.mod h1:jULHjqqjDlbyTa7pfM7WICATnOv+iOhjletM3N0Xbu8= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14 h1:ZSIPAkAsCCjYrhqfw2+lNzWDzxzHXEckFkTePL5RSWQ= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14/go.mod h1:AyGgqiKv9ECM6IZeNQtdT8NnMvUb3/2wokeq2Fgryto= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9 h1:Lh1AShsuIJTwMkoxVCAYPJgNG5H+eN6SmoUn8nOZ5wE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9/go.mod h1:a9j48l6yL5XINLHLcOKInjdvknN+vWqPBxqeIDw7ktw= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18 h1:BBYoNQt2kUZUUK4bIPsKrCcjVPUMNsgQpNAwhznK/zo= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18/go.mod h1:NS55eQ4YixUJPTC+INxi2/jCqe1y2Uw3rnh9wEOVJxY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 h1:Jrd/oMh0PKQc6+BowB+pLEwLIgaQF29eYbe7E1Av9Ug= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17/go.mod h1:4nYOrY41Lrbk2170/BGkcJKBhws9Pfn8MG3aGqjjeFI= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17 h1:HfVVR1vItaG6le+Bpw6P4midjBDMKnjMyZnw9MXYUcE= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17/go.mod h1:YqMdV+gEKCQ59NrB7rzrJdALeBIsYiVi8Inj3+KcqHI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 h1:3/gm/JTX9bX8CpzTgIlrtYpB3EVBDxyg/GY/QdcIEZw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11/go.mod h1:fmgDANqTUCxciViKl9hb/zD5LFbvPINFRgWhDbR+vZo= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 h1:pwvCchFUEnlceKIgPUouBJwK81aCkQ8UDMORfeFtW10= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.23/go.mod h1:/w0eg9IhFGjGyyncHIQrXtU8wvNsTJOP0R6PPj0wf80= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5 h1:GUnZ62TevLqIoDyHeiWj2P7EqaosgakBKVvWriIdLQY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5/go.mod h1:csZuQY65DAdFBt1oIjO5hhBR49kQqop4+lcuCjf2arA= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 h1:9pPi0PsFNAGILFfPCk8Y0iyEBGc6lu6OQ97U7hmdesg= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.19/go.mod h1:h4J3oPZQbxLhzGnk+j9dfYHi5qIOVJ5kczZd658/ydM= +github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA= +github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= -github.com/blacktear23/go-proxyprotocol v0.0.0-20171102103907-62e368e1c470 h1:AAFU1eDJHimRQvJGBBnhO0Cm4oe7V2GG3CLtiQk/6wg= +github.com/bketelsen/crypt v0.0.4 h1:w/jqZtC9YD4DS/Vp9GhWfWcCpuAL58oTnLoI8vE9YHU= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boombuler/barcode v1.0.0 h1:s1TvRnXwL2xJRaccrdcBQMZxq6X7DvsMogtmJeHDdrc= github.com/bshuster-repo/logrus-logstash-hook v0.4.1 h1:pgAtgj+A31JBVtEHu2uHuEx0n+2ukqUJnS2vVe5pQNA= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= -github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/checkpoint-restore/go-criu/v4 v4.1.0 h1:WW2B2uxx9KWF6bGlHqhm8Okiafwwx7Y2kcpn8lCpjgo= github.com/checkpoint-restore/go-criu/v5 v5.3.0 h1:wpFFOoomK3389ue2lAb0Boag6XPht5QYpipxmSNL4d8= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/logex v1.2.0 h1:+eqR0HfOetur4tgnC8ftU5imRnhi4te+BadWS95c5AM= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/readline v1.5.0 h1:lSwwFrbNviGePhkewF1az4oLmcwqCZijQ2/Wi3BGHAI= github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23 h1:dZ0/VyGgQdVGAss6Ju0dt5P0QltE0SFY5Woh6hbIfiQ= github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= @@ -352,8 +411,13 @@ github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 h1:KwaoQzs/WeUxxJqiJsZ4euOly1Az/IgZXXSxlD/UBNk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220520190051-1e77728a1eaa/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195 h1:58f1tJ1ra+zFINPlwLWvQsR9CzAKt2e+EWV2yX9oXQ4= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/cockroach-go/v2 v2.1.1 h1:3XzfSMuUT0wBe1a3o5C0eOTcArhmmFAg2Jzh/7hhKqo= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= @@ -377,28 +441,32 @@ github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAb github.com/containernetworking/plugins v1.0.1 h1:wwCfYbTCj5FC0EJgyzyjTXmqysOiJE9r712Z+2KVZAk= github.com/containers/ocicrypt v1.1.2 h1:Ez+GAMP/4GLix5Ywo/fL7O0nY771gsBIigiqUm1aXz0= github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= +github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk= github.com/coreos/go-oidc v2.1.0+incompatible h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= -github.com/cpuguy83/go-md2man v1.0.7 h1:DVS0EPFHUiaJSaX2EKlaf65HUmk9PXhOl/Xa3Go242Q= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= -github.com/cznic/golex v0.0.0-20181122101858-9c343928389c h1:G8zTsaqyVfIHpgMFcGgdbhHSFhlNc77rAKkhVbQ9kQg= -github.com/cznic/parser v0.0.0-20160622100904-31edd927e5b1 h1:uWcWCkSP+E1w1z8r082miT+c+9vzg+5UdrgGCo15lMo= -github.com/cznic/strutil v0.0.0-20171016134553-529a34b1c186 h1:0rkFMAbn5KBKNpJyHQ6Prb95vIKanmAe62KxsrN+sqA= -github.com/cznic/y v0.0.0-20170802143616-045f81c6662a h1:N2rDAvHuM46OGscJkGX4Dw4BBqZgg6mGNGLYs5utVVo= +github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8 h1:LpMLYGyy67BoAFGda1NeOBQwqlv7nUXpm+rIVHGxZZ4= +github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 h1:MZRmHqDBd0vxNwenEbKSQqRVT24d3C05ft8kduSwlqM= +github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c h1:Xo2rK1pzOm0jO6abTPIQwbAmqBIOj132otexc1mmzFc= github.com/d2g/dhcp4client v1.0.0 h1:suYBsYZIkSlUMEz4TAYCczKf62IA2UWC+O8+KtdOhCo= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5 h1:+CpLbZIeUn94m02LdEKPcgErLJ347NUwxPKs5u8ieiY= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4 h1:itqmmf1PFpC4n5JW+j4BU7X4MTfVurhYRTjODoPb2Y8= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba h1:p6poVbjHDkKa+wtC8frBMwQtT3BmqGYBjzMwJ63tuR4= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= -github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017 h1:2HQmlpI3yI9deH18Q6xiSOIjXD4sLI55Y/gfpa8/558= github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= @@ -406,28 +474,30 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= +github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= +github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.6.2 h1:JiO+kJTpmYGjEodY7O1Zk8oZcNz1+f30UtwtXoFUPzE= -github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a h1:QNEenQIsGDEEfFNSnN+h6hE1OwnHqTg7Dl9gEk1Cko4= -github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.0 h1:jtLewhRR2vMRNnq2ZZUoCjUlgut+Y0+sDDWPOfwOi1o= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.6.13/go.mod h1:qEySVqXrEugbHKvmhI8ZqtQi75/RHSSRNpffvB4I6Bw= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.0 h1:oIfnZFdC0YhpNNEX+SuIqko4cqqVZeN9IGTrhZje83Y= +github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsouza/fake-gcs-server v1.17.0 h1:OeH75kBZcZa3ZE+zz/mFdJ2btt9FgqfjI7gIh9+5fvk= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU= -github.com/gabriel-vasile/mimetype v1.4.0 h1:Cn9dkdYsMIu56tGho+fqzh7XmvY2YyGU0FnbhiOsEro= +github.com/gabriel-vasile/mimetype v1.4.1/go.mod h1:05Vi0w3Y9c/lNvJOdmIwvrrAhX3rYhfQQCaf9VJcv7M= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7 h1:LofdAjjjqCSXMwLGgOgnE+rdPuvX9DxCqaHwKy7i/ko= -github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= -github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM= github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ= github.com/go-fonts/latin-modern v0.2.0 h1:5/Tv1Ek/QCr20C6ZOz15vw3g7GELYL98KWr8Hgo+3vk= @@ -435,36 +505,12 @@ github.com/go-fonts/liberation v0.1.1 h1:wBrPaMkrXFBW3qXpXAjiKljdVUMxn9bX2ia3XjP github.com/go-fonts/stix v0.1.0 h1:UlZlgrvvmT/58o573ot7NFw0vZasZ5I6bcIft/oMdgg= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= -github.com/go-ini/ini v1.25.4 h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo= github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07 h1:OTlfMvwR1rLyf9goVmXfuS5AJn80+Vmj4rTf4n46SOs= github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/runtime v0.0.0-20170901133030-bf2ff8f71507 h1:3O6ZxJ3kV/XnAbTK6rEySxfm9S64Qtj/3FhbVcRSecY= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= -github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= -github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd h1:hSkbZ9XSyjyBirMeqSqUrK+9HboWrweVlzRNqoBi2d4= github.com/gobuffalo/depgen v0.1.0 h1:31atYa/UW9V5q8vMJ+W6wd64OaaTHUrCUXER358zLM4= github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= @@ -478,62 +524,71 @@ github.com/gobuffalo/mapi v1.0.2 h1:fq9WcL1BYrm36SzK6+aAnZ8hcp+SrmnDyAxhNx8dvJk= github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU= github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZCj6A= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556 h1:N/MD/sr6o61X+iZBAT2qEUF023s4KbA8RWfKzl0L6MQ= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e h1:BWhy2j3IXJhjCbC68FptL43tDKIq8FladmaTs3Xs7Z8= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= -github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7 h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.5.1 h1:/+mFTs4AlwsJ/mJe8NDtKb7BxLtbZFpcn8vDsneEkwQ= github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.1 h1:RY7tHKZcRlk788d5WSo/e83gOyyy742E8GSs771ySpg= github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4= -github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= -github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= -github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g= -github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= -github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= -github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= +github.com/hashicorp/consul/api v1.20.0 h1:9IHTjNVSZ7MIwjlW3N3a7iGiykCMDpxZu8jsxFJh0yc= +github.com/hashicorp/consul/api v1.20.0/go.mod h1:nR64eD44KQ59Of/ECwt2vUmIK2DKsDzAwTmwmLl8Wpo= +github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= +github.com/hashicorp/consul/sdk v0.13.1/go.mod h1:SW/mM4LbKfqmMvcFu8v+eiQQ7oitXEFeiBe9StxERb0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= @@ -547,9 +602,6 @@ github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR3 github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= @@ -561,25 +613,45 @@ github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4 github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= +github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2 h1:rcanfLhLDA8nozr/K289V1zcntHr3V+SHlXwzz1ZI2g= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/intel/goresctrl v0.2.0 h1:JyZjdMQu9Kl/wLXe9xA6s1X+tF6BWsQPFGJMEeCfWzE= github.com/j-keck/arping v1.0.2 h1:hlLhuXgQkzIJTZuhMigvG/CuSkaspeaD9hRDk2zuiMI= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= -github.com/jackc/pgconn v1.8.0 h1:FmjZ0rOyXTr1wfWs45i4a9vjnjWUAGpMuQLD9OSs+lw= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451 h1:WAvSpGf7MsFuzAtK4Vk7R4EVe+liW4x83r4oWu0WHKw= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= +github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= -github.com/jackc/pgproto3/v2 v2.0.7 h1:6Pwi1b3QdY65cuv6SyVO0FgPd5J3Bl7wf/nQQjinHMA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= -github.com/jackc/pgtype v1.6.2 h1:b3pDeuhbbzBYcg5kwNmNDun4pFUD/0AAr1kLXZLeNt8= -github.com/jackc/pgx/v4 v4.10.1 h1:/6Q3ye4myIj6AaplUm+eRcz4OhK9HAvFf4ePsG40LJY= -github.com/jackc/puddle v1.1.3 h1:JnPg/5Q9xVJGfjsO5CPUOjnJps1JaRUm8I9FXVCFK94= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= +github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= +github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= +github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= +github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= +github.com/jackc/puddle v1.3.0 h1:eHK/5clGOatcjX3oWGBO/MpxpbHzSwud5EWTSCI+MX0= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle/v2 v2.2.0 h1:RdcDk92EJBuBS55nQMMYFXTxwstHug4jkhT5pq8VxPk= +github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/joefitzgerald/rainbow-reporter v0.1.0 h1:AuMG652zjdzI0YCCnXAqATtRBpGXMcAnrajcaTrSeuo= @@ -595,20 +667,23 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uia github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= -github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e h1:+lIPJOWl+jSiJOc70QXJ07+2eg2Jy2EC7Mi11BWujeM= +github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/knz/go-libedit v1.10.1 h1:0pHpWtx9vcvC0xGZqEQlQdfSQs7WRlAjuPvk3fOZDCo= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= github.com/ktrysmt/go-bitbucket v0.6.4 h1:C8dUGp0qkwncKtAnozHCbbqhptefzEd1I0sfnuy9rYQ= -github.com/leodido/go-urn v1.2.2/go.mod h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3 h1:jUp75lepDg0phMUJBCmvaeFDldD2N3S1lBuPwUTszio= -github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= -github.com/lyft/protoc-gen-star v0.5.3 h1:zSGLzsUew8RT+ZKPHc3jnf8XLaVyHzTcAFBzHtCNR20= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1 h1:erE0rdztuaDq3bpGifD95wfoPrSZc95nGA6tbiNYh6M= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star/v2 v2.0.1 h1:keaAo8hRuAT0O3DfJ/wM3rufbAjGeJ1lAtWZHDjKGB0= +github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= github.com/markbates/pkger v0.15.1 h1:3MPelV53RnGSW07izx5xGxl4e/sdRD6zqseIk0rMASY= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= @@ -617,174 +692,161 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= -github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2 h1:g+4J5sZg6osfvEfkRZxJ1em0VT95/UOZgi/l7zi1/oE= +github.com/microsoft/go-mssqldb v1.0.0 h1:k2p2uuG8T5T/7Hp7/e3vMGTnnR0sU4h8d1CcC71iLHU= +github.com/microsoft/go-mssqldb v1.0.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible h1:aKW/4cBs+yK6gpqU3K/oIwk9Q/XICqd3zOX/UFuvqmk= github.com/mitchellh/cli v1.1.0 h1:tEElEatulEHDeedTxwckzyYMA5c86fbmNIUL1hBIiTg= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f h1:2+myh5ml7lgEU/51gbeLHfKGNfgEQQIWrlbdaOsidbQ= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= github.com/moby/sys/signal v0.6.0 h1:aDpY94H8VlhTGa9sNYUFCFsMZIUh5wm0B6XkIoJj/iY= github.com/moby/sys/symlink v0.2.0 h1:tk1rOM+Ljp0nFmfOIBtlV3rTDlWOwFRhjEeAhZB0nZc= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.6.6 h1:Duep6KMIDpY4Yo11iFsvyqJDyfzLF9+sndUKT+v64GQ= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mutecomm/go-sqlcipher/v4 v4.4.0 h1:sV1tWCWGAVlPhNGT95Q+z/txFxuhAYWwHD1afF5bMZg= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI= github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8 h1:P48LjvUQpTReR3TQRbxSeSBsMXzfK0uol7eRcr7VBYQ= github.com/ncw/swift v1.0.47 h1:4DQRPj35Y41WogBxyhOXlrI37nzGlyEcsforeudyYPQ= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 h1:D6paGObi5Wud7xg83MaEFyjxQB1W5bz5d0IFppr+ymk= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c h1:bY6ktFuJkt+ZXkX0RChQch2FtHpWQLVS8Qo1YasiIVk= +github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba h1:fhFP5RliM2HW/8XdcO5QngSfFli9GcRIpMXvypTQt6E= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5 h1:58+kh9C6jJVXYjt8IE48G2eWl6BjwU5Gj0gqY84fy78= -github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= -github.com/openacid/errors v0.8.1 h1:Hrj9WENDoj5jP27ZfF60SY5LShbxei+sxKZa0EP+oDw= -github.com/openacid/low v0.1.10 h1:rKpmB5CHtKoPq9tFiqUvRk8vtWaPympL2D2dNfw3PvI= -github.com/openacid/must v0.1.3 h1:deanGZVyVwV+ozfwNFbRU5YF7czXeQ67s8GVyZxzKW4= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/opencontainers/runc v1.1.0 h1:O9+X96OcDjkmmZyfaG996kV7yq8HsoU2h1XRRQcefG8= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39 h1:H7DMc6FAjgwZZi8BRqjrAAHWoqEr5e5L6pS4V0ezet4= github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v0.0.0-20180122190007-c65b2f87fee3 h1:9J0mOv1rXIBlRjQCiAGyx9C3dZZh5uIa3HU0oTV8v1E= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/phpdave11/gofpdf v1.4.2 h1:KPKiIbfwbvC/wOncwhrpRdXVj2CZTCFlw4wnoyjtHfQ= github.com/phpdave11/gofpdi v1.0.12 h1:RZb9NG62cw/RW0rHAduVRo+98R8o/G1krcg2ns7DakQ= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= -github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3 h1:04yuCf5NMvLU8rB2m4Qs3rynH7EYpMno3lHkewIOdMo= -github.com/pingcap/log v0.0.0-20210317133921-96f4fcab92a4 h1:ERrF0fTuIOnwfGbt71Ji3DKbOEaP189tjym50u8gpC8= -github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7 h1:k2BbABz9+TNpYRwsCCFS8pEEnFVOdbgEjL/kTlLuzZQ= -github.com/pingcap/tidb/parser v0.0.0-20221126021158-6b02a5d8ba7d h1:1DyyRrgYeNjqPkgjrdEsaIbX+kHpuTTk5ZOCtrcRFcQ= +github.com/pierrec/lz4/v4 v4.1.16/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= -github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 h1:0XM1XL/OFFJjXsYXlG30spTkV/E9+gmd5GD1w2HE8xM= -github.com/prashantv/gostub v1.0.0 h1:wTzvgO04xSS3gHuz6Vhuo0/kvWelyJxwNS0IRBPAwGY= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= -github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498 h1:4CFNy7/q7P06AsIONZzuWy7jcdqEmYQvOZ9FAFZdbls= -github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= github.com/rs/zerolog v1.15.0 h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58 h1:nlG4Wa5+minh3S9LVFtNoY+GVRiudA2e3EVfcCi3RCA= -github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef h1:UD99BBEz19F21KhOFHLNAI6KodDWUvXaPr4Oqu8yMV8= -github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ= -github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1 h1:ZFfeKAhIQiiOrQaI3/znw0gOmYpO28Tcu1YaqMa/jtQ= -github.com/sagikazarmark/crypt v0.9.0 h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zruedRdZk= -github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= -github.com/sanity-io/litter v1.2.0 h1:DGJO0bxH/+C2EukzOSBmAlxmkhVMGqzvcx/rvySYw9M= +github.com/sagikazarmark/crypt v0.10.0 h1:96E1qrToLBU6fGzo+PRRz7KGOc9FkYFiPnR3/zf8Smg= +github.com/sagikazarmark/crypt v0.10.0/go.mod h1:gwTNHQVoOS3xp9Xvz5LLR+1AauC5M6880z5NWzdhOyQ= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4= github.com/sclevine/spec v1.2.0 h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921 h1:58EBmR2dMNL2n/FnbQewK3D14nXr0V9CObDSvMJLq+Y= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 h1:SWV2fHctRpRrp49VXJ6UZja7gU9QLHwRpIPBN89SKEo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636 h1:aSISeOcal5irEhJd1M+IrApc0PdcN7e7Aj4yuEnOrfQ= +github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/vfsgen v0.0.0-20181020040650-a97a25d856ca h1:3fECS8atRjByijiI8yYiuwLwQ2ZxXobW7ua/8GRB3pI= -github.com/snowflakedb/gosnowflake v1.6.3 h1:EJDdDi74YbYt1ty164ge3fMZ0eVZ6KA7b1zmAa/wnRo= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= +github.com/snowflakedb/gosnowflake v1.6.19 h1:KSHXrQ5o7uso25hNIzi/RObXtnSGkFgie91X82KcvMY= +github.com/snowflakedb/gosnowflake v1.6.19/go.mod h1:FM1+PWUdwB9udFDsXdfD58NONC0m+MlOSmQRvimobSM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 h1:lIOOHPEbXzO3vnmx2gok1Tfs31Q8GQqKLc8vVqyQq/I= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/struCoder/pidusage v0.1.2 h1:fFPTThlcWFQyizv3xKs5Lyq1lpG5lZ36arEGNhWz2Vs= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/tchap/go-patricia v2.2.6+incompatible h1:JvoDL7JSoIP2HDE8AbDH3zC8QBPxmzYe32HHy5yQ+Ck= -github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ= -github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= -github.com/uber-go/atomic v1.3.2 h1:Azu9lPBWRNKzYXSIwRfgRuDuS0YKsK4NFhiQv98gkxo= github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/unrolled/render v0.0.0-20180914162206-b9786414de4d h1:ggUgChAeyge4NZ4QUw6lhHsVymzwSDJOZcE0s2X8S20= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 h1:+UB2BJA852UkGH42H+Oee69djmxS3ANzl2b/JtT1YiA= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= -github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvcciqcxEHac4CYj89xI= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= -github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE= github.com/xanzy/go-gitlab v0.15.0 h1:rWtwKTgEnXyNUGrOArN7yyc3THRkpYcKXIXia9abywQ= -github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= -github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f h1:mvXjJIHRZyhNuGassLTcXTwjiWq7NmjdavZsUnmFybQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zenazn/goji v0.9.0 h1:RSQQAbXGArQ0dIDEq+PI6WqN6if+5KHu6x2Cx/GXLTQ= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b h1:7gd+rd8P3bqcn/96gOZa3F5dpJr/vEiDQYlNb/y2uNs= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo= -go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A= -go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= -go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU= -go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= -go.etcd.io/etcd/client/v2 v2.305.6 h1:fIDR0p4KMjw01MJMfUIDWdQbjo06PD6CeYM5z4EHLi0= -go.etcd.io/etcd/client/v2 v2.305.6/go.mod h1:BHha8XJGe8vCIBfWBpbBLVZ4QjOIlfoouvOwydu63E0= -go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E= -go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= +go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= +go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= +go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE= +go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= +go.etcd.io/etcd/client/v2 v2.305.7 h1:AELPkjNR3/igjbO7CjyF1fPuVPjrblliiKj+Y6xSGOU= +go.etcd.io/etcd/client/v2 v2.305.7/go.mod h1:GQGT5Z3TBuAQGvgPfhR7VPySu/SudxmEkRq9BgzFU6s= +go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= +go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA= go.etcd.io/etcd/pkg/v3 v3.5.0 h1:ntrg6vvKRW26JRmHTE0iNlDgYK6JX3hg/4cD62X0ixk= go.etcd.io/etcd/raft/v3 v3.5.0 h1:kw2TmO3yFTgE+F0mdKkG7xMxkit2duBDa2Hu6D/HMlw= go.etcd.io/etcd/server/v3 v3.5.0 h1:jk8D/lwGEDlQU9kZXUFMSANkE22Sg5+mW27ip8xcF9E= -go.mongodb.org/mongo-driver v1.7.0 h1:hHrvOBWlWB2c7+8Gh/Xi5jj82AgidK/t7KVXBZ+IyUA= -go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 h1:A/5uWzF44DlIgdm/PQFwfMkW0JX+cIcQi/SwLAmZP5M= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= @@ -804,148 +866,139 @@ go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJre go.opentelemetry.io/otel/sdk/export/metric v0.20.0 h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g= go.opentelemetry.io/otel/sdk/metric v0.20.0 h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8= go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= -go.opentelemetry.io/proto/otlp v0.11.0 h1:cLDgIBTf4lLOlztkhzAEdQsJ4Lj+i5Wc9k6Nn0K1VyU= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20210216034530-4410531fe030 h1:lP9pYkih3DUSC641giIXa2XqfTIbbbRr0w2EOTA7wHA= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220907135653-1e95f45603a7/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908150016-7ac13a9a928d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.9.3 h1:DnoIG+QAMaF5NvxnGe/oKsgKcAc6PcUyl8q0VetfQ8s= +gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/plot v0.9.0 h1:3sEo36Uopv1/SA/dMFFaxXoL5XyikJ9Sf2Vll/k6+2E= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.107.0 h1:I2SlFjD8ZWabaIFOfeEDg3pf0BHJDh6iYQ1ic3Yu/UU= -google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= +google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 h1:Cpp2P6TPjujNoC5M2KHY6g7wfyLYfIWRZaSdIKfDasA= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc h1:g3hIDl0jRNd9PPTs2uBzYuaD5mQuwOkZY0vSc0LR32o= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25 h1:Ev7yu1/f6+d+b3pi5vPdRPc6nNtP1umSfcWiEfRqv6I= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec h1:RlWgLqCMMIYYEVcAR5MDsuHlVkaIPDAF+5Dehzg8L5A= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= -gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M= gorm.io/driver/postgres v1.0.8 h1:PAgM+PaHOSAeroTjHkCHCBIHHoBIf9RgPWGo8dF2DA8= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= @@ -954,23 +1007,60 @@ k8s.io/apiserver v0.22.5 h1:71krQxCUz218ecb+nPhfDsNB6QgP1/4EMvi1a2uYBlg= k8s.io/code-generator v0.19.7 h1:kM/68Y26Z/u//TFc1ggVVcg62te8A2yQh57jBfD0FWQ= k8s.io/component-base v0.22.5 h1:U0eHqZm7mAFE42hFwYhY6ze/MmVaW00JpMrzVsQmzYE= k8s.io/cri-api v0.23.1 h1:0DHL/hpTf4Fp+QkUXFefWcp1fhjXr9OlNdY9X99c+O8= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded h1:JApXBKYyB7l9xx+DK7/+mFjC7A9Bt5A93FPvFD0HIFE= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c h1:jvamsI1tn9V0S8jicyX82qaFC0H/NKxv2e5mbqsgR80= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c h1:GohjlNKauSai7gN4wsJkeZ3WAJx4Sh+oT/b5IYn5suA= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/kubernetes v1.13.0 h1:qTfB+u5M92k2fCCCVP2iuhgwwSOv1EkAkvQY1tQODD8= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/b v1.0.0 h1:vpvqeyp17ddcQWF29Czawql4lDdABCDRbXRAS4+aF2o= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/cc/v4 v4.2.1 h1:xwwaXFwiPaVZpGRMd19NPLsaiNyNBO8oChey4501g1M= +modernc.org/cc/v4 v4.2.1/go.mod h1:0O8vuqhQfwBy+piyfEjzWIUGV4I3TPsXSf0W05+lgN8= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccgo/v4 v4.0.0-20230612200659-63de3e82e68d h1:3yB/pQNL5kVPDifGFqoZjeRxf8m0+Us15rB7ertNASQ= +modernc.org/ccgo/v4 v4.0.0-20230612200659-63de3e82e68d/go.mod h1:austqj6cmEDRfewsUvmGmyIgsI/Nq87oTXlfTgY85Fc= +modernc.org/ccorpus2 v1.3.1 h1:8m8u4M2USmclI8pB4AFixQldtQXD/4NqZP4owsfXaW0= +modernc.org/ccorpus2 v1.3.1/go.mod h1:Wifvo4Q/qS/h1aRoC2TffcHsnxwTikmi1AuLANuucJQ= modernc.org/db v1.0.0 h1:2c6NdCfaLnshSvY7OU09cyAY0gYXUZj4lmg5ItHyucg= modernc.org/file v1.0.0 h1:9/PdvjVxd5+LcWUQIfapAWRGOkDLK90rloa8s/au06A= -modernc.org/fileutil v1.0.0 h1:Z1AFLZwl6BO8A5NldQg/xTSjGLetp+1Ubvl4alfGx8w= -modernc.org/golex v1.0.1 h1:EYKY1a3wStt0RzHaH8mdSRNg78Ub0OHxYfCRWw35YtM= +modernc.org/fileutil v1.1.2/go.mod h1:HdjlliqRHrMAI4nVOvvpYVzVgvRSK7WnoCiG0GUWJNo= +modernc.org/fileutil v1.2.0 h1:c7fsfzHf9WfUFXvv/RY9sStAr+VAKXYGKiAhBQQNoT4= +modernc.org/fileutil v1.2.0/go.mod h1:0rLMFc17WSz6Bm/GtHeme7TOX8pNRhFN2NkfBlOZhrQ= +modernc.org/gc/v2 v2.1.2-0.20220923113132-f3b5abcf8083 h1:rGoLVwiOxdeVkGYMOF/8Pw7xpDd3OqScJU/tqHgvY1c= +modernc.org/gc/v2 v2.1.2-0.20220923113132-f3b5abcf8083/go.mod h1:Zt5HLUW0j+l02wj99UsPs+1DOFwwsGnqfcw+BGyyP/A= +modernc.org/golex v1.1.0 h1:dmSaksHMd+y6NkBsRsCShNPRaSNCNH+abrVm5/gZic8= +modernc.org/golex v1.1.0/go.mod h1:2pVlfqApurXhR1m0N+WDYu6Twnc4QuvO4+U8HnwoiRA= modernc.org/internal v1.0.0 h1:XMDsFDcBDsibbBnHB2xzljZ+B1yrOVLEFkKL2u15Glw= -modernc.org/lex v1.0.0 h1:w0dxp18i1q+aSE7GkepvwzvVWTLoCIQ2oDgTFAV2JZU= -modernc.org/lexer v1.0.0 h1:D2xE6YTaH7aiEC7o/+rbx6qTAEr1uY83peKwkamIdQ0= +modernc.org/lex v1.1.0/go.mod h1:+ojes+j0JYCaqwKYCBjcUavscJHmWFKvViUTMU4VjLA= +modernc.org/lex v1.1.1 h1:prSCNTLw1R4rn7M/RzwsuMtAuOytfyR3cnyM07P+Pas= +modernc.org/lex v1.1.1/go.mod h1:6r8o8DLJkAnOsQaGi8fMoi+Vt6LTbDaCrkUK729D8xM= +modernc.org/lexer v1.0.4/go.mod h1:tOajb8S4sdfOYitzCgXDFmbVJ/LE0v1fNJ7annTw36U= +modernc.org/lexer v1.0.5 h1:NiKuv6LaU6+D2zra31y6FewnAU8LfrtSwHckwdnDSCg= +modernc.org/lexer v1.0.5/go.mod h1:8npHn3u/NxCEtlC/tRSY77x5+WB3HvHMzMVElQ76ayI= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= modernc.org/lldb v1.0.0 h1:6vjDJxQEfhlOLwl4bhpwIz00uyFK4EmSYcbwqwbynsc= -modernc.org/parser v1.0.2 h1:/qHLDn1ezrcRk9/XbErYp84bPPM4+w0kIDuvMdRk6Vc= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/parser v1.1.0 h1:XoClYpoz2xHEDIteSQ7tICOTFcNwBI7XRCeghUS6SNI= +modernc.org/parser v1.1.0/go.mod h1:CXl3OTJRZij8FeMpzI3Id/bjupHf0u9HSrCUP4Z9pbA= modernc.org/ql v1.0.0 h1:bIQ/trWNVjQPlinI6jdOQsi195SIturGo3mp5hsDqVU= modernc.org/scanner v1.0.1 h1:rmWBTztgQKLM2CYx0uTQGhAxgnrILDEOVXJsEq/I4Js= -modernc.org/sortutil v1.1.0 h1:oP3U4uM+NT/qBQcbg/K2iqAX0Nx7B1b6YZtq3Gk/PjM= -modernc.org/y v1.0.1 h1:+QT+MtLkwkvLkh3fYQq+YD5vw2s5paVE73jdl5R/Py8= +modernc.org/scannertest v1.0.0 h1:87+HefISs60/daPGFYIOpADBxy0kgFz5tIoCXLdL2Uo= +modernc.org/scannertest v1.0.0/go.mod h1:9qnOCV+wSvq1o9hcOPNwRorND4qpZdtmTvmcdKyN3iE= +modernc.org/sortutil v1.1.1 h1:VQGxbQGcHaQeB/BX9TQjrHFmOA0bounO1X/jvOfRo6Q= +modernc.org/sortutil v1.1.1/go.mod h1:DTj/8BqjEBLZFVPYvEGDfFFg94SsfPxQ70R+SQJ98qA= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/y v1.0.9 h1:U3EAg4VQmj2eoAUnMFcv+KXxVQFT19ZIA1mO1XX0b1s= +modernc.org/y v1.0.9/go.mod h1:EjpZC9SxK4Fr+sF7KezoT/AKrl7MOnNO/kNrhxTeib4= modernc.org/zappy v1.0.0 h1:dPVaP+3ueIUv4guk8PuZ2wiUGcJ1WUVvIheeSSTD0yk= nullprogram.com/x/optparse v1.0.0 h1:xGFgVi5ZaWOnYdac2foDT3vg0ZZC9ErXFV57mr4OHrI= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= @@ -978,4 +1068,3 @@ rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22 h1:fmRfl9WJ4ApJn7LxNuED4m0t18qivVQOxP6aAYG9J6c= -sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 h1:e1sMhtVq9AfcEy8AXNb8eSg6gbzfdpYhoNqnPJa+GzI= diff --git a/dbm-services/mysql/db-partition/assests/migrations/000002_create_table.down.sql b/dbm-services/mysql/db-partition/assests/migrations/000002_create_table.down.sql deleted file mode 100644 index 577cd03bc7..0000000000 --- a/dbm-services/mysql/db-partition/assests/migrations/000002_create_table.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS schema_migrations; - diff --git a/dbm-services/mysql/db-partition/assests/migrations/000002_init.down.sql b/dbm-services/mysql/db-partition/assests/migrations/000002_init.down.sql new file mode 100644 index 0000000000..8c212d40fe --- /dev/null +++ b/dbm-services/mysql/db-partition/assests/migrations/000002_init.down.sql @@ -0,0 +1,6 @@ +DROP TABLE IF EXISTS schema_migrations; +DROP TABLE IF EXISTS mysql_partition_config; +DROP TABLE IF EXISTS spider_partition_config; +DROP TABLE IF EXISTS mysql_partition_cron_log; +DROP TABLE IF EXISTS spider_partition_cron_log; +DROP TABLE IF EXISTS manage_logs; \ No newline at end of file diff --git a/dbm-services/mysql/db-partition/assests/migrations/000002_create_table.up.sql b/dbm-services/mysql/db-partition/assests/migrations/000002_init.up.sql similarity index 55% rename from dbm-services/mysql/db-partition/assests/migrations/000002_create_table.up.sql rename to dbm-services/mysql/db-partition/assests/migrations/000002_init.up.sql index 6368c7f391..b0501c0504 100644 --- a/dbm-services/mysql/db-partition/assests/migrations/000002_create_table.up.sql +++ b/dbm-services/mysql/db-partition/assests/migrations/000002_init.up.sql @@ -1,30 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) --- --- Host: localhost Database: dbpartition --- ------------------------------------------------------ --- Server version 5.7.20-tmysql-3.3.2-log -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; -/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; -/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; -/*!50717 EXECUTE s */; -/*!50717 DEALLOCATE PREPARE s */; -/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; -/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; -/*!50717 EXECUTE s */; -/*!50717 DEALLOCATE PREPARE s */; - --- --- Table structure for table `mysql_partition_config` --- - -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +SET NAMES utf8; CREATE TABLE IF NOT EXISTS `mysql_partition_config` ( `id` bigint NOT NULL AUTO_INCREMENT, `bk_biz_id` int NOT NULL, @@ -51,15 +25,7 @@ CREATE TABLE IF NOT EXISTS `mysql_partition_config` ( UNIQUE KEY `uniq` (`bk_biz_id`,`immute_domain`,`cluster_id`,`dblike`,`tblike`), KEY `idx_time_zone_phase` (`cluster_id`,`time_zone`,`phase`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `spider_partition_config` --- -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `spider_partition_config` ( `id` bigint NOT NULL AUTO_INCREMENT, `bk_biz_id` int NOT NULL, @@ -86,15 +52,7 @@ CREATE TABLE IF NOT EXISTS `spider_partition_config` ( UNIQUE KEY `uniq` (`bk_biz_id`,`immute_domain`,`cluster_id`,`dblike`,`tblike`), KEY `idx_time_zone_phase` (`cluster_id`,`time_zone`,`phase`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `mysql_partition_cron_log` --- - -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `mysql_partition_cron_log` ( `id` bigint NOT NULL AUTO_INCREMENT, `config_id` int NOT NULL, @@ -110,17 +68,10 @@ CREATE TABLE IF NOT EXISTS `mysql_partition_cron_log` ( `check_info` text, `status` varchar(100) NOT NULL, PRIMARY KEY (`id`), - KEY `idx_create_time` (`create_time`) - KEY `idx_cron_date_status (cron_date,status)` + KEY `idx_create_time` (`create_time`), + KEY `idx_cron_date_status` (cron_date,status) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `mysql_partition_cron_log` --- - -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `spider_partition_cron_log` ( `id` bigint NOT NULL AUTO_INCREMENT, `config_id` int NOT NULL, @@ -137,16 +88,9 @@ CREATE TABLE IF NOT EXISTS `spider_partition_cron_log` ( `status` varchar(100) NOT NULL, PRIMARY KEY (`id`), KEY `idx_create_time` (`create_time`), - KEY `idx_cron_date_status (cron_date,status)` + KEY `idx_cron_date_status` (cron_date,status) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `partition_logs` --- -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `manage_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `config_id` int(11) NOT NULL, @@ -157,31 +101,9 @@ CREATE TABLE IF NOT EXISTS `manage_logs` ( PRIMARY KEY (`id`), KEY `bk_biz_id` (`bk_biz_id`,`config_id`,`operator`(10),`execute_time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `schema_migrations` --- - -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `schema_migrations` ( `version` bigint(20) NOT NULL, `dirty` tinyint(1) NOT NULL, PRIMARY KEY (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -/*!40101 SET character_set_client = @saved_cs_client */; -/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; -/*!50112 PREPARE s FROM @disable_bulk_load */; -/*!50112 EXECUTE s */; -/*!50112 DEALLOCATE PREPARE s */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2023-03-22 20:55:00 diff --git a/dbm-services/mysql/db-partition/cron/cron.go b/dbm-services/mysql/db-partition/cron/cron.go index b97f22886f..ae3bd8c719 100644 --- a/dbm-services/mysql/db-partition/cron/cron.go +++ b/dbm-services/mysql/db-partition/cron/cron.go @@ -2,6 +2,7 @@ package cron import ( + "dbm-services/mysql/db-partition/util" "errors" "fmt" "log" @@ -27,8 +28,12 @@ func RegisterCron() ([]*cron.Cron, error) { return CronList, err } timing := fmt.Sprintf("02 %s * * * ", timingHour) - retry := fmt.Sprintf("02 %s * * * ", retryHour) - fmt.Println(retry) + multiHours, errOuter := util.SplitName(retryHour) + if errOuter != nil { + errOuter = errors.New("cron.retry_hour format error") + slog.Error("msg", "cron error", errOuter) + return CronList, errOuter + } var debug bool if strings.ToLower(strings.TrimSpace(viper.GetString("log.level"))) == "debug" { debug = true @@ -41,7 +46,6 @@ func RegisterCron() ([]*cron.Cron, error) { for name, offset := range timezone { offetSeconds := offset * 60 * 60 zone := time.FixedZone(name, offetSeconds) - date := time.Now().In(zone).Format("20060102") var c *cron.Cron if debug { c = cron.New(cron.WithLocation(zone), cron.WithLogger(cron.VerbosePrintfLogger(log.New(model.NewWriter( @@ -49,23 +53,19 @@ func RegisterCron() ([]*cron.Cron, error) { } else { c = cron.New(cron.WithLocation(zone)) } - _, err := c.AddJob(timing, PartitionJob{CronType: Daily, ZoneOffset: offset, CronDate: date}) + _, err := c.AddJob(timing, PartitionJob{CronType: Daily, ZoneOffset: offset, ZoneName: name, Hour: timingHour}) if err != nil { slog.Error("msg", "cron add daily job error", err) return CronList, err } - _, err = c.AddJob(retry, PartitionJob{CronType: Retry, ZoneOffset: offset, CronDate: date}) + for _, retry := range multiHours { + _, err = c.AddJob(fmt.Sprintf("08 %s * * * ", retry), PartitionJob{CronType: Retry, + ZoneOffset: offset, ZoneName: name, Hour: retry}) + } if err != nil { slog.Error("msg", "cron add retry job error", err) return CronList, err } - if offset == 0 { - _, err = c.AddJob("@every 1s", PartitionJob{CronType: Heartbeat, ZoneOffset: offset, CronDate: date}) - if err != nil { - slog.Error("msg", "cron add heartbeat job error", err) - return CronList, err - } - } c.Start() slog.Info("msg", zone, c.Entries()) CronList = append(CronList, c) diff --git a/dbm-services/mysql/db-partition/cron/cron_basic_func.go b/dbm-services/mysql/db-partition/cron/cron_basic_func.go index a3ea73bc5e..6db6f23ee5 100644 --- a/dbm-services/mysql/db-partition/cron/cron_basic_func.go +++ b/dbm-services/mysql/db-partition/cron/cron_basic_func.go @@ -13,6 +13,7 @@ package cron import ( "fmt" "strings" + "time" "dbm-services/common/go-pubpkg/errno" "dbm-services/mysql/db-partition/model" @@ -29,20 +30,17 @@ var Scheduler string // Run TODO func (m PartitionJob) Run() { var err error + var key string Scheduler, err = util.ExecShellCommand(false, `hostname -I`) Scheduler = strings.Replace(Scheduler, " ", "", -1) Scheduler = strings.Replace(Scheduler, "\n", "", -1) if err != nil { Scheduler = "0.0.0.0" } - if m.CronType == Heartbeat { - monitor.SendMetric(Scheduler) - return - } - key := fmt.Sprintf("%s_%d_%s", m.CronType, m.ZoneOffset, m.CronDate) - model.Lock(key) - m.ExecutePartitionCron(service.Tendbha) - m.ExecutePartitionCron(service.Tendbcluster) + offetSeconds := m.ZoneOffset * 60 * 60 + zone := time.FixedZone(m.ZoneName, offetSeconds) + m.CronDate = time.Now().In(zone).Format("20060102") + key = fmt.Sprintf("%s_%s_%d_%s", m.CronType, m.Hour, m.ZoneOffset, m.CronDate) flag, err := model.Lock(key) if err != nil { dimension := monitor.NewDeveloperEventDimension(Scheduler) diff --git a/dbm-services/mysql/db-partition/cron/cron_object.go b/dbm-services/mysql/db-partition/cron/cron_object.go index 365a317e9c..9838c3e178 100644 --- a/dbm-services/mysql/db-partition/cron/cron_object.go +++ b/dbm-services/mysql/db-partition/cron/cron_object.go @@ -13,5 +13,7 @@ const Heartbeat = "heartbeat" type PartitionJob struct { CronType string ZoneOffset int + ZoneName string CronDate string + Hour string } diff --git a/dbm-services/mysql/db-partition/go.mod b/dbm-services/mysql/db-partition/go.mod index 9f03530011..6ff80179c9 100644 --- a/dbm-services/mysql/db-partition/go.mod +++ b/dbm-services/mysql/db-partition/go.mod @@ -1,64 +1,65 @@ module dbm-services/mysql/db-partition -go 1.19 +go 1.21 require ( - github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin v1.9.1 github.com/go-redis/redis v6.15.9+incompatible - github.com/golang-migrate/migrate/v4 v4.15.2 + github.com/golang-migrate/migrate/v4 v4.16.2 github.com/google/go-querystring v1.1.0 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/spf13/viper v1.16.0 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 gopkg.in/natefinch/lumberjack.v2 v2.2.1 - gorm.io/driver/mysql v1.5.0 - gorm.io/gorm v1.25.0 + gorm.io/driver/mysql v1.5.1 + gorm.io/gorm v1.25.4 ) require ( - github.com/bytedance/sonic v1.8.8 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/bytedance/sonic v1.10.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect + github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.12.0 // indirect + github.com/go-playground/validator/v10 v10.15.4 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.2.3 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/onsi/ginkgo v1.16.5 // indirect - github.com/onsi/gomega v1.18.1 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect + github.com/onsi/gomega v1.27.10 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect - go.uber.org/atomic v1.9.0 // indirect - golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + golang.org/x/arch v0.5.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/db-partition/go.sum b/dbm-services/mysql/db-partition/go.sum index 6d9f1497f0..6f5953bd5e 100644 --- a/dbm-services/mysql/db-partition/go.sum +++ b/dbm-services/mysql/db-partition/go.sum @@ -1,5 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -19,18 +17,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -39,12 +25,10 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/spanner v1.28.0/go.mod h1:7m6mtQZn/hMbMfx62ct5EWrGND4DNqkXyrmBPRS+OJo= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -52,488 +36,88 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY= -github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0= -github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU= -github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= -github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4/go.mod h1:Ex7XQmbFmgFHrjUX6TN3mApKW5Hglyga+F7wZHTtYhA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6ry18hGvE0i8yvbXoKbnZaE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ= -github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI= -github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= -github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= +github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= +github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= +github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= +github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1 h1:oa2uY0/0G+JX4X7hpGCYvkp9FjUancz56kSNnb1sG3o= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= -github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= -github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= +github.com/dhui/dktest v0.3.16/go.mod h1:gYaA3LRmM8Z4vJl2MA0THIigJoZrwOansEOsp+kqxp0= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= -github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= +github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -541,9 +125,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -559,18 +140,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -579,23 +150,16 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -606,667 +170,161 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= +golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1278,7 +336,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1289,36 +346,21 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190225153610-fe579d43d832/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1334,35 +376,15 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1371,77 +393,36 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1449,134 +430,54 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1596,44 +497,26 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1653,34 +536,18 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1689,7 +556,6 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1698,64 +564,25 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1765,24 +592,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1794,65 +606,30 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= -gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= -gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= -gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= +gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1860,85 +637,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= -modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= -modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo= -modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= -modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= -modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= -modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= -modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= -modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/dbm-services/mysql/db-partition/handler/handler.go b/dbm-services/mysql/db-partition/handler/handler.go index debfe62ca6..6aebb5f7b4 100644 --- a/dbm-services/mysql/db-partition/handler/handler.go +++ b/dbm-services/mysql/db-partition/handler/handler.go @@ -2,7 +2,6 @@ package handler import ( - "dbm-services/mysql/db-partition/cron" "errors" "fmt" "net/http" @@ -11,6 +10,8 @@ import ( "strings" "time" + "dbm-services/mysql/db-partition/cron" + cron_pkg "github.com/robfig/cron/v3" "dbm-services/common/go-pubpkg/errno" diff --git a/dbm-services/mysql/db-partition/main.go b/dbm-services/mysql/db-partition/main.go index 5b57a86701..15960ee92f 100644 --- a/dbm-services/mysql/db-partition/main.go +++ b/dbm-services/mysql/db-partition/main.go @@ -1,12 +1,15 @@ package main import ( - "os" - "dbm-services/mysql/db-partition/assests" "dbm-services/mysql/db-partition/cron" "dbm-services/mysql/db-partition/model" + "dbm-services/mysql/db-partition/monitor" "dbm-services/mysql/db-partition/router" + "fmt" + "net/http" + "os" + "time" "github.com/gin-gonic/gin" "github.com/golang-migrate/migrate/v4" @@ -25,6 +28,31 @@ func main() { } } + // 获取监控配置,多次尝试 + i := 1 + for ; i <= 10; i++ { + setting, err := monitor.GetMonitorSetting() + if err != nil { + slog.Error(fmt.Sprintf("try %d time", i), "get monitor setting error", err) + if i == 10 { + slog.Error("try too many times") + os.Exit(0) + } + time.Sleep(3 * time.Second) + } else { + // for test + slog.Info("msg", "monitor setting", setting) + viper.Set("monitor.service", setting.MonitorService) + // 蓝鲸监控自定义事件 + viper.Set("monitor.event.data_id", setting.MonitorEventDataID) + viper.Set("monitor.event.access_token", setting.MonitorEventAccessToken) + // 蓝鲸监控自定义指标 + viper.Set("monitor.metric.data_id", setting.MonitorMetricDataID) + viper.Set("monitor.metric.access_token", setting.MonitorMetricAccessToken) + break + } + } + // 注册定时任务 cronList, err := cron.RegisterCron() if err != nil { @@ -42,6 +70,9 @@ func main() { gin.SetMode(gin.ReleaseMode) r := gin.New() r.Use(gin.Recovery()) + r.Handle(http.MethodGet, "/ping", func(context *gin.Context) { + context.String(http.StatusOK, "pong") + }) router.RegisterRouter(r) if err = r.Run(viper.GetString("listen_address")); err != nil { slog.Error("register router fail:", err) diff --git a/dbm-services/mysql/db-partition/model/init_env.go b/dbm-services/mysql/db-partition/model/init_env.go index 07c183d119..57b4eed2a0 100644 --- a/dbm-services/mysql/db-partition/model/init_env.go +++ b/dbm-services/mysql/db-partition/model/init_env.go @@ -36,15 +36,7 @@ func InitEnv() { viper.BindEnv("pt.max_size", "PT_MAX_SIZE") viper.BindEnv("pt.max_rows", "PT_MAX_ROWS") - viper.BindEnv("monitor.service", "MONITOR_SERVICE") - // 蓝鲸监控自定义事件 - viper.BindEnv("monitor.event.data_id", "MONITOR_EVENT_DATA_ID") - viper.BindEnv("monitor.event.access_token", "MONITOR_EVENT_ACCESS_TOKEN") - // 蓝鲸监控自定义指标 - viper.BindEnv("monitor.metric.data_id", "MONITOR_METRIC_DATA_ID") - viper.BindEnv("monitor.metric.access_token", "MONITOR_METRIC_ACCESS_TOKEN") - - viper.BindEnv("dba.bk_biz_id", "DBA_BK_BIZ_ID") + viper.BindEnv("dba.bk_biz_id", "DBA_APP_BK_BIZ_ID") // 程序日志参数, 可选参数 viper.BindEnv("log.path", "LOG_PATH") diff --git a/dbm-services/mysql/db-partition/monitor/monitor.go b/dbm-services/mysql/db-partition/monitor/monitor.go index 7ef5402b49..01cd9cb8aa 100644 --- a/dbm-services/mysql/db-partition/monitor/monitor.go +++ b/dbm-services/mysql/db-partition/monitor/monitor.go @@ -2,6 +2,7 @@ package monitor import ( + "encoding/json" "fmt" "net/http" "time" @@ -12,8 +13,6 @@ import ( "golang.org/x/exp/slog" ) -const cronHeartBeat = "partition_cron_beat" - // PartitionEvent TODO const PartitionEvent = "partition" @@ -23,40 +22,6 @@ const PartitionDeveloperEvent = "partition_dev" // PartitionCron TODO const PartitionCron = "partition_cron" -// SendMetric TODO -func SendMetric(serverIp string) { - l, _ := time.LoadLocation("Local") - dimension := make(map[string]interface{}) - dimension["bk_cloud_id"] = 0 - dimension["immute_domain"] = PartitionCron - dimension["server_ip"] = serverIp - dimension["machine_type"] = PartitionCron - - body := metricsBody{ - commonBody: commonBody{ - DataId: viper.GetInt("monitor.metric.data_id"), - AccessToken: viper.GetString("monitor.metric.access_token"), - }, - Data: []metricsData{ - { - commonData: commonData{ - Target: serverIp, - Timestamp: time.Now().In(l).UnixMilli(), - Dimension: dimension, - Metrics: map[string]int{ - cronHeartBeat: 1, - }, - }, - }, - }, - } - c := util.NewClientByHosts(viper.GetString("monitor.service")) - _, err := c.Do(http.MethodPost, "v2/push/", body) - if err != nil { - slog.Error("msg", "send partition cron heatbeat metric error", err) - } -} - // SendEvent TODO func SendEvent(eventName string, dimension map[string]interface{}, content string, serverIp string) { l, _ := time.LoadLocation("Local") @@ -82,7 +47,7 @@ func SendEvent(eventName string, dimension map[string]interface{}, content strin }, } c := util.NewClientByHosts(viper.GetString("monitor.service")) - _, err := c.Do(http.MethodPost, "v2/push/", body) + _, err := c.Do(http.MethodPost, "", body) if err != nil { slog.Info(fmt.Sprintf("%v", body)) slog.Error("msg", "send partition event error", err) @@ -94,7 +59,7 @@ func NewDeveloperEventDimension(serverIp string) map[string]interface{} { dimension := make(map[string]interface{}) dimension["bk_biz_id"] = viper.GetString("dba.bk_biz_id") dimension["bk_cloud_id"] = 0 - dimension["immute_domain"] = PartitionCron + dimension["cluster_domain"] = PartitionCron dimension["server_ip"] = serverIp dimension["machine_type"] = PartitionCron return dimension @@ -104,8 +69,27 @@ func NewDeveloperEventDimension(serverIp string) map[string]interface{} { func NewPartitionEventDimension(bkBizId int, bkCloudId int, domain string) map[string]interface{} { dimension := make(map[string]interface{}) dimension["bk_biz_id"] = bkBizId - dimension["bk_biz_id"] = bkBizId dimension["bk_cloud_id"] = bkCloudId - dimension["immute_domain"] = domain + dimension["cluster_domain"] = domain return dimension } + +func GetMonitorSetting() (Setting, error) { + var setting Setting + c := util.NewClientByHosts(viper.GetString("dbm_ticket_service")) + result, err := c.Do(http.MethodGet, "conf/system_settings/sensitive_environ/", nil) + if err != nil { + slog.Error("msg", "get monitor setting error", err) + return setting, err + } + if err = json.Unmarshal(result.Data, &setting); err != nil { + return setting, err + } + if setting.MonitorService == "" || setting.MonitorEventDataID == 0 || + setting.MonitorMetricDataID == 0 || setting.MonitorEventAccessToken == "" || + setting.MonitorMetricAccessToken == "" { + slog.Error("msg", "settings have null value:", setting) + return setting, fmt.Errorf("settings have null value") + } + return setting, nil +} diff --git a/dbm-services/mysql/db-partition/monitor/monitor_object.go b/dbm-services/mysql/db-partition/monitor/monitor_object.go index 01f6f75b2d..f6b5cf5d94 100644 --- a/dbm-services/mysql/db-partition/monitor/monitor_object.go +++ b/dbm-services/mysql/db-partition/monitor/monitor_object.go @@ -31,3 +31,11 @@ type commonData struct { Dimension map[string]interface{} `json:"dimension"` Metrics map[string]int `json:"metrics"` } + +type Setting struct { + MonitorMetricDataID int `json:"MONITOR_METRIC_DATA_ID"` + MonitorEventDataID int `json:"MONITOR_EVENT_DATA_ID"` + MonitorMetricAccessToken string `json:"MONITOR_METRIC_ACCESS_TOKEN"` + MonitorEventAccessToken string `json:"MONITOR_EVENT_ACCESS_TOKEN"` + MonitorService string `json:"MONITOR_SERVICE"` +} diff --git a/dbm-services/mysql/db-partition/router/router.go b/dbm-services/mysql/db-partition/router/router.go index 1d227a46c7..779b8cf402 100644 --- a/dbm-services/mysql/db-partition/router/router.go +++ b/dbm-services/mysql/db-partition/router/router.go @@ -19,7 +19,7 @@ func RegisterRouter(engine *gin.Engine) { p.POST("/enable_partition", handler.EnablePartition) p.POST("/update_conf", handler.UpdatePartitionsConfig) p.POST("/create_log", handler.CreatePartitionLog) + p.POST("/cron_start", handler.CronStart) p.POST("/cron_entries", handler.CronEntries) p.POST("/cron_stop", handler.CronStop) - p.POST("/cron_start", handler.CronStart) } diff --git a/dbm-services/mysql/db-partition/service/check_partition_base_func.go b/dbm-services/mysql/db-partition/service/check_partition_base_func.go index 23fcb04518..dd4b99bfa3 100644 --- a/dbm-services/mysql/db-partition/service/check_partition_base_func.go +++ b/dbm-services/mysql/db-partition/service/check_partition_base_func.go @@ -621,7 +621,7 @@ func CreatePartitionTicket(check Checker, objects []PartitionObject, zoneOffset if check.ClusterType == Tendbcluster { ticketType = "TENDBCLUSTER_PARTITION" } - ticket := Ticket{BkBizId: check.BkBizId, TicketType: ticketType, Remark: "auto partition", + ticket := Ticket{BkBizId: check.BkBizId, TicketType: ticketType, Remark: "auto partition", IgnoreDuplication: true, Details: Detail{Infos: []Info{{check.ConfigId, check.ClusterId, check.ImmuteDomain, *check.BkCloudId, objects}}}} id, err := CreateDbmTicket(ticket) if err != nil { diff --git a/dbm-services/mysql/db-partition/service/db_meta_service.go b/dbm-services/mysql/db-partition/service/db_meta_service.go index e75afb9e82..a765a19c91 100644 --- a/dbm-services/mysql/db-partition/service/db_meta_service.go +++ b/dbm-services/mysql/db-partition/service/db_meta_service.go @@ -72,18 +72,14 @@ func CreateDbmTicket(config Ticket) (int, error) { var resp Data c := util.NewClientByHosts(viper.GetString("dbm_ticket_service")) - slog.Info(viper.GetString("dbm_ticket_service")) - slog.Info(fmt.Sprintf("config:%v", config)) result, err := c.Do(http.MethodPost, "tickets/", config) if err != nil { slog.Error("msg", err) return ticketId, err } - slog.Info(fmt.Sprintf("data:%v", string(result.Data))) - if err := json.Unmarshal(result.Data, &resp); err != nil { + if err = json.Unmarshal(result.Data, &resp); err != nil { return ticketId, err } - slog.Info(fmt.Sprintf("resp:%v", resp)) return resp.Id, nil } diff --git a/dbm-services/mysql/db-partition/service/execute_partition_object.go b/dbm-services/mysql/db-partition/service/execute_partition_object.go index dd481b5b8c..0f3e06350b 100644 --- a/dbm-services/mysql/db-partition/service/execute_partition_object.go +++ b/dbm-services/mysql/db-partition/service/execute_partition_object.go @@ -1,3 +1,4 @@ +// Package service TODO package service import ( @@ -59,10 +60,11 @@ type ConfigDetail struct { // Ticket 分区单据 type Ticket struct { - BkBizId int `json:"bk_biz_id"` - TicketType string `json:"ticket_type"` - Remark string `json:"remark"` - Details Detail `json:"details"` + BkBizId int `json:"bk_biz_id"` + TicketType string `json:"ticket_type"` + Remark string `json:"remark"` + IgnoreDuplication bool `json:"ignore_duplication"` + Details Detail `json:"details"` } // Details 单据参数 @@ -117,3 +119,18 @@ type PartitionObject struct { ShardName string `json:"shard_name"` ExecuteObjects []PartitionSql `json:"execute_objects"` } + +// PartitionLogs TODO +type PartitionLogs struct { + ID int `gorm:"column:id;primary_key;auto_increment` + BkBizId int `gorm:"column:bk_biz_id"` + Operator string `gorm:"column:operator"` + Para string `gorm:"column:para"` + ExecuteTime time.Time `gorm:"column:execute_time"` +} + +// PartitionLogsParam TODO +type PartitionLogsParam struct { + Para string + Err error +} diff --git a/dbm-services/mysql/db-partition/service/manage_config.go b/dbm-services/mysql/db-partition/service/manage_config.go index e41f9badff..55551b83e5 100644 --- a/dbm-services/mysql/db-partition/service/manage_config.go +++ b/dbm-services/mysql/db-partition/service/manage_config.go @@ -11,6 +11,7 @@ package service import ( + "encoding/json" "errors" "fmt" "regexp" @@ -305,6 +306,7 @@ func (m *CreatePartitionsInput) UpdatePartitionsConfig() error { reservedPartition := m.ExpireTime / m.PartitionTimeInterval partitionType := 0 + switch m.PartitionColumnType { case "datetime": partitionType = 0 @@ -318,37 +320,53 @@ func (m *CreatePartitionsInput) UpdatePartitionsConfig() error { var errs []string for _, dblike := range m.DbLikes { for _, tblike := range m.TbLikes { - updateCondition := fmt.Sprintf("bk_biz_id=%d and immute_domain='%s' and dblike='%s' and tblike='%s'", - m.BkBizId, m.ImmuteDomain, dblike, tblike) - var updateColumn struct { - PartitionColumn string - PartitionColumnType string - ReservedPartition int - ExtraPartition int - PartitionTimeInterval int - PartitionType int - ExpireTime int - Creator string - Updator string + update_column_map := map[string]interface{}{ + "partition_column": m.PartitionColumn, + "partition_column_type": m.PartitionColumnType, + "reserved_partition": reservedPartition, + "extra_partition": extraTime, + "partition_time_interval": m.PartitionTimeInterval, + "partition_type": partitionType, + "expire_time": m.ExpireTime, + "updator": m.Updator, + "update_time": time.Now(), + } + result := model.DB.Self.Debug().Table(tbName). + Where( + "bk_biz_id=? and immute_domain=? and dblike=? and tblike=?", + m.BkBizId, m.ImmuteDomain, dblike, tblike). + Updates(update_column_map) + var para PartitionLogsParam + jString, jerr := json.Marshal(update_column_map) + if jerr != nil { + return jerr } - updateColumn.PartitionColumn = m.PartitionColumn - updateColumn.PartitionColumnType = m.PartitionColumnType - updateColumn.ReservedPartition = reservedPartition - updateColumn.ExtraPartition = extraTime - updateColumn.PartitionTimeInterval = m.PartitionTimeInterval - updateColumn.PartitionType = partitionType - updateColumn.ExpireTime = m.ExpireTime - updateColumn.Creator = m.Creator - updateColumn.Updator = m.Updator - result := model.DB.Self.Debug().Table(tbName).Where(updateCondition).Updates(&updateColumn) + para.Para = string(jString) if result.Error != nil { errs = append(errs, result.Error.Error()) + para.Err = result.Error + } + var plog PartitionLogs + plog.BkBizId = m.BkBizId + plog.ExecuteTime = time.Now() + plog.Operator = m.Updator + + jString, jerr = json.Marshal(update_column_map) + if jerr != nil { + return jerr + } + plog.Para = string(jString) + res := model.DB.Self.Debug().Create(&plog) + if res.Error != nil { + return res.Error } } } + if len(errs) > 0 { return fmt.Errorf("errors: %s", strings.Join(errs, "\n")) } + return nil } diff --git a/dbm-services/mysql/db-partition/util/client.go b/dbm-services/mysql/db-partition/util/client.go index e4aa55289c..9582a67e98 100644 --- a/dbm-services/mysql/db-partition/util/client.go +++ b/dbm-services/mysql/db-partition/util/client.go @@ -183,7 +183,7 @@ func (c *Client) doNewInner(method, url string, params interface{}, headers map[ return nil, err } result := &APIServerResponse{} - if strings.Contains(url, "v2/push") { + if strings.Contains(host, "v2/push") { temp := &APIServerResponseCompatible{} err = json.Unmarshal(b, temp) if err != nil { diff --git a/dbm-services/mysql/db-priv/go.mod b/dbm-services/mysql/db-priv/go.mod index 8f572ee593..7047f7fb7a 100644 --- a/dbm-services/mysql/db-priv/go.mod +++ b/dbm-services/mysql/db-priv/go.mod @@ -1,73 +1,66 @@ module dbm-services/mysql/priv-service -go 1.19 +go 1.21 require ( - github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d - github.com/gin-gonic/gin v1.9.0 - github.com/golang-migrate/migrate/v4 v4.15.2 + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 + github.com/gin-gonic/gin v1.9.1 + github.com/golang-migrate/migrate/v4 v4.16.2 github.com/google/go-querystring v1.1.0 github.com/jinzhu/gorm v1.9.16 github.com/jmoiron/sqlx v1.3.5 - github.com/pingcap/parser v3.1.2+incompatible - github.com/pingcap/tidb v0.0.0-20190108123336-c68ee7318319 + github.com/pingcap/tidb/parser v0.0.0-20230921041342-3ccd09e63add github.com/pkg/errors v0.9.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/spf13/viper v1.16.0 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( - github.com/BurntSushi/toml v1.2.1 // indirect - github.com/bytedance/sonic v1.8.8 // indirect + github.com/benbjohnson/clock v1.3.5 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect - github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.12.0 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.2.3 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect - github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect + github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect + github.com/pingcap/log v1.1.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect - github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.uber.org/atomic v1.9.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.25.0 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.12.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/dbm-services/mysql/db-priv/go.sum b/dbm-services/mysql/db-priv/go.sum index 42005ff57a..da901e9ef2 100644 --- a/dbm-services/mysql/db-priv/go.sum +++ b/dbm-services/mysql/db-priv/go.sum @@ -1,5 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -19,18 +17,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -39,12 +25,10 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/spanner v1.28.0/go.mod h1:7m6mtQZn/hMbMfx62ct5EWrGND4DNqkXyrmBPRS+OJo= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -52,523 +36,95 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY= -github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0= -github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU= -github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= -github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4/go.mod h1:Ex7XQmbFmgFHrjUX6TN3mApKW5Hglyga+F7wZHTtYhA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6ry18hGvE0i8yvbXoKbnZaE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ= -github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI= -github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= -github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blacktear23/go-proxyprotocol v0.0.0-20171102103907-62e368e1c470/go.mod h1:VKt7CNAQxpFpSDz3sXyj9hY/GbVsQCr0sB3w59nE7lU= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1 h1:oa2uY0/0G+JX4X7hpGCYvkp9FjUancz56kSNnb1sG3o= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= -github.com/cznic/mathutil v0.0.0-20181021201202-eba54fb065b7/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= -github.com/cznic/sortutil v0.0.0-20150617083342-4c7342852e65/go.mod h1:q2w6Bg5jeox1B+QkJ6Wp/+Vn0G/bo3f1uY7Fn3vivIQ= -github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8 h1:LpMLYGyy67BoAFGda1NeOBQwqlv7nUXpm+rIVHGxZZ4= -github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8/go.mod h1:q2w6Bg5jeox1B+QkJ6Wp/+Vn0G/bo3f1uY7Fn3vivIQ= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.10.0 h1:QykgLZBorFE95+gO3u9esLd0BmbvpWp0/waNNZfHBM8= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= -github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= -github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= +github.com/dhui/dktest v0.3.16/go.mod h1:gYaA3LRmM8Z4vJl2MA0THIigJoZrwOansEOsp+kqxp0= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= -github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v0.0.0-20180717141946-636bf0302bc9/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= -github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= +github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= +github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -576,10 +132,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20180814211427-aa810b61a9c7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -595,21 +147,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -618,23 +157,16 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -645,741 +177,186 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/myesui/uuid v1.0.0/go.mod h1:2CDfNgU0LR8mIdO8vdWd8i9gWWxLlcoIGGpSNgafq84= -github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI= -github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 h1:7KAv7KMGTTqSmYZtNdcNTgsos+vFzULLwyElndwn+5c= -github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7/go.mod h1:iWMfgwqYW+e8n5lC/jjNEhwcjbRDpl5NT7n2h+4UNcI= -github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef h1:K0Fn+DoFqNqktdZtdV3bPQ/0cuYh2H4rkg0tytX/07k= -github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo6LNmIvEWzsW1hbBQfpUO4JWnuQRmva8= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8 h1:USx2/E1bX46VG32FIw034Au6seQ2fY9NEILmNh/UlQg= -github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 h1:+FZIDR/D97YOPik4N4lPDaUcLDF/EQPogxtlHB2ZZRM= github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63/go.mod h1:X2r9ueLEUZgtx2cIogM0v4Zj5uvvzhuuiu7Pn8HzMPg= -github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3/go.mod h1:DazNTg0PTldtpsQiT9I5tVJwV1onHMKBBgXzmJUlMns= -github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e h1:P73/4dPCL96rGrobssy1nVy2VaVpNCuLpCbr+FEaTA8= -github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw= -github.com/pingcap/kvproto v0.0.0-20181203065228-c14302da291c h1:Qf5St5XGwKgKQLar9lEXoeO0hJMVaFBj3JqvFguWtVg= -github.com/pingcap/kvproto v0.0.0-20181203065228-c14302da291c/go.mod h1:Ja9XPjot9q4/3JyCZodnWDGNXt4pKemhIYCvVJM7P24= -github.com/pingcap/parser v0.0.0-20190108044100-02812c3c22e7/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= -github.com/pingcap/parser v3.1.2+incompatible h1:ZAtv2VBZitECpaHshSIp1bkBhEqJYerw7nO/HYsn8MM= -github.com/pingcap/parser v3.1.2+incompatible/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= -github.com/pingcap/pd v2.1.0-rc.4+incompatible h1:/buwGk04aHO5odk/+O8ZOXGs4qkUjYTJ2UpCJXna8NE= -github.com/pingcap/pd v2.1.0-rc.4+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E= -github.com/pingcap/tidb v0.0.0-20190108123336-c68ee7318319 h1:ltRU5YUxYpW29ywVKnFXIRRTnY6r2cYxauB79L5gU2E= -github.com/pingcap/tidb v0.0.0-20190108123336-c68ee7318319/go.mod h1:qXpdYNt83vgSegvc/TNcxKGiAo4Pa4EtIJl0ka7yGXE= -github.com/pingcap/tidb-tools v2.1.3-0.20190104033906-883b07a04a73+incompatible h1:Ba48wwPwPq5hd1kkQpgua49dqB5cthC2zXVo7fUUDec= -github.com/pingcap/tidb-tools v2.1.3-0.20190104033906-883b07a04a73+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= -github.com/pingcap/tipb v0.0.0-20170310053819-1043caee48da/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI= -github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323 h1:mRKKzRjDNaUNPnAkPAHnRqpNmwNWBX1iA+hxlmvQ93I= -github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI= -github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c h1:CgbKAHto5CQgWM9fSBIvaxsJHuGP0uM74HXtv3MyyGQ= +github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c/go.mod h1:4qGtCB0QK0wBzKtFEGDhxXnSnbQApw1gc9siScUl8ew= +github.com/pingcap/log v1.1.0 h1:ELiPxACz7vdo1qAvvaWJg1NrYFoY6gqAh/+Uo6aXdD8= +github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= +github.com/pingcap/tidb/parser v0.0.0-20230921041342-3ccd09e63add h1:iJgbKF6Hc2mK5LOpT3lrseb5jlp0zpFXBmnIs8Hq8Ug= +github.com/pingcap/tidb/parser v0.0.0-20230921041342-3ccd09e63add/go.mod h1:cwq4bKUlftpWuznB+rqNwbN0xy6/i5SL/nYvEKeJn4s= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/shirou/gopsutil v2.18.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/vfsgen v0.0.0-20181020040650-a97a25d856ca/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/struCoder/pidusage v0.1.2/go.mod h1:pWBlW3YuSwRl6h7R5KbvA4N8oOqe9LjaKW5CwT1SPjI= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= -github.com/twinj/uuid v1.0.0 h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk= -github.com/twinj/uuid v1.0.0/go.mod h1:mMgcE1RHFUFqe5AfiwlINXisXfDGro23fWdPUfOMjRY= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= -github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk= -github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v1.5.0 h1:OHbgr8l656Ub3Fw5k9SWnBfIEwvoHQ+W2y+Aa9D1Uyo= -github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181127175209-856da096dbdf/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/unrolled/render v0.0.0-20180914162206-b9786414de4d/go.mod h1:tu82oB5W2ykJRVioYsB+IQKcft7ryBr7w12qMBUPyXg= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1391,7 +368,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1402,38 +378,21 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190225153610-fe579d43d832/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1444,40 +403,19 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1486,77 +424,32 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1564,137 +457,54 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.0.0-20171214130843-f21a4dfb5e38/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1714,44 +524,25 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1771,35 +562,18 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1808,7 +582,6 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1817,66 +590,25 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1886,24 +618,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1915,60 +632,25 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1976,88 +658,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= -modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= -modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo= -modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= -modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= -modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= -modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= -modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= -modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20180531100431-4c381bd170b4 h1:VO9oZbbkvTwqLimlQt15QNdOOBArT2dw/bvzsMZBiqQ= -sourcegraph.com/sourcegraph/appdash v0.0.0-20180531100431-4c381bd170b4/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/dbm-services/mysql/db-priv/service/clone_instance_priv_base_func.go b/dbm-services/mysql/db-priv/service/clone_instance_priv_base_func.go index 1ec7716371..1daec5a5a4 100644 --- a/dbm-services/mysql/db-priv/service/clone_instance_priv_base_func.go +++ b/dbm-services/mysql/db-priv/service/clone_instance_priv_base_func.go @@ -9,9 +9,11 @@ import ( "dbm-services/mysql/priv-service/util" - "github.com/pingcap/parser" - "github.com/pingcap/parser/ast" - _ "github.com/pingcap/tidb/types/parser_driver" // parser_driver TODO + //"github.com/pingcap/parser" + //"github.com/pingcap/parser/ast" + //_ "github.com/pingcap/tidb/types/parser_driver" // parser_driver TODO + "github.com/pingcap/tidb/parser" + "github.com/pingcap/tidb/parser/ast" "golang.org/x/exp/slog" ) diff --git a/dbm-services/mysql/db-remote-service/cmd/root.go b/dbm-services/mysql/db-remote-service/cmd/root.go index 2dab203d83..eda5b056ac 100644 --- a/dbm-services/mysql/db-remote-service/cmd/root.go +++ b/dbm-services/mysql/db-remote-service/cmd/root.go @@ -5,6 +5,7 @@ import ( "crypto/x509" "fmt" "io" + "log/slog" "net/http" "os" "path" @@ -15,7 +16,6 @@ import ( "github.com/gin-gonic/gin" "github.com/spf13/cobra" - "golang.org/x/exp/slog" "gopkg.in/natefinch/lumberjack.v2" ) @@ -32,6 +32,11 @@ var rootCmd = &cobra.Command{ slog.Debug("run", slog.Any("log config", config.LogConfig)) r := gin.Default() + + r.Handle("GET", "/ping", func(context *gin.Context) { + context.String(http.StatusOK, "pong") + }) + service.RegisterRouter(r) if config.RuntimeConfig.TLS { @@ -44,7 +49,7 @@ var rootCmd = &cobra.Command{ pool := x509.NewCertPool() ca, err := os.ReadFile(config.RuntimeConfig.CAFile) if err != nil { - slog.Error("read cer file", err) + slog.Error("read cer file", slog.String("error", err.Error())) panic(err) } pool.AppendCertsFromPEM(ca) @@ -54,13 +59,13 @@ var rootCmd = &cobra.Command{ }, } if err := s.ListenAndServeTLS(config.RuntimeConfig.CertFile, config.RuntimeConfig.KeyFile); err != nil { - slog.Error("run service", err) + slog.Error("run service", slog.String("error", err.Error())) os.Exit(1) } } else { slog.Info("run in http mode") if err := r.Run(fmt.Sprintf(":%d", config.RuntimeConfig.Port)); err != nil { - slog.Error("run service", err) + slog.Error("run service", slog.String("error", err.Error())) os.Exit(1) } } @@ -72,7 +77,7 @@ var rootCmd = &cobra.Command{ func Execute() { err := rootCmd.Execute() if err != nil { - slog.Error("execute cobra cmd", err) + slog.Error("execute cobra cmd", slog.String("error", err.Error())) os.Exit(1) } } diff --git a/dbm-services/mysql/db-remote-service/go.mod b/dbm-services/mysql/db-remote-service/go.mod index befb84aa9e..7ae2941cdc 100644 --- a/dbm-services/mysql/db-remote-service/go.mod +++ b/dbm-services/mysql/db-remote-service/go.mod @@ -1,58 +1,54 @@ module dbm-services/mysql/db-remote-service -go 1.19 +go 1.21 require ( - github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin v1.9.1 github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.7.1 github.com/jmoiron/sqlx v1.3.5 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df + github.com/spf13/viper v1.16.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( - github.com/bytedance/sonic v1.8.8 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.12.0 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.2.3 // indirect - github.com/lib/pq v1.10.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/db-remote-service/go.sum b/dbm-services/mysql/db-remote-service/go.sum index 852a495fee..4db5ef3715 100644 --- a/dbm-services/mysql/db-remote-service/go.sum +++ b/dbm-services/mysql/db-remote-service/go.sum @@ -39,8 +39,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -66,23 +66,27 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -129,6 +133,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -168,23 +173,22 @@ github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZX github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -193,11 +197,13 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= @@ -205,21 +211,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -231,8 +237,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -259,8 +266,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -271,8 +278,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -328,8 +333,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -387,8 +392,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -546,17 +551,18 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/dbm-services/mysql/db-remote-service/pkg/mysql_rpc/embed.go b/dbm-services/mysql/db-remote-service/pkg/mysql_rpc/embed.go index 54e62acca8..d6ab117abe 100644 --- a/dbm-services/mysql/db-remote-service/pkg/mysql_rpc/embed.go +++ b/dbm-services/mysql/db-remote-service/pkg/mysql_rpc/embed.go @@ -3,7 +3,9 @@ package mysql_rpc import ( "context" "fmt" + "log/slog" "regexp" + "slices" "strings" "time" @@ -12,8 +14,6 @@ import ( _ "github.com/go-sql-driver/mysql" // mysql "github.com/jmoiron/sqlx" - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" ) // MySQLRPCEmbed mysql 实现 @@ -32,7 +32,11 @@ func (c *MySQLRPCEmbed) MakeConnection(address string, user string, password str ) if err != nil { - slog.Error("connect to mysql", err, slog.String("address", address)) + slog.Error( + "connect to mysql", + slog.String("error", err.Error()), + slog.String("address", address), + ) return nil, err } diff --git a/dbm-services/mysql/db-remote-service/pkg/proxy_rpc/proxy_rpc.go b/dbm-services/mysql/db-remote-service/pkg/proxy_rpc/proxy_rpc.go index 4cc2d2fb5d..64afd9eeff 100644 --- a/dbm-services/mysql/db-remote-service/pkg/proxy_rpc/proxy_rpc.go +++ b/dbm-services/mysql/db-remote-service/pkg/proxy_rpc/proxy_rpc.go @@ -4,6 +4,7 @@ package proxy_rpc import ( "context" "fmt" + "log/slog" "strings" "time" @@ -13,7 +14,6 @@ import ( "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql" // mysql "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) var proxyQueryParseCommands = []string{ @@ -52,11 +52,18 @@ func (c *ProxyRPCEmbed) MakeConnection(address string, user string, password str if err != nil { if merr, ok := err.(*mysql.MySQLError); ok { if merr.Number != 1105 { - slog.Error("connect to proxy", err, slog.String("address", address)) + slog.Error( + "connect to proxy", + slog.String("error", err.Error()), + slog.String("address", address), + ) return nil, merr } } else { - slog.Error("connect to proxy", err, slog.String("address", address)) + slog.Error("connect to proxy", + slog.String("error", err.Error()), + slog.String("address", address), + ) return nil, err } } diff --git a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/client.go b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/client.go index 76b1a5455f..995f2bafbd 100644 --- a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/client.go +++ b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/client.go @@ -3,10 +3,10 @@ package redis_rpc import ( "context" "fmt" + "log/slog" "time" "github.com/go-redis/redis/v8" - "golang.org/x/exp/slog" ) // RedisClient redis连接信息 diff --git a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/common.go b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/common.go index 03dcd79b3f..cd5d9a5586 100644 --- a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/common.go +++ b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/common.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "log/slog" "net" "net/http" "os/exec" @@ -17,7 +18,6 @@ import ( "github.com/go-redis/redis/v8" "github.com/pkg/errors" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) // MAX TODO diff --git a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/redis_rpc.go b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/redis_rpc.go index 76c7b40b7e..6b478751cb 100644 --- a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/redis_rpc.go +++ b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/redis_rpc.go @@ -3,10 +3,10 @@ package redis_rpc import ( "fmt" + "log/slog" "strings" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" ) // RedisRPCEmbed redis 实现 diff --git a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/twemproxy_rpc.go b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/twemproxy_rpc.go index bb6704f213..8b64be1e89 100644 --- a/dbm-services/mysql/db-remote-service/pkg/redis_rpc/twemproxy_rpc.go +++ b/dbm-services/mysql/db-remote-service/pkg/redis_rpc/twemproxy_rpc.go @@ -2,9 +2,9 @@ package redis_rpc import ( "fmt" + "log/slog" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" ) // TwemproxyRPCEmbed TODO diff --git a/dbm-services/mysql/db-remote-service/pkg/rpc_core/execute_cmds_on_addr.go b/dbm-services/mysql/db-remote-service/pkg/rpc_core/execute_cmds_on_addr.go index 324b11521c..5724ac9811 100644 --- a/dbm-services/mysql/db-remote-service/pkg/rpc_core/execute_cmds_on_addr.go +++ b/dbm-services/mysql/db-remote-service/pkg/rpc_core/execute_cmds_on_addr.go @@ -2,17 +2,17 @@ package rpc_core import ( "context" + "log/slog" "time" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) { db, err := c.MakeConnection(address, c.user, c.password, c.connectTimeout) if err != nil { - slog.Error("make connection", err) + slog.Error("make connection", slog.String("error", err.Error())) return nil, err } @@ -25,7 +25,7 @@ func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) conn, err := db.Connx(ctx) if err != nil { - slog.Error("get conn from db", err) + slog.Error("get conn from db", slog.String("error", err.Error())) return nil, err } defer func() { @@ -35,7 +35,7 @@ func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) for idx, command := range c.commands { pc, err := c.ParseCommand(command) if err != nil { - slog.Error("parse command", err) + slog.Error("parse command", slog.String("error", err.Error())) return nil, err } @@ -43,7 +43,8 @@ func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) tableData, err := queryCmd(conn, command, ctx) if err != nil { slog.Error( - "query command", err, + "query command", + slog.String("error", err.Error()), slog.String("address", address), slog.String("command", command), ) res = append( @@ -71,7 +72,8 @@ func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) rowsAffected, err := executeCmd(conn, command, ctx) if err != nil { slog.Error( - "execute command", err, + "execute command", + slog.String("error", err.Error()), slog.String("address", address), slog.String("command", command), ) res = append( @@ -97,7 +99,7 @@ func (c *RPCWrapper) executeOneAddr(address string) (res []cmdResult, err error) ) } else { err = errors.Errorf("commands[%d]: %s not support", idx, command) - slog.Error("dispatch command", err) + slog.Error("dispatch command", slog.String("error", err.Error())) res = append( res, cmdResult{Cmd: command, TableData: nil, RowsAffected: 0, ErrorMsg: err.Error()}, ) diff --git a/dbm-services/mysql/db-remote-service/pkg/rpc_core/run.go b/dbm-services/mysql/db-remote-service/pkg/rpc_core/run.go index 72386bc832..d6268fb337 100644 --- a/dbm-services/mysql/db-remote-service/pkg/rpc_core/run.go +++ b/dbm-services/mysql/db-remote-service/pkg/rpc_core/run.go @@ -1,11 +1,10 @@ package rpc_core import ( + "log/slog" "sync" "dbm-services/mysql/db-remote-service/pkg/config" - - "golang.org/x/exp/slog" ) // Run 执行 diff --git a/dbm-services/mysql/db-remote-service/pkg/service/handler_rpc/general_handler.go b/dbm-services/mysql/db-remote-service/pkg/service/handler_rpc/general_handler.go index 58382725b6..b92c558a5a 100644 --- a/dbm-services/mysql/db-remote-service/pkg/service/handler_rpc/general_handler.go +++ b/dbm-services/mysql/db-remote-service/pkg/service/handler_rpc/general_handler.go @@ -2,13 +2,13 @@ package handler_rpc import ( "fmt" + "log/slog" "net/http" "strings" "dbm-services/mysql/db-remote-service/pkg/rpc_core" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" ) func generalHandler(rpcEmbed rpc_core.RPCEmbedInterface) func(*gin.Context) { diff --git a/dbm-services/mysql/db-simulation/app/config/config.go b/dbm-services/mysql/db-simulation/app/config/config.go index 40d5e57dc7..c0a9c1fd87 100644 --- a/dbm-services/mysql/db-simulation/app/config/config.go +++ b/dbm-services/mysql/db-simulation/app/config/config.go @@ -15,15 +15,16 @@ var GAppConfig = AppConfig{} // AppConfig TODO type AppConfig struct { - ListenAddr string `yaml:"listenAddr"` BkRepo BkRepoConfig `yaml:"bkrepo"` - Bcs BcsConfig `yaml:"bcs"` - MirrorsAddress []ImgConfig `yaml:"mirrorsAddress"` Image Images - DbConf DbConfig `yaml:"dbconf"` - Debug bool `yaml:"debug"` - RulePath string `yaml:"rulePath"` - SpiderRulePath string `yaml:"spiderRulePath"` + ListenAddr string `yaml:"listenAddr"` + RulePath string `yaml:"rulePath"` + SpiderRulePath string `yaml:"spiderRulePath"` + Bcs BcsConfig `yaml:"bcs"` + DbConf DbConfig `yaml:"dbconf"` + MirrorsAddress []ImgConfig `yaml:"mirrorsAddress"` + Debug bool `yaml:"debug"` + LoadRuleFromdb bool `yaml:"loadRuleFromdb"` } // BkRepoConfig TODO @@ -181,6 +182,5 @@ func loadConfig() (err error) { if err = viper.Unmarshal(&GAppConfig); err != nil { return err } - logger.Debug("load config is: %v", GAppConfig) return } diff --git a/dbm-services/mysql/db-simulation/app/service/kubernets.go b/dbm-services/mysql/db-simulation/app/service/kubernets.go index 70e798b8c9..63c438e850 100644 --- a/dbm-services/mysql/db-simulation/app/service/kubernets.go +++ b/dbm-services/mysql/db-simulation/app/service/kubernets.go @@ -92,13 +92,13 @@ func NewDbPodSets() *DbPodSets { func (k *DbPodSets) getCreateClusterSqls() []string { var ss []string ss = append(ss, fmt.Sprintf( - "tdbctl create node wrapper 'SPIDER' options(user 'root', password '%s', host 'localhost', port 25000);", + "tdbctl create node wrapper 'SPIDER' options(user 'root', password '%s', host '127.0.0.1', port 25000);", k.BaseInfo.RootPwd)) ss = append(ss, fmt.Sprintf( - "tdbctl create node wrapper 'mysql' options(user 'root', password '%s', host 'localhost', port 20000);", + "tdbctl create node wrapper 'mysql' options(user 'root', password '%s', host '127.0.0.1', port 20000);", k.BaseInfo.RootPwd)) ss = append(ss, fmt.Sprintf( - "tdbctl create node wrapper 'TDBCTL' options(user 'root', password '%s', host 'localhost', port 26000);", + "tdbctl create node wrapper 'TDBCTL' options(user 'root', password '%s', host '127.0.0.1', port 26000);", k.BaseInfo.RootPwd)) ss = append(ss, "tdbctl enable primary;") ss = append(ss, "tdbctl flush routing;") @@ -131,12 +131,12 @@ func (k *DbPodSets) CreateClusterPod() (err error) { k.BaseInfo.Charset), "--user=mysql"}, ReadinessProbe: &v1.Probe{ - Handler: v1.Handler{ + ProbeHandler: v1.ProbeHandler{ Exec: &v1.ExecAction{ Command: []string{"/bin/bash", "-c", fmt.Sprintf("mysql -uroot -p%s -e 'select 1'", k.BaseInfo.RootPwd)}, }, }, - InitialDelaySeconds: 2, + InitialDelaySeconds: 3, PeriodSeconds: 5, }, }, { @@ -151,12 +151,12 @@ func (k *DbPodSets) CreateClusterPod() (err error) { k.BaseInfo.Charset), "--user=mysql"}, ReadinessProbe: &v1.Probe{ - Handler: v1.Handler{ + ProbeHandler: v1.ProbeHandler{ Exec: &v1.ExecAction{ Command: []string{"/bin/bash", "-c", fmt.Sprintf("mysql -uroot -p%s -e 'select 1'", k.BaseInfo.RootPwd)}, }, }, - InitialDelaySeconds: 2, + InitialDelaySeconds: 3, PeriodSeconds: 5, }, }, @@ -174,12 +174,12 @@ func (k *DbPodSets) CreateClusterPod() (err error) { k.BaseInfo.Charset), "--user=mysql"}, ReadinessProbe: &v1.Probe{ - Handler: v1.Handler{ + ProbeHandler: v1.ProbeHandler{ Exec: &v1.ExecAction{ Command: []string{"/bin/bash", "-c", fmt.Sprintf("mysql -uroot -p%s -e 'select 1'", k.BaseInfo.RootPwd)}, }, }, - InitialDelaySeconds: 2, + InitialDelaySeconds: 3, PeriodSeconds: 5, }, }, @@ -193,6 +193,7 @@ func (k *DbPodSets) CreateClusterPod() (err error) { logger.Info("connect tdbctl success ~") // create cluster relation for _, ql := range k.getCreateClusterSqls() { + logger.Info("exec init cluster sql %s", ql) if _, err = k.DbWork.Db.Exec(ql); err != nil { return err } @@ -266,7 +267,7 @@ func (k *DbPodSets) CreateMySQLPod() (err error) { k.BaseInfo.Charset), "--user=mysql"}, ReadinessProbe: &v1.Probe{ - Handler: v1.Handler{ + ProbeHandler: v1.ProbeHandler{ Exec: &v1.ExecAction{ Command: []string{"/bin/bash", "-c", fmt.Sprintf("mysql -uroot -p%s -e 'select 1'", k.BaseInfo.RootPwd)}, }, @@ -281,24 +282,31 @@ func (k *DbPodSets) CreateMySQLPod() (err error) { return k.createpod(c, 3306) } -// DeletePod TODO +// DeletePod delete pod func (k *DbPodSets) DeletePod() (err error) { return k.K8S.Cli.CoreV1().Pods(k.K8S.Namespace).Delete(context.TODO(), k.BaseInfo.PodName, metav1.DeleteOptions{}) } -// GetLoadSchemaSQLCmd TODO -func (k *DbPodSets) GetLoadSchemaSQLCmd(bkpath, file string) (cmd string) { - cmd = fmt.Sprintf( - "curl -o %s %s && mysql --defaults-file=/etc/my.cnf -uroot -p%s --default-character-set=%s -vvv < %s", - file, getdownloadUrl(bkpath, file), k.BaseInfo.RootPwd, k.BaseInfo.Charset, file) - return +// getLoadSchemaSQLCmd create load schema sql cmd +func (k *DbPodSets) getLoadSchemaSQLCmd(bkpath, file string) (cmd string) { + commands := []string{} + commands = append(commands, fmt.Sprintf("curl -s -S -o %s %s", file, getdownloadUrl(bkpath, file))) + // sed -i '/50720 SET tc_admin=0/d' + // 从中控dump的schema文件,默认是添加了tc_admin=0,需要删除 + // 因为模拟执行是需要将中控进行sql转发 + commands = append(commands, fmt.Sprintf("sed -i '/50720 SET tc_admin=0/d' %s", file)) + // sed 's/CREATE definer=.*@.* PROCEDURE/CREATE definer=`root`@`localhost` PROCEDURE/gI' + // 需要处理存储过程、函数的definer,因为拉起的pod是root用户,所以需要将definer修改为root + commands = append(commands, fmt.Sprintf( + "sed -i 's/CREATE definer=.*@.* $/CREATE definer=`root`@`localhost` /gI' %s", file)) + commands = append(commands, fmt.Sprintf("mysql -uroot -p%s --default-character-set=%s -vvv < %s", k.BaseInfo.RootPwd, + k.BaseInfo.Charset, file)) + return strings.Join(commands, " && ") } -// GetLoadSQLCmd TODO -func (k *DbPodSets) GetLoadSQLCmd(bkpath, file string, dbs []string) (cmd []string) { - // cmd = fmt.Sprintf( - // "wget %s && mysql --defaults-file=/etc/my.cnf -uroot -p%s --default-character-set=%s %s < %s", - cmd = append(cmd, fmt.Sprintf("curl -o %s %s", file, getdownloadUrl(bkpath, file))) +// getLoadSQLCmd get load sql cmd +func (k *DbPodSets) getLoadSQLCmd(bkpath, file string, dbs []string) (cmd []string) { + cmd = append(cmd, fmt.Sprintf("curl -s -S -o %s %s", file, getdownloadUrl(bkpath, file))) for _, db := range dbs { cmd = append(cmd, fmt.Sprintf("mysql --defaults-file=/etc/my.cnf -uroot -p%s --default-character-set=%s -vvv %s < %s", k.BaseInfo.RootPwd, k.BaseInfo.Charset, db, file)) @@ -320,12 +328,12 @@ func getdownloadUrl(bkpath, file string) string { return "" } ll := u.ResolveReference(r).String() - logger.Info("dbeug url is %s", ll) + logger.Info("download url: %s", ll) return ll } -// ExecuteInPod TODO -func (k *DbPodSets) ExecuteInPod(cmd, container string, extMap map[string]string) (stdout, stderr bytes.Buffer, +// executeInPod TODO +func (k *DbPodSets) executeInPod(cmd, container string, extMap map[string]string) (stdout, stderr bytes.Buffer, err error) { xlogger := logger.New(os.Stdout, true, logger.InfoLevel, extMap) logger.Info("start exec...") @@ -345,7 +353,7 @@ func (k *DbPodSets) ExecuteInPod(cmd, container string, extMap map[string]string reader, writer := io.Pipe() exec, err := remotecommand.NewSPDYExecutor(k.K8S.RestConfig, "POST", req.URL()) if err != nil { - logger.Error("remotecommand.NewSPDYExecutor", err.Error()) + logger.Error("at remotecommand.NewSPDYExecutor %s", err.Error()) return bytes.Buffer{}, bytes.Buffer{}, err } go func() { @@ -362,19 +370,19 @@ func (k *DbPodSets) ExecuteInPod(cmd, container string, extMap map[string]string return } }() - err = exec.Stream(remotecommand.StreamOptions{ + err = exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{ Stdin: nil, Stdout: writer, Stderr: &stderr, Tty: false, }) if err != nil { - logger.Error("exec.Stream failed %s:\n stdout:%s\n stderr: %s", err.Error(), strings.TrimSpace(stdout.String()), + xlogger.Error("exec.Stream failed %s:\n stdout:%s\n stderr: %s", err.Error(), strings.TrimSpace(stdout.String()), strings.TrimSpace(stderr.String())) - return + return stdout, stderr, err } - logger.Info("exec successfuly...") + xlogger.Info("exec successfuly...") logger.Info("info stdout:%s\nstderr:%s ", strings.TrimSpace(stdout.String()), strings.TrimSpace(stderr.String())) - return stdout, stderr, err + return stdout, stderr, nil } diff --git a/dbm-services/mysql/db-simulation/app/service/simulation_task.go b/dbm-services/mysql/db-simulation/app/service/simulation_task.go index 6168d0a5e4..314d09776a 100644 --- a/dbm-services/mysql/db-simulation/app/service/simulation_task.go +++ b/dbm-services/mysql/db-simulation/app/service/simulation_task.go @@ -31,17 +31,16 @@ var DelPod bool = true // BaseParam TODO type BaseParam struct { - Uid string `json:"uid"` - NodeId string `json:"node_id"` - RootId string `json:"root_id"` - VersionId string `json:"version_id"` - // app + Uid string `json:"uid"` + NodeId string `json:"node_id"` + RootId string `json:"root_id"` + VersionId string `json:"version_id"` TaskId string `json:"task_id" binding:"required"` MySQLVersion string `json:"mysql_version" binding:"required"` MySQLCharSet string `json:"mysql_charset" binding:"required"` Path string `json:"path" binding:"required"` - ExcuteObjects []ExcuteSQLFileObj `json:"execute_objects" binding:"gt=0,dive,required"` SchemaSQLFile string `json:"schema_sql_file" binding:"required"` + ExcuteObjects []ExcuteSQLFileObj `json:"execute_objects" binding:"gt=0,dive,required"` } // SpiderSimulationExecParam TODO @@ -125,8 +124,8 @@ func GetImgFromMySQLVersion(verion string) (img string, err error) { // TaskRuntimCtx TODO type TaskRuntimCtx struct { - dbsExcludeSysDb []string // 过滤了系统库的全部db list version string + dbsExcludeSysDb []string } // TaskChan TODO @@ -252,7 +251,7 @@ func (t *SimulationTask) SimulationRun(containerName string, xlogger *logger.Log // xlogger := t.getXlogger() // execute load schema model.UpdatePhase(t.TaskId, model.Phase_LoadSchema) - stdout, stderr, err := t.DbPodSets.ExecuteInPod(t.GetLoadSchemaSQLCmd(t.Path, t.SchemaSQLFile), + stdout, stderr, err := t.DbPodSets.executeInPod(t.getLoadSchemaSQLCmd(t.Path, t.SchemaSQLFile), containerName, t.getExtmap()) sstdout += stdout.String() + "\n" @@ -266,7 +265,7 @@ func (t *SimulationTask) SimulationRun(containerName string, xlogger *logger.Log if err = t.getDbsExcludeSysDb(); err != nil { logger.Error("getDbsExcludeSysDb faiked") err = errors.Wrap(err, "[getDbsExcludeSysDb failed]") - return + return sstdout, sstderr, err } model.UpdatePhase(t.TaskId, model.Phase_Running) for _, e := range t.ExcuteObjects { @@ -284,9 +283,9 @@ func (t *SimulationTask) SimulationRun(containerName string, xlogger *logger.Log if len(realexcutedbs) <= 0 { return "", "", fmt.Errorf("the changed db does not exist!!!") } - for idx, cmd := range t.GetLoadSQLCmd(t.Path, e.SQLFile, realexcutedbs) { + for idx, cmd := range t.getLoadSQLCmd(t.Path, e.SQLFile, realexcutedbs) { sstdout += util.RemovePassword(cmd) + "\n" - stdout, stderr, err := t.DbPodSets.ExecuteInPod(cmd, containerName, t.getExtmap()) + stdout, stderr, err := t.DbPodSets.executeInPod(cmd, containerName, t.getExtmap()) sstdout += stdout.String() + "\n" sstderr += stderr.String() + "\n" if err != nil { @@ -294,9 +293,11 @@ func (t *SimulationTask) SimulationRun(containerName string, xlogger *logger.Log xlogger.Error("download file failed:%s", err.Error()) return sstdout, sstderr, fmt.Errorf("download file %s failed:%s", e.SQLFile, err.Error()) } - xlogger.Error("%s[%s]:ExecuteInPod failed %s", e.SQLFile, realexcutedbs[idx-1], err.Error()) - return sstdout, sstderr, fmt.Errorf("exec %s in %s failed:%s", e.SQLFile, realexcutedbs[idx-1], - err.Error()) + xlogger.Error("when execute %s at %s, failed %s\n", e.SQLFile, realexcutedbs[idx-1], err.Error()) + xlogger.Error("stderr:\n %s", stderr.String()) + xlogger.Error("stdout:\n %s", stdout.String()) + return sstdout, sstderr, fmt.Errorf("\nexec %s in %s failed:%s\n %s", e.SQLFile, realexcutedbs[idx-1], + err.Error(), stderr.String()) } xlogger.Info("%s \n %s", stdout.String(), stderr.String()) } diff --git a/dbm-services/mysql/db-simulation/app/syntax/builtin_rule.go b/dbm-services/mysql/db-simulation/app/syntax/builtin_rule.go index 0360cde4ed..a86593339a 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/builtin_rule.go +++ b/dbm-services/mysql/db-simulation/app/syntax/builtin_rule.go @@ -22,12 +22,13 @@ const ( // SpecialCharRegex = `[¥$!@#%^&*()+={}\[\];:'"<>,.?/\\| ]` // AllowWordRegex TODO - AllowWordRegex = `^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$` + AllowWordRegex = `^[a-zA-Z0-9]([a-zA-Z0-9_-])*[a-zA-Z0-9]$` // SysReservesPrefixName TODO ) var reAllowWord *regexp.Regexp +var reAllowOneWord *regexp.Regexp // var mysql55WordMap map[string]struct{} var mysql56WordMap map[string]struct{} @@ -39,6 +40,7 @@ var sysReservesPrefixNames []string func init() { sysReservesPrefixNames = []string{"stage_truncate"} reAllowWord = regexp.MustCompile(AllowWordRegex) + reAllowOneWord = regexp.MustCompile(`^[a-zA-Z0-9]$`) mysql56WordMap = sliceToMap(keyworld.MySQL56_KEYWORD) mysql57WordMap = sliceToMap(keyworld.MySQL57_KEYWORD) mysql80WordMap = sliceToMap(keyworld.MySQL80_KEYWORD) @@ -66,8 +68,11 @@ func KeyWordValidator(ver, name string) (matched bool, msg string) { // SpecialCharValidator TODO func SpecialCharValidator(name string) (matched bool, msg string) { + if reAllowOneWord.MatchString(name) { + return false, "" + } if !reAllowWord.MatchString(name) { - return true, "Only allowed " + AllowWordRegex + " characters " + return true, name + " : Must match the regexp " + AllowWordRegex + " characters " } for _, sysPrefix := range sysReservesPrefixNames { re := regexp.MustCompile(fmt.Sprintf("^%s", sysPrefix)) diff --git a/dbm-services/mysql/db-simulation/app/syntax/create_table_rule.go b/dbm-services/mysql/db-simulation/app/syntax/create_table_rule.go index ec4a6947d4..79ce0a3e4f 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/create_table_rule.go +++ b/dbm-services/mysql/db-simulation/app/syntax/create_table_rule.go @@ -16,38 +16,8 @@ import ( "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/logger" - "dbm-services/mysql/db-simulation/pkg/util" ) -// SpiderChecker TODO -func (c CreateTableResult) SpiderChecker(spiderVersion string) (r *CheckerResult) { - r = &CheckerResult{} - if R.BuiltInRule.TableNameSpecification.KeyWord { - r.ParseBultinBan(func() (bool, string) { - return KeyWordValidator(spiderVersion, c.TableName) - }) - } - if R.BuiltInRule.TableNameSpecification.SpeicalChar { - r.ParseBultinBan(func() (bool, string) { - return SpecialCharValidator(c.TableName) - }) - } - r.Parse(SR.SpiderCreateTableRule.CreateTbLike, !c.IsCreateTableLike, "") - r.Parse(SR.SpiderCreateTableRule.CreateWithSelect, !c.IsCreateTableSelect, "") - r.Parse(SR.SpiderCreateTableRule.ColChasetNotEqTbChaset, c.ColCharsetEqTbCharset(), "") - ilegal, msg := c.ValidateSpiderComment() - r.Parse(SR.SpiderCreateTableRule.IllegalComment, ilegal, msg) - // comment 合法且非空 - if ilegal { - b_shardKeyIsIndex := c.ShardKeyIsIndex() - r.Parse(SR.SpiderCreateTableRule.ShardKeyNotIndex, b_shardKeyIsIndex, "") - if !b_shardKeyIsIndex { - r.Parse(SR.SpiderCreateTableRule.ShardKeyNotPk, c.ShardKeyIsNotPrimaryKey(), "") - } - } - return -} - // Checker TODO func (c CreateTableResult) Checker(mysqlVersion string) (r *CheckerResult) { r = &CheckerResult{} @@ -78,56 +48,6 @@ func (c CreateTableResult) BlobColumCount() (blobColumCount int) { return } -// ShardKeyIsIndex TODO -func (c CreateTableResult) ShardKeyIsIndex() bool { - cmt := c.GetComment() - if cmutil.IsEmpty(cmt) { - return len(c.CreateDefinitions.KeyDefs) > 0 - } - if !strings.Contains(cmt, "shard_key") { - return true - } - sk, err := util.ParseGetShardKeyForSpider(cmt) - if err != nil { - logger.Error("parse get shardkey %s", err.Error()) - return false - } - for _, v := range c.CreateDefinitions.KeyDefs { - for _, k := range v.KeyParts { - if strings.Compare(k.ColName, sk) == 0 { - return true - } - } - } - return false -} - -// ShardKeyIsNotPrimaryKey TODO -func (c CreateTableResult) ShardKeyIsNotPrimaryKey() bool { - cmt := c.GetComment() - logger.Info("will check %s ,ShardKeyIsNotPrimaryKey", cmt) - if cmutil.IsEmpty(cmt) { - return true - } - if !strings.Contains(cmt, "shard_key") { - return true - } - sk, err := util.ParseGetShardKeyForSpider(cmt) - if err != nil { - logger.Error("parse get shardkey %s", err.Error()) - return false - } - for _, v := range c.CreateDefinitions.ColDefs { - if v.PrimaryKey { - logger.Info("get sk %s,pk:%s", sk, v.ColName) - if strings.Compare(sk, v.ColName) == 0 { - return true - } - } - } - return false -} - // GetValFromTbOptions TODO func (c CreateTableResult) GetValFromTbOptions(key string) (val string) { for _, tableOption := range c.TableOptions { @@ -165,24 +85,6 @@ func (c CreateTableResult) GetTableCharset() (engine string) { return "" } -// ValidateSpiderComment TODO -func (c CreateTableResult) ValidateSpiderComment() (bool, string) { - comment := c.GetComment() - if cmutil.IsEmpty(comment) { - return true, "" - } - ret := util.ParseGetSpiderUserComment(comment) - switch ret { - case 0: - return true, "OK" - case 1: - return false, "SQL CREATE TABLE WITH ERROR TABLE COMMENT" - case 2: - return false, "UNSUPPORT CREATE TABLE WITH ERROR COMMENT" - } - return false, "" -} - // GetAllColCharsets TODO func (c CreateTableResult) GetAllColCharsets() (charsets []string) { for _, colDef := range c.CreateDefinitions.ColDefs { @@ -193,18 +95,18 @@ func (c CreateTableResult) GetAllColCharsets() (charsets []string) { return cmutil.RemoveDuplicate(charsets) } -// ColCharsetEqTbCharset TODO -func (c CreateTableResult) ColCharsetEqTbCharset() bool { +// ColCharsetNotEqTbCharset 字段的字符集合和表的字符集合相同 +func (c CreateTableResult) ColCharsetNotEqTbCharset() bool { colCharsets := c.GetAllColCharsets() fmt.Println("colCharsets", colCharsets, len(colCharsets)) if len(colCharsets) == 0 { - return true + return false } if len(colCharsets) > 1 { - return false + return true } if strings.Compare(strings.ToUpper(colCharsets[0]), c.GetTableCharset()) == 0 { - return true + return false } - return false + return true } diff --git a/dbm-services/mysql/db-simulation/app/syntax/definer_rule.go b/dbm-services/mysql/db-simulation/app/syntax/definer_rule.go index b38a64faf1..2c029a63fa 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/definer_rule.go +++ b/dbm-services/mysql/db-simulation/app/syntax/definer_rule.go @@ -1,5 +1,9 @@ package syntax +import ( + "fmt" +) + // DefinerBase TODO type DefinerBase struct { ParseBase @@ -9,9 +13,6 @@ type DefinerBase struct { // Checker TODO func (c DefinerBase) Checker(mysqlVersion string) (r *CheckerResult) { r = &CheckerResult{} - emptydefiner := UserHost{} - if c.Definer != emptydefiner { - r.Parse(R.CreateTableRule.DefinerRule, c.Command, "") - } + r.Parse(R.CreateTableRule.DefinerRule, fmt.Sprintf("%s@%s", c.Definer.User, c.Definer.Host), "") return } diff --git a/dbm-services/mysql/db-simulation/app/syntax/rule.go b/dbm-services/mysql/db-simulation/app/syntax/rule.go index bb06707c06..b7c7f78bfe 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/rule.go +++ b/dbm-services/mysql/db-simulation/app/syntax/rule.go @@ -12,7 +12,6 @@ package syntax import ( "fmt" - "log" "os" "reflect" @@ -41,31 +40,6 @@ type CheckerResult struct { RiskWarns []string } -// IsPass TODO -func (c CheckerResult) IsPass() bool { - return len(c.BanWarns) == 0 && len(c.RiskWarns) == 0 -} - -// Parse TODO -func (c *CheckerResult) Parse(rule *RuleItem, val interface{}, s string) { - matched, err := rule.CheckItem(val) - if matched { - if rule.Ban { - c.BanWarns = append(c.BanWarns, fmt.Sprintf("%s\n%s", err.Error(), s)) - } else { - c.RiskWarns = append(c.RiskWarns, fmt.Sprintf("%s\n%s", err.Error(), s)) - } - } -} - -// ParseBultinBan TODO -func (c *CheckerResult) ParseBultinBan(f func() (bool, string)) { - matched, msg := f() - if matched { - c.BanWarns = append(c.BanWarns, msg) - } -} - const ( // DEFAUTL_RULE_FILE TODO DEFAUTL_RULE_FILE = "rule.yaml" @@ -83,14 +57,17 @@ func init() { fileContent, err = os.ReadFile(DEFAUTL_RULE_FILE) } if err != nil { - logger.Error("failed to read the rule file:%s", err.Error()) - panic(err) + logger.Fatal("failed to read the rule file:%s", err.Error()) + return } if err := yaml.Unmarshal(fileContent, R); err != nil { - panic(err) + logger.Fatal("unmarshal rule config failed:%v", err) } - if err = traverseLoadRule(*R); err != nil { - logger.Error("load rule from database failed %s", err.Error()) + // 是否从db中加载配置覆盖配置文件 + if config.GAppConfig.LoadRuleFromdb { + if err = traverseLoadRule(*R); err != nil { + logger.Error("load rule from database failed %s", err.Error()) + } } var initCompiles = []*RuleItem{} initCompiles = append(initCompiles, traverseRule(R.CommandRule)...) @@ -98,21 +75,68 @@ func init() { initCompiles = append(initCompiles, traverseRule(R.AlterTableRule)...) initCompiles = append(initCompiles, traverseRule(R.DmlRule)...) for _, c := range initCompiles { - if err := c.Compile(); err != nil { - panic(err) + if err = c.compile(); err != nil { + logger.Fatal("compile rule failed %s", err.Error()) + return } } } +// IsPass TODO +func (c CheckerResult) IsPass() bool { + return len(c.BanWarns) == 0 && len(c.RiskWarns) == 0 +} + +// Parse TODO +func (c *CheckerResult) Parse(rule *RuleItem, val interface{}, additionalMsg string) { + matched, err := rule.CheckItem(val) + if matched { + if rule.Ban { + c.BanWarns = append(c.BanWarns, fmt.Sprintf("%s\n%s", err.Error(), additionalMsg)) + } else { + c.RiskWarns = append(c.RiskWarns, fmt.Sprintf("%s\n%s", err.Error(), additionalMsg)) + } + } +} + +// Trigger TODO +func (c *CheckerResult) Trigger(rule *BoolRuleItem, additionalMsg string) { + // 表示检查开关关闭,跳过检查 + if !rule.TurnOn { + return + } + if rule.Ban { + c.BanWarns = append(c.BanWarns, fmt.Sprintf("%s:%s\n%s", rule.Desc, additionalMsg, rule.Suggestion)) + } else { + c.RiskWarns = append(c.RiskWarns, fmt.Sprintf("%s:%s\n%s", rule.Desc, additionalMsg, rule.Suggestion)) + } +} + +// ParseBultinBan TODO +func (c *CheckerResult) ParseBultinBan(f func() (bool, string)) { + matched, msg := f() + if matched { + c.BanWarns = append(c.BanWarns, msg) + } +} + // RuleItem TODO type RuleItem struct { - Expr string `yaml:"expr"` - Desc string `yaml:"desc"` - Item interface{} `yaml:"item"` - // ban: true 是都是禁用的行为 - Ban bool `yaml:"ban"` + Item interface{} `yaml:"item"` Val interface{} ruleProgram *vm.Program + Expr string `yaml:"expr"` + Desc string `yaml:"desc"` + Ban bool `yaml:"ban"` + Suggestion string `yaml:"suggestion"` +} + +// BoolRuleItem 开关型规则,只需配置开启或者关闭即可 +type BoolRuleItem struct { + Desc string `yaml:"desc"` + Ban bool `yaml:"ban"` + TurnOn bool `yaml:"turnOn"` + Suggestion string `yaml:"suggestion"` } // Rules TODO @@ -155,7 +179,6 @@ type CreateTableRule struct { SuggestEngine *RuleItem `yaml:"SuggestEngine"` NeedPrimaryKey *RuleItem `yaml:"NeedPrimaryKey"` DefinerRule *RuleItem `yaml:"DefinerRule"` - NormalizedName *RuleItem `yaml:"NormalizedName"` } // AlterTableRule TODO @@ -222,8 +245,10 @@ func parseRule(drule model.TbSyntaxRule) (rule RuleItem, err error) { func traverseRule(v interface{}) (rules []*RuleItem) { value := reflect.ValueOf(v) // coordinate 是一个 Coordinate 实例 for num := 0; num < value.NumField(); num++ { - rule := value.Field(num).Interface().(*RuleItem) - rules = append(rules, rule) + rule, ok := value.Field(num).Interface().(*RuleItem) + if ok { + rules = append(rules, rule) + } } return rules } @@ -234,11 +259,10 @@ type Env struct { Item interface{} } -// Compile TODO -func (i *RuleItem) Compile() (err error) { +func (i *RuleItem) compile() (err error) { p, err := expr.Compile(i.Expr, expr.Env(Env{}), expr.AsBool()) if err != nil { - log.Printf("expr.Compile error %s\n", err.Error()) + logger.Error("%s:expr.Compile error %s\n", i.Desc, err.Error()) return err } i.ruleProgram = p @@ -265,5 +289,5 @@ func (i *RuleItem) CheckItem(val interface{}) (matched bool, err error) { if !matched { return false, fmt.Errorf("") } - return matched, fmt.Errorf("%s:%v", i.Desc, val) + return matched, fmt.Errorf("%s,当前值:%v", i.Desc, val) } diff --git a/dbm-services/mysql/db-simulation/app/syntax/spider_create_table_rule.go b/dbm-services/mysql/db-simulation/app/syntax/spider_create_table_rule.go new file mode 100644 index 0000000000..28fbfc388a --- /dev/null +++ b/dbm-services/mysql/db-simulation/app/syntax/spider_create_table_rule.go @@ -0,0 +1,208 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package syntax + +import ( + "slices" + "strings" + + "dbm-services/common/go-pubpkg/cmutil" + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-simulation/pkg/util" +) + +// SpiderChecker TODO +func (c CreateTableResult) SpiderChecker(spiderVersion string) (r *CheckerResult) { + r = &CheckerResult{} + if R.BuiltInRule.TableNameSpecification.KeyWord { + r.ParseBultinBan(func() (bool, string) { + return KeyWordValidator(spiderVersion, c.TableName) + }) + } + if R.BuiltInRule.TableNameSpecification.SpeicalChar { + r.ParseBultinBan(func() (bool, string) { + return SpecialCharValidator(c.TableName) + }) + } + if c.IsCreateTableLike { + r.Trigger(SR.SpiderCreateTableRule.CreateTbLike, "") + } + if c.IsCreateTableSelect { + r.Trigger(SR.SpiderCreateTableRule.CreateWithSelect, "") + } + if c.ColCharsetNotEqTbCharset() { + r.Trigger(SR.SpiderCreateTableRule.ColChasetNotEqTbChaset, "") + } + c.shardKeyChecker(r) + return r +} + +func (c CreateTableResult) shardKeyChecker(r *CheckerResult) { + var has_shard_key bool + var shardKeyCol string + var err error + logger.Info("start shardKeyChecker...") + // 如果沒有任何索引,则直接返回错误 + if len(c.CreateDefinitions.KeyDefs) <= 0 { + r.Trigger(SR.SpiderCreateTableRule.NoIndexExists, "") + return + } + pk, uks, keys := c.findTablesIndex() + tableComment := c.GetComment() + // 如果存在多个唯一健(含主键),多个唯一键都没有包含相同的字段也是不允许的 + var pubCols []string + logger.Info("uniqueKeys is %v,len is %d", uks, len(uks)) + if len(uks) > 1 { + pubCols = findCommonColByKeys(uks) + if len(pubCols) < 1 { + r.Trigger(SR.SpiderCreateTableRule.NoPubColAtMultUniqueIndex, "") + return + } + } + logger.Info("tableComment is %s", tableComment) + + if cmutil.IsNotEmpty(tableComment) { + // table comment 不为空的时候 先校验comment 格式是否合法 + legal, msg := c.validateSpiderComment(tableComment) + if !legal { + r.Trigger(SR.SpiderCreateTableRule.IllegalComment, msg) + return + } + shardKeyCol, err = util.ParseGetShardKeyForSpider(tableComment) + if err != nil { + // Todo 错误处理 + logger.Error("parse %s comment %s shard key failed %s", c.TableName, tableComment, err.Error()) + return + } + has_shard_key = true + } + // 如果table comment 为空,表示没有指定shard key,或table comnent 没有指定shardkey 由中控自主选择 + if !has_shard_key { + switch { + case pk != nil: + return + case len(uks) > 1: + return + case len(keys) > 1: + // 如果没有唯一索引,如果包含多个普通索引,则必须指定shard_key,否则需要报错 + r.Trigger(SR.SpiderCreateTableRule.MustSpecialShardKeyOnlyHaveCommonIndex, "") + return + } + } else { + // 如果存在索引,但是shard key不属于任何索引 + if !c.shardKeyIsIndex(shardKeyCol) { + r.Trigger(SR.SpiderCreateTableRule.ShardKeyNotIndex, "") + return + } + switch { + case len(uks) == 1: + if !c.shardKeyExistInKeys(shardKeyCol, uks) { + r.Trigger(SR.SpiderCreateTableRule.NoPubColAtMultUniqueIndex, shardKeyCol) + return + } + // 如果存在 一个或者多个唯一索引(包含主键) + case len(uks) > 1: + // shard_key只能是其中的共同部分;否则无法建表; + if !slices.Contains(pubCols, shardKeyCol) { + r.Trigger(SR.SpiderCreateTableRule.NoPubColAtMultUniqueIndex, shardKeyCol) + return + } + // 如果只存在多个普通索引,shard_key只能是其中任意一个的一部分 + case len(uks) < 1 && len(uks) > 1: + if !c.shardKeyExistInKeys(shardKeyCol, uks) { + r.Trigger(SR.SpiderCreateTableRule.MustSpecialShardKeyOnlyHaveCommonIndex, shardKeyCol) + return + } + } + shardKeyColDef := c.getColDef(shardKeyCol) + // 如果shard key 列允许为null + if shardKeyColDef.Nullable { + r.Trigger(SR.SpiderCreateTableRule.ShardKeyNotNull, shardKeyColDef.ColName) + } + } +} + +func (c CreateTableResult) findTablesIndex() (pk *KeyDef, uks []KeyDef, keys []KeyDef) { + for _, key := range c.CreateDefinitions.KeyDefs { + switch { + case key.PrimaryKey: + pk = &key + case key.UniqueKey: + uks = append(uks, key) + default: + keys = append(keys, key) + } + } + return pk, uks, keys +} + +// findCommonColByKeys 寻找多个唯一键中的公共列 +func findCommonColByKeys(keys []KeyDef) (cols []string) { + colmap := make(map[string]int) + for _, key := range keys { + for _, keyPart := range key.KeyParts { + colmap[keyPart.ColName]++ + } + } + for colName, count := range colmap { + if count == len(keys) { + cols = append(cols, colName) + } + } + return cols +} + +func (c CreateTableResult) validateSpiderComment(comment string) (legal bool, prompt string) { + ret := util.ParseGetSpiderUserComment(comment) + switch ret { + case 0: + return true, "OK" + case 1: + return false, "SQL CREATE TABLE WITH ERROR TABLE COMMENT" + case 2: + return false, "UNSUPPORT CREATE TABLE WITH ERROR COMMENT" + } + return false, "" +} + +// shardKeyIsIndex TODO +func (c CreateTableResult) shardKeyIsIndex(shardKeyCol string) bool { + for _, v := range c.CreateDefinitions.KeyDefs { + for _, k := range v.KeyParts { + if strings.Compare(k.ColName, shardKeyCol) == 0 { + logger.Info("the shard key %s is index", shardKeyCol) + return true + } + } + } + return false +} + +func (c CreateTableResult) shardKeyExistInKeys(shardKeyCol string, keys []KeyDef) bool { + for _, v := range keys { + for _, k := range v.KeyParts { + if strings.Compare(k.ColName, shardKeyCol) == 0 { + return true + } + } + } + return false +} + +func (c CreateTableResult) getColDef(colName string) (colDef ColDef) { + for _, col := range c.CreateDefinitions.ColDefs { + if strings.Compare(col.ColName, colName) == 0 { + colDef = col + break + } + } + return colDef +} diff --git a/dbm-services/mysql/db-simulation/app/syntax/spider_rule.go b/dbm-services/mysql/db-simulation/app/syntax/spider_rule.go index 6177d4ca48..921d43b960 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/spider_rule.go +++ b/dbm-services/mysql/db-simulation/app/syntax/spider_rule.go @@ -18,6 +18,26 @@ type SpiderChecker interface { SpiderChecker(mysqlVersion string) *CheckerResult } +// SpiderRules spdier 语法检查规则 +type SpiderRules struct { + CommandRule CommandRule `yaml:"CommandRule"` + SpiderCreateTableRule SpiderCreateTableRule `yaml:"SpiderCreateTableRule"` +} + +// SpiderCreateTableRule spider create table 建表规则 +type SpiderCreateTableRule struct { + ColChasetNotEqTbChaset *BoolRuleItem `yaml:"ColChasetNotEqTbChaset"` + CreateWithSelect *BoolRuleItem `yaml:"CreateWithSelect"` + CreateTbLike *BoolRuleItem `yaml:"CreateTbLike"` + ShardKeyNotPk *BoolRuleItem `yaml:"ShardKeyNotPk"` + ShardKeyNotIndex *BoolRuleItem `yaml:"ShardKeyNotIndex"` + IllegalComment *BoolRuleItem `yaml:"IllegalComment"` + NoIndexExists *BoolRuleItem `yaml:"NoIndexExists"` + NoPubColAtMultUniqueIndex *BoolRuleItem `yaml:"NoPubColAtMultUniqueIndex"` + MustSpecialShardKeyOnlyHaveCommonIndex *BoolRuleItem `yaml:"MustSpecialShardKeyOnlyHaveCommonIndex"` + ShardKeyNotNull *BoolRuleItem `yaml:"ShardKeyNotNull"` +} + func init() { SR = &SpiderRules{} var fileContent []byte @@ -28,39 +48,25 @@ func init() { fileContent, err = os.ReadFile(DEFAUTL_SPIDER_RULE_FILE) } if err != nil { - logger.Error("read rule config file failed %s", err.Error()) - panic(err) + logger.Fatal("read rule config file failed %s", err.Error()) + return } if err = yaml.Unmarshal(fileContent, SR); err != nil { - logger.Error("yaml Unmarshal failed %s", err.Error()) - panic(err) + logger.Fatal("yaml Unmarshal failed %s", err.Error()) + return } - // panic("panic there..") - if err = traverseLoadRule(*SR); err != nil { - logger.Error("load rule from database failed %s", err.Error()) + if config.GAppConfig.LoadRuleFromdb { + if err = traverseLoadRule(*SR); err != nil { + logger.Error("load rule from database failed %s", err.Error()) + } } var initCompiles = []*RuleItem{} initCompiles = append(initCompiles, traverseRule(SR.CommandRule)...) initCompiles = append(initCompiles, traverseRule(SR.SpiderCreateTableRule)...) for _, c := range initCompiles { - if err = c.Compile(); err != nil { - panic(err) + if err = c.compile(); err != nil { + logger.Fatal("compile rule failed %s", err.Error()) + return } } } - -// SpiderRules TODO -type SpiderRules struct { - CommandRule CommandRule `yaml:"CommandRule"` - SpiderCreateTableRule SpiderCreateTableRule `yaml:"SpiderCreateTableRule"` -} - -// SpiderCreateTableRule TODO -type SpiderCreateTableRule struct { - ColChasetNotEqTbChaset *RuleItem `yaml:"ColChasetNotEqTbChaset"` - CreateWithSelect *RuleItem `yaml:"CreateWithSelect"` - CreateTbLike *RuleItem `yaml:"CreateTbLike"` - ShardKeyNotPk *RuleItem `yaml:"ShardKeyNotPk"` - ShardKeyNotIndex *RuleItem `yaml:"ShardKeyNotIndex"` - IllegalComment *RuleItem `yaml:"IllegalComment"` -} diff --git a/dbm-services/mysql/db-simulation/app/syntax/syntax.go b/dbm-services/mysql/db-simulation/app/syntax/syntax.go index 42c82aa6ce..0c211df5fc 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/syntax.go +++ b/dbm-services/mysql/db-simulation/app/syntax/syntax.go @@ -14,6 +14,7 @@ package syntax import ( "bufio" "encoding/json" + "errors" "fmt" "io" "math/rand" @@ -24,7 +25,6 @@ import ( "path/filepath" "runtime/debug" "strconv" - "strings" "sync" "time" @@ -51,28 +51,29 @@ type TmysqlParseSQL struct { // TmysqlParseFile TODO type TmysqlParseFile struct { TmysqlParse - Param CheckSqlFileParam + Param CheckSqlFileParam + IsLocalFile bool } // CheckSqlFileParam TODO type CheckSqlFileParam struct { - BkRepoBasePath string `json:"bkrepo_base_path"` // 制品库相对路径 - FileNames []string `json:"file_names"` // SQL文件名称 - MysqlVersion string `json:"mysql_version"` // mysql版本 + BkRepoBasePath string `json:"bkrepo_base_path"` + MysqlVersion string `json:"mysql_version"` + FileNames []string `json:"file_names"` } // TmysqlParse TODO type TmysqlParse struct { + runtimeCtx + result map[string]*CheckInfo + bkRepoClient *bkrepo.BkRepoClient TmysqlParseBinPath string BaseWorkdir string - result map[string]*CheckInfo - runtimeCtx - bkRepoClient *bkrepo.BkRepoClient } type runtimeCtx struct { - tmpWorkdir string fileMap map[inputFileName]outputFileName + tmpWorkdir string } // CheckInfo TODO @@ -84,43 +85,23 @@ type CheckInfo struct { // FailedInfo TODO type FailedInfo struct { - Line int64 `json:"line"` Sqltext string `json:"sqltext"` - ErrorCode int64 `json:"error_code"` ErrorMsg string `json:"error_msg"` + Line int64 `json:"line"` + ErrorCode int64 `json:"error_code"` } // RiskInfo TODO type RiskInfo struct { - Line int64 `json:"line"` CommandType string `json:"command_type"` Sqltext string `json:"sqltext"` WarnInfo string `json:"warn_info"` + Line int64 `json:"line"` } // DDLMAP_FILE_SUFFIX TODO const DDLMAP_FILE_SUFFIX = ".tbl.map" -// DoSQL TODO -func (tf *TmysqlParseFile) DoSQL(dbtype string) (result map[string]*CheckInfo, err error) { - tf.fileMap = make(map[inputFileName]outputFileName) - tf.result = make(map[string]*CheckInfo) - tf.tmpWorkdir = tf.BaseWorkdir - if err = tf.Execute(); err != nil { - logger.Error("failed to execute tmysqlparse: %s", err.Error()) - return nil, err - } - logger.Info("err is %v", err) - // 对tmysqlparse的处理结果进行分析,为json文件,后面用到了rule - mysqlVersion := tf.Param.MysqlVersion - if err = tf.AnalyzeParseResult(mysqlVersion, dbtype); err != nil { - logger.Error("failed to analyze the parsing result:%s", err.Error()) - return tf.result, err - } - - return tf.result, nil -} - // Do 运行语法检查 For SQL 文件 // // @receiver tf @@ -128,34 +109,57 @@ func (tf *TmysqlParseFile) DoSQL(dbtype string) (result map[string]*CheckInfo, e // @return err func (tf *TmysqlParseFile) Do(dbtype string) (result map[string]*CheckInfo, err error) { logger.Info("doing....") - if err = tf.Init(); err != nil { - logger.Error("Do init failed %s", err.Error()) - return nil, err + tf.fileMap = make(map[inputFileName]outputFileName) + tf.result = make(map[string]*CheckInfo) + tf.tmpWorkdir = tf.BaseWorkdir + if !tf.IsLocalFile { + if err = tf.Init(); err != nil { + logger.Error("Do init failed %s", err.Error()) + return nil, err + } + if err = tf.Downloadfile(); err != nil { + logger.Error("failed to download sql file from the product library %s", err.Error()) + return nil, err + } } // 最后删除临时目录,不会返回错误 // 暂时屏蔽 观察过程文件 - defer tf.delTempDir() - - if err = tf.Downloadfile(); err != nil { - logger.Error("failed to download sql file from the product library %s", err.Error()) - return nil, err - } + // defer tf.delTempDir() + errChan := make(chan error) + resultfileChan := make(chan string, 10) + signalChan := make(chan struct{}) + go func() { + if err = tf.Execute(resultfileChan); err != nil { + logger.Error("failed to execute tmysqlparse: %s", err.Error()) + errChan <- err + // return nil, err + } + close(resultfileChan) + }() - if err = tf.Execute(); err != nil { - logger.Error("failed to execute tmysqlparse: %s", err.Error()) - return nil, err - } // 对tmysqlparse的处理结果进行分析,为json文件,后面用到了rule mysqlVersion := tf.Param.MysqlVersion - logger.Info("start to analyze the parsing result") - if err = tf.AnalyzeParseResult(mysqlVersion, dbtype); err != nil { - logger.Error("failed to analyze the parsing result:%s", err.Error()) - return tf.result, err - } - // // 在一定程度上会增加语法检查的耗时、后续先观察一下 + + go func() { + logger.Info("start to analyze the parsing result") + if err = tf.AnalyzeParseResult(resultfileChan, mysqlVersion, dbtype); err != nil { + logger.Error("failed to analyze the parsing result:%s", err.Error()) + errChan <- err + // return tf.result, err + } + signalChan <- struct{}{} + }() + // 在一定程度上会增加语法检查的耗时、后续先观察一下 // if dbtype == app.Spider { - // tf.UploadDdlTblMapFile() + // tf.UploadDdlTblMapFile() // } + select { + case err := <-errChan: + return tf.result, err + case <-signalChan: + logger.Info("analyze the parsing result done") + break + } return tf.result, nil } @@ -175,15 +179,21 @@ func (tf *TmysqlParseFile) CreateAndUploadDDLTblFile() (err error) { logger.Error("failed to download sql file from the product library %s", err.Error()) return err } + errChan := make(chan error) + resultfileChan := make(chan string, 10) + go func() { + if err = tf.Execute(resultfileChan); err != nil { + logger.Error("failed to execute tmysqlparse: %s", err.Error()) + errChan <- err + // return nil, err + } + close(resultfileChan) + }() - if err = tf.Execute(); err != nil { - logger.Error("failed to execute tmysqlparse: %s", err.Error()) - return err - } - for inputFileName := range tf.fileMap { + for inputFileName := range resultfileChan { if err = tf.analyzeDDLTbls(inputFileName); err != nil { logger.Error("failed to analyzeDDLTbls %s,err:%s", inputFileName, err.Error()) - return + return err } } if err = tf.UploadDdlTblMapFile(); err != nil { @@ -193,6 +203,26 @@ func (tf *TmysqlParseFile) CreateAndUploadDDLTblFile() (err error) { return nil } +var bkrepoClient *bkrepo.BkRepoClient +var once sync.Once + +func getbkrepoClient() *bkrepo.BkRepoClient { + once.Do(func() { + bkrepoClient = &bkrepo.BkRepoClient{ + Client: &http.Client{ + Transport: &http.Transport{}, + }, + BkRepoProject: config.GAppConfig.BkRepo.Project, + BkRepoPubBucket: config.GAppConfig.BkRepo.PublicBucket, + BkRepoUser: config.GAppConfig.BkRepo.User, + BkRepoPwd: config.GAppConfig.BkRepo.Pwd, + BkRepoEndpoint: config.GAppConfig.BkRepo.EndPointUrl, + } + logger.Info("once get config") + }) + return bkrepoClient +} + // Init TODO func (t *TmysqlParse) Init() (err error) { tmpDir := fmt.Sprintf("tmysqlparse_%s_%s", time.Now().Format("20060102150405"), strconv.Itoa(rand.Intn(10000))) @@ -201,16 +231,7 @@ func (t *TmysqlParse) Init() (err error) { logger.Error("mkdir %s failed, err:%+v", t.tmpWorkdir, err) return fmt.Errorf("failed to initialize tmysqlparse temporary directory(%s).detail:%s", t.tmpWorkdir, err.Error()) } - t.bkRepoClient = &bkrepo.BkRepoClient{ - Client: &http.Client{ - Transport: &http.Transport{}, - }, - BkRepoProject: config.GAppConfig.BkRepo.Project, - BkRepoPubBucket: config.GAppConfig.BkRepo.PublicBucket, - BkRepoUser: config.GAppConfig.BkRepo.User, - BkRepoPwd: config.GAppConfig.BkRepo.Pwd, - BkRepoEndpoint: config.GAppConfig.BkRepo.EndPointUrl, - } + t.bkRepoClient = getbkrepoClient() t.fileMap = make(map[inputFileName]outputFileName) t.result = make(map[string]*CheckInfo) return nil @@ -235,14 +256,31 @@ func (t *TmysqlParse) getCommand(filename string) (cmd string) { // Downloadfile TODO func (tf *TmysqlParseFile) Downloadfile() (err error) { + wg := &sync.WaitGroup{} + errCh := make(chan error, 10) + c := make(chan struct{}, 5) for _, fileName := range tf.Param.FileNames { - err = tf.bkRepoClient.Download(tf.Param.BkRepoBasePath, fileName, tf.tmpWorkdir) - if err != nil { - logger.Error("download %s from bkrepo failed :%s", fileName, err.Error()) - return err - } + wg.Add(1) + c <- struct{}{} + go func(fileName string) { + defer wg.Done() + err = tf.bkRepoClient.Download(tf.Param.BkRepoBasePath, fileName, tf.tmpWorkdir) + if err != nil { + logger.Error("download %s from bkrepo failed :%s", fileName, err.Error()) + errCh <- err + } + <-c + }(fileName) } - return + go func() { + wg.Wait() + close(errCh) + }() + var errs []error + for errx := range errCh { + errs = append(errs, errx) + } + return errors.Join(errs...) } // UploadDdlTblMapFile TODO @@ -266,33 +304,36 @@ func (tf *TmysqlParseFile) UploadDdlTblMapFile() (err error) { // // @receiver tf // @return err -func (tf *TmysqlParseFile) Execute() (err error) { +func (tf *TmysqlParseFile) Execute(resultFile chan string) (err error) { var wg sync.WaitGroup - var mu sync.Mutex - var errs []string + var errs []error c := make(chan struct{}, 10) + errChan := make(chan error, 5) for _, fileName := range tf.Param.FileNames { wg.Add(1) tf.fileMap[fileName] = fileName + ".json" c <- struct{}{} - go func() { - command := exec.Command("/bin/bash", "-c", tf.getCommand(fileName)) + go func(sqlfile string) { + command := exec.Command("/bin/bash", "-c", tf.getCommand(sqlfile)) logger.Info("command is %s", command) output, err := command.CombinedOutput() if err != nil { - mu.Lock() - errs = append(errs, fmt.Sprintf("tmysqlparse.sh command run failed. error info:"+err.Error()+","+string(output))) - mu.Unlock() + errChan <- fmt.Errorf("tmysqlparse.sh command run failed. error info:" + err.Error() + "," + string(output)) + } else { + resultFile <- sqlfile } <-c wg.Done() - }() - wg.Wait() + }(fileName) } - if len(errs) > 0 { - return fmt.Errorf("errrors: %s", strings.Join(errs, "\n")) + go func() { + wg.Wait() + close(errChan) + }() + for err := range errChan { + errs = append(errs, err) } - return err + return errors.Join(errs...) } func (tf *TmysqlParse) getAbsoutputfilePath(inputFileName string) string { @@ -301,30 +342,32 @@ func (tf *TmysqlParse) getAbsoutputfilePath(inputFileName string) string { } // AnalyzeParseResult TODO -func (t *TmysqlParse) AnalyzeParseResult(mysqlVersion string, dbtype string) (err error) { - wg := &sync.WaitGroup{} - var errs []string +func (t *TmysqlParse) AnalyzeParseResult(resultFile chan string, mysqlVersion string, dbtype string) (err error) { + var errs []error c := make(chan struct{}, 10) - // 开启多个线程,同时对多个sql文件进行分析 - for inputFileName := range t.fileMap { + errChan := make(chan error, 5) + wg := &sync.WaitGroup{} + go func() { + for err := range errChan { + errs = append(errs, err) + } + }() + for inputFileName := range resultFile { wg.Add(1) c <- struct{}{} - logger.Info("start to analyze %s", inputFileName) go func(fileName string) { + defer wg.Done() err = t.AnalyzeOne(fileName, mysqlVersion, dbtype) if err != nil { - errs = append(errs, err.Error()) + errChan <- err } <-c - wg.Done() }(inputFileName) } wg.Wait() + close(errChan) logger.Info("end to analyze %d files", len(t.fileMap)) - if len(errs) > 0 { - return fmt.Errorf("errors: %s", strings.Join(errs, "\n")) - } - return err + return errors.Join(errs...) } // ParseResult TODO @@ -362,7 +405,7 @@ func (tf *TmysqlParse) analyzeDDLTbls(inputfileName string) (err error) { f, err := os.Open(tf.getAbsoutputfilePath(inputfileName)) if err != nil { logger.Error("open file failed %s", err.Error()) - return + return err } defer f.Close() reader := bufio.NewReader(f) @@ -381,18 +424,18 @@ func (tf *TmysqlParse) analyzeDDLTbls(inputfileName string) (err error) { var res ParseLineQueryBase if err = json.Unmarshal(line, &res); err != nil { logger.Error("json unmasrshal line:%s failed %s", string(line), err.Error()) - return + return err } // 判断是否有语法错误 if res.ErrorCode != 0 { - return + return err } switch res.Command { case "create_table", "alter_table": var o CommDDLResult if err = json.Unmarshal(line, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } // 如果dbname为空,则实际库名由参数指定,无特殊情况 ddlTbls[o.DbName] = append(ddlTbls[o.DbName], o.TableName) @@ -434,7 +477,7 @@ func (tf *TmysqlParse) AnalyzeOne(inputfileName string, mysqlVersion string, dbt f, err := os.Open(tf.getAbsoutputfilePath(inputfileName)) if err != nil { logger.Error("open file failed %s", err.Error()) - return + return err } defer f.Close() reader := bufio.NewReader(f) @@ -457,14 +500,14 @@ func (tf *TmysqlParse) AnalyzeOne(inputfileName string, mysqlVersion string, dbt buf = []byte{} var res ParseLineQueryBase - logger.Debug("buf: %s", string(bs)) + // logger.Debug("buf: %s", string(bs)) if len(bs) == 0 { logger.Info("blank line skip") continue } if err = json.Unmarshal(bs, &res); err != nil { logger.Error("json unmasrshal line:%s failed %s", string(bs), err.Error()) - return + return err } // 判断是否有语法错误 if res.ErrorCode != 0 { @@ -520,7 +563,7 @@ func (ch *CheckInfo) runSpidercheck(ddlTbls map[string][]string, res ParseLineQu var o CreateTableResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } o.TableOptionMap = ConverTableOptionToMap(o.TableOptions) c = o @@ -530,24 +573,24 @@ func (ch *CheckInfo) runSpidercheck(ddlTbls map[string][]string, res ParseLineQu var o CreateDBResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o case "alter_table": var o AlterTableResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } ddlTbls[o.DbName] = append(ddlTbls[o.DbName], o.TableName) } if c == nil { - return + return nil } // 不同结构体绑定不同的Checker result := c.SpiderChecker(mysqlVersion) if result.IsPass() { - return + return nil } if len(result.BanWarns) > 0 { ch.BanWarnings = append(ch.BanWarnings, RiskInfo{ @@ -576,54 +619,53 @@ func (ch *CheckInfo) runcheck(res ParseLineQueryBase, bs []byte, mysqlVersion st var o CreateTableResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o case "alter_table": var o AlterTableResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o case "delete": var o DeleteResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o case "update": var o UpdateResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o case "create_function", "create_trigger", "create_event", "create_procedure", "create_view": var o DefinerBase if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } - logger.Info("detail %v", o.Definer) c = o case "create_db": var o CreateDBResult if err = json.Unmarshal(bs, &o); err != nil { logger.Error("json unmasrshal line failed %s", err.Error()) - return + return err } c = o } if c == nil { - return + return nil } // 不同结构体绑定不同的Checker result := c.Checker(mysqlVersion) if result.IsPass() { - return + return nil } if len(result.BanWarns) > 0 { ch.BanWarnings = append(ch.BanWarnings, RiskInfo{ diff --git a/dbm-services/mysql/db-simulation/app/syntax/syntax_test.go b/dbm-services/mysql/db-simulation/app/syntax/syntax_test.go index 64d7a5fecc..19579e0d06 100644 --- a/dbm-services/mysql/db-simulation/app/syntax/syntax_test.go +++ b/dbm-services/mysql/db-simulation/app/syntax/syntax_test.go @@ -9,11 +9,11 @@ import ( ) type ParseQueryBase struct { - QueryId int `json:"query_id"` Command string `json:"command"` QueryString string `json:"query_string,omitempty"` - ErrorCode int `json:"error_code,omitempty"` ErrorMsg string `json:"error_msg,omitempty"` + QueryId int `json:"query_id"` + ErrorCode int `json:"error_code,omitempty"` MinMySQLVersion int `json:"min_mysql_version"` MaxMySQLVersion int `json:"max_my_sql_version"` } diff --git a/dbm-services/mysql/db-simulation/go.mod b/dbm-services/mysql/db-simulation/go.mod index 7f08178528..6a1af78607 100644 --- a/dbm-services/mysql/db-simulation/go.mod +++ b/dbm-services/mysql/db-simulation/go.mod @@ -1,77 +1,86 @@ module dbm-services/mysql/db-simulation -go 1.19 +go 1.21 require ( - github.com/antonmedv/expr v1.12.5 + github.com/antonmedv/expr v1.15.2 github.com/gin-contrib/pprof v1.4.0 github.com/gin-contrib/requestid v0.0.6 github.com/gin-gonic/gin v1.9.1 github.com/pkg/errors v0.9.1 - github.com/spf13/viper v1.15.0 + github.com/spf13/viper v1.16.0 gopkg.in/yaml.v2 v2.4.0 - gorm.io/driver/mysql v1.5.0 - gorm.io/gorm v1.25.0 - k8s.io/api v0.22.5 - k8s.io/apimachinery v0.22.5 - k8s.io/client-go v0.22.5 + gorm.io/driver/mysql v1.5.1 + gorm.io/gorm v1.25.4 + k8s.io/api v0.28.2 + k8s.io/apimachinery v0.28.2 + k8s.io/client-go v0.28.2 ) require ( - github.com/bytedance/sonic v1.10.0-rc3 // indirect + github.com/bytedance/sonic v1.10.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v1.2.2 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect + github.com/go-playground/validator/v10 v10.15.4 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect - golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/net v0.13.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/term v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/arch v0.5.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/dbm-services/mysql/db-simulation/go.sum b/dbm-services/mysql/db-simulation/go.sum index 3874d33706..0a096fb0d2 100644 --- a/dbm-services/mysql/db-simulation/go.sum +++ b/dbm-services/mysql/db-simulation/go.sum @@ -36,25 +36,16 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/antonmedv/expr v1.12.5 h1:Fq4okale9swwL3OeLLs9WD9H6GbgBLJyN/NUHRv+n0E= -github.com/antonmedv/expr v1.12.5/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/antonmedv/expr v1.15.2 h1:afFXpDWIC2n3bF+kTZE1JvFo+c34uaM3sTqh8z0xfdU= +github.com/antonmedv/expr v1.15.2/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= -github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= +github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= @@ -73,22 +64,16 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= @@ -105,16 +90,18 @@ github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SU github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -122,11 +109,13 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -136,7 +125,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -164,7 +152,8 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -178,7 +167,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -194,33 +182,29 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -233,10 +217,10 @@ github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZY github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -246,12 +230,11 @@ github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -259,25 +242,17 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= +github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= +github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -287,21 +262,19 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -317,8 +290,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= @@ -329,6 +302,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -336,20 +310,19 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= +golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -383,9 +356,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -396,7 +369,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -407,7 +379,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -418,9 +389,9 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -430,8 +401,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -442,8 +413,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -452,11 +423,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -470,7 +437,6 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -483,19 +449,19 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -504,12 +470,12 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -561,6 +527,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -590,8 +559,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -622,7 +592,6 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -662,34 +631,26 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= -gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= -gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= +gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -697,29 +658,26 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.5 h1:xk7C+rMjF/EGELiD560jdmwzrB788mfcHiNbMQLIVI8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/apimachinery v0.22.5 h1:cIPwldOYm1Slq9VLBRPtEYpyhjIm1C6aAMAoENuvN9s= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/client-go v0.22.5 h1:I8Zn/UqIdi2r02aZmhaJ1hqMxcpfJ3t5VqvHtctHYFo= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/dbm-services/mysql/db-simulation/handler/handler.go b/dbm-services/mysql/db-simulation/handler/handler.go index 58ddfb88c2..8199462868 100644 --- a/dbm-services/mysql/db-simulation/handler/handler.go +++ b/dbm-services/mysql/db-simulation/handler/handler.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package handler TODO package handler @@ -17,10 +27,10 @@ import ( // Response TODO type Response struct { + Data interface{} `json:"data"` RequestId string `json:"request_id"` - Code int `json:"code"` Message string `json:"msg"` - Data interface{} `json:"data"` + Code int `json:"code"` } // CreateClusterParam TODO @@ -80,6 +90,10 @@ func SpiderClusterSimulation(r *gin.Context) { DbPodSets: service.NewDbPodSets(), BaseParam: ¶m.BaseParam, } + rootPwd := cmutil.RandStr(10) + if !service.DelPod { + logger.Info("the pwd %s", rootPwd) + } tsk.DbImage = img tsk.SpiderImage = param.GetSpiderImg() tsk.TdbCtlImage = param.GetTdbctlImg() @@ -88,7 +102,7 @@ func SpiderClusterSimulation(r *gin.Context) { replaceUnderSource(param.TaskId)), Lables: map[string]string{"task_id": replaceUnderSource(param.TaskId), "request_id": requestId}, - RootPwd: cmutil.RandStr(10), + RootPwd: rootPwd, Charset: param.MySQLCharSet, } service.SpiderTaskChan <- tsk diff --git a/dbm-services/mysql/db-simulation/handler/syntax_check.go b/dbm-services/mysql/db-simulation/handler/syntax_check.go index eb2d00647a..de1806ff41 100644 --- a/dbm-services/mysql/db-simulation/handler/syntax_check.go +++ b/dbm-services/mysql/db-simulation/handler/syntax_check.go @@ -47,8 +47,8 @@ type SyntaxHandler struct{} // CheckSqlStringParam TODO type CheckSqlStringParam struct { ClusterType string `json:"cluster_type" binding:"required"` - Sqls []string `json:"sqls" binding:"gt=0,dive,required"` // SQLS - Version string `json:"version"` // mysql版本 + Version string `json:"version"` + Sqls []string `json:"sqls" binding:"gt=0,dive,required"` } // SyntaxCheckSQL TODO @@ -74,6 +74,7 @@ func SyntaxCheckSQL(r *gin.Context) { TmysqlParseBinPath: tmysqlParserBin, BaseWorkdir: workdir, }, + IsLocalFile: true, Param: syntax.CheckSqlFileParam{ BkRepoBasePath: "", FileNames: []string{fileName}, @@ -84,11 +85,11 @@ func SyntaxCheckSQL(r *gin.Context) { logger.Info("cluster type :%s", param.ClusterType) switch strings.ToLower(param.ClusterType) { case app.Spider, app.TendbCluster: - data, err = check.DoSQL(app.Spider) + data, err = check.Do(app.Spider) case app.MySQL: - data, err = check.DoSQL(app.MySQL) + data, err = check.Do(app.MySQL) default: - data, err = check.DoSQL(app.MySQL) + data, err = check.Do(app.MySQL) } if err != nil { @@ -101,9 +102,9 @@ func SyntaxCheckSQL(r *gin.Context) { // CheckFileParam TODO type CheckFileParam struct { ClusterType string `json:"cluster_type"` - Path string `json:"path" binding:"required"` // 蓝鲸制品库SQL文件存储的相对路径 - Files []string `json:"files" binding:"gt=0,dive,required"` // SQL 文件名 - Version string `json:"version"` // mysql版本 + Path string `json:"path" binding:"required"` + Version string `json:"version"` + Files []string `json:"files" binding:"gt=0,dive,required"` } // SyntaxCheckFile 运行语法检查 diff --git a/dbm-services/mysql/db-simulation/handler/updaterule.go b/dbm-services/mysql/db-simulation/handler/updaterule.go index 874cc1af96..b42b93b50a 100644 --- a/dbm-services/mysql/db-simulation/handler/updaterule.go +++ b/dbm-services/mysql/db-simulation/handler/updaterule.go @@ -12,8 +12,8 @@ import ( // UpdateRuleParam TODO type UpdateRuleParam struct { - ID int `json:"id" binding:"required"` Item interface{} `json:"item" binding:"required"` + ID int `json:"id" binding:"required"` } // UpdateRule TODO diff --git a/dbm-services/mysql/db-simulation/model/tb_syntax_rule.go b/dbm-services/mysql/db-simulation/model/tb_syntax_rule.go index 0f88322526..c123b2b978 100644 --- a/dbm-services/mysql/db-simulation/model/tb_syntax_rule.go +++ b/dbm-services/mysql/db-simulation/model/tb_syntax_rule.go @@ -123,21 +123,10 @@ func InitRule() (err error) { initRules = append(initRules, TbSyntaxRule{ GroupName: "CreateTableRule", RuleName: "DefinerRule", - Expr: "Val in Item ", + Expr: "Val not in Item ", ItemType: ArryItem, - Item: []byte(`["create_function","create_trigger","create_event","create_procedure","create_view"]`), - Desc: "不允许指定definer", - WarnLevel: 0, - Status: true, - }) - - initRules = append(initRules, TbSyntaxRule{ - GroupName: "CreateTableRule", - RuleName: "NormalizedName", - Expr: "Val in Item ", - ItemType: ArryItem, - Item: []byte(`["first_char_exception", "special_char", "Keyword_exception"]`), - Desc: "规范化命名", + Item: []byte(`["ADMIN@localhost"]`), + Desc: "必须指定definer", WarnLevel: 0, Status: true, }) diff --git a/dbm-services/mysql/db-simulation/pkg/util/spider.go b/dbm-services/mysql/db-simulation/pkg/util/spider.go index 4def7af407..b3b247e1d4 100644 --- a/dbm-services/mysql/db-simulation/pkg/util/spider.go +++ b/dbm-services/mysql/db-simulation/pkg/util/spider.go @@ -19,7 +19,7 @@ import ( "dbm-services/common/go-pubpkg/logger" ) -// ParseGetShardKeyForSpider TODO +// ParseGetShardKeyForSpider get shard key from table comment func ParseGetShardKeyForSpider(tableComment string) (string, error) { pos := strings.Index(tableComment, "shard_key") if pos == -1 { @@ -52,7 +52,7 @@ func ParseGetShardKeyForSpider(tableComment string) (string, error) { } len := uint(end - pos) - keyBuf := make([]byte, len+1) + keyBuf := make([]byte, len) copy(keyBuf, tableComment[pos:end]) return string(keyBuf), nil } diff --git a/dbm-services/mysql/db-simulation/router/router.go b/dbm-services/mysql/db-simulation/router/router.go index b8fa0e9063..6166b941ec 100644 --- a/dbm-services/mysql/db-simulation/router/router.go +++ b/dbm-services/mysql/db-simulation/router/router.go @@ -12,6 +12,8 @@ package router import ( + "net/http" + "dbm-services/common/go-pubpkg/logger" "dbm-services/mysql/db-simulation/app/service" "dbm-services/mysql/db-simulation/handler" @@ -21,6 +23,9 @@ import ( // RegisterRouter reg routers func RegisterRouter(engine *gin.Engine) { + engine.Handle("GET", "/ping", func(context *gin.Context) { + context.String(http.StatusOK, "pong") + }) engine.POST("/app/debug", TurnOnDebug) // mysql g := engine.Group("/mysql") diff --git a/dbm-services/mysql/db-simulation/rule.yaml b/dbm-services/mysql/db-simulation/rule.yaml index 27a04b36a6..474d11ca0d 100644 --- a/dbm-services/mysql/db-simulation/rule.yaml +++ b/dbm-services/mysql/db-simulation/rule.yaml @@ -14,60 +14,92 @@ BuiltInRule: CommandRule: HighRiskCommandRule: - expr: ' Val in Item ' - desc: '高危命令' - item: [ "drop_table", "drop_index", "lock_tables", "analyze","rename_table", "drop_procedure", "drop_view", "drop_trigger","drop_function", "drop_server", "drop_event", "drop_compression_dictionary","optimize", "alter_tablespace"] - + expr: " Val in Item " + desc: "高危命令" + item: + [ + "drop_table", + "drop_index", + "lock_tables", + "analyze", + "rename_table", + "drop_procedure", + "drop_view", + "drop_trigger", + "drop_function", + "drop_server", + "drop_event", + "drop_compression_dictionary", + "optimize", + "alter_tablespace", + ] + BanCommandRule: - expr: ' Val in Item ' - desc: '禁用命令' + expr: " Val in Item " + desc: "禁用命令" ban: true - item: ["truncate", "revoke", "kill", "reset", "drop_db","drop_user", "grant","create_user", "revoke_all", "shutdown", "lock_tables_for_backup","reset", "purge", "lock_binlog_for_backup","lock_tables_for_backup","install_plugin", "uninstall_plugin","alter_user"] - + item: + [ + "truncate", + "revoke", + "kill", + "reset", + "drop_db", + "drop_user", + "grant", + "create_user", + "revoke_all", + "shutdown", + "lock_tables_for_backup", + "reset", + "purge", + "lock_binlog_for_backup", + "lock_tables_for_backup", + "install_plugin", + "uninstall_plugin", + "alter_user", + ] CreateTableRule: SuggestBlobColumCount: - expr: ' Val >= Item ' - item: 10 - desc: "建议单表Blob字段不要过多" + expr: " Val >= Item " + item: 10 + desc: "建议单表Blob字段不要过多" SuggestEngine: - expr: ' not (Val contains Item) and ( len(Val) != 0 ) ' - item: 'innodb' - desc: "建议使用Innodb表" + expr: " not (Val contains Item) and ( len(Val) != 0 ) " + item: "innodb" + desc: "建议使用Innodb表" NeedPrimaryKey: - expr: ' Val == Item ' - item: 1 - desc: "建议包含主键" + expr: " Val == Item " + item: 1 + desc: "建议包含主键" DefinerRule: - expr: ' Val in Item ' - desc: '不允许指定definer' - ban: true - item: ["create_function","create_trigger","create_event","create_procedure","create_view"] - NormalizedName: - expr: ' Val in Item ' - desc: '规范化命名' - item: ["first_char_exception", "special_char", "Keyword_exception"] + expr: " Val not in Item " + desc: "definer必须指定用户" + ban: true + item: ["ADMIN@localhost"] AlterTableRule: HighRiskType: - expr: ' Val in Item ' - item: ["drop_column", "drop_key","change_column","rename_table", "rename_key"] + expr: " Val in Item " + item: + ["drop_column", "drop_key", "change_column", "rename_table", "rename_key"] desc: "高危变更类型" HighRiskPkAlterType: - expr: ' Val in Item ' + expr: " Val in Item " item: ["add_column", "add_key", "change_column"] desc: "高危主键变更类型" AlterUseAfter: - expr: ' Val != Item ' + expr: " Val != Item " item: "" desc: "变更表时使用了after" - AddColumnMixed: - expr: ' ( Item in Val ) && ( len(Val) > 1 ) ' - item: 'add_column' + AddColumnMixed: + expr: " ( Item in Val ) && ( len(Val) > 1 ) " + item: "add_column" desc: "加字段和其它alter table 类型混用,可能导致非在线加字段" DmlRule: DmlNotHasWhere: - # expr: ' Val != Item ' - item: true + expr: " Val != Item " + item: true desc: "没有使用WHERE或者LIMIT,可能会导致全表数据更改" diff --git a/dbm-services/mysql/db-simulation/spider_rule.yaml b/dbm-services/mysql/db-simulation/spider_rule.yaml index 641e7edbfd..2cedd1a754 100644 --- a/dbm-services/mysql/db-simulation/spider_rule.yaml +++ b/dbm-services/mysql/db-simulation/spider_rule.yaml @@ -1,43 +1,93 @@ CommandRule: HighRiskCommandRule: - expr: ' Val in Item ' - desc: '高危命令' - item: [ "drop_table", "drop_index", "lock_tables", "analyze","rename_table", "drop_procedure", "drop_view", "drop_trigger","drop_function", "drop_server", "drop_event", "drop_compression_dictionary","optimize", "alter_tablespace"] - + expr: " Val in Item " + desc: "高危命令" + item: + [ + "drop_table", + "drop_index", + "lock_tables", + "analyze", + "rename_table", + "drop_procedure", + "drop_view", + "drop_trigger", + "drop_function", + "drop_server", + "drop_event", + "drop_compression_dictionary", + "optimize", + "alter_tablespace", + ] + BanCommandRule: - expr: ' Val in Item ' - desc: '禁用命令' + expr: " Val in Item " + desc: "禁用命令" ban: true - item: ["truncate", "revoke", "kill", "reset", "drop_db","drop_user", "grant","create_user", "revoke_all", "shutdown", "lock_tables_for_backup","reset", "purge", "lock_binlog_for_backup","lock_tables_for_backup","install_plugin", "uninstall_plugin","alter_user"] + item: + [ + "truncate", + "revoke", + "kill", + "reset", + "drop_db", + "drop_user", + "grant", + "create_user", + "revoke_all", + "shutdown", + "lock_tables_for_backup", + "reset", + "purge", + "lock_binlog_for_backup", + "lock_tables_for_backup", + "install_plugin", + "uninstall_plugin", + "alter_user", + ] SpiderCreateTableRule: - ColChasetNotEqTbChaset: - expr: " Val != Item " - ban: true - item: true - desc: "create table 语句中列字符集定义与表字符集不一致" - CreateWithSelect: - expr: " Val != Item " - ban: true - item: true - desc: "UNSUPPORT SQL CREATE TABLE WITH SELECT" - CreateTbLike: - expr: " Val != Item " - ban: true - item: true - desc: "UNSUPPORT SQL CREATE TABLE LIKE" - ShardKeyNotPk: - expr: " Val != Item " - ban: true - item: true - desc: " CREATE TABLE shard_key 非主键(表存在主键)" - ShardKeyNotIndex: - expr: " Val != Item " - item: true - ban: true - desc: " CREATE TABLE shard_key 非索引键 " - IllegalComment: - expr: " Val != Item " - item: true - ban: true - desc: " 非法的CREATE TABlE的COMMENT " \ No newline at end of file + ColChasetNotEqTbChaset: + turnOn: true + ban: true + desc: "create table 语句中列字符集定义与表字符集不一致" + suggestion: "去掉列字符集" + CreateWithSelect: + turnOn: true + ban: true + desc: "UNSUPPORT SQL CREATE TABLE WITH SELECT" + CreateTbLike: + turnOn: true + ban: true + desc: "UNSUPPORT SQL CREATE TABLE LIKE" + ShardKeyNotPk: + turnOn: true + ban: true + desc: " CREATE TABLE shard_key 非主键" + ShardKeyNotIndex: + turnOn: true + ban: true + desc: "CREATE TABLE shard_key 非索引键" + IllegalComment: + turnOn: true + ban: true + desc: "非法的CREATE TABlE的COMMENT" + NoIndexExists: + turnOn: true + ban: true + desc: "没有任何索引存在" + suggestion: "请添加索引、唯一键或主键" + NoPubColAtMultUniqueIndex: + turnOn: true + ban: true + desc: "用户comment指定了shard_key,存在多个唯一健(含主键),shard_key只能是其中的共同部分" + MustSpecialShardKeyOnlyHaveCommonIndex: + turnOn: true + ban: true + desc: "不存在唯一索引,只包含包含多个普通索引,则必须指定shard_key" + suggestion: "请指定shard_key" + ShardKeyNotNull: + turnOn: true + ban: true + desc: "如果是shard key 不是主键,默认值就一定要指定成 not null" + suggestion: "请指定shard_key列 is not null" diff --git a/dbm-services/mysql/db-tools/dbactuator/.gitignore b/dbm-services/mysql/db-tools/dbactuator/.gitignore index 01b81f4b16..3810e2c293 100644 --- a/dbm-services/mysql/db-tools/dbactuator/.gitignore +++ b/dbm-services/mysql/db-tools/dbactuator/.gitignore @@ -25,4 +25,7 @@ sync_test.sh .vscode/ scripts/upload_media.sh scripts/upload.sh -localtest/ \ No newline at end of file +localtest/ +.codecc +.idea +.vscode \ No newline at end of file diff --git a/dbm-services/mysql/db-tools/dbactuator/Makefile b/dbm-services/mysql/db-tools/dbactuator/Makefile index 6410406eb9..f5e0ed8904 100644 --- a/dbm-services/mysql/db-tools/dbactuator/Makefile +++ b/dbm-services/mysql/db-tools/dbactuator/Makefile @@ -23,9 +23,6 @@ mini: clean: cd ${BASE_DIR}/build && rm -rf ${APPNAME} -rotatebinlog: - cd ${BASE_DIR}/cmd/rotatebinlog && CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -ldflags ${BUILD_FLAG} -o $(BASE_DIR)/build/rotatebinlog -v . - gotool: @-gofmt -w . diff --git a/dbm-services/mysql/db-tools/dbactuator/docs/swagger.json b/dbm-services/mysql/db-tools/dbactuator/docs/swagger.json index dc9d750987..c2b84f2544 100644 --- a/dbm-services/mysql/db-tools/dbactuator/docs/swagger.json +++ b/dbm-services/mysql/db-tools/dbactuator/docs/swagger.json @@ -482,6 +482,68 @@ "responses": {} } }, + "/mysql/oscmd-run": { + "post": { + "description": "执行os简单命令", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "执行os简单命令", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp" + } + } + } + } + }, + "/mysql/osinfo-get": { + "post": { + "description": "获取 os 内存、cpu、目录/磁盘 信息", + "consumes": [ + "application/json" + ], + "tags": [ + "mysql" + ], + "summary": "获取 os 内存、cpu、目录/磁盘 信息", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoGetComp" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoResult" + } + } + } + } + }, "/mysql/parse-binlog-time": { "post": { "description": "获取 binlog FileDescriptionFormat 和 RotateEvent 事件", @@ -585,7 +647,7 @@ } } }, - "/mysql/semantic-check": { + "/mysql/semantic-dumpschema": { "post": { "description": "运行语义检查", "consumes": [ @@ -605,26 +667,47 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticCheckComp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp" } } ], "responses": {} } }, - "/mysql/semantic-dumpschema": { + "/spdierctl/deploy": { "post": { - "description": "运行语义检查", + "description": "部署 spider ctl 实例说明", "consumes": [ "application/json" ], - "produces": [ + "tags": [ + "spiderctl" + ], + "summary": "部署 spider ctl 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" + } + } + ], + "responses": {} + } + }, + "/spider/deploy": { + "post": { + "description": "部署 spider 实例说明", + "consumes": [ "application/json" ], "tags": [ - "mysql" + "spider" ], - "summary": "运行语义检查", + "summary": "部署 spider 实例", "parameters": [ { "description": "short description", @@ -632,23 +715,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" } } ], "responses": {} } }, - "/spdierctl/deploy": { + "/spiderctl/schema-check": { "post": { - "description": "部署 spider ctl 实例说明", + "description": "spider 集群表结构校验", "consumes": [ "application/json" ], "tags": [ "spiderctl" ], - "summary": "部署 spider ctl 实例", + "summary": "spider 集群表结构校验", "parameters": [ { "description": "short description", @@ -656,23 +739,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckComp" } } ], "responses": {} } }, - "/spider/deploy": { + "/spiderctl/schema-repair": { "post": { - "description": "部署 spider 实例说明", + "description": "spider 集群表结构修复", "consumes": [ "application/json" ], "tags": [ - "spider" + "spiderctl" ], - "summary": "部署 spider 实例", + "summary": "spider 集群表结构修复", "parameters": [ { "description": "short description", @@ -680,7 +763,82 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/deploy": { + "post": { + "description": "部署 tbinlogdumper 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "部署 tbinlogdumper 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/semantic-dumpschema": { + "post": { + "description": "备份表结构并导入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "备份表结构并导入", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp" + } + } + ], + "responses": {} + } + }, + "/tbinlogdumper/uninstall": { + "post": { + "description": "卸载 tbinlogdumper 实例说明", + "consumes": [ + "application/json" + ], + "tags": [ + "tbinlogdumper" + ], + "summary": "卸载 tbinlogdumper 实例", + "parameters": [ + { + "description": "short description", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp" } } ], @@ -689,6 +847,87 @@ } }, "definitions": { + "cmutil.CPUInfo": { + "type": "object", + "properties": { + "cores_logical": { + "type": "integer" + } + } + }, + "cmutil.DiskPartInfo": { + "type": "object", + "properties": { + "device": { + "type": "string" + }, + "free": { + "description": "Free 真实可用量,不包括 fs reserved 部分,相当于 available", + "type": "integer" + }, + "fstype": { + "type": "string" + }, + "inodes_total": { + "description": "UsedPercentReal Used / (Total - Reserved), stat.UsedPercent\nUsedPercentReal float64 `json:\"used_percent_real\"`", + "type": "integer" + }, + "inodes_used": { + "type": "integer" + }, + "inodes_used_percent": { + "type": "number" + }, + "mountpoint": { + "type": "string" + }, + "path": { + "type": "string" + }, + "reserved": { + "description": "Reserved = Total - Free - Used", + "type": "integer" + }, + "total": { + "type": "integer" + }, + "used": { + "description": "Used 真实使用量, 不包含 fs reserved", + "type": "integer" + }, + "used_percent": { + "description": "UsedPercent 在os层面看到的磁盘利用率,包括 reserved (Used + Reserved) / Total", + "type": "number" + }, + "used_total": { + "description": "UsedTotal 总使用量,Used + Reserved", + "type": "integer" + } + } + }, + "cmutil.MemoryInfo": { + "type": "object", + "properties": { + "buffer": { + "type": "integer" + }, + "free": { + "type": "integer" + }, + "shared": { + "type": "integer" + }, + "swap_free": { + "type": "integer" + }, + "swap_total": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, "dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam": { "type": "object", "properties": { @@ -1086,7 +1325,7 @@ "dest_ip": { "description": "目标IP,文件恢复到哪一台机器上的", "type": "string", - "example": "127.0.0.1" + "example": "1.1.1.1" }, "diretory": { "description": "diretory 是备份系统参数错误拼写", @@ -1226,7 +1465,7 @@ ], "properties": { "acls": { - "description": "访问来源限制,从前往后匹配。格式 `[\"allow 127.0.0.1/32\", \"deny all\"]`", + "description": "访问来源限制,从前往后匹配。格式 `[\"allow 1.1.1.1/32\", \"deny all\"]`", "type": "array", "items": { "type": "string" @@ -1282,6 +1521,27 @@ } } }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount": { + "type": "object", + "required": [ + "pwd", + "user" + ], + "properties": { + "access_hosts": { + "type": "array", + "items": { + "type": "string" + } + }, + "pwd": { + "type": "string" + }, + "user": { + "type": "string" + } + } + }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions": { "type": "object", "required": [ @@ -1309,10 +1569,10 @@ } }, "Master": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption" }, "Slave": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption" } } }, @@ -1504,27 +1764,6 @@ } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount": { - "type": "object", - "required": [ - "pwd", - "user" - ], - "properties": { - "access_hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "pwd": { - "type": "string" - }, - "user": { - "type": "string" - } - } - }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam": { "type": "object", "required": [ @@ -1565,35 +1804,12 @@ } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ExcuteSQLFileObj": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer": { "type": "object", "properties": { - "dbnames": { - "description": "需要变更的DBNames,支持模糊匹配", - "type": "array", - "items": { - "type": "string" - } - }, - "ignore_dbnames": { - "description": "忽略的,需要排除变更的dbName,支持模糊匹配", - "type": "array", - "items": { - "type": "string" - } - }, - "sql_file": { - "description": "变更文件名称", - "type": "string" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer": { - "type": "object", - "properties": { - "bucket": { - "description": "目标bucket", - "type": "string" + "bucket": { + "description": "目标bucket", + "type": "string" }, "password": { "description": "制品库 password", @@ -1778,7 +1994,7 @@ "type": "string" }, "dbha_account": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount" }, "host": { "type": "string" @@ -1820,7 +2036,7 @@ } }, "super_account": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount" } } }, @@ -1850,11 +2066,11 @@ "properties": { "bk_biz_id": { "description": "bkbizid", - "type": "string" + "type": "integer" }, "bk_cloud_id": { "description": "bk_cloud_id", - "type": "string" + "type": "integer" }, "cluster_address": { "description": "cluster addresss", @@ -1870,13 +2086,18 @@ "type": "integer" } }, + "cluster_type": { + "type": "string" + }, "configs": { - "description": "模板配置", - "allOf": [ - { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.Cnf" + "description": "Configs BackupConfig", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" } - ] + } }, "exec_user": { "description": "执行Job的用户", @@ -1912,6 +2133,17 @@ "role": { "description": "当前主机安装的mysqld的角色", "type": "string" + }, + "shard_value": { + "description": "shard value for spider", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "untar_only": { + "description": "只解压,不校验不渲染配置,不连接 db", + "type": "boolean" } } }, @@ -1928,6 +2160,9 @@ "cluster_id": { "type": "integer" }, + "db_module_id": { + "type": "integer" + }, "immute_domain": { "type": "string" }, @@ -1963,7 +2198,7 @@ "type": "string" }, "bk_biz_id": { - "type": "string" + "type": "integer" }, "cluster_id": { "type": "integer" @@ -2108,6 +2343,83 @@ } } }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp": { + "type": "object", + "properties": { + "code": { + "description": "Code 只要有一个命令执行出错即退出,错误码 1。正常执行 code=0", + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult" + } + }, + "message": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds": { + "type": "object", + "required": [ + "cmds" + ], + "properties": { + "cmds": { + "description": "Cmds 命令按顺序执行,每个命令完全独立", + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd" + } + }, + "work_dir": { + "description": "WorkDir 会应用到每个命令", + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoGetComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoParam": { + "type": "object", + "properties": { + "directory": { + "description": "Directory default [/ /data /data1 /data2]", + "type": "array", + "items": { + "type": "string" + } + }, + "no_check_device": { + "type": "boolean" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoResult": { + "type": "object", + "properties": { + "cpu": { + "$ref": "#/definitions/cmutil.CPUInfo" + }, + "disk": { + "type": "array", + "items": { + "$ref": "#/definitions/cmutil.DiskPartInfo" + } + }, + "mem": { + "$ref": "#/definitions/cmutil.MemoryInfo" + } + } + }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp": { "type": "object", "properties": { @@ -2206,17 +2518,6 @@ } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticCheckComp": { - "type": "object", - "properties": { - "extend": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SenmanticCheckParam" - }, - "general": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" - } - } - }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp": { "type": "object", "properties": { @@ -2228,42 +2529,52 @@ } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SenmanticCheckParam": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd": { "type": "object", "required": [ - "host", - "port", - "remote_host", - "remote_port", - "schemafile" + "cmd_name" ], "properties": { - "execute_objects": { + "cmd_args": { + "description": "CmdArgs 参数列表", "type": "array", "items": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ExcuteSQLFileObj" + "type": "string" } }, - "host": { - "description": "语义检查实例的主机地址", + "cmd_name": { + "type": "string", + "enum": [ + "mkdir", + "ls", + "cd", + "chown", + "chmod", + "du", + "df", + "head", + "tail", + "grep" + ] + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult": { + "type": "object", + "properties": { + "cmd_line": { + "description": "CmdLine 渲染的命令", "type": "string" }, - "port": { - "description": "语义检查实例的端口", - "type": "integer", - "minimum": 3306 - }, - "remote_host": { - "description": "用于获取目标实例的字符集,默认存储引擎", + "cmd_stderr": { + "description": "CmdStderr 命令执行错误输出", "type": "string" }, - "remote_port": { - "description": "获取表结构的源实例Port", - "type": "integer", - "minimum": 3306 + "cmd_stdout": { + "description": "CmdStdout 命令执行标准输出", + "type": "string" }, - "schemafile": { - "description": "表结构文件", + "err_msg": { "type": "string" } } @@ -2285,200 +2596,30 @@ } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam": { "type": "object", "required": [ - "pwd", - "user" - ], - "properties": { - "access_hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "pwd": { - "type": "string" - }, - "user": { - "type": "string" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.Cnf": { - "type": "object", - "required": [ - "BackupClient", - "LogicalBackup", - "Public" + "host", + "ports" ], "properties": { - "BackupClient": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfBackupClient" - }, - "LogicalBackup": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfLogicalBackup" - }, - "PhysicalBackup": { - "description": "LogicalLoad CnfLogicalLoad `json:\"LogicalLoad\" ini:\"LogicalLoad\"`", - "allOf": [ - { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfPhysicalBackup" - } - ] - }, - "Public": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfShared" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfBackupClient": { - "type": "object", - "properties": { - "doChecksum": { - "type": "string" - }, - "fileTag": { - "type": "string" - }, - "remoteFileSystem": { - "type": "string" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfLogicalBackup": { - "type": "object", - "properties": { - "chunkFilesize": { - "description": "ChunkFilesize Split tables into chunks of this output file size. This value is in MB", - "type": "integer" - }, - "defaultsFile": { - "type": "string" - }, - "disableCompress": { + "force": { + "description": "是否强制下架mysqld", "type": "boolean" }, - "extraOpt": { - "description": "ExtraOpt other mydumper options string to be appended", - "type": "string" - }, - "flushRetryCount": { - "type": "integer" - }, - "regex": { - "type": "string" - }, - "threads": { - "type": "integer" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfPhysicalBackup": { - "type": "object", - "required": [ - "defaultsFile" - ], - "properties": { - "defaultsFile": { - "type": "string" - }, - "extraOpt": { - "description": "ExtraOpt other xtrabackup options string to be appended", - "type": "string" - }, - "splitSpeed": { - "description": "SplitSpeed tar split limit in MB/s, default 300", - "type": "integer" - }, - "threads": { - "description": "Threads –parallel to copy files", - "type": "integer" - }, - "throttle": { - "description": "Throttle limits the number of chunks copied per second. The chunk size is 10 MB, 0 means no limit", - "type": "integer" - } - } - }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfShared": { - "type": "object", - "required": [ - "backupDir", - "backupTimeOut", - "tarSizeThreshold" - ], - "properties": { - "backupDir": { - "type": "string" - }, - "backupId": { - "type": "string" - }, - "backupTimeOut": { - "type": "string" - }, - "backupType": { - "type": "string" - }, - "billId": { - "type": "string" - }, - "bkBizId": { - "type": "string" - }, - "bkCloudId": { - "type": "string" - }, - "clusterAddress": { - "type": "string" - }, - "clusterId": { - "type": "string" - }, - "dataSchemaGrant": { - "type": "string" - }, - "iolimitMBPerSec": { - "description": "IOLimitMBPerSec tar or split default io limit, mb/s. 0 means no limit", - "type": "integer" - }, - "mysqlCharset": { - "type": "string" - }, - "mysqlHost": { - "type": "string" - }, - "mysqlPasswd": { - "type": "string" - }, - "mysqlPort": { - "type": "string" - }, - "mysqlRole": { - "type": "string" - }, - "mysqlUser": { - "type": "string" - }, - "oldFileLeftDay": { - "type": "string" - }, - "resultReportPath": { - "type": "string" - }, - "statusReportPath": { + "host": { "type": "string" }, - "tarSizeThreshold": { - "description": "TarSizeThreshold tar file will be split to this package size. MB", - "type": "integer", - "minimum": 128 + "ports": { + "description": "被监控机器的上所有需要监控的端口", + "type": "array", + "items": { + "type": "integer" + } } } }, - "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption": { + "dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption": { "type": "object", "properties": { "DataSchemaGrant": { @@ -2745,6 +2886,10 @@ "type": "string" } }, + "enable_binlog": { + "description": "EnableBinlog 导入数据时是否写binlog,默认不启用", + "type": "boolean" + }, "ignore_databases": { "type": "array", "items": { @@ -2818,7 +2963,7 @@ ] }, "src_instance": { - "description": "备份实例的 ip port,用于生产 change master 语句", + "description": "备份实例的 ip port,用于生产 change master 语句。如果 host 为空,表示不检查、不生成change master,恢复spider节点时使用", "allOf": [ { "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance" @@ -2953,6 +3098,24 @@ } } }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.CheckObject": { + "type": "object", + "required": [ + "dbname", + "tables" + ], + "properties": { + "dbname": { + "type": "string" + }, + "tables": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp": { "type": "object", "properties": { @@ -2969,9 +3132,11 @@ "required": [ "ctl_instances", "host", - "mysql_instances", + "mysql_instance_tuples", "port", - "spider_instances" + "spider_instances", + "tdbctl_pass", + "tdbctl_user" ], "properties": { "ctl_instances": { @@ -2983,10 +3148,10 @@ "host": { "type": "string" }, - "mysql_instances": { + "mysql_instance_tuples": { "type": "array", "items": { - "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance" + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple" } }, "port": { @@ -2998,11 +3163,42 @@ "items": { "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance" } + }, + "tdbctl_pass": { + "type": "string" + }, + "tdbctl_user": { + "type": "string" } } }, "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance": { "type": "object", + "required": [ + "host", + "port" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "minimum": 3306 + }, + "shard_id": { + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple": { + "type": "object", + "required": [ + "host", + "port", + "shard_id", + "slave_host" + ], "properties": { "host": { "type": "string" @@ -3012,6 +3208,228 @@ }, "shard_id": { "type": "integer" + }, + "slave_host": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckComp": { + "type": "object", + "properties": { + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "params": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckParam": { + "type": "object", + "required": [ + "check_objects", + "host", + "port" + ], + "properties": { + "check_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.CheckObject" + } + }, + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "minimum": 3306 + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairComp": { + "type": "object", + "properties": { + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "params": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairParam": { + "type": "object", + "required": [ + "host", + "port" + ], + "properties": { + "auto_fix": { + "type": "boolean" + }, + "db": { + "description": "必须指定一个待修复的库", + "type": "string" + }, + "dry_run": { + "type": "boolean" + }, + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "minimum": 3306 + }, + "tables": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs": { + "type": "object", + "required": [ + "dumper_configs" + ], + "properties": { + "dumper_configs": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp": { + "type": "object", + "properties": { + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam": { + "type": "object", + "required": [ + "charset", + "host", + "port", + "tbinlogdumper_port" + ], + "properties": { + "charset": { + "description": "字符集参数", + "type": "string" + }, + "host": { + "description": "当前实例的主机地址", + "type": "string" + }, + "port": { + "description": "当前实例的端口", + "type": "integer", + "minimum": 3306 + }, + "tbinlogdumper_port": { + "description": "当前TBinlogdumperPort实例的端口", + "type": "integer", + "minimum": 3306 + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams": { + "type": "object", + "properties": { + "area_name": { + "type": "string" + }, + "dumper_id": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp": { + "type": "object", + "properties": { + "dumperConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams" + } + }, + "extend": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs" + }, + "general": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "renderConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs" + } + }, + "timeZone": { + "type": "string" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld": { + "type": "object", + "properties": { + "area_name": { + "type": "string" + }, + "basedir": { + "type": "string" + }, + "bind-address": { + "type": "string" + }, + "character_set_server": { + "type": "string" + }, + "datadir": { + "type": "string" + }, + "dumper_id": { + "type": "string" + }, + "logdir": { + "type": "string" + }, + "port": { + "type": "string" + }, + "server_id": { + "type": "integer" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp": { + "type": "object", + "properties": { + "generalParam": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam" + }, + "params": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam" + } + } + }, + "dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs": { + "type": "object", + "properties": { + "mysqld": { + "$ref": "#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld" } } }, @@ -3065,7 +3483,7 @@ "host": { "description": "当前实例的主机地址", "type": "string", - "example": "127.0.0.1" + "example": "1.1.1.1" }, "port": { "description": "当前实例的端口", diff --git a/dbm-services/mysql/db-tools/dbactuator/docs/swagger.yaml b/dbm-services/mysql/db-tools/dbactuator/docs/swagger.yaml index e6b8ef78c9..a3a9cefc98 100644 --- a/dbm-services/mysql/db-tools/dbactuator/docs/swagger.yaml +++ b/dbm-services/mysql/db-tools/dbactuator/docs/swagger.yaml @@ -1,5 +1,62 @@ basePath: / definitions: + cmutil.CPUInfo: + properties: + cores_logical: + type: integer + type: object + cmutil.DiskPartInfo: + properties: + device: + type: string + free: + description: Free 真实可用量,不包括 fs reserved 部分,相当于 available + type: integer + fstype: + type: string + inodes_total: + description: |- + UsedPercentReal Used / (Total - Reserved), stat.UsedPercent + UsedPercentReal float64 `json:"used_percent_real"` + type: integer + inodes_used: + type: integer + inodes_used_percent: + type: number + mountpoint: + type: string + path: + type: string + reserved: + description: Reserved = Total - Free - Used + type: integer + total: + type: integer + used: + description: Used 真实使用量, 不包含 fs reserved + type: integer + used_percent: + description: UsedPercent 在os层面看到的磁盘利用率,包括 reserved (Used + Reserved) / Total + type: number + used_total: + description: UsedTotal 总使用量,Used + Reserved + type: integer + type: object + cmutil.MemoryInfo: + properties: + buffer: + type: integer + free: + type: integer + shared: + type: integer + swap_free: + type: integer + swap_total: + type: integer + total: + type: integer + type: object dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam: properties: runtime_account: @@ -275,7 +332,7 @@ definitions: properties: dest_ip: description: 目标IP,文件恢复到哪一台机器上的 - example: 127.0.0.1 + example: 1.1.1.1 type: string diretory: description: diretory 是备份系统参数错误拼写 @@ -375,7 +432,7 @@ definitions: dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer: properties: acls: - description: 访问来源限制,从前往后匹配。格式 `["allow 127.0.0.1/32", "deny all"]` + description: 访问来源限制,从前往后匹配。格式 `["allow 1.1.1.1/32", "deny all"]` example: - allow all items: @@ -420,6 +477,20 @@ definitions: extend: $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_fileserver.FileServer' type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount: + properties: + access_hosts: + items: + type: string + type: array + pwd: + type: string + user: + type: string + required: + - pwd + - user + type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.BackupOptions: properties: BackupType: @@ -435,9 +506,9 @@ definitions: type: string type: object Master: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption' Slave: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption' required: - BackupType - CrontabTime @@ -575,20 +646,6 @@ definitions: required: - op_type type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount: - properties: - access_hosts: - items: - type: string - type: array - pwd: - type: string - user: - type: string - required: - - pwd - - user - type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DumpSchemaParam: properties: backup_dir: @@ -618,22 +675,6 @@ definitions: - host - port type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ExcuteSQLFileObj: - properties: - dbnames: - description: 需要变更的DBNames,支持模糊匹配 - items: - type: string - type: array - ignore_dbnames: - description: 忽略的,需要排除变更的dbName,支持模糊匹配 - items: - type: string - type: array - sql_file: - description: 变更文件名称 - type: string - type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.FileServer: properties: bucket: @@ -757,7 +798,7 @@ definitions: description: 字符集参数 type: string dbha_account: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.DBHAAccount' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount' host: type: string inst_mem: @@ -787,7 +828,7 @@ definitions: type: integer type: array super_account: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.AdditionalAccount' required: - charset - host @@ -808,10 +849,10 @@ definitions: properties: bk_biz_id: description: bkbizid - type: string + type: integer bk_cloud_id: description: bk_cloud_id - type: string + type: integer cluster_address: additionalProperties: type: string @@ -822,10 +863,15 @@ definitions: type: integer description: cluster id type: object + cluster_type: + type: string configs: - allOf: - - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.Cnf' - description: 模板配置 + additionalProperties: + additionalProperties: + type: string + type: object + description: Configs BackupConfig + type: object exec_user: description: 执行Job的用户 type: string @@ -850,6 +896,14 @@ definitions: role: description: 当前主机安装的mysqld的角色 type: string + shard_value: + additionalProperties: + type: integer + description: shard value for spider + type: object + untar_only: + description: 只解压,不校验不渲染配置,不连接 db + type: boolean required: - bk_biz_id - configs @@ -869,6 +923,8 @@ definitions: type: integer cluster_id: type: integer + db_module_id: + type: integer immute_domain: type: string ip: @@ -893,7 +949,7 @@ definitions: bill_id: type: string bk_biz_id: - type: string + type: integer cluster_id: type: integer data_schema_grant: @@ -998,6 +1054,57 @@ definitions: - src_instance - tgt_instance type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp: + properties: + code: + description: Code 只要有一个命令执行出错即退出,错误码 1。正常执行 code=0 + type: integer + data: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult' + type: array + message: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds: + properties: + cmds: + description: Cmds 命令按顺序执行,每个命令完全独立 + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd' + type: array + work_dir: + description: WorkDir 会应用到每个命令 + type: string + required: + - cmds + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoGetComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoParam: + properties: + directory: + description: Directory default [/ /data /data1 /data2] + items: + type: string + type: array + no_check_device: + type: boolean + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoResult: + properties: + cpu: + $ref: '#/definitions/cmutil.CPUInfo' + disk: + items: + $ref: '#/definitions/cmutil.DiskPartInfo' + type: array + mem: + $ref: '#/definitions/cmutil.MemoryInfo' + type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.PtTableChecksumComp: properties: extend: @@ -1068,13 +1175,6 @@ definitions: type: string type: array type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticCheckComp: - properties: - extend: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SenmanticCheckParam' - general: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' - type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp: properties: extend: @@ -1082,35 +1182,42 @@ definitions: general: $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SenmanticCheckParam: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmd: properties: - execute_objects: + cmd_args: + description: CmdArgs 参数列表 items: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.ExcuteSQLFileObj' + type: string type: array - host: - description: 语义检查实例的主机地址 + cmd_name: + enum: + - mkdir + - ls + - cd + - chown + - chmod + - du + - df + - head + - tail + - grep type: string - port: - description: 语义检查实例的端口 - minimum: 3306 - type: integer - remote_host: - description: 用于获取目标实例的字符集,默认存储引擎 + required: + - cmd_name + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SimpleCmdResult: + properties: + cmd_line: + description: CmdLine 渲染的命令 type: string - remote_port: - description: 获取表结构的源实例Port - minimum: 3306 - type: integer - schemafile: - description: 表结构文件 + cmd_stderr: + description: CmdStderr 命令执行错误输出 + type: string + cmd_stdout: + description: CmdStdout 命令执行标准输出 + type: string + err_msg: type: string - required: - - host - - port - - remote_host - - remote_port - - schemafile type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SlaveInfo: properties: @@ -1124,142 +1231,23 @@ definitions: description: slave port type: integer type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SuperAccount: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam: properties: - access_hosts: - items: - type: string - type: array - pwd: - type: string - user: - type: string - required: - - pwd - - user - type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.Cnf: - properties: - BackupClient: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfBackupClient' - LogicalBackup: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfLogicalBackup' - PhysicalBackup: - allOf: - - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfPhysicalBackup' - description: LogicalLoad CnfLogicalLoad `json:"LogicalLoad" - ini:"LogicalLoad"` - Public: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfShared' - required: - - BackupClient - - LogicalBackup - - Public - type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfBackupClient: - properties: - doChecksum: - type: string - fileTag: - type: string - remoteFileSystem: - type: string - type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfLogicalBackup: - properties: - chunkFilesize: - description: ChunkFilesize Split tables into chunks of this output file size. - This value is in MB - type: integer - defaultsFile: - type: string - disableCompress: + force: + description: 是否强制下架mysqld type: boolean - extraOpt: - description: ExtraOpt other mydumper options string to be appended - type: string - flushRetryCount: - type: integer - regex: - type: string - threads: - type: integer - type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfPhysicalBackup: - properties: - defaultsFile: - type: string - extraOpt: - description: ExtraOpt other xtrabackup options string to be appended - type: string - splitSpeed: - description: SplitSpeed tar split limit in MB/s, default 300 - type: integer - threads: - description: Threads –parallel to copy files - type: integer - throttle: - description: Throttle limits the number of chunks copied per second. The chunk - size is 10 MB, 0 means no limit - type: integer - required: - - defaultsFile - type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.CnfShared: - properties: - backupDir: - type: string - backupId: - type: string - backupTimeOut: - type: string - backupType: - type: string - billId: - type: string - bkBizId: - type: string - bkCloudId: - type: string - clusterAddress: - type: string - clusterId: - type: string - dataSchemaGrant: - type: string - iolimitMBPerSec: - description: IOLimitMBPerSec tar or split default io limit, mb/s. 0 means - no limit - type: integer - mysqlCharset: - type: string - mysqlHost: - type: string - mysqlPasswd: - type: string - mysqlPort: - type: string - mysqlRole: - type: string - mysqlUser: - type: string - oldFileLeftDay: - type: string - resultReportPath: - type: string - statusReportPath: + host: type: string - tarSizeThreshold: - description: TarSizeThreshold tar file will be split to this package size. - MB - minimum: 128 - type: integer + ports: + description: 被监控机器的上所有需要监控的端口 + items: + type: integer + type: array required: - - backupDir - - backupTimeOut - - tarSizeThreshold + - host + - ports type: object - dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql_dbbackup.LogicBackupDataOption: + dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.logicBackupDataOption: properties: DataSchemaGrant: description: '"grant,schema,data"' @@ -1452,6 +1440,9 @@ definitions: items: type: string type: array + enable_binlog: + description: EnableBinlog 导入数据时是否写binlog,默认不启用 + type: boolean ignore_databases: items: type: string @@ -1505,7 +1496,8 @@ definitions: src_instance: allOf: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.Instance' - description: 备份实例的 ip port,用于生产 change master 语句 + description: 备份实例的 ip port,用于生产 change master 语句。如果 host 为空,表示不检查、不生成change + master,恢复spider节点时使用 tgt_instance: allOf: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_native.InsObject' @@ -1597,6 +1589,18 @@ definitions: type: string type: array type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.CheckObject: + properties: + dbname: + type: string + tables: + items: + type: string + type: array + required: + - dbname + - tables + type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InitClusterRoutingComp: properties: extend: @@ -1612,9 +1616,9 @@ definitions: type: array host: type: string - mysql_instances: + mysql_instance_tuples: items: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple' type: array port: minimum: 3306 @@ -1623,14 +1627,33 @@ definitions: items: $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance' type: array + tdbctl_pass: + type: string + tdbctl_user: + type: string required: - ctl_instances - host - - mysql_instances + - mysql_instance_tuples - port - spider_instances + - tdbctl_pass + - tdbctl_user type: object dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.Instance: + properties: + host: + type: string + port: + minimum: 3306 + type: integer + shard_id: + type: integer + required: + - host + - port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.InstanceTuple: properties: host: type: string @@ -1638,6 +1661,160 @@ definitions: type: integer shard_id: type: integer + slave_host: + type: string + required: + - host + - port + - shard_id + - slave_host + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckComp: + properties: + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + params: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckParam: + properties: + check_objects: + items: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.CheckObject' + type: array + host: + type: string + port: + minimum: 3306 + type: integer + required: + - check_objects + - host + - port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairComp: + properties: + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + params: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairParam: + properties: + auto_fix: + type: boolean + db: + description: 必须指定一个待修复的库 + type: string + dry_run: + type: boolean + host: + type: string + port: + minimum: 3306 + type: integer + tables: + items: + type: string + type: array + required: + - host + - port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs: + properties: + dumper_configs: + items: + type: integer + type: array + required: + - dumper_configs + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp: + properties: + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaParam: + properties: + charset: + description: 字符集参数 + type: string + host: + description: 当前实例的主机地址 + type: string + port: + description: 当前实例的端口 + minimum: 3306 + type: integer + tbinlogdumper_port: + description: 当前TBinlogdumperPort实例的端口 + minimum: 3306 + type: integer + required: + - charset + - host + - port + - tbinlogdumper_port + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams: + properties: + area_name: + type: string + dumper_id: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp: + properties: + dumperConfigs: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumperParams' + type: object + extend: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Configs' + general: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + renderConfigs: + additionalProperties: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs' + type: object + timeZone: + type: string + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld: + properties: + area_name: + type: string + basedir: + type: string + bind-address: + type: string + character_set_server: + type: string + datadir: + type: string + dumper_id: + type: string + logdir: + type: string + port: + type: string + server_id: + type: integer + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp: + properties: + generalParam: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components.GeneralParam' + params: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.UnInstallMySQLParam' + type: object + dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.renderDumperConfigs: + properties: + mysqld: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.Mysqld' type: object dbm-services_mysql_db-tools_dbactuator_pkg_native.DbWorker: properties: @@ -1674,7 +1851,7 @@ definitions: properties: host: description: 当前实例的主机地址 - example: 127.0.0.1 + example: 1.1.1.1 type: string port: description: 当前实例的端口 @@ -2082,6 +2259,46 @@ paths: summary: 从源实例克隆 my.cnf 部分参数到目标实例 tags: - mysql + /mysql/oscmd-run: + post: + consumes: + - application/json + description: 执行os简单命令 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmds' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSCmdRunResp' + summary: 执行os简单命令 + tags: + - mysql + /mysql/osinfo-get: + post: + consumes: + - application/json + description: 获取 os 内存、cpu、目录/磁盘 信息 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoGetComp' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.OSInfoResult' + summary: 获取 os 内存、cpu、目录/磁盘 信息 + tags: + - mysql /mysql/parse-binlog-time: post: consumes: @@ -2150,7 +2367,7 @@ paths: summary: 备份恢复 tags: - mysql - /mysql/semantic-check: + /mysql/semantic-dumpschema: post: consumes: - application/json @@ -2161,36 +2378,34 @@ paths: name: body required: true schema: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticCheckComp' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp' produces: - application/json responses: {} summary: 运行语义检查 tags: - mysql - /mysql/semantic-dumpschema: + /spdierctl/deploy: post: consumes: - application/json - description: 运行语义检查 + description: 部署 spider ctl 实例说明 parameters: - description: short description in: body name: body required: true schema: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.SemanticDumpSchemaComp' - produces: - - application/json + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' responses: {} - summary: 运行语义检查 + summary: 部署 spider ctl 实例 tags: - - mysql - /spdierctl/deploy: + - spiderctl + /spider/deploy: post: consumes: - application/json - description: 部署 spider ctl 实例说明 + description: 部署 spider 实例说明 parameters: - description: short description in: body @@ -2199,25 +2414,91 @@ paths: schema: $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' responses: {} - summary: 部署 spider ctl 实例 + summary: 部署 spider 实例 + tags: + - spider + /spiderctl/schema-check: + post: + consumes: + - application/json + description: spider 集群表结构校验 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaCheckComp' + responses: {} + summary: spider 集群表结构校验 tags: - spiderctl - /spider/deploy: + /spiderctl/schema-repair: post: consumes: - application/json - description: 部署 spider 实例说明 + description: spider 集群表结构修复 parameters: - description: short description in: body name: body required: true schema: - $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_mysql.InstallMySQLComp' + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_spiderctl.TableSchemaRepairComp' responses: {} - summary: 部署 spider 实例 + summary: spider 集群表结构修复 tags: - - spider + - spiderctl + /tbinlogdumper/deploy: + post: + consumes: + - application/json + description: 部署 tbinlogdumper 实例说明 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.InstallTbinlogDumperComp' + responses: {} + summary: 部署 tbinlogdumper 实例 + tags: + - tbinlogdumper + /tbinlogdumper/semantic-dumpschema: + post: + consumes: + - application/json + description: 备份表结构并导入 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.DumpSchemaComp' + produces: + - application/json + responses: {} + summary: 备份表结构并导入 + tags: + - tbinlogdumper + /tbinlogdumper/uninstall: + post: + consumes: + - application/json + description: 卸载 tbinlogdumper 实例说明 + parameters: + - description: short description + in: body + name: body + required: true + schema: + $ref: '#/definitions/dbm-services_mysql_db-tools_dbactuator_pkg_components_tbinlogdumper.UnInstallTbinlogDumperComp' + responses: {} + summary: 卸载 tbinlogdumper 实例 + tags: + - tbinlogdumper schemes: - http swagger: "2.0" diff --git a/dbm-services/mysql/db-tools/dbactuator/go.mod b/dbm-services/mysql/db-tools/dbactuator/go.mod index e609e63e41..c7088dff35 100644 --- a/dbm-services/mysql/db-tools/dbactuator/go.mod +++ b/dbm-services/mysql/db-tools/dbactuator/go.mod @@ -1,9 +1,9 @@ module dbm-services/mysql/db-tools/dbactuator -go 1.19 +go 1.21 require ( - ariga.io/atlas v0.13.1 + ariga.io/atlas v0.14.0 github.com/BurntSushi/toml v1.3.2 github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 github.com/dustin/go-humanize v1.0.1 @@ -11,60 +11,58 @@ require ( github.com/jmoiron/sqlx v1.3.5 github.com/mitchellh/go-ps v1.0.0 github.com/pkg/errors v0.9.1 - github.com/shirou/gopsutil/v3 v3.23.2 + github.com/shirou/gopsutil/v3 v3.23.8 github.com/spf13/cobra v1.7.0 - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 gopkg.in/ini.v1 v1.67.0 ) require ( - github.com/agext/levenshtein v1.2.1 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/inflect v0.19.0 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect - github.com/hashicorp/hcl/v2 v2.10.0 // indirect + github.com/gopherjs/gopherjs v1.17.2 // indirect + github.com/hashicorp/hcl/v2 v2.18.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/kr/fs v0.1.0 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/lib/pq v1.10.0 // indirect - github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect - github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect - github.com/smartystreets/assertions v1.2.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/smarty/assertions v1.15.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - github.com/zclconf/go-cty v1.8.0 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/zclconf/go-cty v1.14.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) require ( github.com/MakeNowJust/heredoc v1.0.0 github.com/caarlos0/env/v6 v6.10.1 - github.com/dlclark/regexp2 v1.8.1 + github.com/dlclark/regexp2 v1.10.0 github.com/ghodss/yaml v1.0.0 - github.com/gofrs/flock v0.8.1 - github.com/golang-jwt/jwt/v4 v4.4.2 + github.com/golang-jwt/jwt/v4 v4.5.0 github.com/hashicorp/go-version v1.6.0 github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect - github.com/jinzhu/copier v0.3.5 + github.com/jinzhu/copier v0.4.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/panjf2000/ants/v2 v2.7.2 - github.com/pkg/sftp v1.13.5 - github.com/smartystreets/goconvey v1.7.2 - github.com/spf13/cast v1.5.0 - golang.org/x/crypto v0.8.0 - golang.org/x/net v0.9.0 + github.com/pkg/sftp v1.13.6 + github.com/smartystreets/goconvey v1.8.1 + github.com/spf13/cast v1.5.1 + golang.org/x/crypto v0.13.0 + golang.org/x/net v0.15.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/dbm-services/mysql/db-tools/dbactuator/go.sum b/dbm-services/mysql/db-tools/dbactuator/go.sum index c3c9377a71..51131cd268 100644 --- a/dbm-services/mysql/db-tools/dbactuator/go.sum +++ b/dbm-services/mysql/db-tools/dbactuator/go.sum @@ -1,36 +1,36 @@ -ariga.io/atlas v0.13.1 h1:oSkEYgI3qUnQZ6b6+teAEiIuizjBvkZ4YDbz0XWfCdQ= -ariga.io/atlas v0.13.1/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk= +ariga.io/atlas v0.14.0 h1:2gpshFCwvlbXxRJHahUbIpDVdsbJtZVVeuqL410LSTY= +ariga.io/atlas v0.14.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= -github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/caarlos0/env/v6 v6.10.1 h1:t1mPSxNpei6M5yAeu1qtRdPAK29Nbcf/n3G7x+b3/II= github.com/caarlos0/env/v6 v6.10.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5Zu0ddvwc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.8.1 h1:6Lcdwya6GjPUNsBct8Lg/yRPwMhABj269AAzdGSiR+0= -github.com/dlclark/regexp2 v1.8.1/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= +github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -38,36 +38,29 @@ github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrt github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg= -github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= +github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= +github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= +github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -78,34 +71,29 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de h1:V53FWzU6KAZVi1tPp5UIsMoUWJ2/PNwYIDXnu7QuBCE= -github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a h1:N9zuLhTvBSRt0gWSiJswwQ2HqDmtX/ZCDJURnKUt1Ik= +github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/panjf2000/ants/v2 v2.7.2 h1:2NUt9BaZFO5kQzrieOmK/wdb/tQ/K+QHaxN8sOgD63U= -github.com/panjf2000/ants/v2 v2.7.2/go.mod h1:KIBmYG9QQX5U2qzFP/yQJaq/nSb6rahS9iEHkrCMgM8= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.5 h1:a3RLUqkyjYRtBTZJZ1VRrKbN3zhuPLlUc3sphVz81go= -github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg= +github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= +github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= @@ -116,95 +104,87 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= -github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= -github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= +github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/smarty/assertions v1.15.1 h1:812oFiXI+G55vxsFf+8bIZ1ux30qtkdqzKbEFwyX3Tk= +github.com/smarty/assertions v1.15.1/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= +github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= +github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= -github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= -github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= -github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA= -github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= +github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/crontabcmd/clear_crontab.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/crontabcmd/clear_crontab.go index ef56fefa11..9fc5a891a7 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/crontabcmd/clear_crontab.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/crontabcmd/clear_crontab.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package crontabcmd import ( @@ -37,7 +47,7 @@ func ClearCrontabCommand() *cobra.Command { // Init 初始化 func (s *ClearCrontabAct) Init() (err error) { - if err = s.DeserializeAndValidate(&s.Service); err != nil { + if err = s.Deserialize(&s.Service); err != nil { logger.Error("DeserializeAndValidate err %s", err.Error()) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/backup_demand.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/backup_demand.go index 38ebea33e2..8ad5f7c87a 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/backup_demand.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/backup_demand.go @@ -11,19 +11,21 @@ package mysqlcmd import ( "fmt" - "github.com/spf13/cobra" - "dbm-services/bigdata/db-tools/dbactuator/pkg/util" "dbm-services/common/go-pubpkg/logger" "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/backupdemand" + + "github.com/spf13/cobra" ) +// BackupDemandAct TODO type BackupDemandAct struct { *subcmd.BaseOptions Payload backupdemand.Component } +// NewBackupDemandCommand create new subcommand func NewBackupDemandCommand() *cobra.Command { act := BackupDemandAct{BaseOptions: subcmd.GBaseOptions} cmd := &cobra.Command{ @@ -41,6 +43,7 @@ func NewBackupDemandCommand() *cobra.Command { return cmd } +// Init prepare run env func (d *BackupDemandAct) Init() (err error) { if err = d.BaseOptions.Validate(); err != nil { // @todo 应该在一开始就validate return err @@ -54,10 +57,12 @@ func (d *BackupDemandAct) Init() (err error) { return } +// Validate run selfdefine validate function func (d *BackupDemandAct) Validate() error { return nil } +// Run start run command func (d *BackupDemandAct) Run() (err error) { defer util.LoggerErrorStack(logger.Error, err) steps := subcmd.Steps{ diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/import_partitionsql.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/import_partitionsql.go index 396bc47eea..6cf3307f73 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/import_partitionsql.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/import_partitionsql.go @@ -31,7 +31,7 @@ func NewExecPartitionSQLCommand() *cobra.Command { Use: ImportPartitionSQL, Short: "分区", Example: fmt.Sprintf( - `dbactuator mysql deploy-monitor %s %s`, + `dbactuator mysql import-partitionsql %s %s`, subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Payload.Example()), ), diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/install_mysql.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/install_mysql.go index 6973c1d2e8..8273f97d5d 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/install_mysql.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/install_mysql.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package mysqlcmd import ( @@ -39,7 +49,6 @@ func NewDeployMySQLInstanceCommand() *cobra.Command { subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Service.Example()), ), Run: func(cmd *cobra.Command, args []string) { - util.CheckErr(act.Validate()) if act.RollBack { util.CheckErr(act.Rollback()) return @@ -68,7 +77,7 @@ func (d *DeployMySQLAct) Init() (err error) { // @return err func (d *DeployMySQLAct) Rollback() (err error) { var r rollback.RollBackObjects - if err = d.DeserializeAndValidate(&r); err != nil { + if err = d.Deserialize(&r); err != nil { logger.Error("DeserializeAndValidate failed, %v", err) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/mysqlcmd.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/mysqlcmd.go index 114dc98975..b490d46791 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/mysqlcmd.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/mysqlcmd.go @@ -58,6 +58,12 @@ func NewMysqlCommand() *cobra.Command { NewDropTableCommand(), InstallBackupClientCommand(), NewEnableTokudbPluginCommand(), + NewOpenAreaDumpSchemaCommand(), + NewOpenAreaImportSchemaCommand(), + NewOpenAreaDumpData(), + NewOpenAreaImportData(), + OSCmdRunCommand(), + OSInfoGetCommand(), }, }, { diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_data.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_data.go new file mode 100644 index 0000000000..ae6688b208 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_data.go @@ -0,0 +1,96 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OpenAreaDumpDataAct TODO +type OpenAreaDumpDataAct struct { + *subcmd.BaseOptions + Service mysql.OpenAreaDumpSchemaComp +} + +// NewOpenAreaDumpData TODO +func NewOpenAreaDumpData() *cobra.Command { + act := OpenAreaDumpDataAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "open_area_dumpdata", + Short: "开区导出数据", + Example: fmt.Sprintf( + `dbactuator mysql open_area_dumpdata %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Service.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validate TODO +func (d *OpenAreaDumpDataAct) Validate() (err error) { + return d.BaseOptions.Validate() +} + +// Init TODO +func (d *OpenAreaDumpDataAct) Init() (err error) { + if err = d.Deserialize(&d.Service.Params); err != nil { + logger.Error("DeserializeAndValidate failed, %v", err) + return err + } + // d.Deserialize方法执行后,并直接返回值, + d.Service.GeneralParam = subcmd.GeneralRuntimeParam + return nil +} + +// Run TODO +func (d *OpenAreaDumpDataAct) Run() (err error) { + steps := subcmd.Steps{ + { + FunName: "init", + Func: d.Service.Init, + }, + { + FunName: "precheck", + Func: d.Service.Precheck, + }, + { + FunName: "运行导出指定表数据", + Func: d.Service.OpenAreaDumpData, + }, + { + FunName: "压缩开区文件", + Func: d.Service.CompressDumpDir, + }, + { + FunName: "上传指定表数据文件", + Func: d.Service.Upload, + }, + } + if err := steps.Run(); err != nil { + return err + } + logger.Info("开区导出表数据成功") + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_schema.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_schema.go new file mode 100644 index 0000000000..327cf53c89 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_dump_schema.go @@ -0,0 +1,98 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OpenAreaDumpSchemaAct TODO +type OpenAreaDumpSchemaAct struct { + *subcmd.BaseOptions + Service mysql.OpenAreaDumpSchemaComp +} + +// NewOpenAreaDumpSchemaCommand TODO +func NewOpenAreaDumpSchemaCommand() *cobra.Command { + // *subcmd.BaseOptions是指针变量,需要初始化, subcmd.GBaseOptions在subcmd的init中已被初始化 + act := OpenAreaDumpSchemaAct{ + BaseOptions: subcmd.GBaseOptions, + } + + cmd := &cobra.Command{ + Use: "open_area_dumpschema", + Short: "开区导出表结构", + Example: fmt.Sprintf( + `dbactuator mysql open_area_dumpschema %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Service.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validate TODO +func (d *OpenAreaDumpSchemaAct) Validate() (err error) { + return d.BaseOptions.Validate() +} + +// Init TODO +func (d *OpenAreaDumpSchemaAct) Init() (err error) { + if err = d.Deserialize(&d.Service.Params); err != nil { + logger.Error("DeserializeAndValidate failed, %v", err) + return err + } + // d.Deserialize方法执行后,并直接返回值, + d.Service.GeneralParam = subcmd.GeneralRuntimeParam + return nil +} + +// Run TODO +func (d *OpenAreaDumpSchemaAct) Run() (err error) { + steps := subcmd.Steps{ + { + FunName: "init", + Func: d.Service.Init, + }, + { + FunName: "precheck", + Func: d.Service.Precheck, + }, + { + FunName: "运行导出表结构", + Func: d.Service.OpenAreaDumpSchema, + }, + { + FunName: "压缩开区文件", + Func: d.Service.CompressDumpDir, + }, + { + FunName: "上传表结构", + Func: d.Service.Upload, + }, + } + if err := steps.Run(); err != nil { + return err + } + logger.Info("开区导出表结构成功") + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_data.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_data.go new file mode 100644 index 0000000000..9bc4d81c5b --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_data.go @@ -0,0 +1,96 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OpenAreaImportDataAct TODO +type OpenAreaImportDataAct struct { + *subcmd.BaseOptions + Service mysql.OpenAreaImportSchemaComp +} + +// NewOpenAreaImportData TODO +func NewOpenAreaImportData() *cobra.Command { + act := OpenAreaImportDataAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "open_area_importdata", + Short: "开区导入数据", + Example: fmt.Sprintf( + `dbactuator mysql open_area_importschema %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Service.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validate TODO +func (d *OpenAreaImportDataAct) Validate() (err error) { + return d.BaseOptions.Validate() +} + +// Init TODO +func (d *OpenAreaImportDataAct) Init() (err error) { + if err = d.Deserialize(&d.Service.Params); err != nil { + logger.Info("DeserializeAndValidate failed, %v", err) + return err + } + d.Service.GeneralParam = subcmd.GeneralRuntimeParam + return +} + +// Run TODO +func (d *OpenAreaImportDataAct) Run() (err error) { + steps := subcmd.Steps{ + { + FunName: "init", + Func: d.Service.Init, + }, + { + FunName: "precheck", + Func: d.Service.Precheck, + }, + { + FunName: "解压data文件", + Func: d.Service.DecompressDumpDir, + }, + { + FunName: "导入数据文件", + Func: d.Service.OpenAreaImportData, + }, + { + FunName: "清除dump目录", + Func: d.Service.CleanDumpDir, + }, + } + + if err := steps.Run(); err != nil { + return err + } + logger.Info("开区导入数据成功") + return +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_schema.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_schema.go new file mode 100644 index 0000000000..2c110a23b7 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/open_area_import_schema.go @@ -0,0 +1,103 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OpenAreaImportSchemaAct TODO +type OpenAreaImportSchemaAct struct { + *subcmd.BaseOptions + Service mysql.OpenAreaImportSchemaComp +} + +// NewOpenAreaImportSchemaCommand TODO +func NewOpenAreaImportSchemaCommand() *cobra.Command { + act := OpenAreaImportSchemaAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "open_area_importschema", + Short: "开区导入表结构", + Example: fmt.Sprintf( + `dbactuator mysql open_area_importschema %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Service.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validate TODO +func (d *OpenAreaImportSchemaAct) Validate() (err error) { + return d.BaseOptions.Validate() +} + +// Init TODO +func (d *OpenAreaImportSchemaAct) Init() (err error) { + if err = d.Deserialize(&d.Service.Params); err != nil { + logger.Error("DeserializeAndValidate failed, %v", err) + return err + } + d.Service.GeneralParam = subcmd.GeneralRuntimeParam + return +} + +// Run TODO +func (d *OpenAreaImportSchemaAct) Run() (err error) { + steps := subcmd.Steps{ + { + FunName: "init", + Func: d.Service.Init, + }, + { + FunName: "precheck", + Func: d.Service.Precheck, + }, + { + FunName: "解压schema文件", + Func: d.Service.DecompressDumpDir, + }, + { + FunName: "抹除AutoIncrement", + Func: d.Service.EraseAutoIncrement, + }, + { + FunName: "创建新库", + Func: d.Service.CreateNewDatabase, + }, + { + FunName: "导入表结构文件", + Func: d.Service.OpenAreaImportSchema, + }, + { + FunName: "清除dump目录", + Func: d.Service.CleanDumpDir, + }, + } + if err := steps.Run(); err != nil { + return err + } + logger.Info("开区导入表结构成功") + return +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/oscmd_run.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/oscmd_run.go new file mode 100644 index 0000000000..a9fbe8929f --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/oscmd_run.go @@ -0,0 +1,80 @@ +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OSCmdRunAct TODO +type OSCmdRunAct struct { + *subcmd.BaseOptions + Payload mysql.OSCmdRunComp +} + +// OSCmdRunCommand godoc +// +// @Summary 执行os简单命令 +// @Description 执行os简单命令 +// @Tags mysql +// @Accept json +// @Param body body mysql.OSCmds true "short description" +// @Success 200 {object} mysql.OSCmdRunResp +// @Router /mysql/oscmd-run [post] +func OSCmdRunCommand() *cobra.Command { + act := OSCmdRunAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "oscmd-run", + Short: "执行os简单命令", + Example: fmt.Sprintf( + `dbactuator mysql oscmd-run %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Payload.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Init TODO +func (d *OSCmdRunAct) Init() (err error) { + if err = d.BaseOptions.Validate(); err != nil { // @todo 应该在一开始就validate + return err + } + if err = d.Deserialize(&d.Payload.Params); err != nil { + logger.Error("DeserializeAndValidate err %s", err.Error()) + return err + } + return +} + +// Validate TODO +func (d *OSCmdRunAct) Validate() error { + return nil +} + +// Run TODO +func (d *OSCmdRunAct) Run() (err error) { + defer util.LoggerErrorStack(logger.Error, err) + steps := subcmd.Steps{ + { + FunName: "执行命令集", + Func: d.Payload.Start, + }, + } + if err = steps.Run(); err != nil { + return err + } + logger.Info("oscmd-run done") + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/osinfo_get.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/osinfo_get.go new file mode 100644 index 0000000000..873a2c4abf --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/mysqlcmd/osinfo_get.go @@ -0,0 +1,84 @@ +package mysqlcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/internal/subcmd" + "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql" + "dbm-services/mysql/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// OSInfoGetAct TODO +type OSInfoGetAct struct { + *subcmd.BaseOptions + Payload mysql.OSInfoGetComp +} + +// OSInfoGetCommand godoc +// +// @Summary 获取 os 内存、cpu、目录/磁盘 信息 +// @Description 获取 os 内存、cpu、目录/磁盘 信息 +// @Tags mysql +// @Accept json +// @Param body body mysql.OSInfoGetComp true "short description" +// @Success 200 {object} mysql.OSInfoResult +// @Router /mysql/osinfo-get [post] +func OSInfoGetCommand() *cobra.Command { + act := OSInfoGetAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "osinfo-get", + Short: "获取 os 内存、cpu、目录/磁盘 信息", + Example: fmt.Sprintf( + `dbactuator mysql osinfo-get %s %s`, + subcmd.CmdBaseExampleStr, subcmd.ToPrettyJson(act.Payload.Example()), + ), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validate()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Init TODO +func (d *OSInfoGetAct) Init() (err error) { + if len(d.BaseOptions.Payload) == 0 { + return nil + } + if err = d.Deserialize(&d.Payload.Params); err != nil { + logger.Error("DeserializeAndValidate err %s", err.Error()) + return err + } + return +} + +// Validate TODO +func (d *OSInfoGetAct) Validate() error { + return nil +} + +// Run TODO +func (d *OSInfoGetAct) Run() (err error) { + defer util.LoggerErrorStack(logger.Error, err) + steps := subcmd.Steps{ + { + FunName: "采集信息", + Func: d.Payload.Start, + }, + { + FunName: "输出信息", + Func: d.Payload.OutputCtx, + }, + } + if err = steps.Run(); err != nil { + return err + } + logger.Info("osinfo-get done") + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spidercmd/install_spider.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spidercmd/install_spider.go index 4eed523a6a..9fc5ccba6c 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spidercmd/install_spider.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spidercmd/install_spider.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package spidercmd import ( @@ -68,7 +78,7 @@ func (d *DeploySpiderAct) Init() (err error) { // @return err func (d *DeploySpiderAct) Rollback() (err error) { var r rollback.RollBackObjects - if err = d.DeserializeAndValidate(&r); err != nil { + if err = d.Deserialize(&r); err != nil { logger.Error("DeserializeAndValidate failed, %v", err) return err } @@ -110,11 +120,10 @@ func (d *DeploySpiderAct) Run() (err error) { FunName: "执行初始化系统基础权限、库表SQL", Func: d.BaseService.InitDefaultPrivAndSchema, }, - // { - // FunName: "生成exporter配置文件", - // Func: d.BaseService.CreateExporterCnf, - // }, - + { + FunName: "生成exporter配置文件", + Func: d.BaseService.CreateExporterCnf, + }, } if err := steps.Run(); err != nil { diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_check.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_check.go index 82678d6979..2c5a9e2bc9 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_check.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_check.go @@ -27,7 +27,14 @@ type ClusterSchemaCheckAct struct { Service spiderctl.TableSchemaCheckComp } -// NewClusterSchemaCheckCommand TODO +// NewClusterSchemaCheckCommand godoc +// +// @Summary spider 集群表结构校验 +// @Description spider 集群表结构校验 +// @Tags spiderctl +// @Accept json +// @Param body body spiderctl.TableSchemaCheckComp true "short description" +// @Router /spiderctl/schema-check [post] func NewClusterSchemaCheckCommand() *cobra.Command { act := &ClusterSchemaCheckAct{} cmd := &cobra.Command{ diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_repair.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_repair.go index c0a08d1d6a..93cdcb2bf2 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_repair.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/cluster_schema_repair.go @@ -26,7 +26,14 @@ type ClusterSchemaRepairAct struct { Service spiderctl.TableSchemaRepairComp } -// NewClusterSchemaRepairCommand TODO +// NewClusterSchemaRepairCommand godoc +// +// @Summary spider 集群表结构修复 +// @Description spider 集群表结构修复 +// @Tags spiderctl +// @Accept json +// @Param body body spiderctl.TableSchemaRepairComp true "short description" +// @Router /spiderctl/schema-repair [post] func NewClusterSchemaRepairCommand() *cobra.Command { act := &ClusterSchemaRepairAct{} cmd := &cobra.Command{ diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/install_spider_ctl.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/install_spider_ctl.go index a83f8748c1..2a0a7979a3 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/install_spider_ctl.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/spiderctlcmd/install_spider_ctl.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package spiderctlcmd import ( @@ -69,7 +79,7 @@ func (d *DeployCtlSpiderAct) Init() (err error) { // @return err func (d *DeployCtlSpiderAct) Rollback() (err error) { var r rollback.RollBackObjects - if err = d.DeserializeAndValidate(&r); err != nil { + if err = d.Deserialize(&r); err != nil { logger.Error("DeserializeAndValidate failed, %v", err) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/subcmd.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/subcmd.go index 0fbff05b46..6bc51cb7a1 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/subcmd.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/subcmd.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package subcmd TODO package subcmd @@ -106,12 +116,12 @@ func (s Steps) Run() (err error) { return nil } -// DeserializeAndValidate TODO +// DeserializeNonStandard TODO /* 反序列化payload,并校验参数 ps: 参数校验 from golang validate v10 */ -func (b *BaseOptions) DeserializeAndValidate(s interface{}) (err error) { +func (b *BaseOptions) DeserializeNonStandard(s interface{}) (err error) { var bp []byte if b.PayloadFormat == PayloadFormatRaw { bp = []byte(b.Payload) @@ -189,6 +199,9 @@ func Deserialize(s interface{}) (p *BaseOptions, err error) { // ps: 参数校验 from golang validate v10 func (b *BaseOptions) Deserialize(s interface{}) (err error) { var bp []byte + if err = b.Validate(); err != nil { + return err + } if b.PayloadFormat == PayloadFormatRaw { bp = []byte(b.Payload) } else { @@ -217,6 +230,7 @@ func (b *BaseOptions) Deserialize(s interface{}) (err error) { err = errors.WithMessage(err, "参数解析错误") return err } + s = bip.ExtendParam // logger.Info("params after unmarshal %+v", bip) if err = validate.GoValidateStruct(bip, false, true); err != nil { logger.Error("validate struct failed, %v", s, err) @@ -264,8 +278,6 @@ func (b *BaseOptions) Validate() (err error) { if len(b.Payload) == 0 { return fmt.Errorf("payload need input") } - // logger.Info("Validate payload body: %s", b.Payload) - return nil } @@ -327,7 +339,7 @@ func ValidateSubCommand() func(cmd *cobra.Command, args []string) error { if len(args) <= 0 { return fmt.Errorf( "You must specify the type of Operation Describe. %s\n", - SuggestAPIResources(cmd.Parent().Name()), + suggestAPIResources(cmd.Parent().Name()), ) } curName := args[0] @@ -358,19 +370,17 @@ func PrintSubCommandHelper(cmd *cobra.Command, opt *BaseOptions) bool { if err := GetPathDefinitionHelper(subcmdPath); err != nil { fmt.Println(err) os.Exit(1) - } else { - return true } - } else { - fmt.Println("--example need sub-command") + return true } + fmt.Println("--example need sub-command") } return false } -// SuggestAPIResources returns a suggestion to use the "api-resources" command +// suggestAPIResources returns a suggestion to use the "api-resources" command // to retrieve a supported list of resources -func SuggestAPIResources(parent string) string { +func suggestAPIResources(parent string) string { return templates.LongDesc( fmt.Sprintf( "Use \"%s {Operation Type}\" for a complete list of supported resources.", diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/sysinitcmd/sysinit.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/sysinitcmd/sysinit.go index af142a3624..52693898ae 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/sysinitcmd/sysinit.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/sysinitcmd/sysinit.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package sysinitcmd import ( @@ -37,7 +47,7 @@ func NewSysInitCommand() *cobra.Command { // Init TODO func (d *SysInitAct) Init() (err error) { - if err = d.DeserializeAndValidate(&d.Service); err != nil { + if err = d.DeserializeNonStandard(&d.Service); err != nil { logger.Error("DeserializeAndValidate err %s", err.Error()) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/dump_schema_for_tbinlogdumper.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/dump_schema_for_tbinlogdumper.go index c740875e87..3fbb91b43f 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/dump_schema_for_tbinlogdumper.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/dump_schema_for_tbinlogdumper.go @@ -27,7 +27,7 @@ type DumpSchemaAct struct { Service tbinlogdumper.DumpSchemaComp } -// NewSenmanticDumpSchemaCommand godoc +// NewDumpSchemaCommand godoc // // @Summary 备份表结构并导入 // @Description 备份表结构并导入 diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/install_tbinlogdumper.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/install_tbinlogdumper.go index 31064a4296..dc7e196eae 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/install_tbinlogdumper.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/install_tbinlogdumper.go @@ -1,3 +1,13 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package tbinlogdumpercmd import ( @@ -19,13 +29,13 @@ type DeployTbinlogDumperAct struct { Service tbinlogdumper.InstallTbinlogDumperComp } -// NewDeployMySQLInstanceCommand godoc +// NewDeployTbinlogDumperCommand godoc // // @Summary 部署 tbinlogdumper 实例 // @Description 部署 tbinlogdumper 实例说明 // @Tags tbinlogdumper // @Accept json -// @Param body body mysql.InstallTbinlogDumperComp true "short description" +// @Param body body tbinlogdumper.InstallTbinlogDumperComp true "short description" // @Router /tbinlogdumper/deploy [post] func NewDeployTbinlogDumperCommand() *cobra.Command { act := DeployTbinlogDumperAct{ @@ -73,7 +83,7 @@ func (d *DeployTbinlogDumperAct) Init() (err error) { // @return err func (d *DeployTbinlogDumperAct) Rollback() (err error) { var r rollback.RollBackObjects - if err = d.DeserializeAndValidate(&r); err != nil { + if err = d.Deserialize(&r); err != nil { logger.Error("DeserializeAndValidate failed, %v", err) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/uninstall_tbinlogdumper.go b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/uninstall_tbinlogdumper.go index 7d29b24463..2ee182b725 100644 --- a/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/uninstall_tbinlogdumper.go +++ b/dbm-services/mysql/db-tools/dbactuator/internal/subcmd/tbinlogdumpercmd/uninstall_tbinlogdumper.go @@ -17,13 +17,13 @@ type UnInstallTbinlogDumperAct struct { Service tbinlogdumper.UnInstallTbinlogDumperComp } -// NewUnInstallMysqlCommand TODO +// NewUnInstallTbinlogDumperCommand TODO // // @Summary 卸载 tbinlogdumper 实例 // @Description 卸载 tbinlogdumper 实例说明 // @Tags tbinlogdumper // @Accept json -// @Param body body mysql.InstallTbinlogDumperComp true "short description" +// @Param body body tbinlogdumper.UnInstallTbinlogDumperComp true "short description" // @Router /tbinlogdumper/uninstall [post] func NewUnInstallTbinlogDumperCommand() *cobra.Command { act := UnInstallTbinlogDumperAct{ diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/medium.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/medium.go index 86f7785df1..15b94c30db 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/medium.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/medium.go @@ -52,6 +52,16 @@ func (m *Medium) GePkgBaseName() string { // GetPkgTypeName 通过介质包文件名称获取对应的组件类型 // 比如 mysql-5.7.20-linux-x86_64-tmysql-3.1.5-gcs.tar.gz 解析成 mysql // 比如 mariadb-10.3.7-linux-x86_64-tspider-3.7.8-gcs.tar.gz 解析成 mariadb +// tdbctl mysql-5.7.20-linux-x86_64-tdbctl-2.4.2.tar.gz +// 官方包名:mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz mysql-5.7.42-linux-glibc2.12-x86_64.tar.gz func (m *Medium) GetPkgTypeName() string { - return strings.Split(m.Pkg, "-")[0] + if strings.Contains(m.Pkg, "tdbctl") { + return cst.PkgTypeTdbctl + } else if strings.Contains(m.Pkg, "tspider") { + return cst.PkgTypeSpider + } else if strings.HasPrefix(m.Pkg, "mysql-") { + return cst.PkgTypeMysql + } else { + return strings.Split(m.Pkg, "-")[0] + } } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/change_master.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/change_master.go index 56788ebc12..1340c5c663 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/change_master.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/change_master.go @@ -137,7 +137,7 @@ func (b *BuildMSRelationComp) CheckCurrentSlaveStatus() (err error) { // 检查当前实例是否已经存在进程 slaveStatus, err := b.db.ShowSlaveStatus() if err != nil { - logger.Error("%s:err:%s", util.AtWhere()) + logger.Error("show slave status failed,err:%s", err.Error()) return err } var emptySlaveStatus native.ShowSlaveStatusResp @@ -147,7 +147,8 @@ func (b *BuildMSRelationComp) CheckCurrentSlaveStatus() (err error) { } // 如果没有加强制参数,只要存在关系,就抛出错误 if !b.Params.Force { - return fmt.Errorf("当前实例实际存在主从关系") + return fmt.Errorf("当前实例实际存在主从关系, master_host=%s, master_port=%d", + slaveStatus.MasterHost, slaveStatus.MasterPort) } logger.Info("show slave status Info is %v", slaveStatus) // 强制参数force=true,直接执行stop slave && reset slave @@ -201,7 +202,7 @@ func (b *BuildMSRelationComp) CheckBuildOk() (err error) { func (b *BuildMSRelationComp) checkSlaveStatus() (err error) { ss, err := b.db.ShowSlaveStatus() if err != nil { - logger.Error("%s exec show slave status failed:%s", util.AtWhere(), err.Error()) + logger.Error("exec show slave status failed:%s", err.Error()) } if !ss.ReplSyncIsOk() { errMsg := fmt.Sprintf("IOThread:%s,SQLThread:%s", ss.SlaveIORunning, ss.SlaveSQLRunning) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/cutover/base.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/cutover/base.go index 63e512cca8..502c0b07d3 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/cutover/base.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/cutover/base.go @@ -13,6 +13,7 @@ package cutover import ( "database/sql" "encoding/json" + "errors" "fmt" "strings" "time" @@ -317,16 +318,17 @@ func (c *MasterInfo) FindLongQuery() (err error) { if len(activeProcessLists) <= 0 { return nil } - errMsg := []string{"active processlist exist:\n"} + var errs []error + errs = []error{errors.New("active processlist exist:\n")} for _, p := range activeProcessLists { - errMsg = append( - errMsg, fmt.Sprintf( + errs = append( + errs, fmt.Errorf( "[user:%s,time:%s,host:%s,db:%s,info:%s]", p.User, p.Time, p.Host, realVal(p.DB), realVal(p.Info), ), ) } - return + return errors.Join(errs...) } // realVal TODO diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/deploy_mysql_crond.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/deploy_mysql_crond.go index 694ab2e9c3..89abb57a49 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/deploy_mysql_crond.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/deploy_mysql_crond.go @@ -196,7 +196,16 @@ func (c *DeployMySQLCrondComp) Start() (err error) { errChan := make(chan error) go func() { // 重装的时候无脑尝试关闭一次 - _, _ = http.Get("http://127.0.0.1:9999/quit") + resp, err := http.Get("http://127.0.0.1:9999/quit") + if err != nil { + logger.Error("send quit request failed for forehead start", err.Error()) + errChan <- errors.Wrap(err, "send quit request failed for forehead start") + return + } + defer func() { + _ = resp.Body.Close() + }() + time.Sleep(15 * time.Second) cmd := exec.Command( @@ -209,7 +218,7 @@ func (c *DeployMySQLCrondComp) Start() (err error) { ) var stderr bytes.Buffer cmd.Stderr = &stderr - err := cmd.Run() + err = cmd.Run() if err != nil { errChan <- errors.Wrap(err, stderr.String()) } @@ -227,11 +236,12 @@ LabelSelectLoop: } case <-time.After(1 * time.Second): logger.Info("try to connect mysql-crond %d times", i) - _, err := http.Get("http://127.0.0.1:9999/entries") + resp, err := http.Get("http://127.0.0.1:9999/entries") if err != nil { logger.Info("try to connect mysql-crond %d times failed: %s", i, err.Error()) break } + _ = resp.Body.Close() started = true logger.Info("try to connect mysql-crond %d times success", i) break LabelSelectLoop @@ -245,7 +255,15 @@ LabelSelectLoop: } // 关闭前台启动的 mysql-crond - _, _ = http.Get("http://127.0.0.1:9999/quit") + resp, err := http.Get("http://127.0.0.1:9999/quit") + if err != nil { + logger.Error("send quit request failed", err.Error()) + return err + } + defer func() { + _ = resp.Body.Close() + }() + logger.Info("send quit request success") time.Sleep(15 * time.Second) @@ -291,12 +309,13 @@ LabelSelectLoop: started = false for i := 1; i <= 10; i++ { logger.Info("try to connect mysql-crond %d times", i) - _, err := http.Get("http://127.0.0.1:9999/entries") + resp, err := http.Get("http://127.0.0.1:9999/entries") if err != nil { logger.Info("try to connect mysql-crond %d times failed: %s", i, err.Error()) time.Sleep(2 * time.Second) continue } + _ = resp.Body.Close() started = true logger.Info("try to connect mysql-crond %d times success", i) break diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/excute_sql_file.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/excute_sql_file.go index b84366552d..c60acf0030 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/excute_sql_file.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/excute_sql_file.go @@ -214,7 +214,7 @@ func (e *ExcuteSQLFileComp) excuteOne(port int) (err error) { Password: e.GeneralParam.RuntimeAccountParam.AdminPwd, }.ExcuteSqlByMySQLClient(f.SQLFile, realexcutedbs) if err != nil { - logger.Error("执行%s文件失败", f.SQLFile) + logger.Error("执行%s文件失败:%s", f.SQLFile, err.Error()) return err } } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/execute_partition_sql.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/execute_partition_sql.go index f67d1e6d05..305e9ff4fc 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/execute_partition_sql.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/execute_partition_sql.go @@ -188,7 +188,12 @@ func (e *ExcutePartitionSQLComp) Excute() (err error) { } if len(eb.AddPartition) > 0 { logger.Info(fmt.Sprintf("添加分区,config_id=%d\n", eb.ConfigID)) - err := e.excuteOne(dbw, eb.AddPartition, errfile, 20) + if strings.Contains(e.Params.ShardName, "TDBCTL") { + addPartition := e.getNewPartitionSQL(eb.AddPartition) + err = e.excuteOne(dbw, addPartition, errfile, 20) + } else { + err = e.excuteOne(dbw, eb.AddPartition, errfile, 20) + } if err != nil { lock.Lock() errsall = append(errsall, err.Error()) @@ -199,7 +204,12 @@ func (e *ExcutePartitionSQLComp) Excute() (err error) { } if len(eb.DropPartition) > 0 { logger.Info(fmt.Sprintf("删除分区,config_id=%d\n", eb.ConfigID)) - err := e.excuteOne(dbw, eb.DropPartition, errfile, 20) + if strings.Contains(e.Params.ShardName, "TDBCTL") { + dropPartition := e.getNewPartitionSQL(eb.DropPartition) + err = e.excuteOne(dbw, dropPartition, errfile, 20) + } else { + err = e.excuteOne(dbw, eb.DropPartition, errfile, 20) + } if err != nil { lock.Lock() errsall = append(errsall, err.Error()) @@ -221,7 +231,7 @@ func (e *ExcutePartitionSQLComp) Excute() (err error) { body.Dimension["dblike"] = eb.Dblike body.Dimension["tblike"] = eb.Tblike body.Dimension["ticket"] = e.Params.Ticket - body.Dimension["immute_domain"] = e.Params.ImmuteDomain + body.Dimension["cluster_domain"] = e.Params.ImmuteDomain body.Dimension["shard_name"] = e.Params.ShardName manager := ma.NewManager("http://127.0.0.1:9999") sendErr := manager.SendEvent(body.Name, body.Content, body.Dimension) @@ -394,3 +404,12 @@ func (e *ExcutePartitionSQLComp) getInitPartitionSQL(initPartitions []InitPartit } return initPartitionSQL } + +func (e *ExcutePartitionSQLComp) getNewPartitionSQL(partitionSQLs []string) []string { + var newPartitionSQLs []string + for _, parsql := range partitionSQLs { + sql := fmt.Sprintf("%s;;;%s;", "set tc_admin=0", parsql) + newPartitionSQLs = append(newPartitionSQLs, sql) + } + return newPartitionSQLs +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_checksum.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_checksum.go index 1f4d0aaf44..a0a59592e7 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_checksum.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_checksum.go @@ -36,6 +36,7 @@ type InstanceInfo struct { ClusterId int `json:"cluster_id"` ImmuteDomain string `json:"immute_domain"` BkInstanceId int64 `json:"bk_instance_id,omitempty"` // 0 被视为空, 不序列化 + DBModuleId int `json:"db_module_id"` } // InstallMySQLChecksumParam 输入参数 diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_monitor.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_monitor.go index bb26b9e436..f5ca7e1f40 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_monitor.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_monitor.go @@ -42,6 +42,7 @@ type InstallMySQLMonitorParam struct { Schedule *string `json:"schedule" yaml:"schedule"` MachineType []string `json:"machine_type" yaml:"machine_type"` Role []string `json:"role" yaml:"role"` + Name string `json:"name" yaml:"name"` } `json:"items_config"` } @@ -73,6 +74,7 @@ type monitorConfig struct { MachineType string `yaml:"machine_type"` Role *string `yaml:"role"` BkCloudId *int `yaml:"bk_cloud_id" validate:"required,gte=0"` + DBModuleID *int `yaml:"db_module_id" validate:"required"` Log *_logConfig `yaml:"log"` ItemsConfigFile string `yaml:"items_config_file" validate:"required"` ApiUrl string `yaml:"api_url" validate:"required"` @@ -174,6 +176,7 @@ func (c *InstallMySQLMonitorComp) GenerateBinaryConfig() (err error) { Role: &instance.Role, BkBizId: instance.BkBizId, BkCloudId: &c.Params.BkCloudId, + DBModuleID: &instance.DBModuleId, MachineType: c.Params.MachineType, Log: &_logConfig{ Console: false, diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go index 7eb45c5b51..f76bd903de 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go @@ -24,8 +24,6 @@ import ( "dbm-services/mysql/db-tools/dbactuator/pkg/util/osutil" "dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/spider" "dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/masterslaveheartbeat" - - "github.com/pkg/errors" ) // InstallMySQLComp TODO @@ -49,28 +47,14 @@ type InstallMySQLParams struct { // Ports Ports []int `json:"ports" validate:"required,gt=0,dive"` // 安装实例的内存大小,可以不指定,会自动计算 - InstMem uint64 `json:"inst_mem"` - Host string `json:"host" validate:"required,ip" ` - SuperAccount SuperAccount `json:"super_account"` - DBHAAccount DBHAAccount `json:"dbha_account"` - SpiderAutoIncrModeMap json.RawMessage `json:"spider_auto_incr_mode_map"` + InstMem uint64 `json:"inst_mem"` + Host string `json:"host" validate:"required,ip" ` + SuperAccount AdditionalAccount `json:"super_account"` + DBHAAccount AdditionalAccount `json:"dbha_account"` + SpiderAutoIncrModeMap json.RawMessage `json:"spider_auto_incr_mode_map"` AllowDiskFileSystemTypes []string } -// SuperAccount TODO -type SuperAccount struct { - User string `json:"user" validate:"required"` - Pwd string `json:"pwd" validate:"required"` - AccessHosts []string `json:"access_hosts"` -} - -// DBHAAccount TODO -type DBHAAccount struct { - User string `json:"user" validate:"required"` - Pwd string `json:"pwd" validate:"required"` - AccessHosts []string `json:"access_hosts"` -} - // InitDirs TODO type InitDirs = []string @@ -118,7 +102,7 @@ type Mysqld struct { SpiderAutoIncrementModeValue SpiderAutoIncrModeValue `json:"spider_auto_increment_mode_value"` } -// Example TODO +// Example subcommand example input func (i *InstallMySQLComp) Example() interface{} { comp := InstallMySQLComp{ Params: &InstallMySQLParams{ @@ -139,12 +123,12 @@ func (i *InstallMySQLComp) Example() interface{} { "client":{"port": "{{mysqld.port}}"}, "mysql":{"socket": "{{mysqld.datadir}}/mysql.sock"}, "mysqld":{"binlog_format": "ROW","innodb_io_capacity": "2000","innodb_read_io_threads": "10"}}}`), - SuperAccount: SuperAccount{ + SuperAccount: AdditionalAccount{ User: "user", Pwd: "xxx", AccessHosts: []string{"ip1", "ip2"}, }, - DBHAAccount: DBHAAccount{ + DBHAAccount: AdditionalAccount{ User: "user", Pwd: "xxx", AccessHosts: []string{"ip1", "ip2"}, @@ -293,21 +277,20 @@ func (i *InstallMySQLComp) precheckMysqlProcess() (err error) { var mysqldNum int // 如果正在部署tdbctl组件,部署场景会与这块引起冲突,则暂时先跳过。 - if strings.Contains(i.Params.Pkg, "tdbctl") { - logger.Warn("正在部署tdbctl组件,不再mysqld进程存活检查") + if i.Params.Medium.GetPkgTypeName() == cst.PkgTypeTdbctl { + logger.Warn("正在部署tdbctl组件,不再mysqld进程存活检查") return nil } - if output, err = osutil.ExecShellCommand(false, "ps -ef|grep 'mysqld ' |grep -v grep |wc -l"); err != nil { - return errors.Wrap(err, "执行ps -efwww|grep -w mysqld|grep -v grep|wc -l失败") + return fmt.Errorf("%w 执行ps -efwww|grep -w mysqld|grep -v grep|wc -l失败", err) } - fmt.Println("output", output) + logger.Info("output:", output) if mysqldNum, err = strconv.Atoi(osutil.CleanExecShellOutput(output)); err != nil { logger.Error("strconv.Atoi %s failed:%s", output, err.Error()) return err } if mysqldNum > 0 { - return errors.New(fmt.Sprintf("have %d mysqld process running", mysqldNum)) + return fmt.Errorf("have %d mysqld process running", mysqldNum) } return nil } @@ -441,7 +424,7 @@ func (i *InstallMySQLComp) GenerateMycnf() (err error) { } tmpl, err := template.ParseFiles(tmplFileName) if err != nil { - return errors.WithMessage(err, "template ParseFiles failed") + return fmt.Errorf("template ParseFiles failed, err: %w", err) } cnf := util.GetMyCnfFileName(port) f, err := os.Create(cnf) @@ -554,7 +537,7 @@ func (i *InstallMySQLComp) Install() (err error) { myCnf, initialLogFile) } // 拼接tdbctl专属初始化命令 - if strings.Contains(i.Params.Pkg, "tdbctl") { + if i.Params.GetPkgTypeName() == cst.PkgTypeTdbctl { initialMysql = fmt.Sprintf( "su - mysql -c \"cd %s && ./bin/mysqld --defaults-file=%s --tc-admin=0 --initialize-insecure --user=mysql &>%s\"", i.TdbctlInstallDir, myCnf, initialLogFile) @@ -628,7 +611,8 @@ func (i *InstallMySQLComp) Startup() (err error) { */ func (i *InstallMySQLComp) generateDefaultMysqlAccount(realVersion string) (initAccountsql []string) { - initAccountsql = append(i.GetSuperUserAccount(realVersion), i.GetDBHAAccount(realVersion)...) + initAccountsql = append(i.Params.SuperAccount.GetSuperUserAccount(realVersion), i.Params.DBHAAccount.GetDBHAAccount( + realVersion)...) runp := i.GeneralParam.RuntimeAccountParam privParis := []components.MySQLAccountPrivs{} @@ -665,19 +649,26 @@ VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y return } +// AdditionalAccount 额外账户 +type AdditionalAccount struct { + User string `json:"user" validate:"required"` + Pwd string `json:"pwd" validate:"required"` + AccessHosts []string `json:"access_hosts"` +} + // GetSuperUserAccount TODO -func (i *InstallMySQLComp) GetSuperUserAccount(realVersion string) (initAccountsql []string) { - for _, host := range i.Params.SuperAccount.AccessHosts { +func (a *AdditionalAccount) GetSuperUserAccount(realVersion string) (initAccountsql []string) { + for _, host := range cmutil.RemoveDuplicate(a.AccessHosts) { if mysqlutil.MySQLVersionParse(realVersion) >= mysqlutil.MySQLVersionParse("5.7.18") { initAccountsql = append(initAccountsql, fmt.Sprintf("CREATE USER '%s'@'%s' IDENTIFIED WITH mysql_native_password BY '%s' ;", - i.Params.SuperAccount.User, host, i.Params.SuperAccount.Pwd)) + a.User, host, a.Pwd)) initAccountsql = append(initAccountsql, fmt.Sprintf("GRANT ALL PRIVILEGES ON *.* TO '%s'@'%s' WITH GRANT OPTION ; ", - i.Params.SuperAccount.User, host)) + a.User, host)) } else { initAccountsql = append(initAccountsql, fmt.Sprintf("GRANT ALL PRIVILEGES ON *.* TO '%s'@'%s' IDENTIFIED BY '%s' WITH GRANT OPTION ;", - i.Params.SuperAccount.User, host, i.Params.SuperAccount.Pwd)) + a.User, host, a.Pwd)) } } return @@ -685,22 +676,22 @@ func (i *InstallMySQLComp) GetSuperUserAccount(realVersion string) (initAccounts // GetDBHAAccount TODO // 获取生成DHBA-GM访问账号的生成语句 -func (i *InstallMySQLComp) GetDBHAAccount(realVersion string) (initAccountsql []string) { - for _, host := range i.Params.DBHAAccount.AccessHosts { +func (a *AdditionalAccount) GetDBHAAccount(realVersion string) (initAccountsql []string) { + for _, host := range cmutil.RemoveDuplicate(a.AccessHosts) { if mysqlutil.MySQLVersionParse(realVersion) >= mysqlutil.MySQLVersionParse("5.7.18") { initAccountsql = append(initAccountsql, fmt.Sprintf("CREATE USER '%s'@'%s' IDENTIFIED WITH mysql_native_password BY '%s' ;", - i.Params.DBHAAccount.User, host, i.Params.DBHAAccount.Pwd)) + a.User, host, a.Pwd)) initAccountsql = append(initAccountsql, fmt.Sprintf( "GRANT RELOAD, PROCESS, SHOW DATABASES, SUPER, REPLICATION CLIENT, SHOW VIEW "+ "ON *.* TO '%s'@'%s' WITH GRANT OPTION ;", - i.Params.DBHAAccount.User, host)) + a.User, host)) } else { initAccountsql = append(initAccountsql, fmt.Sprintf( "GRANT RELOAD, PROCESS, SHOW DATABASES, SUPER, REPLICATION CLIENT, SHOW VIEW "+ "ON *.* TO '%s'@'%s' IDENTIFIED BY '%s' WITH GRANT OPTION ;", - i.Params.DBHAAccount.User, host, i.Params.DBHAAccount.Pwd)) + a.User, host, a.Pwd)) } } return @@ -716,13 +707,13 @@ func (i *InstallMySQLComp) InitDefaultPrivAndSchema() (err error) { var initSQLs []string // 拼接tdbctl session级命令,初始化session设置tc_admin=0 - if strings.Contains(i.Params.Pkg, "tdbctl") { + if i.Params.GetPkgTypeName() == cst.PkgTypeTdbctl { initSQLs = append(initSQLs, "set tc_admin = 0;") } if bsql, err = staticembed.DefaultSysSchemaSQL.ReadFile(staticembed.DefaultSysSchemaSQLFileName); err != nil { logger.Error("读取嵌入文件%s失败", staticembed.DefaultSysSchemaSQLFileName) - return + return err } for _, value := range strings.SplitAfterN(string(bsql), ";", -1) { if !regexp.MustCompile(`^\\s*$`).MatchString(value) { @@ -733,13 +724,13 @@ func (i *InstallMySQLComp) InitDefaultPrivAndSchema() (err error) { if len(initSQLs) < 2 { return fmt.Errorf("初始化sql为空%v", initSQLs) } - if strings.Contains(i.Params.Pkg, "tdbctl") { + if i.Params.GetPkgTypeName() == cst.PkgTypeTdbctl { initSQLs = append(initSQLs, staticembed.SpiderInitSQL) } // 调用 mysql-monitor 里的主从复制延迟检查心跳表, infodba_schema.master_slave_heartbeat initSQLs = append(initSQLs, masterslaveheartbeat.DropTableSQL, masterslaveheartbeat.CreateTableSQL) - if !strings.Contains(i.Params.Pkg, "tspider") { // 避免迁移实例时,新机器还没有这个表,会同步失败 + if i.Params.GetPkgTypeName() == cst.PkgTypeMysql { // 避免迁移实例时,新机器还没有这个表,会同步失败 initSQLs = append(initSQLs, spider.GetGlobalBackupSchema("InnoDB", nil)) } @@ -747,7 +738,7 @@ func (i *InstallMySQLComp) InitDefaultPrivAndSchema() (err error) { var dbWork *native.DbWorker if dbWork, err = native.NewDbWorker(native.DsnBySocket(i.InsSockets[port], "root", "")); err != nil { logger.Error("connenct by %s failed,err:%s", port, err.Error()) - return + return err } // 初始化schema @@ -843,8 +834,15 @@ func (i *InstallMySQLComp) CreateExporterCnf() (err error) { logger.Error("create exporter conf err : %s", err.Error()) return err } - if _, err = osutil.ExecShellCommand(false, fmt.Sprintf("chown -R mysql %s", exporterConfName)); err != nil { - logger.Error("chown -R mysql %s %s", exporterConfName, err.Error()) + // /etc/exporter_xxx.args is used to set mysqld_exporter collector args + exporterArgsName := fmt.Sprintf("/etc/exporter_%d.args", port) + if err = util.CreateMysqlExporterArgs(exporterArgsName, i.Params.GetPkgTypeName(), port); err != nil { + logger.Error("create exporter collector args err : %s", err.Error()) + return err + } + if _, err = osutil.ExecShellCommand(false, + fmt.Sprintf("chown -R mysql %s %s", exporterConfName, exporterArgsName)); err != nil { + logger.Error("chown -R mysql %s %s : %s", exporterConfName, exporterArgsName, err.Error()) return err } } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_new_dbbackup.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_new_dbbackup.go index f7ada648a2..004bc12ce2 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_new_dbbackup.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_new_dbbackup.go @@ -42,6 +42,7 @@ type logicBackupDataOption struct { // InstallNewDbBackupParam TODO type InstallNewDbBackupParam struct { components.Medium + // Configs BackupConfig Configs map[string]map[string]string `json:"configs" validate:"required"` // 模板配置 Options BackupOptions `json:"options" validate:"required"` // 选项参数配置 Host string `json:"host" validate:"required,ip"` // 当前实例的主机地址 @@ -162,6 +163,8 @@ func (i *InstallNewDbBackupComp) initBackupOptions() { var ignoretbls, ignoredbs []string ignoredbs = strings.Split(i.Params.Options.IgnoreObjs.IgnoreDatabases, ",") ignoredbs = append(ignoredbs, native.DBSys...) + // 默认备份需要 infodba_schema 库 + ignoredbs = util.StringsRemove(ignoredbs, native.INFODBA_SCHEMA) ignoretbls = strings.Split(i.Params.Options.IgnoreObjs.IgnoreTables, ",") i.ignoredbs = util.UniqueStrings(util.RemoveEmpty(ignoredbs)) @@ -210,7 +213,7 @@ func (i *InstallNewDbBackupComp) getInsShardValue(port int) int { return 0 } -// InitRenderData 初始化待渲染的配置变量 +// InitRenderData 初始化待渲染的配置变量 renderCnf[port]: backup_configs func (i *InstallNewDbBackupComp) InitRenderData() (err error) { if i.Params.UntarOnly { logger.Info("untar_only=true do not need InitRenderData") @@ -219,7 +222,7 @@ func (i *InstallNewDbBackupComp) InitRenderData() (err error) { bkuser := i.GeneralParam.RuntimeAccountParam.DbBackupUser bkpwd := i.GeneralParam.RuntimeAccountParam.DbBackupPwd - regexfunc, err := db_table_filter.NewDbTableFilter([]string{"*"}, []string{"*"}, i.ignoredbs, i.ignoretbls) + regexfunc, err := db_table_filter.BuildMydumperRegex([]string{"*"}, []string{"*"}, i.ignoredbs, i.ignoretbls) if err != nil { return err } @@ -236,7 +239,7 @@ func (i *InstallNewDbBackupComp) InitRenderData() (err error) { case cst.BackupRoleOrphan: // orphan 使用的是 tendbsingle Master.DataSchemaGrant dsg = i.Params.Options.Master.DataSchemaGrant - case cst.BackupRoleSpiderMaster, cst.BackupRoleSpiderSlave: + case cst.BackupRoleSpiderMaster, cst.BackupRoleSpiderSlave, cst.BackupRoleSpiderMnt: // spider 只在 spider_master and tdbctl_master 上,备份schema,grant dsg = "schema,grant" default: diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_tokudb_plugin.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_tokudb_plugin.go index 88f56f5d61..d473cbe18a 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_tokudb_plugin.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_tokudb_plugin.go @@ -11,6 +11,7 @@ package mysql import ( + "errors" "fmt" "path" "regexp" @@ -18,8 +19,6 @@ import ( "strings" "sync" - "github.com/pkg/errors" - "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/logger" "dbm-services/mysql/db-tools/dbactuator/pkg/components" @@ -68,9 +67,7 @@ func (t *EnableTokudbEngineComp) CloseConn() (err error) { return nil } -// Example - -// Example TODO +// Example subcommand example input func (t *EnableTokudbEngineComp) Example() interface{} { return &EnableTokudbEngineComp{ Params: EnableTokudbParams{ @@ -85,7 +82,7 @@ func (t *EnableTokudbEngineComp) Example() interface{} { } } -// Init TODO +// Init prepare run env func (t *EnableTokudbEngineComp) Init() (err error) { t.conns = make(map[Port]*native.DbWorker) t.sockeMap = make(map[Port]string) @@ -202,11 +199,11 @@ func (t *EnableTokudbEngineComp) ReWriteMyCnf() (err error) { return err } -// Install TODO +// Install :install func (t *EnableTokudbEngineComp) Install() (err error) { wg := sync.WaitGroup{} mu := sync.Mutex{} - errMap := make(map[Port]error) + var errs []error for _, port := range t.Params.Ports { conn, ok := t.conns[port] if !ok { @@ -226,23 +223,11 @@ func (t *EnableTokudbEngineComp) Install() (err error) { if err != nil { logger.Error("restart mysql %d instance err:%v", port, err) mu.Lock() - errMap[port] = err + errs = append(errs, fmt.Errorf("retsart %d failde:%w", port, err)) mu.Unlock() } }(port) } wg.Wait() - if len(errMap) <= 0 { - return nil - } - var gerr error - for port, errx := range errMap { - logger.Error("restart mysql %d instance err:%v", port, errx) - if gerr == nil { - gerr = errx - } else { - gerr = fmt.Errorf("%v,\n%v", gerr, errx) - } - } - return gerr + return errors.Join(errs...) } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_dump_schema.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_dump_schema.go new file mode 100644 index 0000000000..e34c6e47a6 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_dump_schema.go @@ -0,0 +1,386 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysql + +import ( + "encoding/json" + "fmt" + "net/url" + "os" + "path" + "reflect" + "regexp" + "strconv" + "strings" + + "dbm-services/common/go-pubpkg/bkrepo" + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/pkg/components" + "dbm-services/mysql/db-tools/dbactuator/pkg/core/cst" + "dbm-services/mysql/db-tools/dbactuator/pkg/native" + "dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil" + "dbm-services/mysql/db-tools/dbactuator/pkg/util/osutil" +) + +// OpenAreaDumpSchemaComp TODO +type OpenAreaDumpSchemaComp struct { + GeneralParam *components.GeneralParam `json:"general"` + Params OpenAreaDumpSchemaParam `json:"extend"` + OpenAreaDumpSchemaRunTimeCtx `json:"-"` +} + +// OpenAreaDumpSchemaParam TODO +type OpenAreaDumpSchemaParam struct { + Host string `json:"host" validate:"required,ip"` // 当前实例的主机地址 + Port int `json:"port" validate:"required,lt=65536,gte=3306"` // 当前实例的端口 + CharSet string `json:"charset" validate:"required,checkCharset"` // 字符集参数 传default过来,按照源数据库的字符集 + RootId string `json:"root_id"` + BkCloudId int `json:"bk_cloud_id"` + DBCloudToken string `json:"db_cloud_token"` + DumpDirName string `json:"dump_dir_name"` // dump目录名称 {}_schema {}_data + FileServer FileServer `json:"fileserver"` + OpenAreaParam []OneOpenAreaSchema `json:"open_area_param"` +} + +// OneOpenAreaSchema 用于存放一个区库表的信息 +type OneOpenAreaSchema struct { + Schema string `json:"schema"` // 指定dump的库 + Tbales []string `json:"tables"` +} + +// OpenAreaDumpSchemaRunTimeCtx TODO +type OpenAreaDumpSchemaRunTimeCtx struct { + charset string // 当前实例的字符集 + dumpCmd string // 中控位置不一样 + isTdbctl bool // 是否spider中控 + dumpDirPath string // dump目录绝对路径 + tarName string // 压缩文件名称 {}.tar.gz + workDir string // schema目录所在的位置 即位于/data/install/mysql_open_area + uploadFile []UploadFile + GtidPurgedOff bool // 对于开启了gtid模式的实例,在导出时设置 --set-gtid-purged=OFF +} + +// UploadFile TODO +type UploadFile struct { + FilePath string // 上传文件的绝对路径 + FileName string // 上传文件的名称 +} + +// Example TODO +func (c *OpenAreaDumpSchemaComp) Example() interface{} { + comp := OpenAreaDumpSchemaComp{ + Params: OpenAreaDumpSchemaParam{ + Host: "0.0.0.0", + Port: 3306, + CharSet: "default", + RootId: "xxxxxxx", + OpenAreaParam: []OneOpenAreaSchema{ + { + Schema: "data1", + Tbales: []string{"tb1", "tb2"}, + }, + { + Schema: "data2", + Tbales: []string{"tb1", "tb2"}, + }, + }, + }, + } + return comp +} + +// Init TODO +func (c *OpenAreaDumpSchemaComp) Init() (err error) { + // 连接实例,查询版本和字符集 同时根据版本确认是否为中控 + conn, err := native.InsObject{ + Host: c.Params.Host, + Port: c.Params.Port, + User: c.GeneralParam.RuntimeAccountParam.AdminUser, + Pwd: c.GeneralParam.RuntimeAccountParam.AdminPwd, + }.Conn() + if err != nil { + logger.Error("Connect %d failed:%s", c.Params.Port, err.Error()) + return err + } + // 获取版本,下面通过版本判断是否是中控节点 + version, err := conn.SelectVersion() + if err != nil { + logger.Error("获取version failed %s", err.Error()) + return err + } + c.isTdbctl = strings.Contains(version, "tdbctl") + + // 如果是中控或者mysql版本大于等于5.6.9的,设置--set-gtid-purged=OFF + // 中控在precheck中判断 + if strings.Contains(version, "mysql") { + reg, err := regexp.Compile(`(\d+\.\d+\.\d+)`) + if err != nil { + logger.Error("regexp.Compile failed:%s", err.Error()) + return err + } + v := reg.FindString(version) + if c.VersionCompare(v) { + c.GtidPurgedOff = true + } + } + + c.charset = c.Params.CharSet + if c.Params.CharSet == "default" { + if c.charset, err = conn.ShowServerCharset(); err != nil { + logger.Error("获取实例的字符集失败:%s", err.Error()) + return err + } + } + c.workDir = path.Join(cst.BK_PKG_INSTALL_PATH, "mysql_open_area") + c.dumpDirPath = path.Join(c.workDir, c.Params.DumpDirName) + c.tarName = fmt.Sprintf("%s.tar.gz", c.Params.DumpDirName) + err = os.MkdirAll(c.dumpDirPath, 0755) + if err != nil { + logger.Error("开区目录创建失败!%s", err.Error()) + return err + } + + return nil +} + +// Precheck TODO +func (c *OpenAreaDumpSchemaComp) Precheck() (err error) { + // spider实例和mysql实例的目录都是/usr/local/mysql spider建立了软链 也是mysql + c.dumpCmd = path.Join(cst.MysqldInstallPath, "bin", "mysqldump") + if c.isTdbctl { + c.dumpCmd = path.Join(cst.TdbctlInstallPath, "bin", "mysqldump") + c.GtidPurgedOff = true + } + if !osutil.FileExist(c.dumpCmd) { + return fmt.Errorf("dumpCmd: %s文件不存在", c.dumpCmd) + } + return +} + +// OpenAreaDumpSchema TODO +func (c *OpenAreaDumpSchemaComp) OpenAreaDumpSchema() (err error) { + + for _, oneOpenAreaSchema := range c.Params.OpenAreaParam { + var dumper mysqlutil.Dumper + outputfileName := fmt.Sprintf("%s.sql", oneOpenAreaSchema.Schema) + schema := fmt.Sprintf("%s %s", + oneOpenAreaSchema.Schema, strings.Join(oneOpenAreaSchema.Tbales, " "), + ) + // 导出表结构,同时导出存储过程、触发器、event + dumper = &mysqlutil.MySQLDumperTogether{ + MySQLDumper: mysqlutil.MySQLDumper{ + DumpDir: c.dumpDirPath, + Ip: c.Params.Host, + Port: c.Params.Port, + DbBackupUser: c.GeneralParam.RuntimeAccountParam.AdminUser, + DbBackupPwd: c.GeneralParam.RuntimeAccountParam.AdminPwd, + DbNames: []string{schema}, + DumpCmdFile: c.dumpCmd, + Charset: c.charset, + MySQLDumpOption: mysqlutil.MySQLDumpOption{ + NoData: true, + AddDropTable: false, + DumpRoutine: true, + DumpTrigger: true, + DumpEvent: true, + GtidPurgedOff: c.GtidPurgedOff, + }, + }, + OutputfileName: outputfileName, + } + if err := dumper.Dump(); err != nil { + logger.Error("dump failed: ", err.Error()) + return err + } + } + + return nil +} + +// OpenAreaDumpData TODO +func (c *OpenAreaDumpSchemaComp) OpenAreaDumpData() (err error) { + + for _, oneOpenAreaSchema := range c.Params.OpenAreaParam { + var dumper mysqlutil.Dumper + if len(oneOpenAreaSchema.Tbales) == 0 { + + continue + } + outputfileName := fmt.Sprintf("%s.sql", oneOpenAreaSchema.Schema) + schema := fmt.Sprintf("%s %s", + oneOpenAreaSchema.Schema, strings.Join(oneOpenAreaSchema.Tbales, " "), + ) + + dumper = &mysqlutil.MySQLDumperTogether{ + MySQLDumper: mysqlutil.MySQLDumper{ + DumpDir: c.dumpDirPath, + Ip: c.Params.Host, + Port: c.Params.Port, + DbBackupUser: c.GeneralParam.RuntimeAccountParam.AdminUser, + DbBackupPwd: c.GeneralParam.RuntimeAccountParam.AdminPwd, + DbNames: []string{schema}, + DumpCmdFile: c.dumpCmd, + Charset: c.charset, + MySQLDumpOption: mysqlutil.MySQLDumpOption{ + NoData: false, + AddDropTable: false, + NeedUseDb: false, + NoCreateTb: true, + DumpRoutine: false, + GtidPurgedOff: c.GtidPurgedOff, + }, + }, + OutputfileName: outputfileName, + } + if err := dumper.Dump(); err != nil { + logger.Error("dump failed: ", err.Error()) + return err + } + } + + return nil +} + +// CompressDumpDir TODO +func (c *OpenAreaDumpSchemaComp) CompressDumpDir() (err error) { + // // 如果不上传制品库,则不用压缩 + // if reflect.DeepEqual(c.Params.FileServer, FileServer{}) { + // logger.Info("the fileserver parameter is empty no upload is required ~") + // return nil + // } + // tarPath是开区目录压缩文件的绝对路径 + tarPath := path.Join(c.workDir, c.tarName) + schemaInfo := UploadFile{ + FilePath: tarPath, + FileName: c.tarName, + } + c.uploadFile = append(c.uploadFile, schemaInfo) + tarCmd := fmt.Sprintf("tar -zcf %s -C %s %s", tarPath, c.workDir, c.Params.DumpDirName) + output, err := osutil.ExecShellCommand(false, tarCmd) + if err != nil { + logger.Error("execute(%s) get an error:%s,%s", tarCmd, output, err.Error()) + return err + } + + // 获取压缩文件的MD5 + md5Val, err := osutil.GetFileMd5(tarPath) + if err != nil { + logger.Error("Failed to obtain the MD5 value of the file!Error:%s", err.Error()) + return err + } + md5FileName := fmt.Sprintf("%s.md5sum", c.Params.DumpDirName) + md5FilePath := path.Join(c.workDir, md5FileName) + md5Info := UploadFile{ + FilePath: md5FilePath, + FileName: md5FileName, + } + c.uploadFile = append(c.uploadFile, md5Info) + md5File, err := os.Create(md5FilePath) + if err != nil { + logger.Error("create file(%s) get an error:%s", md5FileName, err.Error()) + return err + } + defer md5File.Close() + _, err = md5File.WriteString(md5Val) + if err != nil { + logger.Error("Write md5 value(%s) to file(%s) error: %s", md5Val, md5FileName, err.Error()) + return err + } + return nil +} + +// Upload TODO +func (c *OpenAreaDumpSchemaComp) Upload() (err error) { + // 这里不传FileServer相关内容,则不会上传到制品库 + if reflect.DeepEqual(c.Params.FileServer, FileServer{}) { + logger.Info("the fileserver parameter is empty no upload is required ~") + return nil + } + + for _, uf := range c.uploadFile { + r := path.Join("generic", c.Params.FileServer.Project, c.Params.FileServer.Bucket, c.Params.FileServer.UploadPath) + uploadUrl, err := url.JoinPath(c.Params.FileServer.URL, r, "/") + if err != nil { + logger.Error("call url joinPath failed %s ", err.Error()) + return err + } + if c.Params.BkCloudId == 0 { + // 此处设置上传的路径,注意最后是待上传文件名,不是文件路径 + uploadUrl, err = url.JoinPath( + c.Params.FileServer.URL, path.Join( + "/generic", c.Params.FileServer.Project, + c.Params.FileServer.Bucket, c.Params.FileServer.UploadPath, uf.FileName, + ), + ) + if err != nil { + logger.Error("call url joinPath failed %s ", err.Error()) + return err + } + } + logger.Info("bk_cloud_id:%d,upload url:%s", c.Params.BkCloudId, uploadUrl) + resp, err := bkrepo.UploadFile( + uf.FilePath, uploadUrl, c.Params.FileServer.Username, c.Params.FileServer.Password, + c.Params.BkCloudId, c.Params.DBCloudToken, + ) + if err != nil { + logger.Error("upload sqlfile error %s", err.Error()) + return err + } + if resp.Code != 0 { + errMsg := fmt.Sprintf( + "upload respone code is %d,respone msg:%s,traceId:%s", + resp.Code, + resp.Message, + resp.RequestId, + ) + logger.Error(errMsg) + return fmt.Errorf(errMsg) + } + logger.Info("Resp: code:%d,msg:%s,traceid:%s", resp.Code, resp.Message, resp.RequestId) + var uploadRespdata bkrepo.UploadRespData + if err := json.Unmarshal(resp.Data, &uploadRespdata); err != nil { + logger.Error("unmarshal upload respone data failed %s", err.Error()) + return err + } + logger.Info("%v", uploadRespdata) + } + + return nil +} + +// VersionCompare TODO +func (c *OpenAreaDumpSchemaComp) VersionCompare(version string) bool { + verStr1 := strings.Split(version, ".") + verStr2 := strings.Split("5.6.8", ".") + verLen := len(verStr1) + if len(verStr2) > len(verStr1) { + verLen = len(verStr2) + } + + for i := 0; i < verLen; i++ { + // int默认值是0 + var v1, v2 int + + if i < len(verStr1) { + v1, _ = strconv.Atoi(verStr1[i]) + } + if i < len(verStr2) { + v2, _ = strconv.Atoi(verStr2[i]) + } + + if v1 > v2 { + return true + } else if v1 < v2 { + return false + } + } + return false +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_import_schema.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_import_schema.go new file mode 100644 index 0000000000..3e1cd117a9 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/open_area_import_schema.go @@ -0,0 +1,261 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysql + +import ( + "fmt" + "os" + "path" + "regexp" + + "dbm-services/bigdata/db-tools/dbactuator/pkg/util" + "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/pkg/components" + "dbm-services/mysql/db-tools/dbactuator/pkg/core/cst" + "dbm-services/mysql/db-tools/dbactuator/pkg/native" + "dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil" + "dbm-services/mysql/db-tools/dbactuator/pkg/util/osutil" + + "github.com/pkg/errors" +) + +// OpenAreaImportSchemaComp TODO +type OpenAreaImportSchemaComp struct { + GeneralParam *components.GeneralParam `json:"general"` + Params OpenAreaImportSchemaParam `json:"extend"` + OpenAreaImportSchemaRunTimeCtx `json:"-"` +} + +// OpenAreaImportSchemaParam TODO +type OpenAreaImportSchemaParam struct { + Host string `json:"host" validate:"required,ip"` + Port int `json:"port" validate:"required,lt=65536,gte=3306"` + CharSet string `json:"charSet" validate:"required,checkCharset"` + RootId string `json:"root_id"` + BkCloudId int `json:"bk_cloud_id"` + DumpDirName string `json:"dump_dir_name"` // dump目录名称 {}_schema {}_data + DBCloudToken string `json:"db_cloud_token"` + OpenAreaParam []OneOpenAreaImportSchema `json:"open_area_param"` +} + +// OneOpenAreaImportSchema TODO +type OneOpenAreaImportSchema struct { + Schema string `json:"schema"` // 指定dump的库 + NewDB string `json:"newdb"` +} + +// OpenAreaImportSchemaRunTimeCtx TODO +type OpenAreaImportSchemaRunTimeCtx struct { + charset string // 当前实例的字符集 + workDir string + tarFilePath string + md5FilePath string + dumpDir string + conn *native.DbWorker + socket string +} + +// Example TODO +func (c *OpenAreaImportSchemaComp) Example() interface{} { + comp := OpenAreaImportSchemaComp{ + Params: OpenAreaImportSchemaParam{ + Host: "0.0.0.0", + Port: 3306, + CharSet: "default", + RootId: "xxxxxxx", + OpenAreaParam: []OneOpenAreaImportSchema{ + { + Schema: "data1", + NewDB: "data1-1001", + }, + { + Schema: "data2", + NewDB: "data2-1001", + }, + }, + }, + } + return comp +} + +// Init TODO +func (c *OpenAreaImportSchemaComp) Init() (err error) { + // 连接实例,确认字符集 + c.conn, err = native.InsObject{ + Host: c.Params.Host, + Port: c.Params.Port, + User: c.GeneralParam.RuntimeAccountParam.AdminUser, + Pwd: c.GeneralParam.RuntimeAccountParam.AdminPwd, + }.Conn() + if err != nil { + logger.Error("Connect %d failed:%s", c.Params.Port, err.Error()) + return err + } + c.charset = c.Params.CharSet + if c.Params.CharSet == "default" { + if c.charset, err = c.conn.ShowServerCharset(); err != nil { + logger.Error("获取实例的字符集失败:%s", err.Error()) + return err + } + } + c.socket, err = c.conn.ShowSocket() + if err != nil { + logger.Error("get socket failed!error:", err.Error()) + return err + } + c.workDir = path.Join(cst.BK_PKG_INSTALL_PATH, "mysql_open_area") + // 绝对路径 + tarFileName := fmt.Sprintf("%s.tar.gz", c.Params.DumpDirName) + c.tarFilePath = path.Join(c.workDir, tarFileName) + md5FileName := fmt.Sprintf("%s.md5sum", c.Params.DumpDirName) + c.md5FilePath = path.Join(c.workDir, md5FileName) + c.dumpDir = path.Join(c.workDir, c.Params.DumpDirName) + return +} + +// Precheck TODO +func (c *OpenAreaImportSchemaComp) Precheck() (err error) { + if !util.FileExists(c.tarFilePath) { + logger.Error("tar file(*s) does not exist.", c.tarFilePath) + return errors.New("压缩文件不存在") + } + if !util.FileExists(c.md5FilePath) { + logger.Error("tar file(*s) does not exist.", c.tarFilePath) + return errors.New("md5sum文件不存在") + } + return +} + +// DecompressDumpDir TODO +func (c *OpenAreaImportSchemaComp) DecompressDumpDir() (err error) { + md5Byte, err := os.ReadFile(c.md5FilePath) + if err != nil { + logger.Error("read md5sum(%s) file got an error:%s", c.md5FilePath, err.Error()) + return err + } + realMd5sumVal, err := osutil.GetFileMd5(c.tarFilePath) + if err != nil { + logger.Error("get real md5sum value failed!") + return err + } + sourceMd5sumVal := string(md5Byte) + if sourceMd5sumVal != realMd5sumVal { + msg := fmt.Sprintf("realMD5Sum(%s) is not equal to md5sum(%s) recored in the file(%s)", + realMd5sumVal, sourceMd5sumVal, c.md5FilePath) + logger.Error(msg) + return errors.New(msg) + } + logger.Info("get tar file sucess!") + decopressCmd := fmt.Sprintf("tar -zxf %s -C %s", c.tarFilePath, c.workDir) + output, err := osutil.ExecShellCommand(false, decopressCmd) + if err != nil { + logger.Error("execute(%s) get an error:%s,%s", decopressCmd, output, err.Error()) + return err + } + + return +} + +// EraseAutoIncrement TODO +func (c *OpenAreaImportSchemaComp) EraseAutoIncrement() (err error) { + for _, oneSchemaInfo := range c.Params.OpenAreaParam { + schemaFilePath := fmt.Sprintf("%s/%s.sql", c.dumpDir, oneSchemaInfo.Schema) + schemaContent, err := os.ReadFile(schemaFilePath) + if err != nil { + logger.Error("read file(%s) got an error:%s", schemaFilePath, err.Error()) + return err + } + reg, err := regexp.Compile(`(?i)AUTO_INCREMENT=(\d+)`) + if err != nil { + logger.Error("regexp.Compile failed:%s", err.Error()) + return err + } + newSchemaContent := reg.ReplaceAllString(string(schemaContent), "") + newSchemaFilePath := fmt.Sprintf("%s.new", schemaFilePath) + + f, err := os.Create(newSchemaFilePath) + if err != nil { + logger.Error("create file(%s) error:%s", newSchemaFilePath, err.Error()) + return err + } + _, err = f.WriteString(newSchemaContent) + if err != nil { + logger.Error("write file(%s) error:%s", newSchemaFilePath, err.Error()) + return err + } + } + return nil +} + +// CreateNewDatabase TODO +func (c *OpenAreaImportSchemaComp) CreateNewDatabase() (err error) { + for _, oneShemaInfo := range c.Params.OpenAreaParam { + createDBSql := fmt.Sprintf("create database if not exists `%s` charset %s;", + oneShemaInfo.NewDB, c.charset) + _, err := c.conn.Exec(createDBSql) + if err != nil { + logger.Error("create db %s got an error:%s", oneShemaInfo.NewDB, err.Error()) + return err + } + } + return +} + +// OpenAreaImportSchema TODO +func (c *OpenAreaImportSchemaComp) OpenAreaImportSchema() (err error) { + for _, oneShemaInfo := range c.Params.OpenAreaParam { + schemaName := fmt.Sprintf("%s.sql.new", oneShemaInfo.Schema) + err = mysqlutil.ExecuteSqlAtLocal{ + IsForce: false, + Charset: c.charset, + NeedShowWarnings: false, + Host: c.Params.Host, + Port: c.Params.Port, + Socket: c.socket, + WorkDir: c.dumpDir, + User: c.GeneralParam.RuntimeAccountParam.AdminUser, + Password: c.GeneralParam.RuntimeAccountParam.AdminPwd, + }.ExcuteSqlByMySQLClientOne(schemaName, oneShemaInfo.NewDB) + if err != nil { + logger.Error("执行%s文件失败!", schemaName) + return err + } + } + return nil +} + +// OpenAreaImportData TODO +func (c *OpenAreaImportSchemaComp) OpenAreaImportData() (err error) { + for _, oneShemaInfo := range c.Params.OpenAreaParam { + dataFileName := fmt.Sprintf("%s.sql", oneShemaInfo.Schema) + err = mysqlutil.ExecuteSqlAtLocal{ + IsForce: false, + Charset: c.charset, + NeedShowWarnings: false, + Host: c.Params.Host, + Port: c.Params.Port, + Socket: c.socket, + WorkDir: c.dumpDir, + User: c.GeneralParam.RuntimeAccountParam.AdminUser, + Password: c.GeneralParam.RuntimeAccountParam.AdminPwd, + }.ExcuteSqlByMySQLClientOne(dataFileName, oneShemaInfo.NewDB) + if err != nil { + logger.Error("执行%s文件失败!", dataFileName) + return err + } + } + return nil +} + +// CleanDumpDir TODO +func (c *OpenAreaImportSchemaComp) CleanDumpDir() (err error) { + return +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/oscmd_run.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/oscmd_run.go new file mode 100644 index 0000000000..5ecfbbfc7d --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/oscmd_run.go @@ -0,0 +1,141 @@ +package mysql + +import ( + "encoding/json" + "fmt" + "strings" + + "dbm-services/common/go-pubpkg/logger" + + "github.com/pkg/errors" + + "dbm-services/common/go-pubpkg/cmutil" + "dbm-services/mysql/db-tools/dbactuator/pkg/components" +) + +// OSCmdRunComp TODO +type OSCmdRunComp struct { + Params OSCmds `json:"extend"` + results []*SimpleCmdResult + errIndex int +} + +// OSCmds TODO +type OSCmds struct { + // Cmds 命令按顺序执行,每个命令完全独立 + Cmds []SimpleCmd `json:"cmds" validate:"required"` + // WorkDir 会应用到每个命令 + WorkDir string `json:"work_dir"` + //RunUser string `json:"run_user"` +} +type SimpleCmd struct { + CmdName string `json:"cmd_name" validate:"required" enums:"mkdir,ls,cd,chown,chmod,du,df,head,tail,grep"` + // CmdArgs 参数列表 + CmdArgs []string `json:"cmd_args"` +} + +type SimpleCmdResult struct { + // CmdLine 渲染的命令 + CmdLine string `json:"cmd_line"` + // CmdStdout 命令执行标准输出 + CmdStdout string `json:"cmd_stdout"` + // CmdStderr 命令执行错误输出 + CmdStderr string `json:"cmd_stderr"` + ErrMsg string `json:"err_msg"` + err error +} + +type OSCmdRunResp struct { + // Code 只要有一个命令执行出错即退出,错误码 1。正常执行 code=0 + Code int `json:"code"` + Message string `json:"message"` + Data []*SimpleCmdResult `json:"data"` +} + +func (s *SimpleCmd) Run(workDir string) *SimpleCmdResult { + cmdLine := fmt.Sprintf(`%s %s`, s.CmdName, strings.Join(s.CmdArgs, " ")) + cmdResult := &SimpleCmdResult{CmdLine: cmdLine} + if strings.Contains(cmdLine, ";") { + cmdResult.err = errors.New("danger cmd") + cmdResult.ErrMsg = cmdResult.err.Error() + return cmdResult + } + fmt.Println(cmdLine) + switch s.CmdName { + case "mkdir", "ls", "cd", "chown", "chmod", "du", "df", "head", "tail", "grep": + logger.Info("oscmd_run command:", cmdLine) + stdout, stderr, err := cmutil.ExecCommand(false, workDir, s.CmdName, s.CmdArgs...) + cmdResult.CmdStdout = stdout + cmdResult.CmdStderr = stderr + cmdResult.err = err + default: + cmdResult.err = errors.New("cmd_name is not allowed") + cmdResult.ErrMsg = cmdResult.err.Error() + return cmdResult + } + if cmdResult.err != nil { + cmdResult.ErrMsg = cmdResult.err.Error() + } + return cmdResult +} + +// Example TODO +func (s *OSCmdRunComp) Example() interface{} { + comp := OSCmdRunComp{ + Params: OSCmds{ + Cmds: []SimpleCmd{ + {CmdName: "mkdir", CmdArgs: []string{"/data/dbbak/123"}}, + {CmdName: "ls", CmdArgs: []string{"/data/dbbak"}}, + }}, + } + return comp +} + +// String 用于打印 +func (s *OSCmdRunComp) String() string { + str, _ := json.Marshal(s) + return string(str) +} + +// Start TODO +func (s *OSCmdRunComp) Start() error { + s.errIndex = -1 + for i, c := range s.Params.Cmds { + res := c.Run(s.Params.WorkDir) + s.results = append(s.results, res) + if res.err != nil { + s.errIndex = i + _ = s.OutputCtx() + return res.err + } + } + return s.OutputCtx() +} + +// WaitDone TODO +func (s *OSCmdRunComp) WaitDone() error { + return nil +} + +// OutputCtx TODO +func (s *OSCmdRunComp) OutputCtx() error { + var resp OSCmdRunResp + if s.errIndex >= 0 { + resp = OSCmdRunResp{ + Message: s.results[s.errIndex].CmdStderr, + Code: 1, + Data: s.results, + } + } else { + resp = OSCmdRunResp{ + Code: 0, + Data: s.results, + } + } + ss, err := components.WrapperOutput(resp) + if err != nil { + return err + } + fmt.Println(ss) + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/osinfo_get.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/osinfo_get.go new file mode 100644 index 0000000000..55f0f4d767 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/osinfo_get.go @@ -0,0 +1,90 @@ +package mysql + +import ( + "encoding/json" + "fmt" + + "dbm-services/common/go-pubpkg/cmutil" + "dbm-services/mysql/db-tools/dbactuator/pkg/components" +) + +// OSInfoGetComp TODO +type OSInfoGetComp struct { + Params OSInfoParam `json:"extend"` + result OSInfoResult + defaultParams bool +} + +// OSInfoParam TODO +type OSInfoParam struct { + // Directory default [/ /data /data1 /data2] + Directory []string `json:"directory"` + NoCheckDevice bool `json:"no_check_device"` +} + +type OSInfoResult struct { + Mem *cmutil.MemoryInfo `json:"mem"` + Cpu *cmutil.CPUInfo `json:"cpu"` + Disk []*cmutil.DiskPartInfo `json:"disk"` +} + +// Example TODO +func (s *OSInfoGetComp) Example() interface{} { + comp := OSInfoGetComp{ + Params: OSInfoParam{ + Directory: []string{"/data/dbbak", "/data1/dbbak"}, + NoCheckDevice: false, + }, + } + return comp +} + +// String 用于打印 +func (s *OSInfoGetComp) String() string { + str, _ := json.Marshal(s) + return string(str) +} + +// Start TODO +func (s *OSInfoGetComp) Start() (err error) { + res := OSInfoResult{} + res.Mem, err = cmutil.GetMemoryInfo() + if err != nil { + return err + } + res.Cpu, err = cmutil.GetCPUInfo() + if err != nil { + return err + } + if len(s.Params.Directory) == 0 { + s.defaultParams = true + s.Params.Directory = []string{"/", "/data", "/data1", "/data2"} + } + for _, dir := range s.Params.Directory { + disk, err := cmutil.GetDiskPartInfo(dir, !s.Params.NoCheckDevice) + if err != nil { + if s.defaultParams { + continue + } + return err + } + res.Disk = append(res.Disk, disk) + } + s.result = res + return nil +} + +// WaitDone TODO +func (s *OSInfoGetComp) WaitDone() error { + return nil +} + +// OutputCtx TODO +func (s *OSInfoGetComp) OutputCtx() error { + ss, err := components.WrapperOutput(s.result) + if err != nil { + return err + } + fmt.Println(ss) + return nil +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go index c5b36bf048..dbe1697759 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go @@ -331,12 +331,11 @@ func (c *PtTableChecksumComp) transformFilter() (*_ptFilters, error) { c.Params.DbPatterns, c.Params.TablePatterns, c.Params.IgnoreDbs, - c.Params.IgnoreTables, - ) + c.Params.IgnoreTables) if err != nil { return nil, err } - + filter.BuildFilter() logger.Info("filter: %v", filter) var res _ptFilters err = c.transformInclude(&res, filter) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader/logical_loader.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader/logical_loader.go index e6f31311d6..570a897daa 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader/logical_loader.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader/logical_loader.go @@ -10,6 +10,7 @@ import ( "dbm-services/common/go-pubpkg/cmutil" "dbm-services/common/go-pubpkg/logger" + "dbm-services/mysql/db-tools/dbactuator/pkg/native" "dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter" "dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config" ) @@ -42,6 +43,9 @@ func (l *LogicalLoader) CreateConfigFile() error { if loaderConfig.MysqlCharset == "" { loaderConfig.MysqlCharset = "binary" } + if l.doDr { + loaderConfig.DBListDropIfExists = native.INFODBA_SCHEMA + } //logger.Info("dbloader config file, %+v", loaderConfig) // 有密码打印 f := ini.Empty() @@ -146,6 +150,7 @@ func (l *LogicalLoader) buildFilter() error { ); err != nil { return err } else { + filter.BuildFilter() l.myloaderRegex = filter.MyloaderRegex(l.doDr) } return nil diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go index bc1b6f00ed..df33f3407b 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go @@ -88,7 +88,12 @@ func (m *DBLoader) chooseDBBackupLoader() error { IndexObj: m.BackupInfo.indexObj, LoaderDir: m.targetDir, TaskDir: m.taskDir, - EnableBinlog: m.RestoreOpt.EnableBinlog, + //EnableBinlog: m.RestoreOpt.EnableBinlog, + } + if m.RestoreOpt == nil { + m.RestoreOpt = &RestoreOpt{ + EnableBinlog: false, + } } // logger.Warn("validate dbLoaderUtil: %+v", m.dbLoaderUtil) if err := validate.GoValidateStruct(m.dbLoaderUtil, false, false); err != nil { diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/recover_binlog.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/recover_binlog.go index 16872890b6..c3225dd50e 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/recover_binlog.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/recover_binlog.go @@ -98,7 +98,7 @@ type RecoverBinlog struct { parseScript string binlogParsedDir string logDir string - //tools tools.ToolSet + // tools tools.ToolSet } const ( diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/semantic_dump_schema.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/semantic_dump_schema.go index 8c5dc3a670..8b675b1d99 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/semantic_dump_schema.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/semantic_dump_schema.go @@ -161,7 +161,8 @@ func (c *SemanticDumpSchemaComp) DumpSchema() (err error) { AddDropTable: true, NeedUseDb: true, DumpRoutine: true, - DumpTrigger: false, + DumpTrigger: true, + DumpEvent: true, } if c.isSpider { dumpOption.GtidPurgedOff = true @@ -181,7 +182,7 @@ func (c *SemanticDumpSchemaComp) DumpSchema() (err error) { OutputfileName: c.Params.BackupFileName, } if err := dumper.Dump(); err != nil { - logger.Error("dump failed: ", err.Error()) + logger.Error("dump failed: %s", err.Error()) return err } return nil diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/sysinit/sysinit.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/sysinit/sysinit.go index f175785fb6..e3bcc5f1a6 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/sysinit/sysinit.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/sysinit/sysinit.go @@ -1,9 +1,19 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package sysinit TODO package sysinit import ( "fmt" - "io/ioutil" + "os" "dbm-services/common/go-pubpkg/logger" "dbm-services/mysql/db-tools/dbactuator/pkg/core/staticembed" @@ -41,7 +51,7 @@ func ExecSysInitScript() (err error) { return err } tmpScriptName := "/tmp/sysinit.sh" - if err = ioutil.WriteFile(tmpScriptName, data, 07555); err != nil { + if err = os.WriteFile(tmpScriptName, data, 07555); err != nil { logger.Error("write tmp script failed %s", err.Error()) return err } @@ -62,7 +72,7 @@ func (s *SysInitParam) InitExternal() (err error) { return err } tmpScriptName := "/tmp/yum_install_perl_dep.sh" - if err = ioutil.WriteFile(tmpScriptName, data, 07555); err != nil { + if err = os.WriteFile(tmpScriptName, data, 07555); err != nil { logger.Error("write tmp script failed %s", err.Error()) return err } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/cst.go b/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/cst.go index b5c7682370..12b6fa8899 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/cst.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/cst.go @@ -13,13 +13,6 @@ package cst import "time" -const ( - // Environment TODO - Environment = "enviroment" - // Test TODO - Test = "test" -) - const ( // TIMELAYOUT TODO TIMELAYOUT = "2006-01-02 15:04:05" diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/medium.go b/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/medium.go new file mode 100644 index 0000000000..40f53ab3c3 --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/core/cst/medium.go @@ -0,0 +1,10 @@ +package cst + +const ( + // PkgTypeTdbctl tdbctl package + PkgTypeTdbctl = "tdbctl" + // PkgTypeSpider tspider package + PkgTypeSpider = "tspider" + // PkgTypeMysql mysql backend package (storage layer) + PkgTypeMysql = "mysql" +) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/core/staticembed/default_sys_schema.sql b/dbm-services/mysql/db-tools/dbactuator/pkg/core/staticembed/default_sys_schema.sql index cd306b34b8..cce6ec8c6d 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/core/staticembed/default_sys_schema.sql +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/core/staticembed/default_sys_schema.sql @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS infodba_schema.check_heartbeat ( uid INT NOT NULL PRIMARY KEY, ck_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP ) ENGINE = InnoDB; -REPLACE INTO infodba_schema.check_heartbeat(uid) value(1); +REPLACE INTO infodba_schema.check_heartbeat(uid) value(@@server_id); CREATE TABLE IF NOT EXISTS infodba_schema.query_response_time( time_min INT(11) NOT NULL DEFAULT '0', time VARCHAR(14) NOT NULL DEFAULT '', diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/native/db.go b/dbm-services/mysql/db-tools/dbactuator/pkg/native/db.go index 0b929b9a59..591ea5c748 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/native/db.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/native/db.go @@ -96,7 +96,8 @@ func (o InsObject) MySQLClientCmd(mysqlClient string) string { if o.Options != "" { cmd += " " + o.Options } - o.mysqlCli = cmd + // 无效赋值 + // o.mysqlCli = cmd return cmd } @@ -138,11 +139,11 @@ func (o InsObject) CheckInstanceConnIdle(sysUsers []string, sleepTime time.Durat return nil } -// IsEmptyDB 过滤出系统库后,判断是否存在业务db +// isEmptyDB 过滤出系统库后,判断是否存在业务db // // @receiver dblist // @return bool -func IsEmptyDB(dblist []string) bool { +func isEmptyDB(dblist []string) bool { var whiteDBs = DBSys for _, db := range dblist { if !cmutil.HasElem(db, whiteDBs) { diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/native/dbworker.go b/dbm-services/mysql/db-tools/dbactuator/pkg/native/dbworker.go index 7127eac776..bc6663106a 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/native/dbworker.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/native/dbworker.go @@ -13,6 +13,7 @@ package native import ( "context" "database/sql" + "errors" "fmt" "strconv" "strings" @@ -24,7 +25,6 @@ import ( "dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil" "github.com/jmoiron/sqlx" - "github.com/pkg/errors" "github.com/spf13/cast" ) @@ -160,7 +160,7 @@ func (h *DbWorker) QueryOneColumn(columnName string, query string) ([]string, er if len(ret) > 0 { row0 := ret[0] if _, ok := row0[columnName]; !ok { - return nil, errors.Errorf("column name %s not found", columnName) + return nil, fmt.Errorf("column name %s not found", columnName) } } for _, row := range ret { @@ -651,7 +651,7 @@ func (h *DbWorker) IsEmptyInstance() bool { if err != nil { return false } - return IsEmptyDB(dbs) + return isEmptyDB(dbs) } // GetUserHosts 获取MySQL 实例上的user,host @@ -727,7 +727,7 @@ func (h *DbWorker) MySQLVarsCompare(referInsConn *DbWorker, checkVars []string) } func compareDbVariables(referVars, compareVars map[string]string, checkVars []string) (err error) { - var errMsg []string + var errs []error for _, varName := range checkVars { referV, r_ok := referVars[varName] compareV, c_ok := compareVars[varName] @@ -736,13 +736,10 @@ func compareDbVariables(referVars, compareVars map[string]string, checkVars []st continue } if strings.Compare(referV, compareV) != 0 { - errMsg = append(errMsg, fmt.Sprintf("存在差异: 变量名:%s Master:%s,Slave:%s", varName, referV, compareV)) + errs = append(errs, fmt.Errorf("存在差异: 变量名:%s Master:%s,Slave:%s", varName, referV, compareV)) } } - if len(errMsg) > 0 { - return fmt.Errorf(strings.Join(errMsg, "\n")) - } - return nil + return errors.Join(errs...) } // ResetSlave TODO @@ -779,7 +776,8 @@ func (h *DbWorker) GetTableUniqueKeys(dbtable string) (uniqKeys map[string][]str uniqKeys = make(map[string][]string) if err != nil && !strings.Contains(err.Error(), "not row found") { return nil, fmt.Errorf("GetTableUniqueKeysRemote fail,error:%s", err.Error()) - } else if len(result) > 0 { + } + if len(result) > 0 { var pKey []string for _, row := range result { pKey = append(pKey, row["Column_name"].(string)) @@ -790,18 +788,18 @@ func (h *DbWorker) GetTableUniqueKeys(dbtable string) (uniqKeys map[string][]str result, err := h.Query(sqlKeys) if err != nil { return nil, fmt.Errorf("GetTableUniqueKeysRemote fail,error:%s", err.Error()) - } else if len(result) == 0 { + } + if len(result) == 0 { return nil, fmt.Errorf(`No PRIMARY or UNIQUE key found on table %s `, dbtable) - } else { - for _, row := range result { - Key_name := row["Key_name"].(string) - if _, ok := uniqKeys[Key_name]; ok { - uniqKeys[Key_name] = append(uniqKeys[Key_name], row["Column_name"].(string)) - } else { - var uKey []string - uKey = append(uKey, row["Column_name"].(string)) - uniqKeys[Key_name] = uKey - } + } + for _, row := range result { + Key_name := row["Key_name"].(string) + if _, ok := uniqKeys[Key_name]; ok { + uniqKeys[Key_name] = append(uniqKeys[Key_name], row["Column_name"].(string)) + } else { + var uKey []string + uKey = append(uKey, row["Column_name"].(string)) + uniqKeys[Key_name] = uKey } } } @@ -950,7 +948,7 @@ func (slaveConn *DbWorker) ReplicateDelayCheck(allowDelaySec int, behindExecBinL return err } if beatSec > 600 { - return errors.Errorf("超过 %ds 没有延迟检测信号", beatSec) + return fmt.Errorf("超过 %ds 没有延迟检测信号", beatSec) } if delaySec > allowDelaySec { return fmt.Errorf("slave 延迟时间 %ds, 超过了上限 %d", delaySec, allowDelaySec) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter.go index a8dbee7d61..123a6394cc 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter.go @@ -23,6 +23,8 @@ type DbTableFilter struct { } // NewDbTableFilter 构造函数 +// 如果是 mydumper,内置忽略 infodba_schema.conn_log 表 +// NewDbTableFilter 完成后,需要 BuildFilter() func NewDbTableFilter( includeDbPatterns []string, includeTablePatterns []string, @@ -46,12 +48,16 @@ func NewDbTableFilter( return nil, err } - tf.buildDbFilterRegex() - tf.buildTableFilterRegex() - return tf, nil } +// BuildFilter normal build filter +// is different with NewMydumperRegex +func (c *DbTableFilter) BuildFilter() { + c.buildDbFilterRegex() + c.buildTableFilterRegex() +} + func (c *DbTableFilter) validate() error { if len(c.IncludeDbPatterns) == 0 || len(c.IncludeTablePatterns) == 0 { return fmt.Errorf("include patterns can't be empty") @@ -110,7 +116,13 @@ func (c *DbTableFilter) buildTableFilterRegex() { ) } } - + /* + if mydumper { + // ignore infodba_schema.conn_log + // 这里没有放到 ExcludeDbPatterns=[infodba_schema, mysql,test...], ExcludeTablePatterns=[conn_log] 里,因为会拼多 + excludeParts = append(excludeParts, fmt.Sprintf(`%s\.%s$`, native.INFODBA_SCHEMA, "conn_log")) + } + */ c.tableFilterIncludeRegex = buildIncludeRegexp(includeParts) c.tableFilterExcludeRegex = buildExcludeRegexp(excludeParts) } @@ -191,6 +203,7 @@ func (c *DbTableFilter) getDbsByRegexp(ip string, port int, user string, passwor if err != nil { return nil, err } + defer rows.Close() pattern, err := regexp2.Compile(reg, regexp2.None) if err != nil { @@ -236,6 +249,7 @@ func (c *DbTableFilter) getTablesByRegexp(ip string, port int, user string, pass if err != nil { return nil, err } + defer rows.Close() pattern, err := regexp2.Compile(reg, regexp2.None) if err != nil { diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter_test.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter_test.go index 179baaf619..81004c7b95 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter_test.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/db_table_filter_test.go @@ -18,5 +18,6 @@ func TestDbtableFilter(t *testing.T) { t.Fatal(err) return } + r.BuildFilter() t.Log(r.TableFilterRegex()) } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/mydumper_regex.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/mydumper_regex.go index 873394c51d..6dedec3232 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/mydumper_regex.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/db_table_filter/mydumper_regex.go @@ -5,10 +5,27 @@ import ( "strings" ) +func BuildMydumperRegex( + includeDbPatterns []string, + includeTablePatterns []string, + excludeDbPatterns []string, + excludeTablePatterns []string, +) (*DbTableFilter, error) { + tf, err := NewDbTableFilter(includeDbPatterns, includeTablePatterns, excludeDbPatterns, excludeTablePatterns) + if err != nil { + return nil, err + } + + tf.buildDbFilterRegex() + tf.buildTableFilterRegex() + return tf, nil +} + // MyloaderRegex TODO func (c *DbTableFilter) MyloaderRegex(doDr bool) string { if doDr { - sysDBExclude := `^(?!(mysql\.|sys\.|infodba_schema\.|test\.|db_infobase\.))` + // infodba_schema 不忽略,因为需要同步旧库的信息过来,不然replication可能会报错 + sysDBExclude := `^(?!(mysql\.|sys\.|test\.|db_infobase\.))` return sysDBExclude } for i, db := range c.IncludeDbPatterns { diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/dbcnf.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/dbcnf.go index 6ecc2b121a..3dd791f0de 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/dbcnf.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/dbcnf.go @@ -12,6 +12,7 @@ package util import ( "fmt" + "os" "path" "path/filepath" "reflect" @@ -609,3 +610,54 @@ func CreateExporterConf(fileName string, host string, port string, user string, } return nil } + +func CreateMysqlExporterArgs(fileName, pkgType string, port int) error { + spiderArgs := []string{ + "--collect.global_status", + "--collect.global_variables", + "--collect.datadir_size", + "--no-collect.info_schema.processlist", + "--collect.info_schema.processlist_ext", + "--collect.info_schema.processlist_ext.by_user", + "--collect.info_schema.query_response_time", + //"--collect.auto_increment_ext.columns", "--collect.auto_increment_ext.interval=1h", + } + backendArgs := []string{ + "--collect.global_status", + "--collect.global_variables", + "--collect.datadir_size", + "--no-collect.info_schema.processlist", + "--collect.info_schema.processlist_ext", + "--collect.info_schema.processlist_ext.by_user", + "--collect.info_schema.query_response_time", + "--collect.auto_increment_ext.columns", + "--collect.auto_increment_ext.interval=1h", + "--no-collect.slave_status", + "--collect.slave_status_ext", + "--collect.infodba_schema.heartbeat", + "--no-collect.info_schema.tables", + "--collect.info_schema.tables_ext", + "--collect.info_schema.tables_ext.interval=1h", + "--collect.info_schema.tables_ext.databases=*", + "--collect.info_schema.innodb_metrics", + "--collect.info_schema.innodb_trx", + "--collect.engine_innodb_status", + } + //fileName := fmt.Sprintf("/etc/exporter_%d.args", port) + f, err := os.OpenFile(fileName, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0755) + if err != nil { + return err + } + defer f.Close() + if pkgType == cst.PkgTypeSpider { + _, err = f.WriteString(strings.Join(spiderArgs, "\n")) + } else if pkgType == cst.PkgTypeMysql { + _, err = f.WriteString(strings.Join(backendArgs, "\n")) + } else { + return errors.Errorf("port %d unknown dbrole %s for generating mysql exporter args file", port, pkgType) + } + if err != nil { + return err + } + return f.Sync() +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/filelock.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/filelock.go deleted file mode 100644 index 3fdf750c05..0000000000 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/filelock.go +++ /dev/null @@ -1,198 +0,0 @@ -package util - -import ( - "fmt" - "io/ioutil" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/gofrs/flock" - "github.com/pkg/errors" -) - -// FLock TODO -type FLock struct { - fileName string - file *os.File - filedataName string - filedata *os.File - filedataMax int -} - -// NewFlock TODO -func NewFlock(filename string, maxConn int) (*FLock, error) { - // maxConn cannot be 0 - - // check filedataName lastModifyTime - // 如果 filedataName 文件最后修改时间在 1h 以前,删掉这个文件 - - if strings.ContainsAny(filename, " ;'\"") { - // 非法文件名 - return nil, fmt.Errorf("illegal filename:%s", filename) - } else if maxConn == 0 { - return nil, fmt.Errorf("illegal maxConn:%d", maxConn) - } - - filedataName := filename + ".data" - if ok, mtimeInt := GetFileModifyTime(filedataName); ok { - curTime := time.Now() - mtime := time.Unix(mtimeInt, 0) - timeDiff := curTime.Sub(mtime) - if timeDiff.Minutes() > 60 { - os.Remove(filedataName) - } - } - - fl := &FLock{ - fileName: filename, - filedataName: filedataName, - filedataMax: maxConn, - } - - return fl, nil -} - -// FileFlock TODO -func (fl *FLock) FileFlock() (locked bool, err error) { - if fl.fileName == "" { - return false, errors.New("fileLock filename canot be empty") - } - fileLock := flock.New(fl.fileName) - return fileLock.TryLock() -} - -// FileUnlock TODO -func (fl *FLock) FileUnlock() error { - fileLock := flock.New(fl.fileName) - return fileLock.Unlock() -} - -// SetFileLockIncr TODO -func (fl *FLock) SetFileLockIncr(incr int) (succ int, err error) { - f, err := os.OpenFile(fl.filedataName, os.O_CREATE|os.O_RDWR, 0644) - if err == nil { - defer f.Close() - } - content, err := ioutil.ReadAll(f) - contentStr := strings.Trim(strings.ReplaceAll(string(content), " ", ""), "\n") - if err != nil { - return -1, fmt.Errorf(`io error:%v`, err.Error()) - } else if contentStr == "" { - contentStr = fmt.Sprintf(`%d:0`, fl.filedataMax) - } - concurrent := strings.Split(contentStr, ":") - if len(concurrent) != 2 { - return -1, fmt.Errorf(`error:contentStr=%s`, contentStr) - } - maxNum, err1 := strconv.Atoi(concurrent[0]) - CurNum, err2 := strconv.Atoi(concurrent[1]) - if err1 == nil && err2 == nil { - CurNum += incr - if CurNum > maxNum && incr > 0 { - // lock fail - return 0, nil - } - if CurNum < 0 { - CurNum = 0 - } - contentStr = fmt.Sprintf(`%d:%d`, maxNum, CurNum) - f.Seek(0, 0) - f.Truncate(0) - f.WriteString(contentStr) - return 1, nil - } else { - return -1, fmt.Errorf(`error:contentStr=%s`, contentStr) - } -} - -// FileIncrSafe TODO -// retryInterval: 如果获取锁失败,下次重试间隔(秒)。为 0 时表示不重试,麻烦返回获取锁失败 -// retcode: -// 1: success incr -// 0: full -// -1: operation failed -func (fl *FLock) FileIncrSafe(incr int, retryInterval int) (succ int, err error) { - intvl := time.Duration(retryInterval) - - fileLock := flock.New(fl.fileName) - locked, err := fileLock.TryLock() - - if err != nil { - // handle locking error - return -1, errors.New(fmt.Sprintf("failed to get lock: %s", err.Error())) - } - if locked { - // open and incr 1 and close - succ, err2 := fl.SetFileLockIncr(incr) - fileLock.Unlock() - if succ == 1 { - /* - if err = fileLock.Unlock(); err != nil { - // handle unlock error - return false, errors.New(fmt.Sprintf(`failed to unlock: %s`, err.Error())) - } - */ - return 1, nil - } else if succ == 0 { - if retryInterval == 0 { - return 0, nil - } else { - time.Sleep(intvl * time.Second) - return fl.FileIncrSafe(incr, retryInterval) - } - } else { - return -1, errors.New(fmt.Sprintf("failed to incr: %s", err2.Error())) - } - - } else { - // wait and retry - if retryInterval == 0 { - return 0, nil - } else { - // lockWaitMs := IntnRange(500, 3000) - // time.Sleep(time.Duration(lockWaitMs) * time.Millisecond) - time.Sleep(time.Duration(IntnRange(500, 3000)) * time.Millisecond) - return fl.FileIncrSafe(incr, retryInterval) - } - } -} - -// FileUnlockIncr TODO -func (fl *FLock) FileUnlockIncr(filename string) error { - fileLock := flock.New(filename) - return fileLock.Unlock() -} - -// Test TODO -func Test() { - filename := "flashback.lock" - maxConn := 4 - fl, err := NewFlock(filename, maxConn) - if err != nil { - fmt.Println(err) - return - } - - wg := &sync.WaitGroup{} - for i := 0; i <= 8; i++ { - fmt.Println(i) - wg.Add(1) - go func(i int) { - time.Sleep(time.Duration(IntnRange(100, 2000)) * time.Millisecond) - defer wg.Done() - // 这个 retryInterval 尽量跟单个任务处理时间接近 - if succ, err := fl.FileIncrSafe(1, 20); succ == 1 { - // do - fmt.Printf("id=%d\n", i) - time.Sleep(20 * time.Second) - fl.FileIncrSafe(-1, 1) - } else if err != nil { - fmt.Printf("id=%d err=%v\n", i, err.Error()) - } - }(i) - } - wg.Wait() -} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_passowrd.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_passowrd.go index cdd3d37482..a1e43774a3 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_passowrd.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_passowrd.go @@ -15,15 +15,15 @@ import ( ) var ( - mysqlRegex = regexp.MustCompile(`mysql.*-u(\s*)\w+.*\s-p(\w+).*`) - mysqlAdminRegex = regexp.MustCompile(`mysqladmin.*-u\w+.*\s-p(\w+).*`) + mysqlRegex = regexp.MustCompile(`mysql.*-u(\s*)\w+.*\s-p(\S+).*`) + mysqlAdminRegex = regexp.MustCompile(`mysqladmin.*-u\w+.*\s-p(\S+).*`) mysqlPasswordRegex = regexp.MustCompile(`\s-p[^\s]+`) masterPasswordRegexp = regexp.MustCompile(`master_password="[^\s]*"`) identifyByRegex = regexp.MustCompile(`identified by '[^\s]*'`) - userPasswordRegex = regexp.MustCompile(`\s-u\w+.*\s-p(\w+).*`) + userPasswordRegex = regexp.MustCompile(`\s-u\w+.*\s-p(\S+).*`) dsnRegex = regexp.MustCompile(`\w+:[^\s]*@tcp\([^\s]+\)`) dsnPasswordRegex = regexp.MustCompile(`:[^\s]*@tcp\(`) - passwordRegex = regexp.MustCompile(`password ['|"]*\w+['|"]*`) + passwordRegex = regexp.MustCompile(`password ['|"]*\S+['|"]*`) ) // ClearSensitiveInformation clear sensitive information from input diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_password_test.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_password_test.go new file mode 100644 index 0000000000..25580d334e --- /dev/null +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/hide_password_test.go @@ -0,0 +1,23 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package mysqlutil_test + +import ( + "testing" + + "dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil" +) + +func TestClearSensitiveInformatio(t *testing.T) { + t.Log("start ...") + textString := "mysqldump \t\t-h1.1.1.1 \t\t-P26000 \t\t-uxasasda \t\t-p{xasx} \t\t--skip-opt \t\t--create-options \t" + t.Log(mysqlutil.ClearSensitiveInformation(textString)) +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go index 05b35d5de8..3305fdc706 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go @@ -1,7 +1,19 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package mysqlutil import ( + "errors" "fmt" + "os" "path" "regexp" "runtime" @@ -11,8 +23,6 @@ import ( "dbm-services/common/go-pubpkg/logger" "dbm-services/mysql/db-tools/dbactuator/pkg/util" "dbm-services/mysql/db-tools/dbactuator/pkg/util/osutil" - - "github.com/panjf2000/ants/v2" ) var dumpCompleteReg = regexp.MustCompile("Dump completed on") @@ -65,6 +75,7 @@ type MySQLDumperTogether struct { MySQLDumper OutputfileName string UseTMySQLDump bool // 是否使用的是自研的mysqldump,一般介质在备份目录下 + TDBCTLDump bool // 中控专有参数 } // checkDumpComplete 检查导出结果是否Ok @@ -111,8 +122,8 @@ func (m *MySQLDumperTogether) Dump() (err error) { dumpOption = m.getTMySQLDumpOption() } dumpCmd := m.getDumpCmd(strings.Join(m.DbNames, " "), outputFile, errFile, dumpOption) - logger.Info("mysqldump cmd:%s", RemovePassword(dumpCmd)) - output, err := osutil.ExecShellCommand(false, dumpCmd) + logger.Info("mysqldump cmd:%s", ClearSensitiveInformation(dumpCmd)) + output, err := osutil.StandardShellCommand(false, dumpCmd) if err != nil { return fmt.Errorf("execte %s get an error:%s,%w", dumpCmd, output, err) } @@ -128,50 +139,47 @@ func (m *MySQLDumperTogether) Dump() (err error) { // @receiver m // @return err func (m *MySQLDumper) Dump() (err error) { - var wg sync.WaitGroup - var errs []string m.init() + var wg sync.WaitGroup + var errs []error errChan := make(chan error, 1) + concurrencyControl := make(chan struct{}, m.maxConcurrency) logger.Info("mysqldump data:%+v", *m) - pool, _ := ants.NewPool(m.maxConcurrency) - defer pool.Release() - f := func(db string) func() { - return func() { + go func() { + for err := range errChan { + logger.Error("dump db failed: %s", err.Error()) + errs = append(errs, err) + } + }() + for _, db := range m.DbNames { + wg.Add(1) + concurrencyControl <- struct{}{} + go func(db string) { + defer func() { + wg.Done() + <-concurrencyControl + }() outputFile := path.Join(m.DumpDir, fmt.Sprintf("%s.sql", db)) errFile := path.Join(m.DumpDir, fmt.Sprintf("%s.err", db)) dumpCmd := m.getDumpCmd(db, outputFile, errFile, "") logger.Info("mysqldump cmd:%s", RemovePassword(dumpCmd)) - output, err := osutil.ExecShellCommand(false, dumpCmd) + output, err := osutil.StandardShellCommand(false, dumpCmd) if err != nil { - errChan <- fmt.Errorf("execte %s get an error:%s,%w", dumpCmd, output, err) - wg.Done() + errContent, _ := os.ReadFile(errFile) + errChan <- fmt.Errorf("execte %s get an error:%s,%w\n errfile content:%s", dumpCmd, output, err, + string(errContent)) return } if err := checkDumpComplete(outputFile); err != nil { - errChan <- err - wg.Done() + errContent, _ := os.ReadFile(errFile) + errChan <- fmt.Errorf("%w\n errfile content:%s", err, string(errContent)) return } - wg.Done() - } + }(db) } - - for _, db := range m.DbNames { - wg.Add(1) - pool.Submit(f(db)) - } - go func() { - for err := range errChan { - logger.Error("dump db failed: %s", err.Error()) - errs = append(errs, err.Error()) - } - }() wg.Wait() close(errChan) - if len(errs) > 0 { - return fmt.Errorf("Errrors: %s", strings.Join(errs, "\n")) - } - return err + return errors.Join(errs...) } /* @@ -282,3 +290,9 @@ func (m *MySQLDumper) getTMySQLDumpOption() (dumpOption string) { `, m.maxConcurrency, m.maxResourceUsePercent, ) } + +func (m *MySQLDumper) getTDBCTLDumpOption() (dumpOption string) { + // 默认false 即不带有SET tc_admin=0 + // 如果不需要下发spider,可添加此参数 + return " --print-tc-admin-info " +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os.go index 629a1a3d43..4fc4c81eaa 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os.go @@ -191,17 +191,11 @@ func GenMysqlServerId(ip string, port int) (uint64, error) { err = fmt.Errorf("len(ips) is not 4. ips:%+v", ips) return 0, err } - switch { - case ips[0] == "172": - first = 1 - case ips[0] == "10": - first = 2 - case ips[0] == "192": - first = 3 - default: - first = 4 + firstcol, err := strconv.Atoi(ips[0]) + if err != nil { + return 0, err } - + first = (firstcol % 9) + 1 first += (port % 10000 % 64) * 4 two, err := strconv.ParseInt(ips[1], 10, 64) if err != nil { diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os_test.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os_test.go index b8226697c5..efd3a54239 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os_test.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_os_test.go @@ -19,3 +19,8 @@ func TestMySQLVersionParse(t *testing.T) { func TestMajorVersion(t *testing.T) { t.Logf("major Version:%s", mysqlutil.GetMajorVersion(5006024)) } + +func TestGenMysqlServerId(t *testing.T) { + svrid, _ := mysqlutil.GenMysqlServerId("127.0.0.1", 3306) + t.Logf("gen mysql server id:%d", svrid) +} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/slice.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/slice.go index 5812ef6cac..83f1978f52 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/slice.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/slice.go @@ -1,8 +1,17 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + package util import ( - "fmt" - "reflect" + "slices" "sort" "strconv" "strings" @@ -10,29 +19,14 @@ import ( "github.com/pkg/errors" ) -// 判断val 是否在elems 中 +// ContainElem 判断val 是否在elems 中 func ContainElem[T int | int64 | string](elems []T, val T) bool { - for _, ele := range elems { - if ele == val { - return true - } - } - return false -} - -// IntsHas check the []int contains the given value -func IntsHas(ints []int, val int) bool { - return ContainElem(ints, val) -} - -// Int64sHas check the []int64 contains the given value -func Int64sHas(ints []int64, val int64) bool { - return ContainElem(ints, val) + return slices.Contains(elems, val) } // StringsHas check the []string contains the given element func StringsHas(ss []string, val string) bool { - return ContainElem(ss, val) + return slices.Contains(ss, val) } // StringsHasICase check the []string contains the given element. insensitive case @@ -46,6 +40,7 @@ func StringsHasICase(ss []string, val string) bool { return false } +// UniqueSlice TODO func UniqueSlice[T string | int](slice []T) []T { uniqMap := make(map[T]struct{}) for _, v := range slice { @@ -106,13 +101,9 @@ func IsConsecutiveStrings(strList []string, isNumber bool) error { // RemoveEmpty 过滤掉空字符串 func RemoveEmpty(input []string) []string { - var result []string - for _, item := range input { - if strings.TrimSpace(item) != "" { - result = append(result, item) - } - } - return result + return slices.DeleteFunc(input, func(s string) bool { + return strings.TrimSpace(s) == "" + }) } // StringSliceToInterfaceSlice 把字符串数组转换为interface{}数组 @@ -129,57 +120,11 @@ func StringSliceToInterfaceSlice(ids []string) []interface{} { } // StringsRemove an value form an string slice -func StringsRemove(ss []string, s string) []string { - var ns []string - for _, v := range ss { - if v != s { - ns = append(ns, v) - } - } - - return ns -} - -// StringsInsertAfter 在 slice 里插入某个元素之后,仅匹配一次 -// 如果没有找到元素,忽略 -func StringsInsertAfter(ss []string, old string, new string) []string { - var ssNew = make([]string, len(ss)+1) - var found bool - for i, v := range ss { - if found { - ssNew[i+1] = v - } else if v == old { - ssNew[i] = v - ssNew[i+1] = new - found = true - } else { - ssNew[i] = v - } - } - if !found { - return ssNew[:len(ss)] - } - return ssNew -} - -// StringsInsertIndex 在 slice index 当前位置,插入一个元素 -// 如果 index 非法,则忽略 -func StringsInsertIndex(ss []string, index int, new string) []string { - if index < 0 || index > len(ss)-1 { - return ss - } - var ssNew = make([]string, len(ss)+1) - for i, v := range ss { - if i > index { - ssNew[i+1] = v - } else if i < index { - ssNew[i] = v - } else { - ssNew[i] = new - ssNew[i+1] = v - } - } - return ssNew +func StringsRemove(ss []string, s string) (ns []string) { + ns = slices.DeleteFunc(ss, func(item string) bool { + return item == s + }) + return } // FilterOutStringSlice 滤除scr中含有filters 里面元素的数组 @@ -206,55 +151,3 @@ func RemoveNilElements(v []interface{}) []interface{} { } return newSlice } - -// StrVal TODO -func StrVal(v interface{}) string { - switch v := v.(type) { - case string: - return v - case []byte: - return string(v) - case error: - return v.Error() - case fmt.Stringer: - return v.String() - default: - return fmt.Sprintf("%v", v) - } -} - -// StrSlice TODO -func StrSlice(v interface{}) []string { - switch v := v.(type) { - case []string: - return v - case []interface{}: - b := make([]string, 0, len(v)) - for _, s := range v { - if s != nil { - b = append(b, StrVal(s)) - } - } - return b - default: - val := reflect.ValueOf(v) - switch val.Kind() { - case reflect.Array, reflect.Slice: - l := val.Len() - b := make([]string, 0, l) - for i := 0; i < l; i++ { - value := val.Index(i).Interface() - if value != nil { - b = append(b, StrVal(value)) - } - } - return b - default: - if v == nil { - return []string{} - } - - return []string{StrVal(v)} - } - } -} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/util.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/util.go index bcce9daf9e..df45de43a1 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/util.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/util.go @@ -1,9 +1,20 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + // Package util TODO package util import ( "crypto/md5" "encoding/json" + "errors" "fmt" "io" "math/rand" @@ -11,14 +22,12 @@ import ( "os" "reflect" "regexp" - "runtime" "strings" "time" "dbm-services/common/go-pubpkg/logger" "github.com/TylerBrock/colorjson" - "github.com/pkg/errors" ) // RetryConfig TODO @@ -40,22 +49,6 @@ func Retry(r RetryConfig, f func() error) (err error) { return } -// AtWhere TODO -func AtWhere() string { - pc, _, _, ok := runtime.Caller(1) - if ok { - fileName, line := runtime.FuncForPC(pc).FileLine(pc) - result := strings.Index(fileName, "/bk-dbactuator/") - if result > 1 { - preStr := fileName[0:result] - fileName = strings.Replace(fileName, preStr, "", 1) - } - return fmt.Sprintf("%s:%d", fileName, line) - } else { - return "Method not Found!" - } -} - const ( tcpDialTimeout = 3 * time.Second ) @@ -281,12 +274,7 @@ func ReverseRead(name string, lineNum uint) ([]string, error) { // SliceErrorsToError TODO func SliceErrorsToError(errs []error) error { - var errStrs []string - for _, e := range errs { - errStrs = append(errStrs, e.Error()) - } - errString := strings.Join(errStrs, "\n") - return errors.New(errString) + return errors.Join(errs...) } // IntnRange TODO diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xml.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xml.go deleted file mode 100644 index d83fee7966..0000000000 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xml.go +++ /dev/null @@ -1,60 +0,0 @@ -package xmlutil - -import "encoding/xml" - -// GenericMap TODO -type GenericMap map[string]interface{} - -// MarshalXML TODO -func (g GenericMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - start.Name.Local = "performance_status" - tokens := []xml.Token{start} - tokens = ScanXMLNode(g, tokens) - tokens = append(tokens, xml.EndElement{Name: start.Name}) - - for _, t := range tokens { - err := e.EncodeToken(t) - if err != nil { - return err - } - } - // flush to ensure tokens are written - err := e.Flush() - if err != nil { - return err - } - return nil -} - -// ScanXMLNode TODO -func ScanXMLNode(g map[string]interface{}, tokens []xml.Token) []xml.Token { - for key, value := range g { - t := xml.StartElement{Name: xml.Name{Space: "", Local: key}} - if mapInterface, ok := value.(map[string]interface{}); ok { - haveAttr := false - for k, v := range mapInterface { // k:check,expire_days v: - if str, innerOk := v.(string); innerOk { - t.Attr = append(t.Attr, xml.Attr{Name: xml.Name{Space: "", Local: k}, Value: str}) - haveAttr = true - } - // 暂时不考虑既有 child 是 map[string]string, 又是 map[string]map[string]interface{} 这种。 - } - if haveAttr { - tokens = append(tokens, t) - } else { - tokens = append(tokens, t) - tokens = ScanXMLNode(mapInterface, tokens) - } - } else if mapString, ok := value.(map[string]string); ok { - for k, v := range mapString { - t.Attr = append(t.Attr, xml.Attr{Name: xml.Name{Space: "", Local: k}, Value: v}) - } - tokens = append(tokens, t) - } else { - return nil - } - // fmt.Println("key end:", key) - tokens = append(tokens, xml.EndElement{Name: xml.Name{Space: "", Local: key}}) - } - return tokens -} diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xmlutil.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xmlutil.go deleted file mode 100644 index b71255c936..0000000000 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/xmlutil/xmlutil.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package xmlutil TODO -package xmlutil diff --git a/dbm-services/mysql/db-tools/mysql-crond/cmd/root.go b/dbm-services/mysql/db-tools/mysql-crond/cmd/root.go index 5b799f4890..213e213b3e 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/cmd/root.go +++ b/dbm-services/mysql/db-tools/mysql-crond/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "io" + "log/slog" "os" "path" "sync" @@ -13,7 +14,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" "gopkg.in/natefinch/lumberjack.v2" ) @@ -27,7 +27,7 @@ var rootCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { err := config.InitConfig(viper.GetString("config")) if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } @@ -38,22 +38,22 @@ var rootCmd = &cobra.Command{ ) pf, err := os.Create(pidFile) if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } err = os.Chown(pidFile, config.JobsUserUid, config.JobsUserGid) if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } err = os.Truncate(pidFile, 0) if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } _, err = io.WriteString(pf, fmt.Sprintf("%d\n", os.Getpid())) if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } @@ -69,13 +69,13 @@ var rootCmd = &cobra.Command{ err = crond.Start() if err != nil { - slog.Error("start crond", err) + slog.Error("start crond", slog.String("error", err.Error())) return err } err = service.Start(version, buildStamp, gitHash, quit, &m) if err != nil { - slog.Error("start http server", err) + slog.Error("start http server", slog.String("error", err.Error())) return err } @@ -87,7 +87,7 @@ var rootCmd = &cobra.Command{ func Execute() { err := rootCmd.Execute() if err != nil { - slog.Error("start", err) + slog.Error("start", slog.String("error", err.Error())) os.Exit(1) } } diff --git a/dbm-services/mysql/db-tools/mysql-crond/go.mod b/dbm-services/mysql/db-tools/mysql-crond/go.mod index a5e3b08108..3f6a9c712b 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/go.mod +++ b/dbm-services/mysql/db-tools/mysql-crond/go.mod @@ -1,26 +1,26 @@ module dbm-services/mysql/db-tools/mysql-crond -go 1.19 +go 1.21 require ( - github.com/gin-gonic/gin v1.9.0 - github.com/go-playground/validator/v10 v10.12.0 + github.com/gin-gonic/gin v1.9.1 + github.com/go-playground/validator/v10 v10.15.4 github.com/olekukonko/tablewriter v0.0.5 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 - github.com/spf13/cast v1.5.0 + github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/spf13/viper v1.16.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/bytedance/sonic v1.8.8 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect @@ -29,15 +29,14 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.2.3 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -45,11 +44,10 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/dbm-services/mysql/db-tools/mysql-crond/go.sum b/dbm-services/mysql/db-tools/mysql-crond/go.sum index 9698ec997f..18c28173f9 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/go.sum +++ b/dbm-services/mysql/db-tools/mysql-crond/go.sum @@ -39,8 +39,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= @@ -62,23 +62,27 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -120,6 +124,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -157,17 +162,18 @@ github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZX github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -179,9 +185,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= @@ -191,21 +196,21 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -217,8 +222,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -245,8 +251,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -257,8 +263,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -314,8 +318,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -373,8 +377,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -532,9 +536,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/config.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/config.go index 1a83d63ca2..01c6c87b48 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/config.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/config.go @@ -3,12 +3,12 @@ package config import ( "fmt" + "log/slog" "os" "os/user" "strconv" "github.com/go-playground/validator/v10" - "golang.org/x/exp/slog" "gopkg.in/yaml.v2" ) @@ -38,7 +38,7 @@ func InitConfig(configFilePath string) error { jobsUser, err = user.Lookup(RuntimeConfig.JobsUser) if err != nil { - slog.Error("init runtimeConfig find jobs user", err) + slog.Error("init runtimeConfig find jobs user", slog.String("error", err.Error())) return err } @@ -47,7 +47,7 @@ func InitConfig(configFilePath string) error { currentUser, err = user.Current() if err != nil { - slog.Error("init runtimeConfig get current user", err) + slog.Error("init runtimeConfig get current user", slog.String("error", err.Error())) return err } @@ -62,14 +62,14 @@ func InitConfig(configFilePath string) error { func initConfig(configFilePath string) error { content, err := os.ReadFile(configFilePath) if err != nil { - slog.Error("init runtimeConfig", err) + slog.Error("init runtimeConfig", slog.String("error", err.Error())) return err } RuntimeConfig = &runtimeConfig{} err = yaml.UnmarshalStrict(content, RuntimeConfig) if err != nil { - slog.Error("init runtimeConfig", err) + slog.Error("init runtimeConfig", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/job_config.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/job_config.go index fc39013425..f19d2b952b 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/job_config.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/job_config.go @@ -3,13 +3,13 @@ package config import ( "bytes" "fmt" + "log/slog" "os" "os/exec" "path" "syscall" "github.com/go-playground/validator/v10" - "golang.org/x/exp/slog" "gopkg.in/yaml.v2" ) @@ -56,7 +56,7 @@ func (j *ExternalJob) run() { if err != nil { slog.Error( "external job", - err, + slog.String("error", err.Error()), slog.String("name", j.Name), slog.String("stderr", stderr.String()), ) @@ -71,7 +71,7 @@ func (j *ExternalJob) run() { }, ) if err != nil { - slog.Error("send event", err) + slog.Error("send event", slog.String("error", err.Error())) } } else { slog.Info( @@ -97,7 +97,7 @@ func (j *ExternalJob) Run() { "job_name": j.Name, }, ) - slog.Error("send event", err) + slog.Error("send event", slog.String("error", err.Error())) } } @@ -116,7 +116,7 @@ func (j *ExternalJob) validate() error { func InitJobsConfig() error { if !path.IsAbs(RuntimeConfig.JobsConfigFile) { err := fmt.Errorf("jobs-config need absolute path") - slog.Error("init jobs config", err) + slog.Error("init jobs config", slog.String("error", err.Error())) return err } @@ -126,31 +126,31 @@ func InitJobsConfig() error { slog.Info("init jobs config jobs-config file not found, try create it") _, err := os.Create(RuntimeConfig.JobsConfigFile) if err != nil { - slog.Error("init jobs config create empty jobs-config file", err) + slog.Error("init jobs config create empty jobs-config file", slog.String("error", err.Error())) return err } err = os.Chown(RuntimeConfig.JobsConfigFile, JobsUserUid, JobsUserGid) if err != nil { - slog.Error("init jobs config chown for jobs config", err) + slog.Error("init jobs config chown for jobs config", slog.String("error", err.Error())) return err } } else { - slog.Error("init jobs config get jobs-config file stat", err) + slog.Error("init jobs config get jobs-config file stat", slog.String("error", err.Error())) return err } } content, err := os.ReadFile(RuntimeConfig.JobsConfigFile) if err != nil { - slog.Error("init jobs config", err) + slog.Error("init jobs config", slog.String("error", err.Error())) return err } JobsConfig = &jobsConfig{} err = yaml.Unmarshal(content, &JobsConfig) if err != nil { - slog.Error("init jobs config", err) + slog.Error("init jobs config", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/send_bk_monitor_beat.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/send_bk_monitor_beat.go index a39faf37d6..d030e39083 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/send_bk_monitor_beat.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/send_bk_monitor_beat.go @@ -4,11 +4,10 @@ import ( "bytes" "encoding/json" "fmt" + "log/slog" "os/exec" "strconv" "time" - - "golang.org/x/exp/slog" ) type commonData struct { @@ -52,7 +51,8 @@ func SendBkMonitorBeat( if err != nil { slog.Error( "send bk monitor heart beat encode body", - err, slog.Any("body", body), + slog.String("error", err.Error()), + slog.Any("body", body), ) return err } @@ -76,7 +76,7 @@ func SendBkMonitorBeat( if err != nil { slog.Error( "send bk monitor beat", - err, + slog.String("error", err.Error()), slog.String("std out", stdout.String()), slog.String("std err", stderr.String()), ) @@ -118,7 +118,7 @@ func SendEvent(name string, content string, additionDimension map[string]interfa body, ) if err != nil { - slog.Error("send event", err) + slog.Error("send event", slog.String("error", err.Error())) return err } @@ -156,7 +156,7 @@ func SendMetrics(mKey string, mValue int64, additionDimension map[string]interfa ) if err != nil { - slog.Error("send event", err) + slog.Error("send event", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/sync.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/sync.go index e612db62d8..dff38b6fd9 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/config/sync.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/config/sync.go @@ -2,9 +2,9 @@ package config import ( "fmt" + "log/slog" "os" - "golang.org/x/exp/slog" "gopkg.in/yaml.v3" ) @@ -12,14 +12,14 @@ import ( func SyncAddJob(newJob *ExternalJob) error { content, err := os.ReadFile(RuntimeConfig.JobsConfigFile) if err != nil { - slog.Error("sync add new read config from disk", err) + slog.Error("sync add new read config from disk", slog.String("error", err.Error())) return err } // var jobs []*ExternalJob err = yaml.Unmarshal(content, &JobsConfig) if err != nil { - slog.Error("sync add encode config", err) + slog.Error("sync add encode config", slog.String("error", err.Error())) return err } @@ -29,13 +29,13 @@ func SyncAddJob(newJob *ExternalJob) error { // output, err := yaml.Marshal(jobs) output, err := yaml.Marshal(JobsConfig) if err != nil { - slog.Error("sync add decode updated config", err) + slog.Error("sync add decode updated config", slog.String("error", err.Error())) return err } err = os.WriteFile(RuntimeConfig.JobsConfigFile, output, 0644) if err != nil { - slog.Error("sync add write to disk", err) + slog.Error("sync add write to disk", slog.String("error", err.Error())) return err } return nil @@ -45,14 +45,14 @@ func SyncAddJob(newJob *ExternalJob) error { func SyncJobEnable(name string, enable bool) error { content, err := os.ReadFile(RuntimeConfig.JobsConfigFile) if err != nil { - slog.Error("sync job enable new read config from disk", err) + slog.Error("sync job enable new read config from disk", slog.String("error", err.Error())) return err } // var jobs []*ExternalJob err = yaml.Unmarshal(content, &JobsConfig) if err != nil { - slog.Error("sync job enable encode config", err) + slog.Error("sync job enable encode config", slog.String("error", err.Error())) return err } @@ -68,19 +68,19 @@ func SyncJobEnable(name string, enable bool) error { "target job %s not found in %s", name, RuntimeConfig.JobsConfigFile, ) - slog.Error("sync job enable seek target job", err) + slog.Error("sync job enable seek target job", slog.String("error", err.Error())) return err } output, err := yaml.Marshal(JobsConfig) if err != nil { - slog.Error("sync enable decode updated config", err) + slog.Error("sync enable decode updated config", slog.String("error", err.Error())) return err } err = os.WriteFile(RuntimeConfig.JobsConfigFile, output, 0644) if err != nil { - slog.Error("sync enable write to disk", err) + slog.Error("sync enable write to disk", slog.String("error", err.Error())) return err } return nil @@ -90,14 +90,14 @@ func SyncJobEnable(name string, enable bool) error { func SyncDelete(name string) error { content, err := os.ReadFile(RuntimeConfig.JobsConfigFile) if err != nil { - slog.Error("sync job enable new read config from disk", err) + slog.Error("sync job enable new read config from disk", slog.String("error", err.Error())) return err } // var jobs []*ExternalJob err = yaml.Unmarshal(content, &JobsConfig) if err != nil { - slog.Error("sync job enable encode config", err) + slog.Error("sync job enable encode config", slog.String("error", err.Error())) return err } @@ -120,13 +120,13 @@ func SyncDelete(name string) error { output, err := yaml.Marshal(JobsConfig) if err != nil { - slog.Error("sync enable decode updated config", err) + slog.Error("sync enable decode updated config", slog.String("error", err.Error())) return err } err = os.WriteFile(RuntimeConfig.JobsConfigFile, output, 0644) if err != nil { - slog.Error("sync enable write to disk", err) + slog.Error("sync enable write to disk", slog.String("error", err.Error())) return err } return nil diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/crond.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/crond.go index 77acacd195..330d33de32 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/crond.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/crond.go @@ -2,6 +2,7 @@ package crond import ( + "log/slog" "sync" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" @@ -9,7 +10,6 @@ import ( "github.com/robfig/cron/v3" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) // DisabledJobs TODO @@ -43,7 +43,7 @@ func Start() error { for _, j := range config.JobsConfig.Jobs { entryID, err := Add(j, false) if err != nil { - slog.Error("load job from config", err) + slog.Error("load job from config", slog.String("error", err.Error())) return err } slog.Info( @@ -66,7 +66,7 @@ func Start() error { }, ) if err != nil { - slog.Error("add clearance job", err) + slog.Error("add clearance job", slog.String("error", err.Error())) return err } slog.Info("add clearance job", slog.Int("entry id", int(entryID))) @@ -81,7 +81,7 @@ func Start() error { map[string]interface{}{}, ) if err != nil { - slog.Error("heart beat", err) + slog.Error("heart beat", slog.String("error", err.Error())) } else { slog.Info("heart beat success") } @@ -110,12 +110,12 @@ func Reload() error { err := config.InitJobsConfig() if err != nil { - slog.Error("reload re-init jobs-config", err) + slog.Error("reload re-init jobs-config", slog.String("error", err.Error())) return err } err = Start() if err != nil { - slog.Error("reload start crond", err) + slog.Error("reload start crond", slog.String("error", err.Error())) } return err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_add.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_add.go index 09b334a22a..f0945645b8 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_add.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_add.go @@ -2,10 +2,9 @@ package crond import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" - - "golang.org/x/exp/slog" ) // Add TODO @@ -13,13 +12,13 @@ func Add(j *config.ExternalJob, permanent bool) (int, error) { existEntry := findEntry(j.Name) if existEntry != nil { err := fmt.Errorf("duplicate activate job name: %s", j.Name) - slog.Error("add job", err) + slog.Error("add job", slog.String("error", err.Error())) return 0, err } if _, ok := DisabledJobs.Load(j.Name); ok { err := fmt.Errorf("duplicate deleted job name: %s", j.Name) - slog.Error("add job", err) + slog.Error("add job", slog.String("error", err.Error())) return 0, err } @@ -33,7 +32,7 @@ func Add(j *config.ExternalJob, permanent bool) (int, error) { func addActivate(j *config.ExternalJob, permanent bool) (int, error) { entryID, err := cronJob.AddJob(j.Schedule, j) if err != nil { - slog.Error("add job", err) + slog.Error("add job", slog.String("error", err.Error())) return 0, err } slog.Info( diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_delete.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_delete.go index 8692f6b3f1..f72397fcc8 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_delete.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_delete.go @@ -2,11 +2,11 @@ package crond import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" "github.com/robfig/cron/v3" - "golang.org/x/exp/slog" ) // Delete TODO @@ -21,7 +21,7 @@ func Delete(name string, permanent bool) (int, error) { } err := NotFoundError(fmt.Sprintf("job %s not found", name)) - slog.Error("delete job", err) + slog.Error("delete job", slog.String("error", err.Error())) return 0, err } @@ -29,7 +29,7 @@ func deleteActivate(entry *cron.Entry, permanent bool) (int, error) { j, ok := entry.Job.(*config.ExternalJob) if !ok { err := fmt.Errorf("convert %v to ExternalJob failed", entry) - slog.Error("delete activate", err) + slog.Error("delete activate", slog.String("error", err.Error())) return 0, err } @@ -50,7 +50,7 @@ func deleteDisabled(name string, permanent bool) (int, error) { job, ok := v.(*config.ExternalJob) if !ok { err := fmt.Errorf("conver %v to ExternalJob failed", v) - slog.Error("delete disabled", err) + slog.Error("delete disabled", slog.String("error", err.Error())) return 0, err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_disable.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_disable.go index e11a4874b5..f8b7438ce2 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_disable.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_disable.go @@ -2,10 +2,9 @@ package crond import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" - - "golang.org/x/exp/slog" ) // Disable TODO @@ -13,14 +12,14 @@ func Disable(name string, permanent bool) (int, error) { existEntry := findEntry(name) if existEntry == nil { err := fmt.Errorf("entry %s not found", name) - slog.Error("delete job", err) + slog.Error("delete job", slog.String("error", err.Error())) return 0, err } j, ok := existEntry.Job.(*config.ExternalJob) if !ok { err := fmt.Errorf("convert %v to ExternalJob failed", existEntry) - slog.Error("disable job", err) + slog.Error("disable job", slog.String("error", err.Error())) return 0, err } *j.Enable = false diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_pause.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_pause.go index ab0dd8a7e6..4020d4c845 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_pause.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_pause.go @@ -2,13 +2,13 @@ package crond import ( "fmt" + "log/slog" "time" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" "dbm-services/mysql/db-tools/mysql-crond/pkg/schedule" "github.com/robfig/cron/v3" - "golang.org/x/exp/slog" ) // Pause TODO @@ -16,7 +16,7 @@ func Pause(name string, du time.Duration) (int, error) { existEntry := findEntry(name) if existEntry == nil { err := fmt.Errorf("entry %s not found", name) - slog.Error("pause job", err) + slog.Error("pause job", slog.String("error", err.Error())) return 0, err } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_replace.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_replace.go index e89913e683..03a6b4f9a9 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_replace.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_replace.go @@ -1,9 +1,11 @@ package crond import ( + "github.com/pkg/errors" + "dbm-services/mysql/db-tools/mysql-crond/pkg/config" - "golang.org/x/exp/slog" + "log/slog" ) // CreateOrReplace TODO @@ -11,15 +13,22 @@ func CreateOrReplace(j *config.ExternalJob, permanent bool) (int, error) { _, err := Delete(j.Name, permanent) if err != nil { - if _, ok := err.(NotFoundError); !ok { - slog.Error("create or replace job", err, slog.Any("job", j)) + var notFoundError NotFoundError + if !errors.As(err, ¬FoundError) { + slog.Error("create or replace job", + slog.String("error", err.Error()), + slog.Any("job", j), + ) return 0, err } } entryID, err := Add(j, permanent) if err != nil { - slog.Error("create or replace job", err, slog.Any("job", j)) + slog.Error("create or replace job", + slog.String("error", err.Error()), + slog.Any("job", j), + ) return 0, err } return entryID, nil diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_resume.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_resume.go index b63db6ddc5..7d03847a73 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_resume.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/crond/job_resume.go @@ -2,10 +2,9 @@ package crond import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-crond/pkg/config" - - "golang.org/x/exp/slog" ) // Resume TODO @@ -16,7 +15,7 @@ func Resume(name string, permanent bool) (int, error) { entryID, err := cronJob.AddJob(j.Schedule, j) if err != nil { - slog.Error("resume job", err) + slog.Error("resume job", slog.String("error", err.Error())) return 0, err } slog.Info( @@ -37,12 +36,12 @@ func Resume(name string, permanent bool) (int, error) { return int(entryID), nil } else { err := fmt.Errorf("conver %v to ExternalJob failed", value) - slog.Error("resume job", err) + slog.Error("resume job", slog.String("error", err.Error())) return 0, err } } else { err := fmt.Errorf("%s not found", name) - slog.Error("resume job", err) + slog.Error("resume job", slog.String("error", err.Error())) return 0, err } } diff --git a/dbm-services/mysql/db-tools/mysql-crond/pkg/service/service.go b/dbm-services/mysql/db-tools/mysql-crond/pkg/service/service.go index 1068e3ad0d..6e3ffb1d0b 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/pkg/service/service.go +++ b/dbm-services/mysql/db-tools/mysql-crond/pkg/service/service.go @@ -3,6 +3,7 @@ package service import ( "fmt" + "log/slog" "net/http" "sync" "time" @@ -11,7 +12,6 @@ import ( "dbm-services/mysql/db-tools/mysql-crond/pkg/crond" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" ) // Start TODO diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/go.mod b/dbm-services/mysql/db-tools/mysql-dbbackup/go.mod index 5409c0489d..3784b839f7 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/go.mod +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/go.mod @@ -1,49 +1,48 @@ module dbm-services/mysql/db-tools/mysql-dbbackup -go 1.19 +go 1.21 require ( github.com/Masterminds/squirrel v1.5.4 github.com/go-sql-driver/mysql v1.7.1 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/jmoiron/sqlx v1.3.5 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/olekukonko/tablewriter v0.0.5 github.com/shirou/gopsutil v3.21.11+incompatible - github.com/sirupsen/logrus v1.9.0 + github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - gopkg.in/natefinch/lumberjack.v2 v2.0.0 + github.com/spf13/viper v1.16.0 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( github.com/pkg/errors v0.9.1 - github.com/spf13/cast v1.5.0 - golang.org/x/sys v0.8.0 // indirect + github.com/spf13/cast v1.5.1 + golang.org/x/sys v0.12.0 // indirect ) require ( github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.2 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/text v0.13.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/go.sum b/dbm-services/mysql/db-tools/mysql-dbbackup/go.sum index ed23906c99..8b52a5a2fd 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/go.sum +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/go.sum @@ -36,7 +36,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= @@ -59,14 +58,16 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= @@ -107,6 +108,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -122,8 +124,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -142,10 +144,12 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= @@ -154,8 +158,9 @@ github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -164,33 +169,36 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -200,15 +208,14 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= -github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= -github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -238,8 +245,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -352,9 +359,11 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -364,8 +373,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -514,11 +523,9 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config/logical.go b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config/logical.go index bdb40f711f..846a331244 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config/logical.go +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config/logical.go @@ -37,4 +37,8 @@ type LogicalLoad struct { SchemaOnly bool `ini:"SchemaOnly"` IndexFilePath string `ini:"IndexFilePath" validate:"required"` ExtraOpt string `ini:"ExtraOpt"` // other myloader options string to be appended + // DBListDropIfExists will run drop database if exists db_xxx before load data. comma separated + DBListDropIfExists string `ini:"DBListDropIfExists"` + // CreateTableIfNotExists true will add --append-if-not-exist for myloader + CreateTableIfNotExists bool `ini:"CreateTableIfNotExists"` } diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_logical.go b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_logical.go index 7ef90dcbcb..2d4de120a5 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_logical.go +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_logical.go @@ -1,6 +1,7 @@ package backupexe import ( + "database/sql" "fmt" "os" "path/filepath" @@ -13,12 +14,15 @@ import ( "dbm-services/common/go-pubpkg/cmutil" "dbm-services/mysql/db-tools/mysql-dbbackup/pkg/config" "dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/logger" + "dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/mysqlconn" ) // LogicalLoader this is used to load logical backup type LogicalLoader struct { cnf *config.BackupConfig dbbackupHome string + dbConn *sql.DB + initConnect string } func (l *LogicalLoader) initConfig(_ *IndexContent) error { @@ -34,8 +38,84 @@ func (l *LogicalLoader) initConfig(_ *IndexContent) error { return nil } +func (l *LogicalLoader) preExecute() error { + // 临时清理 init_connect + dbListDrop := l.cnf.LogicalLoad.DBListDropIfExists + var initConnect string + if err := l.dbConn.QueryRow("select @@init_connect").Scan(&initConnect); err != nil { + return err + } + l.initConnect = initConnect + if l.initConnect != "" && strings.TrimSpace(dbListDrop) != "" { + logger.Log.Info("set global init_connect='' for safe") + if _, err := l.dbConn.Exec("set global init_connect=''"); err != nil { + return err + } + } + + // handle DBListDropIfExists + // 如果有设置这个选项,会在运行前执行 drop database if exists 命令,来清理脏库 + if strings.TrimSpace(dbListDrop) != "" { + logger.Log.Info("load logical DBListDropIfExists:", dbListDrop) + if strings.Contains(dbListDrop, "`") { + return errors.Errorf("DBListDropIfExists has invalid character %s", dbListDrop) + } + SysDBs := []string{"mysql", "sys", "information_schema", "performance_schema", "test"} + dblist := strings.Split(dbListDrop, ",") + dblistNew := []string{} + for _, dbName := range dblist { + dbName = strings.TrimSpace(dbName) + if dbName == "" { + continue + } else if cmutil.StringsHas(SysDBs, dbName) { + return errors.Errorf("DBListDropIfExists should not contain sys db: %s", dbListDrop) + } else { + dblistNew = append(dblistNew, dbName) + } + } + + for _, dbName := range dblistNew { + dropDbSql := fmt.Sprintf("DROP DATABASE IF EXISTS `%s`", dbName) + logger.Log.Warn("DBListDropIfExists sql:", dropDbSql) + if _, err := l.dbConn.Exec(dropDbSql); err != nil { + return errors.Wrap(err, "DBListDropIfExists err") + } + } + return nil + } + return nil +} + // Execute execute loading backup with logical backup tool -func (l *LogicalLoader) Execute() error { +func (l *LogicalLoader) Execute() (err error) { + cnfPublic := config.Public{ + MysqlHost: l.cnf.LogicalLoad.MysqlHost, + MysqlPort: l.cnf.LogicalLoad.MysqlPort, + MysqlUser: l.cnf.LogicalLoad.MysqlUser, + MysqlPasswd: l.cnf.LogicalLoad.MysqlPasswd, + MysqlCharset: l.cnf.LogicalLoad.MysqlCharset, + } + l.dbConn, err = mysqlconn.InitConn(&cnfPublic) + if err != nil { + return err + } + defer func() { + _ = l.dbConn.Close() + }() + if err = l.preExecute(); err != nil { + return err + } + + defer func() { + if l.initConnect != "" { + logger.Log.Info("set global init_connect back:", l.initConnect) + if _, err = l.dbConn.Exec(fmt.Sprintf(`set global init_connect="%s"`, l.initConnect)); err != nil { + //return err + logger.Log.Warn("fail set global init_connect back:", l.initConnect) + } + } + }() + binPath := filepath.Join(l.dbbackupHome, "bin/myloader") args := []string{ "-h", l.cnf.LogicalLoad.MysqlHost, @@ -52,6 +132,9 @@ func (l *LogicalLoader) Execute() error { if l.cnf.LogicalLoad.SchemaOnly { args = append(args, "--no-data") } + if l.cnf.LogicalLoad.CreateTableIfNotExists { + args = append(args, "--append-if-not-exist") + } if l.cnf.LogicalLoad.Regex != "" { args = append(args, "-x", fmt.Sprintf(`'%s'`, l.cnf.LogicalLoad.Regex)) } diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/dbareport/report.go b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/dbareport/report.go index 8159382c1d..d95124b7ee 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/dbareport/report.go +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/dbareport/report.go @@ -128,11 +128,13 @@ func (r *Reporter) ExecuteBackupClient(fileName string) (taskid string, err erro } logger.Log.Infof("upload register file %s", fileName) taskid, err = backupClient.Upload(fileName) + logger.Log.Infof("upload register file %s with taskid=%s, err=%v", fileName, taskid, err) if err != nil { return "", err } } else { taskid = "-1" + logger.Log.Infof("backup_client is not enabled: %s taskid=%s", fileName, taskid) } return taskid, nil } @@ -184,6 +186,7 @@ func (r *Reporter) ExecuteBackupClient2(fileName string) (taskid string, err err } // ReportBackupResult Report BackupResult info +// 会执行 ExecuteBackupClient upload func (r *Reporter) ReportBackupResult(backupBaseResult BackupResult) error { var backupResultArray []BackupResult diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/test.2000.ini b/dbm-services/mysql/db-tools/mysql-dbbackup/test.2000.ini index daaa3c7d25..790a8d9138 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/test.2000.ini +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/test.2000.ini @@ -25,10 +25,10 @@ StatusReportPath= /data/git-code/dbbackup [BackupClient] Enable = false -RemoteFileSystem = hdfs +RemoteFileSystem = cos FileTag = MYSQL_FULL_BACKUP DoChecksum = true -BackupClientBin = /usr/local/bin/backup_client +BackupClientBin = /usr/local/backup_client/bin/backup_client [LogicalBackup] ChunkFilesize = 2048 @@ -58,6 +58,8 @@ EnableBinlog = false MysqlLoadDir = /data/git-code/dbbackup/file/1111_VM-165-14-centos_127.0.0.1_12000_20230423_173959_logical IndexFilePath = /data/git-code/dbbackup/file/1111_VM-165-14-centos_127.0.0.1_12000_20230423_173959_logical.index ExtraOpt = +DBListDropIfExists = db1,dbx +CreateTableIfNotExists = false [PhysicalLoad] Threads = 4 diff --git a/dbm-services/mysql/db-tools/mysql-monitor/README.md b/dbm-services/mysql/db-tools/mysql-monitor/README.md index d7919fdc3c..80136f5071 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/README.md +++ b/dbm-services/mysql/db-tools/mysql-monitor/README.md @@ -15,6 +15,21 @@ ## _clean_ * 执行 `mysql-monitor -c runtime.yaml clean` 会删除所有相关的 `mysql-crond entry` +* 会触发 `监控心跳丢失` 的告警 +* 一般只用于下架场景 +* 如果临时停止监控需求, 用下面的 `disable-all` + +## _disable-all_ +`mysql-monitor disable-all -c monitor-config_20000.yaml --staff somebody --with-db-up` +* 保留 `监控心跳` +* 停掉包括`db-up` 在内的所有监控项 + +如果不使用 `--with-db-up`, 则会保留 `db-up` 监控项 + +不修改任何配置文件, _disable_ 不会持久化, 可以随时使用上面提到的 _reschedule_ 恢复回来 + + + ## 硬编码项 目前有两个硬编码项 1. 执行心跳 @@ -178,6 +193,10 @@ type ConnectionCollect struct { |db-up|@every 10s|backend, proxy| | 致命 |db 连通性. 硬编码, 不可配置, 无需录入配置系统|enable |mysql_monitor_heart_beat|@every 10s|backend, proxy| | 无 |监控心跳. 硬编码, 不可配置, 无需录入配置系统|enable +## 生成dbconfig 配置 +``` +perl config2sql.pl | sed 's/"enable":"1"/"enable":true/g' +``` ## 重要 * `character-consistency, ext3-check, *-definer, engine` 不要在 _spider_ 执行 diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/init.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/init.go index 38448ab82e..ab84eb5fe3 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/init.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/init.go @@ -3,12 +3,12 @@ package cmd import ( "fmt" "io" + "log/slog" "os" "path/filepath" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" - "golang.org/x/exp/slog" "gopkg.in/natefinch/lumberjack.v2" ) @@ -41,7 +41,10 @@ func initLogger(cfg *config.LogConfig) { // ToDo 修改目录宿主 - logFile := filepath.Join(*cfg.LogFileDir, fmt.Sprintf("%s.log", executableName)) + logFile := filepath.Join( + *cfg.LogFileDir, + fmt.Sprintf("%s.%d.log", executableName, config.MonitorConfig.Port), + ) _, err = os.Stat(logFile) if err != nil { if os.IsNotExist(err) { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/reschedule_items.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/reschedule_items.go new file mode 100644 index 0000000000..3da9740af7 --- /dev/null +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/reschedule_items.go @@ -0,0 +1,125 @@ +package cmd + +import ( + "fmt" + "log/slog" + "strings" + + ma "dbm-services/mysql/db-tools/mysql-crond/api" + "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" +) + +func reschedule(configFileDir, configFileName, staff string) error { + manager := ma.NewManager(config.MonitorConfig.ApiUrl) + entries, err := manager.Entries() + if err != nil { + slog.Error("reschedule list entries", slog.String("error", err.Error())) + return err + } + + for _, entry := range entries { + if strings.HasPrefix( + entry.Job.Name, + fmt.Sprintf("mysql-monitor-%d", config.MonitorConfig.Port), + ) { + eid, err := manager.Delete(entry.Job.Name, true) + if err != nil { + slog.Error( + "reschedule delete entry", + slog.String("error", err.Error()), + slog.String("name", entry.Job.Name), + ) + return err + } + slog.Info( + "reschedule delete entry", + slog.String("name", entry.Job.Name), + slog.Int("ID", eid), + ) + } + } + + var hardCodeItems []*config.MonitorItem + itemGroups := make(map[string][]*config.MonitorItem) + for _, ele := range config.ItemsConfig { + // 硬编码监控项先排除掉 + if ele.Name == "db-up" || ele.Name == config.HeartBeatName { + if ele.IsEnable() { + hardCodeItems = append(hardCodeItems, ele) + } + continue + } + + if ele.IsEnable() && ele.IsMatchMachineType() && ele.IsMatchRole() { + var key string + + if ele.Schedule == nil { + key = config.MonitorConfig.DefaultSchedule + } else { + key = *ele.Schedule + } + + if _, ok := itemGroups[key]; !ok { + itemGroups[key] = []*config.MonitorItem{} + } + itemGroups[key] = append(itemGroups[key], ele) + } + } + + for k, v := range itemGroups { + var itemNames []string + for _, j := range v { + itemNames = append(itemNames, j.Name) + } + args := []string{ + "run", + "--items", strings.Join(itemNames, ","), + "-c", configFileName, // use WorkDir + } + eid, err := manager.CreateOrReplace( + ma.JobDefine{ + Name: fmt.Sprintf("mysql-monitor-%d-%s", config.MonitorConfig.Port, k), + Command: executable, + Args: args, + Schedule: k, + Creator: staff, //viper.GetString("staff"), + Enable: true, + WorkDir: configFileDir, + }, true, + ) + if err != nil { + slog.Error("reschedule add entry", slog.String("error", err.Error())) + return err + } + slog.Info("reschedule add entry", slog.Int("entry id", eid)) + } + + // 注册 hardcode + for _, j := range hardCodeItems { + args := []string{ + "hardcode-run", + "--items", j.Name, //strings.Join(itemNames, ","), + "-c", configFileName, + } + + eid, err := manager.CreateOrReplace( + ma.JobDefine{ + Name: fmt.Sprintf( + "mysql-monitor-%d-hardcode-%s", config.MonitorConfig.Port, j.Name), + Command: executable, + Args: args, + Schedule: config.HardCodeSchedule, + Creator: staff, //viper.GetString("staff"), + Enable: true, + WorkDir: configFileDir, + }, true, + ) + if err != nil { + slog.Error("reschedule add hardcode entry", slog.String("error", err.Error())) + return err + } + slog.Info("reschedule add hardcode entry", slog.Int("entry id", eid)) + } + + return nil +} diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/root.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/root.go index 6953d85079..9d54a222a6 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/root.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/root.go @@ -1,10 +1,10 @@ package cmd import ( + "log/slog" "os" "github.com/spf13/cobra" - "golang.org/x/exp/slog" ) var rootCmd = &cobra.Command{ @@ -21,7 +21,7 @@ func init() { func Execute() { err := rootCmd.Execute() if err != nil { - slog.Error("start", err) + slog.Error("start", slog.String("error", err.Error())) os.Exit(1) } } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_clean.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_clean.go index a94375db0f..5e8166addf 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_clean.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_clean.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log/slog" "strings" ma "dbm-services/mysql/db-tools/mysql-crond/api" @@ -9,7 +10,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdClean = &cobra.Command{ @@ -26,7 +26,7 @@ var subCmdClean = &cobra.Command{ manager := ma.NewManager(config.MonitorConfig.ApiUrl) entries, err := manager.Entries() if err != nil { - slog.Error("clean list entries", err) + slog.Error("clean list entries", slog.String("error", err.Error())) return err } @@ -38,7 +38,8 @@ var subCmdClean = &cobra.Command{ eid, err := manager.Delete(entry.Job.Name, true) if err != nil { slog.Error( - "reschedule delete entry", err, + "reschedule delete entry", + slog.String("error", err.Error()), slog.String("name", entry.Job.Name), ) return err diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_disable_all.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_disable_all.go new file mode 100644 index 0000000000..489986ef94 --- /dev/null +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_disable_all.go @@ -0,0 +1,86 @@ +package cmd + +import ( + "log/slog" + "os" + "path/filepath" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" +) + +var subCmdDisableAll = &cobra.Command{ + Use: "disable-all", + Short: "disable-all items", + Long: "disable-all items", + RunE: func(cmd *cobra.Command, args []string) error { + configPath := viper.GetString("disable-config") + if !filepath.IsAbs(configPath) { + cwd, err := os.Getwd() + if err != nil { + slog.Error("disable-all get config abs path", slog.String("error", err.Error())) + return err + } + configPath = filepath.Join(cwd, configPath) + } + configFileDir, configFileName := filepath.Split(configPath) + + err := config.InitConfig(configPath) + if err != nil { + return err + } + initLogger(config.MonitorConfig.Log) + + emptyItemsConfig, err := os.CreateTemp("/tmp", "empty-items.yaml") + if err != nil { + slog.Error("disable-all create empty items config", slog.String("error", err.Error())) + return err + } + defer func() { + _ = emptyItemsConfig.Close() + _ = os.Remove(emptyItemsConfig.Name()) + }() + slog.Info("disable-all create empty items config success") + + config.MonitorConfig.ItemsConfigFile = emptyItemsConfig.Name() + + err = config.LoadMonitorItemsConfig() + if err != nil { + slog.Error("disable-all load items", slog.String("error", err.Error())) + return err + } + + disableDbUp := viper.GetBool("with-db-up") + if !disableDbUp { + config.InjectMonitorDbUpItem() + } + config.InjectMonitorHeartBeatItem() + + slog.Info("disable-all", + slog.String("staff", viper.GetString("staff"))) + err = reschedule(configFileDir, configFileName, viper.GetString("disable-staff")) + if err != nil { + slog.Error("disable-all sub-cmd", slog.String("error", err.Error())) + return err + } + + return nil + }, +} + +func init() { + subCmdDisableAll.PersistentFlags().StringP("config", "c", "", "config file") + _ = subCmdDisableAll.MarkPersistentFlagRequired("config") + _ = viper.BindPFlag("disable-config", subCmdDisableAll.PersistentFlags().Lookup("config")) + + subCmdDisableAll.PersistentFlags().StringP("staff", "", "", "staff name") + _ = subCmdDisableAll.MarkPersistentFlagRequired("staff") + _ = viper.BindPFlag("disable-staff", subCmdDisableAll.PersistentFlags().Lookup("staff")) + + subCmdDisableAll.PersistentFlags().BoolP("with-db-up", "", false, "also disable db-up") + _ = viper.BindPFlag("with-db-up", subCmdDisableAll.PersistentFlags().Lookup("with-db-up")) + + rootCmd.AddCommand(subCmdDisableAll) +} diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_hardcode_run.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_hardcode_run.go index 1b3ce8e88d..0b8dc22481 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_hardcode_run.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_hardcode_run.go @@ -1,12 +1,13 @@ package cmd import ( + "log/slog" + "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop" "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdHardCodeRun = &cobra.Command{ @@ -22,13 +23,13 @@ var subCmdHardCodeRun = &cobra.Command{ err = config.LoadMonitorItemsConfig() if err != nil { - slog.Error("run hardcode monitor load items", err) + slog.Error("run hardcode monitor load items", slog.String("error", err.Error())) return err } err = mainloop.Run(true) if err != nil { - slog.Error("run monitor hardcode items", err) + slog.Error("run monitor hardcode items", slog.String("error", err.Error())) return err } return nil diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_reschedule.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_reschedule.go index 7e403da7c3..c0e41c44c5 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_reschedule.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_reschedule.go @@ -1,17 +1,14 @@ package cmd import ( - "fmt" + "log/slog" "os" "path/filepath" - "strings" - ma "dbm-services/mysql/db-tools/mysql-crond/api" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdReschedule = &cobra.Command{ @@ -27,7 +24,7 @@ var subCmdReschedule = &cobra.Command{ if !filepath.IsAbs(configPath) { cwd, err := os.Getwd() if err != nil { - slog.Error("reschedule get config abs path", err) + slog.Error("reschedule get config abs path", slog.String("error", err.Error())) return err } configPath = filepath.Join(cwd, configPath) @@ -42,127 +39,25 @@ var subCmdReschedule = &cobra.Command{ err = config.LoadMonitorItemsConfig() if err != nil { - slog.Error("reschedule load items", err) + slog.Error("reschedule load items", slog.String("error", err.Error())) return err } - config.InjectHardCodeItem() + config.InjectMonitorDbUpItem() + config.InjectMonitorHeartBeatItem() err = config.WriteMonitorItemsBack() if err != nil { - slog.Error("reschedule write back items", err) + slog.Error("reschedule write back items", slog.String("error", err.Error())) return err } - manager := ma.NewManager(config.MonitorConfig.ApiUrl) - entries, err := manager.Entries() + err = reschedule(configFileDir, configFileName, viper.GetString("reschedule-staff")) if err != nil { - slog.Error("reschedule list entries", err) + slog.Error("reschedule sub-cmd", slog.String("error", err.Error())) return err } - for _, entry := range entries { - if strings.HasPrefix( - entry.Job.Name, - fmt.Sprintf("mysql-monitor-%d", config.MonitorConfig.Port), - ) { - eid, err := manager.Delete(entry.Job.Name, true) - if err != nil { - slog.Error( - "reschedule delete entry", err, - slog.String("name", entry.Job.Name), - ) - return err - } - slog.Info( - "reschedule delete entry", - slog.String("name", entry.Job.Name), - slog.Int("ID", eid), - ) - } - } - - var hardCodeItems []*config.MonitorItem - itemGroups := make(map[string][]*config.MonitorItem) - for _, ele := range config.ItemsConfig { - // 硬编码监控项先排除掉 - if ele.Name == "db-up" || ele.Name == config.HeartBeatName { - if ele.IsEnable() { - hardCodeItems = append(hardCodeItems, ele) - } - continue - } - - if ele.IsEnable() && ele.IsMatchMachineType() && ele.IsMatchRole() { - var key string - - if ele.Schedule == nil { - key = config.MonitorConfig.DefaultSchedule - } else { - key = *ele.Schedule - } - - if _, ok := itemGroups[key]; !ok { - itemGroups[key] = []*config.MonitorItem{} - } - itemGroups[key] = append(itemGroups[key], ele) - } - } - - for k, v := range itemGroups { - var itemNames []string - for _, j := range v { - itemNames = append(itemNames, j.Name) - } - args := []string{ - "run", - "--items", strings.Join(itemNames, ","), - "-c", configFileName, // use WorkDir - } - eid, err := manager.CreateOrReplace( - ma.JobDefine{ - Name: fmt.Sprintf("mysql-monitor-%d-%s", config.MonitorConfig.Port, k), - Command: executable, - Args: args, - Schedule: k, - Creator: viper.GetString("staff"), - Enable: true, - WorkDir: configFileDir, - }, true, - ) - if err != nil { - slog.Error("reschedule add entry", err) - return err - } - slog.Info("reschedule add entry", slog.Int("entry id", eid)) - } - - // 注册 hardcode - var itemNames []string - for _, j := range hardCodeItems { - itemNames = append(itemNames, j.Name) - } - args = []string{ - "hardcode-run", - "--items", strings.Join(itemNames, ","), - "-c", configPath, - } - eid, err := manager.CreateOrReplace( - ma.JobDefine{ - Name: fmt.Sprintf("mysql-monitor-%d-hardcode", config.MonitorConfig.Port), - Command: executable, - Args: args, - Schedule: config.HardCodeSchedule, - Creator: viper.GetString("staff"), - Enable: true, - }, true, - ) - if err != nil { - slog.Error("reschedule add hardcode entry", err) - return err - } - slog.Info("reschedule add hardcode entry", slog.Int("entry id", eid)) - return nil }, } @@ -174,7 +69,7 @@ func init() { subCmdReschedule.PersistentFlags().StringP("staff", "", "", "staff name") _ = subCmdReschedule.MarkPersistentFlagRequired("staff") - _ = viper.BindPFlag("staff", subCmdReschedule.PersistentFlags().Lookup("staff")) + _ = viper.BindPFlag("reschedule-staff", subCmdReschedule.PersistentFlags().Lookup("staff")) rootCmd.AddCommand(subCmdReschedule) } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_run.go b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_run.go index 4b2d698e9a..8e9d74bcd4 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_run.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/cmd/subcmd_run.go @@ -1,12 +1,13 @@ package cmd import ( + "log/slog" + "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop" "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdRun = &cobra.Command{ @@ -22,13 +23,13 @@ var subCmdRun = &cobra.Command{ err = config.LoadMonitorItemsConfig() if err != nil { - slog.Error("run monitor load items", err) + slog.Error("run monitor load items", slog.String("error", err.Error())) return err } err = mainloop.Run(false) if err != nil { - slog.Error("run monitor items", err) + slog.Error("run monitor items", slog.String("error", err.Error())) return err } return nil diff --git a/dbm-services/mysql/db-tools/mysql-monitor/go.mod b/dbm-services/mysql/db-tools/mysql-monitor/go.mod index 1b5d503287..a9eda5a2dd 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/go.mod +++ b/dbm-services/mysql/db-tools/mysql-monitor/go.mod @@ -1,43 +1,41 @@ module dbm-services/mysql/db-tools/mysql-monitor -go 1.19 +go 1.21 require ( - github.com/dlclark/regexp2 v1.8.1 - github.com/go-playground/validator/v10 v10.12.0 + github.com/dlclark/regexp2 v1.10.0 + github.com/go-playground/validator/v10 v10.15.4 github.com/go-sql-driver/mysql v1.7.1 github.com/jmoiron/sqlx v1.3.5 github.com/juju/ratelimit v1.0.2 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/spf13/viper v1.16.0 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/leodido/go-urn v1.2.3 // indirect - github.com/lib/pq v1.10.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.12.0 // indirect golang.org/x/text v0.9.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/db-tools/mysql-monitor/go.sum b/dbm-services/mysql/db-tools/mysql-monitor/go.sum index 7c3fbe72df..dc29063093 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/go.sum +++ b/dbm-services/mysql/db-tools/mysql-monitor/go.sum @@ -50,27 +50,31 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.8.1 h1:6Lcdwya6GjPUNsBct8Lg/yRPwMhABj269AAzdGSiR+0= -github.com/dlclark/regexp2 v1.8.1/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= +github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= +github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= @@ -111,6 +115,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -146,26 +151,24 @@ github.com/juju/ratelimit v1.0.2/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSg github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= @@ -173,21 +176,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -197,9 +200,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -219,8 +222,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -231,8 +234,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -288,6 +291,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -343,8 +348,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -499,9 +504,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/dbm-services/mysql/db-tools/mysql-monitor/items-config.yaml b/dbm-services/mysql/db-tools/mysql-monitor/items-config.yaml index e26550527d..13e2186e51 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/items-config.yaml +++ b/dbm-services/mysql/db-tools/mysql-monitor/items-config.yaml @@ -62,12 +62,10 @@ machine_type: - backend - remote - - spider role: - master - repeater - slave - - spider_master - name: mysql-config-diff enable: true schedule: '@every 1m' diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/init.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/init.go index 99af42a4ce..c2d85621b4 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/init.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/init.go @@ -2,11 +2,11 @@ package config import ( "fmt" + "log/slog" "os" "path/filepath" "github.com/go-playground/validator/v10" - "golang.org/x/exp/slog" "gopkg.in/yaml.v2" ) @@ -21,7 +21,7 @@ func InitConfig(configPath string) error { if !filepath.IsAbs(configPath) { cwd, err := os.Getwd() if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } @@ -31,21 +31,21 @@ func InitConfig(configPath string) error { content, err := os.ReadFile(configPath) if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } MonitorConfig = &monitorConfig{} err = yaml.UnmarshalStrict(content, MonitorConfig) if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } validate := validator.New() err = validate.Struct(MonitorConfig) if err != nil { - slog.Error("validate monitor config", err) + slog.Error("validate monitor config", slog.String("error", err.Error())) return err } @@ -58,13 +58,13 @@ func LoadMonitorItemsConfig() error { content, err := os.ReadFile(MonitorConfig.ItemsConfigFile) if err != nil { - slog.Error("load monitor items config", err) + slog.Error("load monitor items config", slog.String("error", err.Error())) return err } err = yaml.UnmarshalStrict(content, &ItemsConfig) if err != nil { - slog.Error("unmarshal monitor items config", err) + slog.Error("unmarshal monitor items config", slog.String("error", err.Error())) return err } @@ -72,7 +72,7 @@ func LoadMonitorItemsConfig() error { for _, ele := range ItemsConfig { err := validate.Struct(ele) if err != nil { - slog.Error("validate monitor items config", err) + slog.Error("validate monitor items config", slog.String("error", err.Error())) return err } } @@ -80,6 +80,32 @@ func LoadMonitorItemsConfig() error { return nil } +func InjectMonitorHeartBeatItem() { + enable := true + heartBeatItem := &MonitorItem{ + Name: HeartBeatName, + Enable: &enable, + Schedule: &HardCodeSchedule, //&MonitorConfig.DefaultSchedule, + MachineType: []string{MonitorConfig.MachineType}, + Role: nil, + } + ItemsConfig = injectItem(heartBeatItem, ItemsConfig) + slog.Debug("inject hardcode", slog.Any("items", ItemsConfig)) +} + +func InjectMonitorDbUpItem() { + enable := true + dbUpItem := &MonitorItem{ + Name: "db-up", + Enable: &enable, + Schedule: &HardCodeSchedule, //&MonitorConfig.DefaultSchedule, + MachineType: []string{MonitorConfig.MachineType}, + Role: nil, + } + ItemsConfig = injectItem(dbUpItem, ItemsConfig) + slog.Debug("inject hardcode", slog.Any("items", ItemsConfig)) +} + // InjectHardCodeItem 注入硬编码的心跳和db-up监控 func InjectHardCodeItem() { enable := true @@ -124,19 +150,19 @@ func WriteMonitorItemsBack() error { // 注入硬编码监控项后回写items文件 content, err := yaml.Marshal(ItemsConfig) if err != nil { - slog.Error("marshal items config", err) + slog.Error("marshal items config", slog.String("error", err.Error())) return err } f, err := os.OpenFile(MonitorConfig.ItemsConfigFile, os.O_TRUNC|os.O_WRONLY, 0755) if err != nil { - slog.Error("open items config file", err) + slog.Error("open items config file", slog.String("error", err.Error())) return err } _, err = f.Write(content) if err != nil { - slog.Error("write items config file", err) + slog.Error("write items config file", slog.String("error", err.Error())) return err } return nil diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/items_config.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/items_config.go index 01de861b64..1205dcc0ee 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/items_config.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/items_config.go @@ -1,6 +1,6 @@ package config -import "golang.org/x/exp/slices" +import "slices" // MonitorItem 监控项 type MonitorItem struct { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/monitor_config.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/monitor_config.go index f66e298da9..b68f982ded 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/monitor_config.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/config/monitor_config.go @@ -25,6 +25,7 @@ type monitorConfig struct { MachineType string `yaml:"machine_type"` Role *string `yaml:"role"` BkCloudID *int `yaml:"bk_cloud_id" validate:"required,gte=0"` + DBModuleID *int `yaml:"db_module_id" validate:"required"` Log *LogConfig `yaml:"log"` ItemsConfigFile string `yaml:"items_config_file" validate:"required"` ApiUrl string `yaml:"api_url" validate:"required"` diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/dbhaheartbeat/checker.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/dbhaheartbeat/checker.go index 1b7e3574e9..f186b4ab86 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/dbhaheartbeat/checker.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/dbhaheartbeat/checker.go @@ -4,10 +4,10 @@ import ( "context" "database/sql" "fmt" + "log/slog" "time" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/check_definer.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/check_definer.go index 710301fab2..f146881379 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/check_definer.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/check_definer.go @@ -10,10 +10,9 @@ package definer import ( "fmt" + "log/slog" + "slices" "strings" - - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" ) func checkDefiner(ownerFinger string, definer string) string { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/routine.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/routine.go index 11150256cb..a242a7d9b5 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/routine.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/routine.go @@ -11,12 +11,12 @@ package definer import ( "context" "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) func routines(db *sqlx.DB) (msg []string, err error) { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/trigger.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/trigger.go index 6c9e6a5401..8ebbd3bcbd 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/trigger.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/trigger.go @@ -11,12 +11,12 @@ package definer import ( "context" "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) func triggers(db *sqlx.DB) (msg []string, err error) { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/user_list_snap_shot.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/user_list_snap_shot.go index 1f93d75c0f..bc63f18286 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/user_list_snap_shot.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/user_list_snap_shot.go @@ -10,11 +10,11 @@ package definer import ( "context" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) func snapshot(db *sqlx.DB) error { @@ -24,7 +24,7 @@ func snapshot(db *sqlx.DB) error { err := db.SelectContext(ctx, &mysqlUsers, `SELECT user FROM mysql.user`) if err != nil { - slog.Error("query users", err) + slog.Error("query users", slog.String("error", err.Error())) return err } slog.Debug("query users", slog.Any("users", mysqlUsers)) diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/view.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/view.go index ad09a7cf4d..971405dab1 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/view.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/definer/view.go @@ -11,12 +11,12 @@ package definer import ( "context" "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) func views(db *sqlx.DB) (msg []string, err error) { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ext3check/filter_dir_fs.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ext3check/filter_dir_fs.go index 21fb572269..07607cfba1 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ext3check/filter_dir_fs.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ext3check/filter_dir_fs.go @@ -13,10 +13,10 @@ import ( "bytes" "os/exec" "regexp" + "slices" "strings" "github.com/pkg/errors" - "golang.org/x/exp/slices" ) func filterDirFs(dirs []string, filterFs ...string) (ftDirs []string, err error) { diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/collect_result.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/collect_result.go index db1f4b3792..3e00c4f12f 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/collect_result.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/collect_result.go @@ -10,11 +10,10 @@ package ibdstatistic import ( "io/fs" + "log/slog" "os" "path/filepath" "strings" - - "golang.org/x/exp/slog" ) func collectResult(dataDir string) (map[string]map[string]int64, error) { @@ -42,7 +41,7 @@ func collectResult(dataDir string) (map[string]map[string]int64, error) { st, err := os.Stat(path) if err != nil { - slog.Error("ibd-statistic collect result", err) + slog.Error("ibd-statistic collect result", slog.String("error", err.Error())) return err } @@ -60,7 +59,7 @@ func collectResult(dataDir string) (map[string]map[string]int64, error) { ) if err != nil { - slog.Error("ibd-statistic collect result", err) + slog.Error("ibd-statistic collect result", slog.String("error", err.Error())) return nil, err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/ibd_statistic.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/ibd_statistic.go index c6c4e4a038..3066bda0d8 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/ibd_statistic.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/ibd_statistic.go @@ -4,6 +4,7 @@ package ibdstatistic import ( "context" "database/sql" + "log/slog" "regexp" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" @@ -11,7 +12,6 @@ import ( "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) /* @@ -47,13 +47,13 @@ func (c *ibdStatistic) Run() (msg string, err error) { var dataDir sql.NullString err = c.db.GetContext(ctx, &dataDir, `SELECT @@datadir`) if err != nil { - slog.Error("ibd-statistic", err) + slog.Error("ibd-statistic", slog.String("error", err.Error())) return "", err } if !dataDir.Valid { err := errors.Errorf("invalid datadir: '%s'", dataDir.String) - slog.Error("ibd-statistic", err) + slog.Error("ibd-statistic", slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/report_metrics.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/report_metrics.go index 0330d697ae..1521b7447e 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/report_metrics.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/ibdstatistic/report_metrics.go @@ -9,13 +9,13 @@ package ibdstatistic import ( + "log/slog" "regexp" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/utils" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) var tableSizeMetricName string @@ -43,7 +43,7 @@ func reportMetrics(result map[string]map[string]int64) error { "invalid dbname: '%s' on %s", dbName, config.MonitorConfig.MachineType, ) - slog.Error("ibd-statistic report", err) + slog.Error("ibd-statistic report", slog.String("error", err.Error())) return err } dbName = match[1] diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/items_collect.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/items_collect.go index ef82ef6d40..3e9e6a8759 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/items_collect.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/items_collect.go @@ -11,6 +11,7 @@ package itemscollect import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/characterconsistency" "dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/dbhaheartbeat" @@ -31,8 +32,6 @@ import ( "dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/tscc" "dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/uniquectlmaster" mi "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" - - "golang.org/x/exp/slog" ) var registeredItemConstructor map[string]func(*mi.ConnectionCollect) mi.MonitorItemInterface @@ -42,7 +41,7 @@ func registerItemConstructor( ) error { if _, ok := registeredItemConstructor[name]; ok { err := fmt.Errorf("%s already registered", name) - slog.Error("register item creator", err) + slog.Error("register item creator", slog.String("error", err.Error())) return err } registeredItemConstructor[name] = f diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/masterslaveheartbeat/master_slave_heartbeat.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/masterslaveheartbeat/master_slave_heartbeat.go index 1fb1b30224..9dcce8abd6 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/masterslaveheartbeat/master_slave_heartbeat.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/masterslaveheartbeat/master_slave_heartbeat.go @@ -5,6 +5,7 @@ import ( "context" "database/sql" "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/internal/cst" @@ -13,7 +14,6 @@ import ( "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) var ( @@ -49,7 +49,10 @@ func (c *Checker) updateHeartbeat() error { err := c.db.QueryRow("select @@server_id, @@binlog_format"). Scan(&masterServerId, &binlogFormatOld) if err != nil { - slog.Error("master-slave-heartbeat query server_id, binlog_format", err) + slog.Error( + "master-slave-heartbeat query server_id, binlog_format", + slog.String("error", err.Error()), + ) return err } slog.Debug( @@ -61,7 +64,7 @@ func (c *Checker) updateHeartbeat() error { // will set session variables, so get a connection from pool conn, err := c.db.DB.Conn(context.Background()) if err != nil { - slog.Error("master-slave-heartbeat get conn from db", err) + slog.Error("master-slave-heartbeat get conn from db", slog.String("error", err.Error())) return err } defer func() { @@ -71,18 +74,13 @@ func (c *Checker) updateHeartbeat() error { if config.MonitorConfig.MachineType == "spider" { _, err := conn.ExecContext(ctx, "set tc_admin=0") if err != nil { - slog.Error("master-slave-heartbeat", err) + slog.Error("master-slave-heartbeat", slog.String("error", err.Error())) return err } } txrrSQL := "SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ" // SET SESSION transaction_isolation = 'REPEATABLE-READ' binlogSQL := "SET SESSION binlog_format='STATEMENT'" - updateSQL := fmt.Sprintf( - `UPDATE %s SET -master_time=now(), slave_time=sysdate(),delay_sec=timestampdiff(SECOND, now(),sysdate()) -WHERE slave_server_id=@@server_id and master_server_id= '%s'`, - c.heartBeatTable, masterServerId) insertSQL := fmt.Sprintf( `REPLACE INTO %s(master_server_id, slave_server_id, master_time, slave_time, delay_sec) VALUES('%s', @@server_id, now(), sysdate(), timestampdiff(SECOND, now(),sysdate()))`, @@ -90,16 +88,16 @@ VALUES('%s', @@server_id, now(), sysdate(), timestampdiff(SECOND, now(),sysdate( if _, err := conn.ExecContext(ctx, txrrSQL); err != nil { err := errors.WithMessage(err, "update heartbeat need SET SESSION tx_isolation = 'REPEATABLE-READ'") - slog.Error("master-slave-heartbeat", err) + slog.Error("master-slave-heartbeat", slog.String("error", err.Error())) return err } if _, err := conn.ExecContext(ctx, binlogSQL); err != nil { err := errors.WithMessage(err, "update heartbeat need binlog_format=STATEMENT") - slog.Error("master-slave-heartbeat", err) + slog.Error("master-slave-heartbeat", slog.String("error", err.Error())) return err } - res, err := conn.ExecContext(ctx, updateSQL) + res, err := conn.ExecContext(ctx, insertSQL) if err != nil { var merr *mysql.MySQLError if errors.As(err, &merr) { @@ -107,22 +105,16 @@ VALUES('%s', @@server_id, now(), sysdate(), timestampdiff(SECOND, now(),sysdate( slog.Debug("master-slave-heartbeat table not found") // ERROR 1054 (42S22): Unknown colum res, err = c.initTableHeartbeat() if err != nil { - slog.Error("master-slave-heartbeat init table", err) + slog.Error("master-slave-heartbeat init table", slog.String("error", err.Error())) return err } slog.Debug("master-slave-heartbeat init table success") } } - } - - num, _ := res.RowsAffected() - slog.Debug("master-slave-heartbeat", slog.String("update rows", name)) - if num == 0 { - if _, err = conn.ExecContext(ctx, insertSQL); err != nil { - slog.Error("master-slave-heartbeat insert", err) - return err + } else { + if num, _ := res.RowsAffected(); num > 0 { + slog.Debug("master-slave-heartbeat insert success") } - slog.Debug("master-slave-heartbeat insert success") } /* // 正常只在 slave 上才需要 update slave beat_sec,但 repeater 也需要更新,所以可以直接忽略角色 diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconfigdiff/mysql_config_diff.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconfigdiff/mysql_config_diff.go index aa4866ae95..1f78ac0709 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconfigdiff/mysql_config_diff.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconfigdiff/mysql_config_diff.go @@ -13,17 +13,17 @@ import ( "bytes" "encoding/json" "fmt" + "log/slog" "os" "os/exec" "path/filepath" + "slices" "strings" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "github.com/pkg/errors" - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" ) var name = "mysql-config-diff" @@ -75,21 +75,21 @@ func (c *Checker) Run() (msg string, err error) { var exitError *exec.ExitError var ok bool - if exitError, ok = err.(*exec.ExitError); !ok { - slog.Error("compare mysql config", err) + if ok = errors.As(err, &exitError); !ok { + slog.Error("compare mysql config", slog.String("error", err.Error())) return "", err } if exitError.ExitCode() != 1 { unexpectErr := errors.Errorf("unexpect error: %s, stderr: %s", err.Error(), stderr.String()) - slog.Error("compare mysql config", unexpectErr) + slog.Error("compare mysql config", slog.String("error", unexpectErr.Error())) return "", unexpectErr } diffs := make(map[string]map[string]interface{}) jerr := json.Unmarshal(stdout.Bytes(), &diffs) if jerr != nil { - slog.Error("unmarshal variables diffs", err) + slog.Error("unmarshal variables diffs", slog.String("error", err.Error())) return "", jerr } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_report.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_report.go index 12c7f3c41b..f9689f4581 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_report.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_report.go @@ -10,8 +10,10 @@ package mysqlconnlog import ( "context" + "database/sql" "encoding/json" "fmt" + "log/slog" "os" "path/filepath" "time" @@ -21,7 +23,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/juju/ratelimit" - "golang.org/x/exp/slog" + "github.com/pkg/errors" ) type connRecord struct { @@ -45,14 +47,32 @@ func mysqlConnLogReport(db *sqlx.DB) (string, error) { conn, err := db.Connx(ctx) if err != nil { - slog.Error("connlog report get conn from db", err) + slog.Error("connlog report get conn from db", slog.String("error", err.Error())) return "", err } + defer func() { + _ = conn.Close() + }() + + var _r interface{} + err = conn.GetContext(ctx, &_r, + `SELECT 1 FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND TABLE_TYPE='BASE TABLE'`, + cst.DBASchema, "conn_log_old") + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + slog.Info("conn_log_old not found, skip report") + return "", nil + } else { + slog.Error("check conn_log_old exists", slog.String("error", err.Error())) + return "", err + } + } // report 会把 old 表删掉, 所以也要禁用 binlog 防止从 master 到 slave _, err = conn.ExecContext(ctx, `SET SQL_LOG_BIN=0`) if err != nil { - slog.Error("disable binlog", err) + slog.Error("disable binlog", slog.String("error", err.Error())) return "", err } slog.Info("report conn log disable binlog success") @@ -60,7 +80,7 @@ func mysqlConnLogReport(db *sqlx.DB) (string, error) { reportFilePath := filepath.Join(cst.DBAReportBase, "mysql", "conn_log", "report.log") err = os.MkdirAll(filepath.Dir(reportFilePath), 0755) if err != nil { - slog.Error("make report dir", err) + slog.Error("make report dir", slog.String("error", err.Error())) return "", err } slog.Info("make report dir", slog.String("dir", filepath.Dir(reportFilePath))) @@ -71,7 +91,7 @@ func mysqlConnLogReport(db *sqlx.DB) (string, error) { 0755, ) if err != nil { - slog.Error("open conn log report file", err) + slog.Error("open conn log report file", slog.String("error", err.Error())) return "", err } slog.Info("open conn report file", slog.String("file path", f.Name())) @@ -80,7 +100,7 @@ func mysqlConnLogReport(db *sqlx.DB) (string, error) { rows, err := conn.QueryxContext(ctx, fmt.Sprintf(`SELECT * FROM %s.conn_log_old`, cst.DBASchema)) if err != nil { - slog.Error("connlog report query conn_log_old", err) + slog.Error("connlog report query conn_log_old", slog.String("error", err.Error())) return "", err } defer func() { @@ -99,26 +119,26 @@ func mysqlConnLogReport(db *sqlx.DB) (string, error) { } err := rows.StructScan(&cr) if err != nil { - slog.Error("scan conn_log record", err) + slog.Error("scan conn_log record", slog.String("error", err.Error())) return "", err } content, err := json.Marshal(cr) if err != nil { - slog.Error("marshal conn record", err) + slog.Error("marshal conn record", slog.String("error", err.Error())) return "", err } _, err = lf.Write(append(content, []byte("\n")...)) if err != nil { - slog.Error("write conn report", err) + slog.Error("write conn report", slog.String("error", err.Error())) return "", err } } _, err = db.ExecContext(ctx, fmt.Sprintf(`DROP TABLE IF EXISTS %s.conn_log_old`, cst.DBASchema)) if err != nil { - slog.Error("drop conn_log_old", err) + slog.Error("drop conn_log_old", slog.String("error", err.Error())) return "", err } slog.Info("drop conn_log_old") diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_rotate.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_rotate.go index 786920e046..cf4ba20ffc 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_rotate.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_rotate.go @@ -10,14 +10,15 @@ package mysqlconnlog import ( "context" + "database/sql" "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/internal/cst" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) // mysqlConnLogRotate TODO @@ -31,16 +32,32 @@ func mysqlConnLogRotate(db *sqlx.DB) (string, error) { conn, err := db.Connx(ctx) if err != nil { - slog.Error("connlog rotate get conn from db", err) + slog.Error("connlog rotate get conn from db", slog.String("error", err.Error())) return "", err } defer func() { _ = conn.Close() }() + var _r interface{} + err = conn.GetContext(ctx, &_r, + `SELECT 1 FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND TABLE_TYPE='BASE TABLE'`, + cst.DBASchema, "conn_log") + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + err = errors.Errorf("conn_log table not found") + slog.Error(err.Error()) + return "", err + } else { + slog.Error("check conn_log exists", slog.String("error", err.Error())) + return "", err + } + } + _, err = conn.ExecContext(ctx, `SET SQL_LOG_BIN=0`) if err != nil { - slog.Error("disable binlog", err) + slog.Error("disable binlog", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log disable binlog success") @@ -48,34 +65,34 @@ func mysqlConnLogRotate(db *sqlx.DB) (string, error) { var initConn string err = conn.QueryRowxContext(ctx, "SELECT @@INIT_CONNECT").Scan(&initConn) if err != nil { - slog.Error("query init connect", err) + slog.Error("query init connect", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log", slog.String("init connect", initConn)) _, err = conn.ExecContext(ctx, `SET @OLD_INIT_CONNECT=@@INIT_CONNECT`) if err != nil { - slog.Error("save init_connect", err) + slog.Error("save init_connect", slog.String("error", err.Error())) return "", err } var oldInitConn string err = conn.QueryRowxContext(ctx, "SELECT @OLD_INIT_CONNECT").Scan(&oldInitConn) if err != nil { - slog.Error("query old init connect", err) + slog.Error("query old init connect", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log", slog.String("old init connect", oldInitConn)) if initConn != oldInitConn { err = errors.Errorf("save init_connect failed") - slog.Error("check save init connect", err) + slog.Error("check save init connect", slog.String("error", err.Error())) return "", err } _, err = conn.ExecContext(ctx, `SET GLOBAL INIT_CONNECT = ''`) if err != nil { - slog.Error("disable init_connect", err) + slog.Error("disable init_connect", slog.String("error", err.Error())) return "", err } @@ -86,7 +103,7 @@ func mysqlConnLogRotate(db *sqlx.DB) (string, error) { ), ) if err != nil { - slog.Error("drop conn_log_old", err) + slog.Error("drop conn_log_old", slog.String("error", err.Error())) return "", err } @@ -98,7 +115,7 @@ func mysqlConnLogRotate(db *sqlx.DB) (string, error) { ), ) if err != nil { - slog.Error("rename conn_log", err) + slog.Error("rename conn_log", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log", "rename conn_log success") @@ -111,26 +128,26 @@ func mysqlConnLogRotate(db *sqlx.DB) (string, error) { ), ) if err != nil { - slog.Error("recreate conn_log", err) + slog.Error("recreate conn_log", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log", "recreate conn_log success") _, err = conn.ExecContext(ctx, `SET GLOBAL INIT_CONNECT = @OLD_INIT_CONNECT`) if err != nil { - slog.Error("restore init_connect", err) + slog.Error("restore init_connect", slog.String("error", err.Error())) return "", err } initConn = "" err = conn.QueryRowxContext(ctx, "SELECT @@INIT_CONNECT").Scan(&initConn) if err != nil { - slog.Error("query init connect", err) + slog.Error("query init connect", slog.String("error", err.Error())) return "", err } slog.Info("rotate conn log", slog.String("init connect", initConn)) if initConn != oldInitConn { err = errors.Errorf("restore init_connect failed") - slog.Error("check restore init_connect", err) + slog.Error("check restore init_connect", slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_size.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_size.go index 00ba39c579..c61fd88f57 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_size.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/connlog_size.go @@ -12,6 +12,7 @@ import ( "context" "fmt" "io/fs" + "log/slog" "os" "path/filepath" "strings" @@ -20,7 +21,6 @@ import ( "dbm-services/mysql/db-tools/mysql-monitor/pkg/internal/cst" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) func mysqlConnLogSize(db *sqlx.DB) (string, error) { @@ -30,7 +30,7 @@ func mysqlConnLogSize(db *sqlx.DB) (string, error) { var dataDir string err := db.QueryRowxContext(ctx, `SELECT @@datadir`).Scan(&dataDir) if err != nil { - slog.Error("select @@datadir", err) + slog.Error("select @@datadir", slog.String("error", err.Error())) return "", err } @@ -41,7 +41,10 @@ func mysqlConnLogSize(db *sqlx.DB) (string, error) { filepath.Join(dataDir, cst.DBASchema), func(path string, d fs.DirEntry, err error) error { if err != nil { - slog.Error("statistic conn log size", err, slog.String("path", path)) + slog.Error("statistic conn log size", + slog.String("error", err.Error()), + slog.String("path", path), + ) return filepath.SkipDir } @@ -63,7 +66,7 @@ func mysqlConnLogSize(db *sqlx.DB) (string, error) { }, ) if err != nil { - slog.Error("statistic conn log size", err) + slog.Error("statistic conn log size", slog.String("error", err.Error())) return "", err } slog.Info("statistic conn log size", slog.Int64("size", logSize)) @@ -71,7 +74,10 @@ func mysqlConnLogSize(db *sqlx.DB) (string, error) { if logSize >= sizeLimit { _, err = db.ExecContext(ctx, `SET GLOBAL INIT_CONNECT = ''`) if err != nil { - slog.Error("disable init_connect", err, slog.Int64("size", logSize)) + slog.Error("disable init_connect", + slog.String("error", err.Error()), + slog.Int64("size", logSize), + ) return "", err } return fmt.Sprintf("too big connlog table size %d", logSize), nil diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/init.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/init.go index 4f941f7b09..ced1dc5541 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/init.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlconnlog/init.go @@ -11,12 +11,12 @@ package mysqlconnlog import ( "context" "database/sql" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) var nameMySQLConnLogSize = "mysql-connlog-size" @@ -41,11 +41,16 @@ func (c *Checker) Run() (msg string, err error) { var initConnLog sql.NullString err = c.db.QueryRowxContext(ctx, `SELECT @@init_connect`).Scan(&initConnLog) if err != nil { - slog.Error("select @@init_connect", err) + slog.Error("select @@init_connect", slog.String("error", err.Error())) return "", err } + slog.Info( + "select @@init_connect", + slog.String("init_connect", initConnLog.String), + slog.Bool("initConnLog valid", initConnLog.Valid), + ) - if !initConnLog.Valid { + if !initConnLog.Valid || initConnLog.String == "" { slog.Info("init_connect disabled") return "", nil } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/errlog_snapshot.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/errlog_snapshot.go index 5f7c3a9c9f..f15bb70f4e 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/errlog_snapshot.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/errlog_snapshot.go @@ -11,6 +11,7 @@ package mysqlerrlog import ( "bufio" "context" + "log/slog" "os" "path/filepath" "strconv" @@ -18,7 +19,6 @@ import ( "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) func snapShot(db *sqlx.DB) error { @@ -44,7 +44,7 @@ func snapShot(db *sqlx.DB) error { 0755, ) if err != nil { - slog.Error("create reg file", err) + slog.Error("create reg file", slog.String("error", err.Error())) return err } @@ -59,13 +59,13 @@ func snapShot(db *sqlx.DB) error { startMatch, err := rowStartPattern.MatchString(string(content)) if err != nil { - slog.Error("apply row start pattern", err) + slog.Error("apply row start pattern", slog.String("error", err.Error())) return err } baseErrTokenMatch, err := baseErrTokenPattern.MatchString(string(content)) if err != nil { - slog.Error("apply base error token pattern", err) + slog.Error("apply base error token pattern", slog.String("error", err.Error())) return err } @@ -80,12 +80,12 @@ func snapShot(db *sqlx.DB) error { f, err := os.OpenFile(offsetRegFile, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755) if err != nil { - slog.Error("open offset reg", err) + slog.Error("open offset reg", slog.String("error", err.Error())) return err } _, err = f.WriteString(strconv.FormatInt(offset, 10)) if err != nil { - slog.Error("update offset reg", err) + slog.Error("update offset reg", slog.String("error", err.Error())) return err } @@ -96,7 +96,7 @@ func snapShot(db *sqlx.DB) error { func loadSnapShot() (*bufio.Scanner, error) { f, err := os.Open(errLogRegFile) if err != nil { - slog.Error("open err log reg", err) + slog.Error("open err log reg", slog.String("error", err.Error())) return nil, err } @@ -110,7 +110,7 @@ func findErrLogFile(db *sqlx.DB) (string, error) { var errLogPath, dataDir string err := db.QueryRowxContext(ctx, `SELECT @@LOG_ERROR, @@DATADIR`).Scan(&errLogPath, &dataDir) if err != nil { - slog.Error("query log_error, datadir", err) + slog.Error("query log_error, datadir", slog.String("error", err.Error())) return "", err } @@ -123,13 +123,13 @@ func findErrLogFile(db *sqlx.DB) (string, error) { func newScanner(logPath string) (*bufio.Scanner, int64, error) { f, err := os.Open(logPath) if err != nil { - slog.Error("open err log", err) + slog.Error("open err log", slog.String("error", err.Error())) return nil, 0, err } st, err := f.Stat() if err != nil { - slog.Error("stat of err log", err) + slog.Error("stat of err log", slog.String("error", err.Error())) return nil, 0, err } errLogSize := st.Size() @@ -153,7 +153,7 @@ func newScanner(logPath string) (*bufio.Scanner, int64, error) { offset, err := f.Seek(lastOffset, 0) if err != nil { - slog.Error("seek err log", err) + slog.Error("seek err log", slog.String("error", err.Error())) return nil, 0, err } @@ -171,9 +171,11 @@ func lastRoundOffset() (int64, error) { return 0, err } + slog.Info("read offset reg", slog.String("offset", string(content))) + r, err := strconv.ParseInt(string(content), 10, 64) if err != nil { - slog.Error("parse last offset", err) + slog.Error("parse last offset", slog.String("error", err.Error())) return 0, err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/general_scan.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/general_scan.go index 538b9cd87b..cc98b915f2 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/general_scan.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/general_scan.go @@ -27,7 +27,7 @@ func scanSnapShot(name string, pattern *regexp2.Regexp) (string, error) { line := scanner.Text() err := scanner.Err() if err != nil { - slog.Error("scan err log", err, slog.String("item", name)) + slog.Error("scan err log", slog.String("error", err.Error()), slog.String("item", name)) return "", err } slog.Debug("scan err log", slog.String("line", line)) diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/init.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/init.go index 7202cbf0ca..262d724764 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/init.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlerrlog/init.go @@ -10,16 +10,17 @@ package mysqlerrlog import ( "fmt" + "log/slog" "os" "path/filepath" "strings" "time" + "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "github.com/dlclark/regexp2" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) var executable string @@ -45,8 +46,6 @@ var spiderCriticalPattern *regexp2.Regexp func init() { executable, _ = os.Executable() - offsetRegFile = filepath.Join(filepath.Dir(executable), "errlog_offset.reg") - errLogRegFile = filepath.Join(filepath.Dir(executable), "errlog.reg") now := time.Now() rowStartPattern = regexp2.MustCompile( @@ -115,9 +114,17 @@ type Checker struct { // Run TODO func (c *Checker) Run() (msg string, err error) { + offsetRegFile = filepath.Join( + filepath.Dir(executable), + fmt.Sprintf("errlog_offset.%d.reg", config.MonitorConfig.Port), + ) + errLogRegFile = filepath.Join(filepath.Dir(executable), + fmt.Sprintf("errlog.%d.reg", config.MonitorConfig.Port), + ) + err = snapShot(c.db) if err != nil { - slog.Error(c.name, err) + slog.Error(c.name, slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_inject.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_inject.go index aabfb37fdd..b8b0bcc237 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_inject.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_inject.go @@ -9,10 +9,10 @@ package mysqlprocesslist import ( + "log/slog" "strings" "github.com/dlclark/regexp2" - "golang.org/x/exp/slog" ) func mysqlInject() (string, error) { @@ -60,7 +60,7 @@ func hasLongUserSleep(p *mysqlProcess) (bool, error) { re := regexp2.MustCompile(`User sleep`, regexp2.IgnoreCase) match, err := re.MatchString(p.State.String) if err != nil { - slog.Error("check long user sleep", err) + slog.Error("check long user sleep", slog.String("error", err.Error())) return false, err } @@ -71,7 +71,7 @@ func hasCommentInQuery(p *mysqlProcess) (bool, error) { re := regexp2.MustCompile(`\s+#`, regexp2.IgnoreCase) match, err := re.MatchString(p.Command.String) if err != nil { - slog.Error("check comment in query", err) + slog.Error("check comment in query", slog.String("error", err.Error())) return false, err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_lock.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_lock.go index 5227e22b29..27130208dc 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_lock.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/mysql_lock.go @@ -1,11 +1,11 @@ package mysqlprocesslist import ( + "log/slog" "strings" "time" "github.com/dlclark/regexp2" - "golang.org/x/exp/slog" ) /* @@ -68,7 +68,7 @@ func hasNormalLock(p *mysqlProcess) (bool, error) { reLockPattern := regexp2.MustCompile(`lock`, regexp2.IgnoreCase) match, err := reLockPattern.MatchString(p.State.String) if err != nil { - slog.Error("apply lock pattern", err) + slog.Error("apply lock pattern", slog.String("error", err.Error())) return false, err } if !match { @@ -78,7 +78,7 @@ func hasNormalLock(p *mysqlProcess) (bool, error) { reSystemLockPattern := regexp2.MustCompile(`system lock`, regexp2.IgnoreCase) match, err = reSystemLockPattern.MatchString(p.State.String) if err != nil { - slog.Error("apply system lock pattern", err) + slog.Error("apply system lock pattern", slog.String("error", err.Error())) return false, err } @@ -91,7 +91,7 @@ func hasNormalLock(p *mysqlProcess) (bool, error) { reExcludeSql := regexp2.MustCompile(`(?=(?:(^binlog|load data)))`, regexp2.IgnoreCase) match, err = reExcludeSql.MatchString(p.Info.String) if err != nil { - slog.Error("apply exclude commands pattern", err) + slog.Error("apply exclude commands pattern", slog.String("error", err.Error())) return false, err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/processlist_snapshot.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/processlist_snapshot.go index 762586ca1a..7ec18a1624 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/processlist_snapshot.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/mysqlprocesslist/processlist_snapshot.go @@ -12,13 +12,14 @@ import ( "context" "database/sql" "encoding/json" + "fmt" + "log/slog" "os" "path/filepath" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) type mysqlProcess struct { @@ -62,7 +63,7 @@ func (c *mysqlProcess) JsonString() (string, error) { ) if err != nil { - slog.Error("marshal process list", err) + slog.Error("marshal process list", slog.String("error", err.Error())) return "", err } @@ -79,25 +80,32 @@ func snapShot(db *sqlx.DB) error { return err } + regFilePath := filepath.Join( + filepath.Dir(executable), + fmt.Sprintf("processlist.%d.reg", config.MonitorConfig.Port)) f, err := os.OpenFile( - filepath.Join(filepath.Dir(executable), "processlist.reg"), + regFilePath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755, ) if err != nil { - slog.Error("create processlist.reg", err) + slog.Error( + "create processlist reg file", + slog.String("error", err.Error()), + slog.String("file path", regFilePath), + ) return err } content, err := json.Marshal(processList) if err != nil { - slog.Error("marshal processlist", err) + slog.Error("marshal processlist", slog.String("error", err.Error())) return err } _, err = f.Write(content) if err != nil { - slog.Error("write processlist.reg", err) + slog.Error("write processlist.reg", slog.String("error", err.Error())) return err } @@ -108,18 +116,19 @@ func snapShot(db *sqlx.DB) error { func loadSnapShot() ([]*mysqlProcess, error) { content, err := os.ReadFile( filepath.Join( - filepath.Dir(executable), "processlist.reg", + filepath.Dir(executable), + fmt.Sprintf("processlist.%d.reg", config.MonitorConfig.Port), ), ) if err != nil { - slog.Error("read processlist.reg", err) + slog.Error("read processlist.reg", slog.String("error", err.Error())) return nil, err } var res []*mysqlProcess err = json.Unmarshal(content, &res) if err != nil { - slog.Error("unmarshal processlist", err) + slog.Error("unmarshal processlist", slog.String("error", err.Error())) return nil, err } @@ -134,7 +143,7 @@ func queryProcessList(db *sqlx.DB) ([]mysqlProcess, error) { ctx, `SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM INFORMATION_SCHEMA.PROCESSLIST`) if err != nil { - slog.Error("show full processlist", err) + slog.Error("show full processlist", slog.String("error", err.Error())) return nil, err } defer func() { @@ -146,7 +155,7 @@ func queryProcessList(db *sqlx.DB) ([]mysqlProcess, error) { p := mysqlProcess{} err := rows.StructScan(&p) if err != nil { - slog.Error("scan processlist", err) + slog.Error("scan processlist", slog.String("error", err.Error())) return nil, err } res = append(res, p) diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxybackend/proxy_backend.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxybackend/proxy_backend.go index a444403a4c..09ae5bb526 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxybackend/proxy_backend.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxybackend/proxy_backend.go @@ -14,6 +14,7 @@ import ( "context" "database/sql" "fmt" + "log/slog" "math/big" "net" "os" @@ -27,7 +28,6 @@ import ( "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) var name = "proxy-backend" @@ -42,7 +42,7 @@ func (c *Checker) Run() (msg string, err error) { cnfPath := filepath.Join("/etc", fmt.Sprintf(`proxy.cnf.%d`, config.MonitorConfig.Port)) f, err := os.Open(cnfPath) if err != nil { - slog.Error("open proxy cnf file", err) + slog.Error("open proxy cnf file", slog.String("error", err.Error())) return "", err } defer func() { @@ -55,7 +55,7 @@ func (c *Checker) Run() (msg string, err error) { for scanner.Scan() { line := scanner.Text() if err := scanner.Err(); err != nil { - slog.Error("scan proxy cnf file", err) + slog.Error("scan proxy cnf file", slog.String("error", err.Error())) return "", err } @@ -67,7 +67,7 @@ func (c *Checker) Run() (msg string, err error) { if backendLine == "" { err := errors.Errorf("proxy-backend-addresses not found in cnf") - slog.Error("find backend in cnf", err) + slog.Error("find backend in cnf", slog.String("error", err.Error())) return "", nil } @@ -75,7 +75,7 @@ func (c *Checker) Run() (msg string, err error) { splitLine := splitPattern.Split(backendLine, -1) if len(splitLine) != 2 { err := errors.Errorf("invalid config: %s", backendLine) - slog.Error("split proxy-backend-addresses", err) + slog.Error("split proxy-backend-addresses", slog.String("error", err.Error())) return "", nil } @@ -94,7 +94,7 @@ func (c *Checker) Run() (msg string, err error) { } err = c.db.QueryRowxContext(ctx, `SELECT * FROM BACKENDS`).StructScan(&backendInfo) if err != nil { - slog.Error("query backends", err) + slog.Error("query backends", slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxyuserlist/proxy_user_list.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxyuserlist/proxy_user_list.go index decb64b779..b1ea379f1b 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxyuserlist/proxy_user_list.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/proxyuserlist/proxy_user_list.go @@ -5,6 +5,7 @@ import ( "bufio" "context" "fmt" + "log/slog" "os" "path/filepath" "strings" @@ -13,7 +14,6 @@ import ( "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) var name = "proxy-user-list" @@ -31,7 +31,7 @@ func (c *Checker) Run() (msg string, err error) { ) f, err := os.Open(userListFilePath) if err != nil { - slog.Error("read proxy user list file", err) + slog.Error("read proxy user list file", slog.String("error", err.Error())) return "", err } defer func() { @@ -44,7 +44,7 @@ func (c *Checker) Run() (msg string, err error) { usersFromFile = append(usersFromFile, scanner.Text()) err := scanner.Err() if err != nil { - slog.Error("scan proxy user list file", err) + slog.Error("scan proxy user list file", slog.String("error", err.Error())) return "", err } } @@ -55,7 +55,7 @@ func (c *Checker) Run() (msg string, err error) { var usersFromQuery []string err = c.db.SelectContext(ctx, &usersFromQuery, `SELECT * FROM USERS`) if err != nil { - slog.Error("query user list", err) + slog.Error("query user list", slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/rotateslowlog/rotate_slowlog.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/rotateslowlog/rotate_slowlog.go index f14ba6bd2b..e585bf46c3 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/rotateslowlog/rotate_slowlog.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/rotateslowlog/rotate_slowlog.go @@ -13,6 +13,7 @@ import ( "bytes" "context" "fmt" + "log/slog" "os" "os/exec" "path/filepath" @@ -22,7 +23,6 @@ import ( "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" ) var name = "rotate-slowlog" @@ -57,7 +57,7 @@ func (d *Dummy) Run() (msg string, err error) { `SELECT @@slow_query_log, @@slow_query_log_file`, ).Scan(&slowLogOn, &slowLogPath) if err != nil { - slog.Error("query slow_query_log, slow_query_log_file", err) + slog.Error("query slow_query_log, slow_query_log_file", slog.String("error", err.Error())) return "", err } slog.Info( @@ -85,7 +85,10 @@ func (d *Dummy) Run() (msg string, err error) { st, err := os.Stat(historySlowLogFilePath) if err != nil { if !os.IsNotExist(err) { // 文件存在 - slog.Error("get history slow log file stat", err, slog.String("history file path", historySlowLogFilePath)) + slog.Error("get history slow log file stat", + slog.String("error", err.Error()), + slog.String("history file path", historySlowLogFilePath), + ) return "", nil } // 文件不存在 @@ -113,7 +116,10 @@ func (d *Dummy) Run() (msg string, err error) { mvCmd.Stderr = &stderr err = mvCmd.Run() if err != nil { - slog.Error("mv slow log", err, slog.String("stderr", stderr.String())) + slog.Error("mv slow log", + slog.String("error", err.Error()), + slog.String("stderr", stderr.String()), + ) return "", err } @@ -122,13 +128,16 @@ func (d *Dummy) Run() (msg string, err error) { touchCmd.Stderr = &stderr err = touchCmd.Run() if err != nil { - slog.Error("touch slow log", err, slog.String("stderr", stderr.String())) + slog.Error("touch slow log", + slog.String("error", err.Error()), + slog.String("stderr", stderr.String()), + ) return "", err } _, err = d.db.ExecContext(ctx, `FLUSH SLOW LOGS`) if err != nil { - slog.Error("flush slow logs", err) + slog.Error("flush slow logs", slog.String("error", err.Error())) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/ctl_replicate.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/ctl_replicate.go index 7f537012b0..31418576b1 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/ctl_replicate.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/ctl_replicate.go @@ -11,8 +11,7 @@ package slavestatus import ( "context" "fmt" - - "golang.org/x/exp/slog" + "log/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" @@ -68,7 +67,7 @@ func (c *ctlReplicateChecker) isPrimary() (bool, error) { err := c.db.SelectContext(ctx, &getPrimaryRes, `TDBCTL GET PRIMARY`) if err != nil { - slog.Error("TDBCTL GET PRIMARY", err) + slog.Error("TDBCTL GET PRIMARY", slog.String("error", err.Error())) return false, err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/slave_status.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/slave_status.go index 1b16ede88a..35d982ca49 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/slave_status.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/slavestatus/slave_status.go @@ -11,6 +11,7 @@ package slavestatus import ( "context" "fmt" + "log/slog" "strings" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" @@ -18,7 +19,6 @@ import ( "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) var slaveStatusName = "slave-status" @@ -77,7 +77,7 @@ func (s *slaveStatusChecker) collectError() (string, error) { if errNo.(string) != "0" { if errMsg, ok := s.slaveStatus[ek.ErrKey]; !ok { err := errors.Errorf("%s not found in slave status", ek.ErrnoKey) - slog.Error("collect slave errors", err) + slog.Error("collect slave errors", slog.String("error", err.Error())) return "", err } else { slaveErr := fmt.Sprintf( @@ -105,7 +105,7 @@ func (s *slaveStatusChecker) fetchSlaveStatus() error { rows, err := s.db.QueryxContext(ctx, `SHOW SLAVE STATUS`) if err != nil { - slog.Error("show slave status", err) + slog.Error("show slave status", slog.String("error", err.Error())) return err } defer func() { @@ -115,7 +115,7 @@ func (s *slaveStatusChecker) fetchSlaveStatus() error { for rows.Next() { err := rows.MapScan(s.slaveStatus) if err != nil { - slog.Error("scan slave status", err) + slog.Error("scan slave status", slog.String("error", err.Error())) return err } break diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/spiderremote/spider_remote.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/spiderremote/spider_remote.go index 8848303a40..5b9fa8b086 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/spiderremote/spider_remote.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/spiderremote/spider_remote.go @@ -13,10 +13,10 @@ import ( "encoding/json" "fmt" "hash/crc32" + "log/slog" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" @@ -60,7 +60,10 @@ func (c *spiderRemoteCheck) Run() (msg string, err error) { b, err := json.Marshal(res) if err != nil { - slog.Error("spider remote marshal res", err, slog.Any("res", res)) + slog.Error("spider remote marshal res", + slog.String("error", err.Error()), + slog.Any("res", res), + ) return "", err } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/tscc/tscc.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/tscc/tscc.go index 5a825376e6..3ae02c742d 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/tscc/tscc.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/tscc/tscc.go @@ -14,11 +14,11 @@ package tscc import ( "encoding/json" "fmt" + "log/slog" "strings" "time" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" ) @@ -103,7 +103,7 @@ func (c *tableSchemaConsistencyCheck) Run() (msg string, err error) { var ps PrimaryCtlInfo err = c.ctldb.Get(&ps, "TDBCTL GET PRIMARY") if err != nil { - slog.Error("execute TDBCTL GET PRIMARY failed", err) + slog.Error("execute TDBCTL GET PRIMARY failed", slog.String("error", err.Error())) return } if ps.IsThisServer == 0 { @@ -121,14 +121,14 @@ func (c *tableSchemaConsistencyCheck) Run() (msg string, err error) { var count int err = c.ctldb.Get(&count, "select count(*) from tscc_pending_execute_tbl") if err != nil { - slog.Error("query pending execute check table failed", err) + slog.Error("query pending execute check table failed", slog.String("error", err.Error())) return } if count < 10 { query, args, err := sqlx.In( "insert ignore into tscc_pending_execute_tbl select TABLE_SCHEMA,TABLE_NAME,CREATE_TIME from information_schema.tables where TABLE_SCHEMA not in (?) ", ignoreDbs) if err != nil { - slog.Error("get check tables failed", err) + slog.Error("get check tables failed", slog.String("error", err.Error())) return msg, err } _, err = c.ctldb.Exec(c.ctldb.Rebind(query), args...) @@ -158,7 +158,7 @@ func (c *tableSchemaConsistencyCheck) Run() (msg string, err error) { var tblRows []TsccPendingExecuteTbl err = c.ctldb.Select(&tblRows, "select * from tscc_pending_execute_tbl limit 500") if err != nil { - slog.Error("failed to query the table to be verified", err) + slog.Error("failed to query the table to be verified", slog.String("error", err.Error())) return } if len(tblRows) < 1 { @@ -170,7 +170,7 @@ func (c *tableSchemaConsistencyCheck) Run() (msg string, err error) { err = c.ctldb.Select(&result, fmt.Sprintf("tdbctl checksum `%s`.`%s`;", tblRow.Db, tblRow.Tbl)) if err != nil { errChan <- struct{}{} - slog.Error("exec tdbctl checksum table failed", err) + slog.Error("exec tdbctl checksum table failed", slog.String("error", err.Error())) continue } c.ctldb.Exec("set tc_admin = 0;") @@ -196,7 +196,7 @@ func (c *tableSchemaConsistencyCheck) atomUpdateCheckResult(db, tbl string, inco if len(inconsistentItems) != 0 { checkResult, err = json.Marshal(inconsistentItems) if err != nil { - slog.Error("json marshal failed %s", err.Error()) + slog.Error("json marshal failed %s", slog.String("error", err.Error())) return } status = "" @@ -205,16 +205,16 @@ func (c *tableSchemaConsistencyCheck) atomUpdateCheckResult(db, tbl string, inco checkResult, time.Now()) if err != nil { - slog.Error("replace checksum record failed", err) + slog.Error("replace checksum record failed", slog.String("error", err.Error())) return } _, err = tx.Exec("delete from infodba_schema.tscc_pending_execute_tbl where db = ? and tbl = ? ", db, tbl) if err != nil { - slog.Warn("delete pending tbl record failed", err) + slog.Warn("delete pending tbl record failed", slog.String("error", err.Error())) return } if err = tx.Commit(); err != nil { - slog.Warn("commit error: ", err) + slog.Warn("commit error: ", slog.String("error", err.Error())) return } return diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/uniquectlmaster/checker.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/uniquectlmaster/checker.go index 4025054e53..93d252a422 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/uniquectlmaster/checker.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/itemscollect/uniquectlmaster/checker.go @@ -1,11 +1,11 @@ package uniquectlmaster import ( + "log/slog" "math/big" "net" "github.com/jmoiron/sqlx" - "golang.org/x/exp/slog" "dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface" "dbm-services/mysql/db-tools/mysql-monitor/pkg/utils" diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop/main_loop.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop/main_loop.go index c9cd6ff417..867e724805 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop/main_loop.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/mainloop/main_loop.go @@ -11,6 +11,8 @@ package mainloop import ( "fmt" + "log/slog" + "slices" "strings" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" @@ -21,8 +23,6 @@ import ( _ "github.com/go-sql-driver/mysql" // mysql TODO "github.com/pkg/errors" "github.com/spf13/viper" - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" ) // Run TODO @@ -62,7 +62,7 @@ func Run(hardcode bool) error { if constructor, ok := itemscollect.RegisteredItemConstructor()[iName]; ok { msg, err := constructor(cc).Run() if err != nil { - slog.Error("run monitor item", err, slog.String("name", iName)) + slog.Error("run monitor item", slog.String("error", err.Error()), slog.String("name", iName)) utils.SendMonitorEvent( "monitor-internal-error", fmt.Sprintf("run monitor item %s failed: %s", iName, err.Error()), @@ -84,7 +84,7 @@ func Run(hardcode bool) error { } else { err := errors.Errorf("%s not registered", iName) - slog.Error("run monitor item", err) + slog.Error("run monitor item", slog.String("error", err.Error())) continue } } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface/connection_collect.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface/connection_collect.go index 5e8c4707da..bba25710c5 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface/connection_collect.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/monitoriteminterface/connection_collect.go @@ -11,6 +11,7 @@ package monitoriteminterface import ( "context" "fmt" + "log/slog" "time" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" @@ -18,7 +19,6 @@ import ( "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/exp/slog" ) // ConnectionCollect DB连接对象 @@ -51,7 +51,7 @@ func (c *ConnectionCollect) Close() { // NewConnectionCollect 新建连接 func NewConnectionCollect() (*ConnectionCollect, error) { switch config.MonitorConfig.MachineType { - case "backend", "remote": + case "backend", "remote", "single": db, err := connectDB( config.MonitorConfig.Ip, config.MonitorConfig.Port, @@ -59,7 +59,8 @@ func NewConnectionCollect() (*ConnectionCollect, error) { ) if err != nil { slog.Error( - fmt.Sprintf("connect %s", config.MonitorConfig.MachineType), err, + fmt.Sprintf("connect %s", config.MonitorConfig.MachineType), + slog.String("error", err.Error()), slog.String("ip", config.MonitorConfig.Ip), slog.Int("port", config.MonitorConfig.Port), ) @@ -74,7 +75,8 @@ func NewConnectionCollect() (*ConnectionCollect, error) { ) if err != nil { slog.Error( - "connect proxy", err, + "connect proxy", + slog.String("error", err.Error()), slog.String("ip", config.MonitorConfig.Ip), slog.Int("port", config.MonitorConfig.Port), ) @@ -96,7 +98,8 @@ func NewConnectionCollect() (*ConnectionCollect, error) { } } slog.Error( - "connect proxy admin", err, + "connect proxy admin", + slog.String("error", err.Error()), slog.String("ip", config.MonitorConfig.Ip), slog.Int("port", adminPort), ) @@ -112,7 +115,8 @@ func NewConnectionCollect() (*ConnectionCollect, error) { ) if err != nil { slog.Error( - "connect spider", err, + "connect spider", + slog.String("error", err.Error()), slog.String("ip", config.MonitorConfig.Ip), slog.Int("port", config.MonitorConfig.Port), ) @@ -131,7 +135,8 @@ func NewConnectionCollect() (*ConnectionCollect, error) { ) if err != nil { slog.Error( - "connect ctl", err, + "connect ctl", + slog.String("error", err.Error()), slog.String("ip", config.MonitorConfig.Ip), slog.Int("port", ctlPort), ) @@ -145,7 +150,7 @@ func NewConnectionCollect() (*ConnectionCollect, error) { "not support machine type: %s", config.MonitorConfig.MachineType, ) - slog.Error("new connect", err) + slog.Error("new connect", slog.String("error", err.Error())) return nil, err } } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_event.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_event.go index 7d5d13cd55..7edeae75cb 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_event.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_event.go @@ -1,12 +1,11 @@ package utils import ( + "log/slog" "strconv" ma "dbm-services/mysql/db-tools/mysql-crond/api" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" - - "golang.org/x/exp/slog" ) // SendMonitorEvent TODO @@ -14,7 +13,8 @@ func SendMonitorEvent(name string, msg string) { crondManager := ma.NewManager(config.MonitorConfig.ApiUrl) additionDimension := map[string]interface{}{ - "immute_domain": config.MonitorConfig.ImmuteDomain, + "cluster_domain": config.MonitorConfig.ImmuteDomain, + "db_module": *config.MonitorConfig.DBModuleID, "machine_type": config.MonitorConfig.MachineType, "bk_cloud_id": *config.MonitorConfig.BkCloudID, "port": config.MonitorConfig.Port, @@ -32,7 +32,8 @@ func SendMonitorEvent(name string, msg string) { ) if err != nil { slog.Error( - "send event", err, + "send event", + slog.String("error", err.Error()), slog.String("name", name), slog.String("msg", msg), ) } diff --git a/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_metrics.go b/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_metrics.go index fe1a6c4949..714451abbf 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_metrics.go +++ b/dbm-services/mysql/db-tools/mysql-monitor/pkg/utils/send_monitor_metrics.go @@ -1,13 +1,12 @@ package utils import ( + "log/slog" + "maps" "strconv" ma "dbm-services/mysql/db-tools/mysql-crond/api" "dbm-services/mysql/db-tools/mysql-monitor/pkg/config" - - "golang.org/x/exp/maps" - "golang.org/x/exp/slog" ) // SendMonitorMetrics TODO @@ -15,7 +14,8 @@ func SendMonitorMetrics(name string, value int64, customDimension map[string]int crondManager := ma.NewManager(config.MonitorConfig.ApiUrl) additionDimension := map[string]interface{}{ - "immute_domain": config.MonitorConfig.ImmuteDomain, + "cluster_domain": config.MonitorConfig.ImmuteDomain, + "db_module": *config.MonitorConfig.DBModuleID, "machine_type": config.MonitorConfig.MachineType, "bk_cloud_id": strconv.Itoa(*config.MonitorConfig.BkCloudID), "port": strconv.Itoa(config.MonitorConfig.Port), @@ -37,7 +37,8 @@ func SendMonitorMetrics(name string, value int64, customDimension map[string]int ) if err != nil { slog.Error( - "send metrics", err, + "send metrics", + slog.String("error", err.Error()), slog.String("name", name), slog.Int64("value", value), ) } diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/.gitignore b/dbm-services/mysql/db-tools/mysql-rotatebinlog/.gitignore new file mode 100644 index 0000000000..2b1f6e3fef --- /dev/null +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/.gitignore @@ -0,0 +1,3 @@ +.idea +*.log +build \ No newline at end of file diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile b/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile index e7335773f3..baefad396c 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile @@ -8,13 +8,15 @@ RELEASE_BUILD_FLAG = "-X ${MODULE}/cmd.version=${VERSION} -X ${MODULE}/cmd.build BETA_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X ${MODULE}/cmd.gitHash="" " BASE_DIR = $(shell pwd) +.PHONY: build +build: + @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -gcflags="all=-trimpath=${PWD}" -asmflags="all=-trimpath=${PWD}" -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} + .PHONY: release -release: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} +release: build @cp config.example.yaml ${OUTPUT_DIR}/${PROJ}/config.yaml.example @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PROJ_PKG} ${PROJ}/ -release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} + .PHONY: beta beta: @cd ${BASE_DIR}/cmd && go build -ldflags ${BETA_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.mod b/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.mod index 2e6409f6da..4b9ed72da6 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.mod +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.mod @@ -1,21 +1,21 @@ module dbm-services/mysql/db-tools/mysql-rotatebinlog -go 1.19 +go 1.21 require ( github.com/Masterminds/squirrel v1.5.4 github.com/ghodss/yaml v1.0.0 github.com/go-mysql-org/go-mysql v1.7.0 - github.com/golang-migrate/migrate/v4 v4.15.2 + github.com/golang-migrate/migrate/v4 v4.16.2 github.com/jmoiron/sqlx v1.3.5 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/pkg/errors v0.9.1 - github.com/spf13/cast v1.5.0 + github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.2 - modernc.org/sqlite v1.22.1 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 + modernc.org/sqlite v1.25.0 ) require ( @@ -23,7 +23,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -32,34 +32,34 @@ require ( github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 // indirect - github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 // indirect + github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - go.uber.org/atomic v1.9.0 // indirect - golang.org/x/mod v0.8.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.6.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/tools v0.13.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/uint128 v1.2.0 // indirect - modernc.org/cc/v3 v3.40.0 // indirect - modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.22.5 // indirect - modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.5.0 // indirect + lukechampine.com/uint128 v1.3.0 // indirect + modernc.org/cc/v3 v3.41.0 // indirect + modernc.org/ccgo/v3 v3.16.15 // indirect + modernc.org/libc v1.24.1 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.7.1 // indirect modernc.org/opt v0.1.3 // indirect - modernc.org/strutil v1.1.3 // indirect - modernc.org/token v1.0.1 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect ) diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.sum b/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.sum index 19beefad46..1459e34786 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.sum +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/go.sum @@ -1,5 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -19,18 +17,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -39,12 +25,10 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/spanner v1.28.0/go.mod h1:7m6mtQZn/hMbMfx62ct5EWrGND4DNqkXyrmBPRS+OJo= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -52,470 +36,55 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY= -github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0= -github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU= -github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= -github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4/go.mod h1:Ex7XQmbFmgFHrjUX6TN3mApKW5Hglyga+F7wZHTtYhA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6ry18hGvE0i8yvbXoKbnZaE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ= -github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI= -github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= -github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8/go.mod h1:q2w6Bg5jeox1B+QkJ6Wp/+Vn0G/bo3f1uY7Fn3vivIQ= github.com/cznic/strutil v0.0.0-20171016134553-529a34b1c186/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-mysql-org/go-mysql v1.7.0 h1:qE5FTRb3ZeTQmlk3pjE+/m2ravGxxRDrVDTyDe9tvqI= github.com/go-mysql-org/go-mysql v1.7.0/go.mod h1:9cRWLtuXNKhamUPMkrDVzBhaomGvqLRLtBiyjvjc4pk= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= -github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= +github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -523,9 +92,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -540,17 +106,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -559,22 +116,12 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -585,354 +132,65 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/jmoiron/sqlx v1.3.3/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8 h1:USx2/E1bX46VG32FIw034Au6seQ2fY9NEILmNh/UlQg= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ= github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= @@ -940,307 +198,94 @@ github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 h1:+FZIDR/D97YOP github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63/go.mod h1:X2r9ueLEUZgtx2cIogM0v4Zj5uvvzhuuiu7Pn8HzMPg= github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM= github.com/pingcap/tidb/parser v0.0.0-20221126021158-6b02a5d8ba7d/go.mod h1:ElJiub4lRy6UZDb+0JHDkGEdr6aOli+ykhyej7VCLoI= -github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= -github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 h1:oI+RNwuC9jF2g2lP0u0cVEEZrc/AYBCuFdvwrLWM/6Q= github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07/go.mod h1:yFdBgwXP24JziuRl2NMUahT7nGLNOKi1SIiFxMttVD4= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed h1:KMgQoLJGCq1IoZpLZE3AIffh9veYWoVlsvA4ib55TMM= +github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed/go.mod h1:yFdBgwXP24JziuRl2NMUahT7nGLNOKi1SIiFxMttVD4= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1252,7 +297,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1263,38 +307,20 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190225153610-fe579d43d832/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1305,38 +331,17 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1345,78 +350,34 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1424,132 +385,53 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1569,47 +451,26 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201125231158-b5590deeca9b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1629,34 +490,18 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1665,7 +510,6 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1674,63 +518,25 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1740,23 +546,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1767,56 +559,21 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1824,119 +581,47 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= -modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= -modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo= -modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= +lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= +modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= +modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0= +modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= -modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk= modernc.org/lexer v1.0.0/go.mod h1:F/Dld0YKYdZCLQ7bD0USbWL4YKCyTDRDHiDTOs0q0vk= -modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= -modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= -modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.7.1 h1:9J+2/GKTlV503mk3yv8QJ6oEpRCUrRy0ad8TXEPoV8M= +modernc.org/memory v1.7.1/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/parser v1.0.0/go.mod h1:H20AntYJ2cHHL6MHthJ8LZzXCdDCHMWt1KZXtIMjejA= modernc.org/parser v1.0.2/go.mod h1:TXNq3HABP3HMaqLK7brD1fLA/LfN0KS6JxZn71QdDqs= -modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= modernc.org/scanner v1.0.1/go.mod h1:OIzD2ZtjYk6yTuyqZr57FmifbM9fIH74SumloSsajuE= modernc.org/sortutil v1.0.0/go.mod h1:1QO0q8IlIlmjBIwm6t/7sof874+xCfZouyqZMLIAtxM= -modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= -modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= -modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= +modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/y v1.0.1/go.mod h1:Ho86I+LVHEI+LYXoUKlmOMAM1JTXOCfj8qi1T8PsClE= -modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= -modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/backup/backup_cos.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/backup/backup_cos.go index a23f550c45..13054afbcc 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/backup/backup_cos.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/backup/backup_cos.go @@ -1,6 +1,10 @@ package backup -import "dbm-services/common/go-pubpkg/backupclient" +import ( + "github.com/pkg/errors" + + "dbm-services/common/go-pubpkg/backupclient" +) // COSBackupClient TODO type COSBackupClient struct { @@ -22,6 +26,9 @@ func (o *COSBackupClient) Init() error { // Upload TODO func (o *COSBackupClient) Upload(fileName string) (string, error) { + if o.backupClient == nil { + return "-1", errors.New("COSBackupClient need init first") + } return o.backupClient.Upload(fileName) } diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/models/dbmodel.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/models/dbmodel.go index 03129bfc0a..3dc1618457 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/models/dbmodel.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/models/dbmodel.go @@ -324,7 +324,8 @@ func (m *BinlogFileModel) QuerySuccess(db *sqlx.DB) ([]*BinlogFileModel, error) // QueryFailed 查询上传失败、过期的文件 func (m *BinlogFileModel) QueryFailed(db *sqlx.DB) ([]*BinlogFileModel, error) { - return m.Query(db, "backup_status > ?", IBStatusSuccess) + inWhere := sq.NotEq{"backup_status": []int{IBStatusSuccess, FileStatusRemoved}} + return m.Query(db, inWhere) } // Query 返回 binlog files 以文件名排序 @@ -340,7 +341,7 @@ func (m *BinlogFileModel) Query(db *sqlx.DB, pred interface{}, params ...interfa if err != nil { return nil, err } - logger.Info("Query sqlStr: %s, args: %v", sqlStr, args) + logger.Debug("Query sqlStr: %s, args: %v", sqlStr, args) if err = db.Select(&files, sqlStr, args...); err != nil { return nil, err } @@ -355,7 +356,7 @@ func (m *BinlogFileModel) QueryLastFileReport(db *sqlx.DB) (*BinlogFileModel, er if err != nil { return nil, err } - logger.Info("sqlStr: %s, args: %v", sqlStr, args) + logger.Info("QueryLastFileReport sqlStr: %s, args: %v", sqlStr, args) bf := &BinlogFileModel{} if err = db.Get(bf, sqlStr, args...); err != nil { if errors.Is(err, sql.ErrNoRows) { diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/main.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/main.go index 21562e41bc..5a80ac4872 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/main.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/main.go @@ -1,6 +1,7 @@ package rotate import ( + "errors" "fmt" "io/ioutil" "os" @@ -20,7 +21,7 @@ import ( "dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util" "github.com/ghodss/yaml" - "github.com/pkg/errors" + errs "github.com/pkg/errors" "github.com/spf13/cast" "github.com/spf13/viper" ) @@ -51,7 +52,9 @@ func (c *RotateBinlogComp) Init() (err error) { return nil } -// Start TODO +// Start godoc +// 多个实例进行rotate,除了空间释放的计算有关联,其它互补影响 +// 即一个实例rotate失败,不影响其它rotate执行。但会抛出失败的那个实例相应错误 func (c *RotateBinlogComp) Start() (err error) { if err = log.InitLogger(); err != nil { return err @@ -70,19 +73,23 @@ func (c *RotateBinlogComp) Start() (err error) { if err = models.SetupTable(); err != nil { return err } - var backupClient backup.BackupClient - if backupClient, err = backup.InitBackupClient(); err != nil { - return err - } var servers []*ServerObj if err = viper.UnmarshalKey("servers", &servers); err != nil { - return errors.Wrap(err, "parse config servers") + return errs.Wrap(err, "parse config servers") } else { logger.Info("config servers: %+v", servers) } + var errRet error for _, inst := range servers { - inst.backupClient = backupClient + var backupClient backup.BackupClient + if backupClient, err = backup.InitBackupClient(); err != nil { + err = errs.WithMessagef(err, "init backup_client") + logger.Error("%+v", err.Error()) + errRet = errors.Join(errRet, err) + continue + } + inst.backupClient = backupClient // if nil, ignore backup inst.instance = &native.InsObject{ Host: inst.Host, Port: inst.Port, @@ -91,26 +98,32 @@ func (c *RotateBinlogComp) Start() (err error) { Socket: inst.Socket, } if err = validate.GoValidateStruct(inst, true, false); err != nil { - logger.Error("validate instance failed: %s", inst) + err = errs.WithMessagef(err, "validate instance %s", inst) + logger.Error("%+v", err.Error()) + errRet = errors.Join(errRet, err) continue } if err = inst.Rotate(); err != nil { - logger.Error("fail to rotate_binlog: %d, err: %+v", inst.Port, err) + err = errs.WithMessagef(err, "run rotatebinlog %d", inst.Port) + logger.Error("%+v", err) + errRet = errors.Join(errRet, err) continue } } if err = c.decideSizeToFree(servers); err != nil { - return err + return errors.Join(errRet, err) } for _, inst := range servers { if err = inst.FreeSpace(); err != nil { - logger.Error(err.Error()) + logger.Error("FreeSpace %+v", err) + errRet = errors.Join(errRet, err) } if err = inst.rotate.Backup(); err != nil { - logger.Error("%+v", err) + logger.Error("Backup %+v", err) + errRet = errors.Join(errRet, err) } } - return nil + return errRet } // RemoveConfig 删除某个 binlog 实例的 rotate 配置 @@ -206,15 +219,15 @@ func (c *RotateBinlogComp) decideSizeToFree(servers []*ServerObj) error { return fmt.Errorf("unknown keep_policy %s", keepPolicy) } - var diskPartInst = make(map[string][]*ServerObj) // 每个挂载目录上,放了哪些binlog实例以及对应的binlog空间 - var diskParts = make(map[string]*util.DiskDfResult) // 目录对应的空间信息 + var diskPartInst = make(map[string][]*ServerObj) // 每个挂载目录上,放了哪些binlog实例以及对应的binlog空间 + var diskParts = make(map[string]*cmutil.DiskPartInfo) // 目录对应的空间信息 for _, inst := range servers { diskPart, err := util.GetDiskPartitionWithDir(inst.binlogDir) if err != nil { logger.Warn("fail to get binlog_dir %s disk partition info", inst.binlogDir) continue } - mkey := diskPart.MountedOn + mkey := diskPart.Mountpoint diskPartInst[mkey] = append(diskPartInst[mkey], inst) diskParts[mkey] = diskPart } @@ -226,8 +239,7 @@ func (c *RotateBinlogComp) decideSizeToFree(servers []*ServerObj) error { } else { maxBinlogSizeAllowedMB = maxBinlogSizeAllowed / 1024 / 1024 } - logger.Info( - "viper config:%s, parsed_mb:%d", + logger.Info("viper config:%s, parsed_mb:%d", viper.GetString("public.max_binlog_total_size"), maxBinlogSizeAllowedMB, ) @@ -251,14 +263,18 @@ func (c *RotateBinlogComp) decideSizeToFree(servers []*ServerObj) error { } // 根据磁盘使用率来决定删除空间 - maxDiskUsedPctAllowed := cast.ToFloat32(viper.GetFloat64("public.max_disk_used_pct") / float64(100)) - maxDiskUsedAllowedMB := cast.ToInt64(maxDiskUsedPctAllowed * float32(diskPart.TotalSizeMB)) - if diskPart.UsedPct < maxDiskUsedPctAllowed { + maxDiskUsedPctAllowed := viper.GetFloat64("public.max_disk_used_pct") / float64(100) + maxDiskUsedAllowedMB := cast.ToUint64(maxDiskUsedPctAllowed*float64(diskPart.Total)) / 1024 / 1024 + logger.Info("diskPart %s TotalMB:%d UsedPercent:%.2f, maxDiskUsedPctAllowed:%.2f", + diskPartName, diskPart.Total/1024/1024, diskPart.UsedPercent, maxDiskUsedPctAllowed) + if diskPart.UsedPercent < maxDiskUsedPctAllowed { continue } - diskPart.SizeToFreeMB = diskPart.UsedMB - maxDiskUsedAllowedMB - portSizeToFreeMB := util.DecideSizeToRemove(instBinlogSizeMB, diskPart.SizeToFreeMB) - logger.Info("plan to free space MB: %+v", portSizeToFreeMB) + diskPartSizeToFreeMB := int64((diskPart.UsedTotal / 1024 / 1024) - maxDiskUsedAllowedMB) + portSizeToFreeMB := util.DecideSizeToRemove(instBinlogSizeMB, diskPartSizeToFreeMB) + logger.Info("diskPart %s maxDiskUsedAllowedMB:%d UsedTotalMB:%d expectFreeMB:%d", + diskPartName, maxDiskUsedAllowedMB, diskPart.UsedTotal/1024/1024, diskPartSizeToFreeMB) + logger.Info("plan to free spaceMB:%+v", portSizeToFreeMB) for _, inst := range diskPartInst[diskPartName] { if portSizeToFreeMB[inst.Port] > inst.rotate.sizeToFreeMB { inst.rotate.sizeToFreeMB = portSizeToFreeMB[inst.Port] diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate.go index 0164902a69..a4063ee122 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate.go @@ -118,7 +118,7 @@ func (i *ServerObj) FlushLogs() error { bp, _ := binlog_parser.NewBinlogParse("", 0) events, err := bp.GetTime(fileName, true, false) // 只获取start_time if err != nil { - logger.Warn(err.Error()) + logger.Warn("FlushLogs GetTime %s", fileName, err.Error()) _ = i.flushLogs() } else { lastRotateTime, _ := time.ParseInLocation(cst.DBTimeLayout, events[0].EventTime, time.Local) @@ -178,7 +178,9 @@ func (i *ServerObj) RemoveMaxKeepDuration() error { // logger.Info("RemoveMaxKeepDuration keep ReserveMinBinlogNum=%d", ReserveMinBinlogNum) continue } - if err := os.Remove(filepath.Join(i.binlogDir, f.Filename)); err != nil { + fileFullPath := filepath.Join(i.binlogDir, f.Filename) + logger.Info("max_keep_duration remove file: %s", fileFullPath) + if err := os.Remove(fileFullPath); err != nil { logger.Error(err.Error()) } } else { @@ -211,15 +213,18 @@ func (i *ServerObj) RegisterBinlog(lastFileBefore string) error { fileName := filepath.Join(i.binlogDir, fileObj.Filename) events, err := bp.GetTime(fileName, true, true) if err != nil { - logger.Warn(err.Error()) + logger.Warn("binlog %s GetTime failed: %s", fileName, err.Error()) backupStatus = models.IBStatusClientFail backupStatusInfo = err.Error() } if i.Tags.DBRole == models.RoleSlave { // slave 无需备份 binlog backupStatus = models.FileStatusNoNeedUpload } - startTime := events[0].EventTime - stopTime := events[1].EventTime + var startTime, stopTime string + if len(events) >= 2 { + startTime = events[0].EventTime + stopTime = events[1].EventTime + } ff := &models.BinlogFileModel{ BkBizId: i.Tags.BkBizId, ClusterId: i.Tags.ClusterId, @@ -269,7 +274,7 @@ func (r *BinlogRotate) Backup() error { bp, _ := binlog_parser.NewBinlogParse("", 0) events, err := bp.GetTime(filename, true, true) if err != nil { - logger.Warn(err.Error()) + logger.Warn("Backup GetTime %s", filename, err.Error()) // f.BackupStatus = FileStatusAbnormal } else { f.StartTime = events[0].EventTime @@ -315,12 +320,17 @@ func (r *BinlogRotate) Backup() error { // 将本地 done,success 的超过阈值的 binlog 文件删除,更新 binlog 列表状态 // 超过 max_keep_days 的强制删除,单位 bytes // sizeBytesToFree=999999999 代表尽可能删除 -func (r *BinlogRotate) Remove(sizeBytesToFree int64) error { +func (r *BinlogRotate) Remove(sizeBytesToFree int64, success bool) (err error) { if sizeBytesToFree == 0 { logger.Info("no need to free %d binlog size", r.binlogInst.Port) return nil } - binlogFiles, err := r.binlogInst.QuerySuccess(models.DB.Conn) + var binlogFiles []*models.BinlogFileModel + if success { + binlogFiles, err = r.binlogInst.QuerySuccess(models.DB.Conn) + } else { + binlogFiles, err = r.binlogInst.QueryFailed(models.DB.Conn) + } if err != nil { return err } @@ -331,13 +341,13 @@ func (r *BinlogRotate) Remove(sizeBytesToFree int64) error { num := len(binlogFiles) for i, f := range binlogFiles { if num-i-cst.ReserveMinBinlogNum < 0 { - logger.Info("rotate binlog keep ReserveMinBinlogNum=%d", cst.ReserveMinBinlogNum) + logger.Info("rotate binlog %d keep ReserveMinBinlogNum=%d", r.binlogInst.Port, cst.ReserveMinBinlogNum) break } fileFullPath := filepath.Join(r.binlogDir, f.Filename) logger.Info("remove file: %s", fileFullPath) if err = os.Remove(fileFullPath); err != nil { - logger.Error(err.Error()) + logger.Error("remove file failed: %s", err.Error()) // return err } if !cmutil.FileExists(fileFullPath) { @@ -356,12 +366,18 @@ func (r *BinlogRotate) Remove(sizeBytesToFree int64) error { } if sizeDeleted < sizeBytesToFree && sizeBytesToFree != PolicyLeastMaxSize*1024*1024 { logger.Warn( - "disk space freed does not satisfy needed after delete all allowed binlog files. "+ + "removeSuccess=%t disk space freed does not satisfy needed after delete all allowed binlog files. "+ "sizeDeleted:%d sizeBytesToFree:%d", - sizeDeleted, sizeBytesToFree, + success, sizeDeleted, sizeBytesToFree, ) - // todo 可能需要开始删除 备份未完成的 binlog + // 需要删除 备份未完成的 binlog + if success { + leftSizeBytesToFree := sizeBytesToFree - sizeDeleted + return r.Remove(leftSizeBytesToFree, false) + } + } - logger.Info("sizeBytesDeleted:%d, fileDeleted:%d. binlog lastDeleted: %s", sizeDeleted, fileDeleted, stopFile) + logger.Info("removeSuccess=%t sizeBytesDeleted:%d, fileDeleted:%d. binlog lastDeleted: %s", + success, sizeDeleted, fileDeleted, stopFile) return nil } diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate_binlog.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate_binlog.go index 919ff7d2c8..033c99cb3d 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate_binlog.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/rotate/rotate_binlog.go @@ -2,7 +2,6 @@ package rotate import ( "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -33,7 +32,7 @@ type ServerObj struct { dbWorker *native.DbWorker binlogDir string - // 已按文件名升序排序 + // 已按文件名升序排序,本地存在的binlog文件列表 binlogFiles []*BinlogFile backupClient backup.BackupClient instance *native.InsObject @@ -103,11 +102,11 @@ func (i *ServerObj) Rotate() (err error) { func (i *ServerObj) FreeSpace() (err error) { sizeToFreeBytes := i.rotate.sizeToFreeMB * 1024 * 1024 // MB to bytes logger.Info("plan to free port %d binlog bytes %d", i.Port, sizeToFreeBytes) - if err = i.rotate.Remove(sizeToFreeBytes); err != nil { - logger.Error("%+v", err) + if err = i.rotate.Remove(sizeToFreeBytes, true); err != nil { + logger.Error("Remove %+v", err) } if err = i.PurgeIndex(); err != nil { - logger.Error("%+v", err) + logger.Error("PurgeIndex %+v", err) } defer i.dbWorker.Stop() return nil @@ -142,7 +141,7 @@ func (f *BinlogFile) String() string { // getBinlogFilesLocal 获取实例的 本地 binlog 列表,会按文件名排序 func (i *ServerObj) getBinlogFilesLocal() (string, []*BinlogFile, error) { // 临时关闭 binlog 删除 - files, err := ioutil.ReadDir(i.binlogDir) // 已经按文件名排序 + files, err := os.ReadDir(i.binlogDir) // 已经按文件名排序 if err != nil { return "", nil, errors.Wrap(err, "read binlog dir") } @@ -154,11 +153,12 @@ func (i *ServerObj) getBinlogFilesLocal() (string, []*BinlogFile, error) { } continue } else { + fii, _ := fi.Info() i.binlogFiles = append( i.binlogFiles, &BinlogFile{ Filename: fi.Name(), - Mtime: fi.ModTime().Format(cst.DBTimeLayout), - Size: fi.Size(), + Mtime: fii.ModTime().Format(cst.DBTimeLayout), + Size: fii.Size(), }, ) } diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/balance.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/balance.go index 11caeaab16..64a3ef22bc 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/balance.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/balance.go @@ -26,11 +26,12 @@ func DecideSizeToRemove(ports map[int]int64, sizeToFree int64) map[int]int64 { break } } - logger.Info("规划出每个实例删除binlog大小,portSizeToFree MB:%+v", portSizeToFree) + logger.Info("we got every instance binlog size to delete MB:%+v", portSizeToFree) return portSizeToFree } // reduceFromMax ports代表当前实例的binlog大小 +// 会修改 ports map 里面端口对应的 size 大小 func reduceFromMax(ports map[int]int64, incr int) (port int) { maxSize := int64(0) var maxSizePort int = 0 @@ -40,7 +41,8 @@ func reduceFromMax(ports map[int]int64, incr int) (port int) { maxSizePort = p } } - if ports[maxSizePort]-int64(incr) >= 0 { + ports[maxSizePort] = ports[maxSizePort] - int64(incr*cst.ReduceStepSizeMB) + if ports[maxSizePort] >= 0 { return maxSizePort } else { return 0 diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/util.go b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/util.go index 7ebe207eed..fb494fb554 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/util.go +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/pkg/util/util.go @@ -24,8 +24,6 @@ type DiskDfResult struct { UsedPct float32 TotalSizeMBReal int64 - - SizeToFreeMB int64 } // String 用于打印 @@ -36,8 +34,12 @@ func (d DiskDfResult) String() string { ) } -// GetDiskPartitionWithDir TODO -func GetDiskPartitionWithDir(dirName string) (*DiskDfResult, error) { +func GetDiskPartitionWithDir(dirName string) (*cmutil.DiskPartInfo, error) { + return cmutil.GetDiskPartInfo(dirName, true) +} + +// GetDiskPartitionWithDir2 TODO +func GetDiskPartitionWithDir2(dirName string) (*DiskDfResult, error) { /* $ df -m /data/dbbak/data1 Filesystem 1M-blocks Used Available Use% Mounted on @@ -75,6 +77,7 @@ func GetDiskPartitionWithDir(dirName string) (*DiskDfResult, error) { // GetDirectorySizeMB du 获取 binlog 目录大小 // 如果 binlog 目录有其它文件,会一起计算 +// TODO replace with cmutil.DirSize() func GetDirectorySizeMB(binlogDir string) (int64, error) { /* du -sm /data/ diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile b/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile index f918e27db7..e2c488f1e9 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile @@ -9,8 +9,9 @@ DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp .PHONY: release-bin release-bin: @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} - @cp pt-table-checksum ${OUTPUT_DIR}/ - @cp pt-table-sync ${OUTPUT_DIR}/ + @chmod +x pt-table-checksum pt-table-sync + @cp -a pt-table-checksum ${OUTPUT_DIR}/ + @cp -a pt-table-sync ${OUTPUT_DIR}/ @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} ${PROJ} pt-table-checksum pt-table-sync .PHONY: dev-bin diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/init.go b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/init.go index ef0c57ba72..85e13b9b92 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/init.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/init.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "io" + "log/slog" "os" "path" "path/filepath" @@ -10,7 +11,6 @@ import ( "dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config" "github.com/spf13/viper" - "golang.org/x/exp/slog" "gopkg.in/natefinch/lumberjack.v2" ) diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/run_checksum.go b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/run_checksum.go index 56762d870b..fb9b46aaff 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/run_checksum.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/run_checksum.go @@ -2,13 +2,13 @@ package cmd import ( "fmt" + "log/slog" "os" "dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker" "dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config" "github.com/juju/fslock" - "golang.org/x/exp/slog" ) func generateRun(mode config.CheckMode, configPath string) /*func(cmd *cobra.Command, args []string)*/ error { @@ -35,13 +35,13 @@ func generateRun(mode config.CheckMode, configPath string) /*func(cmd *cobra.Com case config.RoleMaster: err = lock.TryLock() if err != nil { - slog.Error("another checksum already running", err) + slog.Error("another checksum already running", slog.String("error", err.Error())) return err } slog.Info("run checksum on master start") err = ck.Run() if err != nil { - slog.Error("run checksum on master", err) + slog.Error("run checksum on master", slog.String("error", err.Error())) return err } slog.Info("run checksum on master finish") @@ -49,21 +49,21 @@ func generateRun(mode config.CheckMode, configPath string) /*func(cmd *cobra.Com case config.RoleRepeater: err = lock.TryLock() if err != nil { - slog.Error("another checksum already running", err) + slog.Error("another checksum already running", slog.String("error", err.Error())) return err } slog.Info("run checksum on repeater start") err = ck.Run() if err != nil { - slog.Error("run checksum on repeater", err) + slog.Error("run checksum on repeater", slog.String("error", err.Error())) return err } if ck.Mode == config.GeneralMode { slog.Info("run checksum on repeater to report start") err = ck.Report() if err != nil { - slog.Error("run report on repeater", err) + slog.Error("run report on repeater", slog.String("error", err.Error())) return err } slog.Info("run checksum on repeater to report finish") @@ -74,20 +74,20 @@ func generateRun(mode config.CheckMode, configPath string) /*func(cmd *cobra.Com slog.Info("run checksum on slave") if ck.Mode == config.DemandMode { err = fmt.Errorf("checksum bill should not run on slave") - slog.Error("role is slave", err) + slog.Error("role is slave", slog.String("error", err.Error())) return err } slog.Info("run checksum on slave to report start") err = ck.Report() if err != nil { - slog.Error("run report on slave", err) + slog.Error("run report on slave", slog.String("error", err.Error())) return err } slog.Info("run checksum on slave to report finish") return nil default: err := fmt.Errorf("unknown instance inner role: %s", ck.Config.InnerRole) - slog.Error("general run", err) + slog.Error("general run", slog.String("error", err.Error())) return err } } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_clean.go b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_clean.go index 0912af7da6..f69bb3fcc3 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_clean.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_clean.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log/slog" "strings" ma "dbm-services/mysql/db-tools/mysql-crond/api" @@ -9,7 +10,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdClean = &cobra.Command{ @@ -25,7 +25,7 @@ var subCmdClean = &cobra.Command{ manager := ma.NewManager(config.ChecksumConfig.ApiUrl) entries, err := manager.Entries() if err != nil { - slog.Error("clean list entries", err) + slog.Error("clean list entries", slog.String("error", err.Error())) return err } @@ -37,7 +37,8 @@ var subCmdClean = &cobra.Command{ eid, err := manager.Delete(entry.Job.Name, true) if err != nil { slog.Error( - "reschedule delete entry", err, + "reschedule delete entry", + slog.String("error", err.Error()), slog.String("name", entry.Job.Name), ) return err diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_reschedule.go b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_reschedule.go index 479110216c..3fc05c2374 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_reschedule.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/cmd/subcmd_reschedule.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log/slog" "os" "path/filepath" "strings" @@ -11,7 +12,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "golang.org/x/exp/slog" ) var subCmdReschedule = &cobra.Command{ @@ -27,7 +27,7 @@ var subCmdReschedule = &cobra.Command{ if !filepath.IsAbs(configPath) { cwd, err := os.Getwd() if err != nil { - slog.Error("reschedule get config abs path", err) + slog.Error("reschedule get config abs path", slog.String("error", err.Error())) return err } configPath = filepath.Join(cwd, configPath) @@ -41,7 +41,7 @@ var subCmdReschedule = &cobra.Command{ manager := ma.NewManager(config.ChecksumConfig.ApiUrl) entries, err := manager.Entries() if err != nil { - slog.Error("reschedule list entries", err) + slog.Error("reschedule list entries", slog.String("error", err.Error())) return err } @@ -53,7 +53,8 @@ var subCmdReschedule = &cobra.Command{ eid, err := manager.Delete(entry.Job.Name, true) if err != nil { slog.Error( - "reschedule delete entry", err, + "reschedule delete entry", + slog.String("error", err.Error()), slog.String("name", entry.Job.Name), ) return err @@ -80,7 +81,7 @@ var subCmdReschedule = &cobra.Command{ }, true, ) if err != nil { - slog.Error("reschedule add entry", err) + slog.Error("reschedule add entry", slog.String("error", err.Error())) return err } slog.Info("reschedule add entry", slog.Int("entry id", eid)) diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/go.mod b/dbm-services/mysql/db-tools/mysql-table-checksum/go.mod index 344ba6e751..594d354219 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/go.mod +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/go.mod @@ -1,14 +1,13 @@ module dbm-services/mysql/db-tools/mysql-table-checksum -go 1.19 +go 1.21 require ( github.com/go-sql-driver/mysql v1.7.1 github.com/jmoiron/sqlx v1.3.5 github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/spf13/viper v1.16.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -17,21 +16,16 @@ require ( github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/lib/pq v1.10.0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/go.sum b/dbm-services/mysql/db-tools/mysql-table-checksum/go.sum index 80b30bd947..9cf19e832a 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/go.sum +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/go.sum @@ -56,7 +56,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -102,6 +103,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -137,45 +139,43 @@ github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b/go.mod h1:HMcgvsgd0Fjj github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -185,9 +185,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -217,8 +216,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -329,8 +326,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -485,9 +482,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/checker.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/checker.go index 8b4a967f1a..7d1dc312fe 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/checker.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/checker.go @@ -4,7 +4,9 @@ package checker import ( "database/sql" "fmt" + "log/slog" "os" + "slices" "strings" "time" @@ -13,8 +15,6 @@ import ( _ "github.com/go-sql-driver/mysql" // mysql "github.com/jmoiron/sqlx" - "golang.org/x/exp/slices" - "golang.org/x/exp/slog" ) // NewChecker 新建检查器 @@ -22,7 +22,7 @@ func NewChecker(mode config.CheckMode) (*Checker, error) { if mode == config.GeneralMode { err := os.MkdirAll(config.ChecksumConfig.ReportPath, 0755) if err != nil { - slog.Error("new checker create report path", err) + slog.Error("new checker create report path", slog.String("error", err.Error())) return nil, err } } @@ -41,7 +41,7 @@ func NewChecker(mode config.CheckMode) (*Checker, error) { checker.resultHistoryTable = fmt.Sprintf("%s_history", splitR[1]) if err := checker.connect(); err != nil { - slog.Error("connect host", err) + slog.Error("connect host", slog.String("error", err.Error())) return nil, err } @@ -102,7 +102,7 @@ func (r *Checker) connect() (err error) { func (r *Checker) validateSlaves() error { if len(r.Config.Slaves) < 1 { err := fmt.Errorf("demand checksum need at least 1 slave") - slog.Error("validate slaves counts", err) + slog.Error("validate slaves counts", slog.String("error", err.Error())) return err } @@ -122,7 +122,7 @@ func (r *Checker) validateSlaves() error { ), ) if err != nil { - slog.Error("validate slaves connect", err) + slog.Error("validate slaves connect", slog.String("error", err.Error())) return err } } @@ -132,7 +132,7 @@ func (r *Checker) validateSlaves() error { func (r *Checker) prepareDsnsTable() error { _, err := r.db.Exec(`DROP TABLE IF EXISTS dsns`) if err != nil { - slog.Error("drop exists dsns table", err) + slog.Error("drop exists dsns table", slog.String("error", err.Error())) return err } @@ -144,7 +144,7 @@ func (r *Checker) prepareDsnsTable() error { `PRIMARY KEY(id)) ENGINE=InnoDB`, ) if err != nil { - slog.Error("create dsns table", err) + slog.Error("create dsns table", slog.String("error", err.Error())) return err } @@ -154,7 +154,7 @@ func (r *Checker) prepareDsnsTable() error { fmt.Sprintf(`h=%s,u=%s,p=%s,P=%d`, slave.Ip, slave.User, slave.Password, slave.Port), ) if err != nil { - slog.Error("add slave dsn record", err) + slog.Error("add slave dsn record", slog.String("error", err.Error())) return err } } @@ -194,7 +194,7 @@ func (r *Checker) validateHistoryTable() error { slog.Info("checksum result table not found") return nil } else { - slog.Error("try to find checksum result table failed", err) + slog.Error("try to find checksum result table failed", slog.String("error", err.Error())) return err } } @@ -207,7 +207,7 @@ func (r *Checker) validateHistoryTable() error { ), ) if err != nil { - slog.Error("create history table", err) + slog.Error("create history table", slog.String("error", err.Error())) return err } _, err = r.db.Exec( @@ -221,12 +221,12 @@ func (r *Checker) validateHistoryTable() error { ), ) if err != nil { - slog.Error("add column and index to history table", err) + slog.Error("add column and index to history table", slog.String("error", err.Error())) return err } } } else { - slog.Error("check history table exists", err) + slog.Error("check history table exists", slog.String("error", err.Error())) return err } } @@ -258,7 +258,7 @@ func (r *Checker) validateHistoryTable() error { ), ) if err != nil { - slog.Error("compare result table column", err) + slog.Error("compare result table column", slog.String("error", err.Error())) return err } @@ -266,7 +266,7 @@ func (r *Checker) validateHistoryTable() error { diffColumn.ColumnName != "reported" || diffColumn.DataType != "int" { err = fmt.Errorf("%s need column as 'reported int default 0'", r.resultHistoryTable) - slog.Error("check history table reported column", err) + slog.Error("check history table reported column", slog.String("error", err.Error())) return nil } @@ -282,13 +282,13 @@ func (r *Checker) validateHistoryTable() error { ), ) if err != nil { - slog.Error("check history table primary key", err) + slog.Error("check history table primary key", slog.String("error", err.Error())) return err } if slices.Compare(pkColumns, []string{"master_ip", "master_port", "db", "tbl", "chunk", "ts"}) != 0 { err = fmt.Errorf("history table must has primary as (master_ip, master_port, db, tbl, chunk, ts])") - slog.Error("check history table primary key", err) + slog.Error("check history table primary key", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/command_args.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/command_args.go index d72b80cd1a..0ae746c44f 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/command_args.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/command_args.go @@ -2,15 +2,14 @@ package checker import ( "fmt" + "log/slog" "os" "strings" - - "golang.org/x/exp/slog" ) func (r *Checker) ptPrecheck() error { if _, err := os.Stat(r.Config.PtChecksum.Path); err != nil { - slog.Error("pt pre check", err) + slog.Error("pt pre check", slog.String("error", err.Error())) return err } return nil diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/move_result.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/move_result.go index d1beb76f48..32efc01c2e 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/move_result.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/move_result.go @@ -3,9 +3,8 @@ package checker import ( "context" "fmt" + "log/slog" "strings" - - "golang.org/x/exp/slog" ) func (r *Checker) moveResult() error { @@ -18,7 +17,7 @@ func (r *Checker) moveResult() error { if err != nil { slog.Error( "fetch result table columns", - err, + slog.String("error", err.Error()), slog.String("result table", r.resultTbl), slog.String("result db", r.resultDB), ) @@ -29,7 +28,7 @@ func (r *Checker) moveResult() error { var col string err := rows.Scan(&col) if err != nil { - slog.Error("iterator columns", err) + slog.Error("iterator columns", slog.String("error", err.Error())) return err } @@ -38,16 +37,14 @@ func (r *Checker) moveResult() error { err = r.validateHistoryTable() if err != nil { - slog.Error("move result validate history table again", err) + slog.Error("move result validate history table again", slog.String("error", err.Error())) return err } slog.Info("move result validate history table again success") - slog.Info("move result", slog.Time("ts", r.startTS)) - conn, err := r.db.Conn(context.Background()) if err != nil { - slog.Error("get connect", err) + slog.Error("get connect", slog.String("error", err.Error())) return err } defer func() { @@ -56,9 +53,11 @@ func (r *Checker) moveResult() error { _, err = conn.ExecContext(context.Background(), `SET BINLOG_FORMAT = 'STATEMENT'`) if err != nil { - slog.Error("set binlog_format = 'statement'", err) + slog.Error("set binlog_format = 'statement'", slog.String("error", err.Error())) return err } + + slog.Info("move result", slog.Time("from", r.startTS)) _, err = conn.ExecContext( context.Background(), fmt.Sprintf( @@ -69,7 +68,7 @@ func (r *Checker) moveResult() error { ), r.startTS, ) if err != nil { - slog.Error("move result", err) + slog.Error("move result", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/report.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/report.go index 6e81717168..54d3797815 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/report.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/report.go @@ -2,10 +2,9 @@ package checker import ( "fmt" + "log/slog" "dbm-services/mysql/db-tools/mysql-table-checksum/pkg/reporter" - - "golang.org/x/exp/slog" ) // Report 只在 repeater, slave 的例行校验做上报 @@ -32,7 +31,7 @@ func (r *Checker) Report() error { ) if err != nil { - slog.Error("query unreported result", err) + slog.Error("query unreported result", slog.String("error", err.Error())) return err } @@ -46,7 +45,7 @@ func (r *Checker) Report() error { ), ) if err != nil { - slog.Error("prepare update statement", err) + slog.Error("prepare update statement", slog.String("error", err.Error())) return err } @@ -54,7 +53,7 @@ func (r *Checker) Report() error { var cs reporter.ChecksumResult err := rows.StructScan(&cs) if err != nil { - slog.Error("scan unreported result", err) + slog.Error("scan unreported result", slog.String("error", err.Error())) return err } @@ -87,7 +86,7 @@ func (r *Checker) Report() error { ) if err != nil { - slog.Error("update reported", err) + slog.Error("update reported", slog.String("error", err.Error())) return err } } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/run_command.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/run_command.go index dc5efdd884..dfee35f9be 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/run_command.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/run_command.go @@ -6,13 +6,12 @@ import ( "encoding/json" "errors" "fmt" + "log/slog" "os" "os/exec" "time" "dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config" - - "golang.org/x/exp/slog" ) // Run 执行 @@ -35,7 +34,7 @@ func (r *Checker) Run() error { if err != nil { var exitError *exec.ExitError if !errors.As(err, &exitError) { - slog.Error("run pt-table-checksum got unexpected error", err) + slog.Error("run pt-table-checksum got unexpected error", slog.String("error", err.Error())) return err } } @@ -83,7 +82,7 @@ func (r *Checker) Run() error { */ if stderr.Len() > 0 { err = errors.New(stderr.String()) - slog.Error("run pt-table-checksum got un-docoument error", err) + slog.Error("run pt-table-checksum got un-docoument error", slog.String("error", err.Error())) return err } @@ -96,7 +95,7 @@ func (r *Checker) Run() error { if err != nil { slog.Error( "trans pt-table-checksum stdout to summary", - err, + slog.String("error", err.Error()), slog.String("pt stdout", stdout.String()), ) return err @@ -117,7 +116,7 @@ func (r *Checker) Run() error { if err != nil { slog.Error( "truncate regular result table", - err, + slog.String("error", err.Error()), slog.String("table name", r.Config.PtChecksum.Replicate), ) return err @@ -127,6 +126,27 @@ func (r *Checker) Run() error { slog.Info("run in demand mode") } + // 固定写入一行恒为真的站位数据 + ts := time.Now() + _, err = r.db.Exec( + fmt.Sprintf("INSERT INTO %s("+ + "master_ip, master_port, "+ + "`db`, tbl, chunk, chunk_time, chunk_index, "+ + "lower_boundary, upper_boundary, "+ + "this_crc, this_cnt, master_crc, master_cnt, ts) "+ + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + r.resultHistoryTable), + r.Config.Ip, r.Config.Port, + "_dba_fake_db", "_dba_fake_table", 0, 0, "", + "1=1", "1=1", + 0, 0, 0, 0, ts, + ) + if err != nil { + slog.Error("write place hold row", slog.String("error", err.Error())) + return err + } + slog.Info("write place hold row success") + output := Output{ PtStderr: stderr.String(), Summaries: summaries, @@ -134,7 +154,10 @@ func (r *Checker) Run() error { } ojson, err := json.Marshal(output) if err != nil { - slog.Error("marshal output", err, slog.String("output", fmt.Sprintf("%v", output))) + slog.Error("marshal output", + slog.String("error", err.Error()), + slog.String("output", fmt.Sprintf("%v", output)), + ) return err } @@ -142,7 +165,7 @@ func (r *Checker) Run() error { if ptErr != nil && (ptErr.ExitCode()&1 != 0 || ptErr.ExitCode()&2 != 0 || ptErr.ExitCode()&4 != 0) { err = errors.New(string(ojson)) - slog.Error("run pt-table-checksum bad flag found", err) + slog.Error("run pt-table-checksum bad flag found", slog.String("error", err.Error())) _, _ = fmt.Fprintf(os.Stderr, string(ojson)) return err } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/strategy.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/strategy.go index b506206cd6..7ad1b9a4a2 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/strategy.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/strategy.go @@ -2,8 +2,7 @@ package checker import ( "fmt" - - "golang.org/x/exp/slices" + "slices" ) type switchStrategy struct { diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/summary.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/summary.go index 86c0b7282b..272ad02396 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/summary.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/checker/summary.go @@ -3,13 +3,12 @@ package checker import ( "bufio" "fmt" + "log/slog" "os/exec" "regexp" "strconv" "strings" "time" - - "golang.org/x/exp/slog" ) func summary(stdout string) (summaries []ChecksumSummary, err error) { @@ -46,7 +45,11 @@ func summary(stdout string) (summaries []ChecksumSummary, err error) { time.Local, ) if err != nil { - slog.Error("parse time", err, slog.String("original row", line)) + slog.Error( + "parse time", + slog.String("error", err.Error()), + slog.String("original row", line), + ) return nil, err } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config/config.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config/config.go index d9483c4748..7c335b2fd5 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config/config.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/config/config.go @@ -2,11 +2,11 @@ package config import ( + "log/slog" "os" "path" "path/filepath" - "golang.org/x/exp/slog" "gopkg.in/yaml.v2" ) @@ -73,7 +73,7 @@ func InitConfig(configPath string) error { if !path.IsAbs(configPath) { cwd, err := os.Getwd() if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } configPath = filepath.Join(cwd, configPath) @@ -81,14 +81,14 @@ func InitConfig(configPath string) error { content, err := os.ReadFile(configPath) if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } ChecksumConfig = &Config{} err = yaml.UnmarshalStrict(content, ChecksumConfig) if err != nil { - slog.Error("init config", err) + slog.Error("init config", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/reporter/report.go b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/reporter/report.go index acd6485f44..27773f79a2 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/reporter/report.go +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/pkg/reporter/report.go @@ -2,8 +2,7 @@ package reporter import ( "encoding/json" - - "golang.org/x/exp/slog" + "log/slog" ) // Report 执行上报 @@ -20,7 +19,7 @@ func (r *Reporter) Report(cs *ChecksumResult) error { row, err := json.Marshal(rr) if err != nil { - slog.Error("marshal report", err) + slog.Error("marshal report", slog.String("error", err.Error())) return err } @@ -28,7 +27,7 @@ func (r *Reporter) Report(cs *ChecksumResult) error { _, err = r.writer.Write(row) if err != nil { - slog.Error("write report", err) + slog.Error("write report", slog.String("error", err.Error())) return err } diff --git a/dbm-services/mysql/slow-query-parser-service/go.mod b/dbm-services/mysql/slow-query-parser-service/go.mod index d0046c4237..e972666d49 100644 --- a/dbm-services/mysql/slow-query-parser-service/go.mod +++ b/dbm-services/mysql/slow-query-parser-service/go.mod @@ -1,41 +1,37 @@ module dbm-services/mysql/slow-query-parser-service -go 1.19 +go 1.21 require ( github.com/alecthomas/kingpin/v2 v2.3.2 - github.com/gin-gonic/gin v1.9.0 - golang.org/x/exp v0.0.0-20230418202329-0354be287a23 + github.com/gin-gonic/gin v1.9.1 ) require ( github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/bytedance/sonic v1.8.8 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.12.0 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/kr/pretty v0.3.0 // indirect - github.com/leodido/go-urn v1.2.3 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/dbm-services/mysql/slow-query-parser-service/go.sum b/dbm-services/mysql/slow-query-parser-service/go.sum index 3bf9f29f80..89fa9d8fac 100644 --- a/dbm-services/mysql/slow-query-parser-service/go.sum +++ b/dbm-services/mysql/slow-query-parser-service/go.sum @@ -3,63 +3,52 @@ github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HR github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -69,8 +58,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= @@ -80,27 +70,23 @@ github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtX golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY= -golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/dbm-services/mysql/slow-query-parser-service/main.go b/dbm-services/mysql/slow-query-parser-service/main.go index dca8731bb8..6f3f53c5bc 100644 --- a/dbm-services/mysql/slow-query-parser-service/main.go +++ b/dbm-services/mysql/slow-query-parser-service/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log/slog" "os" "path/filepath" @@ -9,7 +10,6 @@ import ( "dbm-services/mysql/slow-query-parser-service/pkg/service" "github.com/alecthomas/kingpin/v2" - "golang.org/x/exp/slog" ) var ( diff --git a/dbm-services/mysql/slow-query-parser-service/pkg/mysql/parse.go b/dbm-services/mysql/slow-query-parser-service/pkg/mysql/parse.go index bfbc2db213..ade545b721 100644 --- a/dbm-services/mysql/slow-query-parser-service/pkg/mysql/parse.go +++ b/dbm-services/mysql/slow-query-parser-service/pkg/mysql/parse.go @@ -4,10 +4,9 @@ import ( "bytes" "encoding/json" "io" + "log/slog" "os" "os/exec" - - "golang.org/x/exp/slog" ) // ParserPath TODO @@ -18,7 +17,7 @@ func parse(query string) (*Response, error) { inputFile, err := os.CreateTemp("/tmp", "mysql-slow-input") if err != nil { - slog.Error("mysql parse create input file", err) + slog.Error("mysql parse create input file", slog.String("error", err.Error())) return nil, err } defer os.Remove(inputFile.Name()) @@ -26,7 +25,7 @@ func parse(query string) (*Response, error) { outputFile, err := os.CreateTemp("/tmp", "mysql-slow-output") if err != nil { - slog.Error("mysql parse create output file", err) + slog.Error("mysql parse create output file", slog.String("error", err.Error())) return nil, err } defer os.Remove(outputFile.Name()) @@ -34,7 +33,7 @@ func parse(query string) (*Response, error) { _, err = inputFile.WriteString(query) if err != nil { - slog.Error("mysql parse write query", err) + slog.Error("mysql parse write query", slog.String("error", err.Error())) return nil, err } slog.Info("mysql parse write query success") @@ -51,7 +50,8 @@ func parse(query string) (*Response, error) { err = cmd.Run() if err != nil { - slog.Error("mysql parse execute tmysqlparse", err, + slog.Error("mysql parse execute tmysqlparse", + slog.String("error", err.Error()), slog.String("command", cmd.String()), slog.String("stderr", stderr.String())) return nil, err @@ -64,7 +64,11 @@ func parse(query string) (*Response, error) { outputFile.Seek(0, 0) content, err := io.ReadAll(outputFile) if err != nil { - slog.Error("mysql parse read output file", err, slog.String("output file", outputFile.Name())) + slog.Error( + "mysql parse read output file", + slog.String("error", err.Error()), + slog.String("output file", outputFile.Name()), + ) return nil, err } slog.Info("mysql parse read output file success", slog.String("output file", outputFile.Name())) @@ -74,7 +78,11 @@ func parse(query string) (*Response, error) { } err = json.Unmarshal(content, &cmdRet) if err != nil { - slog.Error("mysql parse unmarshal result", err, slog.String("result", string(content))) + slog.Error( + "mysql parse unmarshal result", + slog.String("error", err.Error()), + slog.String("result", string(content)), + ) return nil, err } cmdRet.Result[0].QueryLength = len(query) diff --git a/dbm-services/mysql/slow-query-parser-service/pkg/mysql/router.go b/dbm-services/mysql/slow-query-parser-service/pkg/mysql/router.go index 15e43bfe9b..a7f0ed5faf 100644 --- a/dbm-services/mysql/slow-query-parser-service/pkg/mysql/router.go +++ b/dbm-services/mysql/slow-query-parser-service/pkg/mysql/router.go @@ -1,10 +1,10 @@ package mysql import ( + "log/slog" "net/http" "github.com/gin-gonic/gin" - "golang.org/x/exp/slog" ) // AddRouter TODO diff --git a/dbm-services/mysql/slow-query-parser-service/pkg/service/service.go b/dbm-services/mysql/slow-query-parser-service/pkg/service/service.go index 7ba484687c..cb1f0c5100 100644 --- a/dbm-services/mysql/slow-query-parser-service/pkg/service/service.go +++ b/dbm-services/mysql/slow-query-parser-service/pkg/service/service.go @@ -2,6 +2,8 @@ package service import ( + "net/http" + "dbm-services/mysql/slow-query-parser-service/pkg/mysql" "github.com/gin-gonic/gin" @@ -12,5 +14,10 @@ func Start(address string) error { r := gin.New() r.Use(gin.Logger()) mysql.AddRouter(r) + + r.Handle("GET", "/ping", func(context *gin.Context) { + context.String(http.StatusOK, "pong") + }) + return r.Run(address) } diff --git a/dbm-services/redis/db-tools/dbactuator/example/bkdbmon_install.example.md b/dbm-services/redis/db-tools/dbactuator/example/bkdbmon_install.example.md index 4d18a8bf7d..57f8035927 100644 --- a/dbm-services/redis/db-tools/dbactuator/example/bkdbmon_install.example.md +++ b/dbm-services/redis/db-tools/dbactuator/example/bkdbmon_install.example.md @@ -15,6 +15,7 @@ bk-dbmon安装: "pkg":"dbtools.tar.gz", "pkg_md5":"334cf6e3b84d371325052d961584d5aa" }, + "agent_address":"/var/run/ipc.state.report", "gsepath":"/usr/local/gse_bkte", "redis_fullbackup":{ "to_backup_system":"yes", @@ -59,9 +60,9 @@ bk-dbmon安装: "bk_cloud_id":"246", "app":"testapp", "app_name":"测试app", - "cluster_domain":"tendisx.aaaa.testapp.db", + "cluster_domain":"cache.aaaa.testapp.db", "cluster_name":"aaaa", - "cluster_type":"PredixyTendisplusCluster", + "cluster_type":"TwemproxyRedisInstance", "meta_role":"redis_master", "server_ip":"127.0.0.1", "server_ports":[ @@ -69,7 +70,14 @@ bk-dbmon安装: 30001, 30002, 30003 - ] + ], + "server_shards":{ + "a.a.a.a:12000":"0-104999", + "a.a.a.a:12001":"105000-209999", + "a.a.a.a:12002":"210000-314999", + "a.a.a.a:12003":"315000-419999" + }, + "cache_backup_mode":"rdb" }, { "bk_biz_id":"200500194", @@ -86,7 +94,9 @@ bk-dbmon安装: 31001, 31002, 31003 - ] + ], + "server_shards":{}, + "cache_backup_mode":"" } ] } diff --git a/dbm-services/redis/db-tools/dbactuator/example/redis_cluster_failover.example.md b/dbm-services/redis/db-tools/dbactuator/example/redis_cluster_failover.example.md new file mode 100644 index 0000000000..4b608194e9 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/example/redis_cluster_failover.example.md @@ -0,0 +1,24 @@ +### redis cluster failover +redis cluster failover +`./dbactuator_redis --uid={{uid}} --root_id={{root_id}} --node_id={{node_id}} --version_id={{version_id}} --atom-job-list="redis_cluster_failover" --data_dir=/path/to/data --backup_dir=/path/to/backup --payload='{{payload_base64}}'` + +`--data_dir`、`--backup_dir` 可以留空. + + +原始payload +```json +{ + "redis_password":"xxxx", + "redis_master_slave_pairs":[ + { + "master": {"ip":"a.a.a.a","port":"30000"}, + "slave": {"ip":"b.b.b.b","port":"30000"} + }, + { + "master": {"ip":"a.a.a.a","port":"30001"}, + "slave": {"ip":"b.b.b.b","port":"30001"} + } + ], + "force":false +} +``` \ No newline at end of file diff --git a/dbm-services/redis/db-tools/dbactuator/example/redis_version_update.example.md b/dbm-services/redis/db-tools/dbactuator/example/redis_version_update.example.md new file mode 100644 index 0000000000..f361736176 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/example/redis_version_update.example.md @@ -0,0 +1,21 @@ +### redis version update +redis版本更新 +`./dbactuator_redis --uid={{uid}} --root_id={{root_id}} --node_id={{node_id}} --version_id={{version_id}} --atom-job-list="redis_version_update" --data_dir=/path/to/data --backup_dir=/path/to/backup --payload='{{payload_base64}}'` + +`--data_dir`、`--backup_dir` 可以留空. + +前置工作: +- 将`redis-6.2.7.tar.gz`下载到`/data/install`目录下; + + +原始payload +```json +{ + "pkg":"redis-6.2.7.tar.gz", + "pkg_md5":"1fc9e5c3a044ce523844a6f2717e5ac3", + "ip":"127.0.0.1", + "ports":[30000,30001,30002], //端口不连续 + "password":"xxx", + "role":"redis_master" // or redis_slave +} +``` \ No newline at end of file diff --git a/dbm-services/redis/db-tools/dbactuator/go.mod b/dbm-services/redis/db-tools/dbactuator/go.mod index fb758236ee..673c048578 100644 --- a/dbm-services/redis/db-tools/dbactuator/go.mod +++ b/dbm-services/redis/db-tools/dbactuator/go.mod @@ -1,6 +1,6 @@ module dbm-services/redis/db-tools/dbactuator -go 1.18 +go 1.21 require ( github.com/dustin/go-humanize v1.0.1 diff --git a/dbm-services/redis/db-tools/dbactuator/models/myredis/client.go b/dbm-services/redis/db-tools/dbactuator/models/myredis/client.go index 2d0fd16530..ae5c56a900 100644 --- a/dbm-services/redis/db-tools/dbactuator/models/myredis/client.go +++ b/dbm-services/redis/db-tools/dbactuator/models/myredis/client.go @@ -712,8 +712,8 @@ func (db *RedisClient) Sscan(keyname string, cursor uint64, match string, count fields, retCursor, err = db.InstanceClient.SScan(context.TODO(), keyname, cursor, match, count).Result() } if err != nil && err != redis.Nil { - mylog.Logger.Error("Redis 'sscan %s %d match %s count %s' command fail,err:%v,addr:%s", keyname, cursor, match, count, - err, db.Addr) + mylog.Logger.Error("Redis 'sscan %s %d match %s count %d' command fail,err:%v,addr:%s", + keyname, cursor, match, count, err, db.Addr) return fields, 0, err } return fields, retCursor, nil @@ -1751,6 +1751,32 @@ func (db *RedisClient) ClusterReset() (err error) { return nil } +// ClusterFailOver 执行cluster failover,opt: force or takeover +func (db *RedisClient) ClusterFailOver(opt string) (err error) { + var ret string + if opt == "" { + ret, err = db.InstanceClient.ClusterFailover(context.Background()).Result() + } else if strings.ToLower(opt) == "force" || strings.ToLower(opt) == "takeover" { + cmds := []string{"cluster", "failover", opt} + tmpRet, err := db.DoCommand(cmds, 0) + if err != nil { + return err + } + ret = tmpRet.(string) + } + if err != nil { + err = fmt.Errorf("ClusterFailOver fail,err:%v,addr:%s", err, db.Addr) + mylog.Logger.Error(err.Error()) + return + } + if strings.ToLower(ret) != "ok" { + err = fmt.Errorf("ClusterFailOver fail,ret:%s,addr:%s", ret, db.Addr) + mylog.Logger.Error(err.Error()) + return + } + return nil +} + // GetClusterNodesStr 获取tendisplus集群cluster nodes命令结果,并返回字符串 func (db *RedisClient) GetClusterNodesStr() (ret string, err error) { ret, err = db.InstanceClient.ClusterNodes(context.TODO()).Result() @@ -1761,3 +1787,33 @@ func (db *RedisClient) GetClusterNodesStr() (ret string, err error) { } return } + +// RedisClusterGetMasterNode 获取master节点信息(如果 addr是master则返回它的node信息,否则找到它的masterID,进而找到master的node信息) +func (db *RedisClient) RedisClusterGetMasterNode(addr string) (masterNode *ClusterNodeData, err error) { + addrToNodes, err := db.GetAddrMapToNodes() + if err != nil { + return + } + myNode, ok := addrToNodes[addr] + if !ok { + err = fmt.Errorf("addr:%s not found in cluster nodes", addr) + mylog.Logger.Error(err.Error()) + return + } + if myNode.GetRole() == consts.RedisMasterRole { + masterNode = myNode + return + } + masterNodeID := myNode.MasterID + idToNode, err := db.GetNodeIDMapToNodes() + if err != nil { + return + } + masterNode, ok = idToNode[masterNodeID] + if !ok { + err = fmt.Errorf("masterNodeID:%s not found in cluster nodes", masterNodeID) + mylog.Logger.Error(err.Error()) + return + } + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/models/myredis/myredis.go b/dbm-services/redis/db-tools/dbactuator/models/myredis/myredis.go index d797498747..cc222347aa 100644 --- a/dbm-services/redis/db-tools/dbactuator/models/myredis/myredis.go +++ b/dbm-services/redis/db-tools/dbactuator/models/myredis/myredis.go @@ -106,3 +106,44 @@ func LocalRedisConnectTest(ip string, ports []int, password string) (err error) } return } + +// CheckMultiRedisConnected 检查多个redis是否可连接 +func CheckMultiRedisConnected(addrs []string, password string) (err error) { + l01 := make([]*connTestItem, 0, len(addrs)) + for _, addr := range addrs { + ip, port, err := util.AddrToIpPort(addr) + if err != nil { + return err + } + l01 = append(l01, &connTestItem{ + IP: ip, + Port: port, + Password: password, + }) + } + // 并发测试 + wg := sync.WaitGroup{} + for _, item := range l01 { + test01 := item + wg.Add(1) + go func(test01 *connTestItem) { + defer wg.Done() + cli01, err := NewRedisClientWithTimeout(test01.addr(), test01.Password, 0, + consts.TendisTypeRedisInstance, 10*time.Second) + if err != nil { + test01.Err = err + return + } + cli01.Close() + }(test01) + } + wg.Wait() + + for _, item := range l01 { + test01 := item + if test01.Err != nil { + return test01.Err + } + } + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/models/myredis/tendisplus_infoRepl.go b/dbm-services/redis/db-tools/dbactuator/models/myredis/tendisplus_infoRepl.go index 3e0d7a0053..35454b7999 100644 --- a/dbm-services/redis/db-tools/dbactuator/models/myredis/tendisplus_infoRepl.go +++ b/dbm-services/redis/db-tools/dbactuator/models/myredis/tendisplus_infoRepl.go @@ -12,15 +12,22 @@ import ( "dbm-services/redis/db-tools/dbactuator/pkg/consts" ) -// InfoReplSlave Tendisplus master中执行info replication结果中slave状态 +// InfoReplSlave master中执行info replication结果中slave状态 // 如: slave0:ip=luketest03-redis-rdsplus4-1.luketest03-svc.dmc,port=30000,state=online,offset=930327677,lag=0 type InfoReplSlave struct { - Name string `json:"name"` - IP string `json:"ip"` - Port int `json:"port"` - State string `json:"state"` - Offset int64 `json:"offset"` - Lag int64 `json:"lag"` + Name string `json:"name"` + IP string `json:"ip"` + Port int `json:"port"` + State string `json:"state"` + Offset int64 `json:"offset"` + Seq int64 `json:"seq"` + Lag int64 `json:"lag"` + BinlogLag int64 `json:"binlog_lag"` +} + +// Addr addr字符串 +func (slave *InfoReplSlave) Addr() string { + return slave.IP + ":" + strconv.Itoa(slave.Port) } func (slave *InfoReplSlave) decode(line string) error { @@ -40,10 +47,14 @@ func (slave *InfoReplSlave) decode(line string) error { slave.Port, _ = strconv.Atoi(list02[1]) } else if list02[0] == "state" { slave.State = list02[1] + } else if list02[0] == "seq" { + slave.Seq, _ = strconv.ParseInt(list02[1], 10, 64) } else if list02[0] == "offset" { slave.Offset, _ = strconv.ParseInt(list02[1], 10, 64) } else if list02[0] == "lag" { slave.Lag, _ = strconv.ParseInt(list02[1], 10, 64) + } else if list02[0] == "binlog_lag" { + slave.BinlogLag, _ = strconv.ParseInt(list02[1], 10, 64) } } return nil @@ -411,3 +422,46 @@ func (db *RedisClient) TendisSSDInfoSlaves() (ret TendisSSDInfoSlavesData, err e } return } + +// GetInfoReplSlaves 获取info replication中slave列表 +func (db *RedisClient) GetInfoReplSlaves() (slaveList []*InfoReplSlave, slaveMap map[string]*InfoReplSlave, err error) { + var replRet string + if db.DbType == consts.TendisTypeRedisCluster { + replRet, err = db.ClusterClient.Info(context.TODO(), "replication").Result() + } else { + replRet, err = db.InstanceClient.Info(context.TODO(), "replication").Result() + } + if err != nil { + err = fmt.Errorf("info replication fail,err:%v,aadr:%s", err, db.Addr) + mylog.Logger.Error(err.Error()) + return + } + infoList := strings.Split(replRet, "\n") + slaveReg := regexp.MustCompile(`^slave\d+$`) + slaveMap = make(map[string]*InfoReplSlave) + for _, infoItem := range infoList { + infoItem = strings.TrimSpace(infoItem) + if strings.HasPrefix(infoItem, "#") { + continue + } + if len(infoItem) == 0 { + continue + } + list01 := strings.SplitN(infoItem, ":", 2) + if len(list01) < 2 { + continue + } + list01[0] = strings.TrimSpace(list01[0]) + list01[1] = strings.TrimSpace(list01[1]) + if slaveReg.MatchString(list01[0]) == true { + slave01 := &InfoReplSlave{} + err = slave01.decode(infoItem) + if err != nil { + return + } + slaveList = append(slaveList, slave01) + slaveMap[slave01.Addr()] = slave01 + } + } + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/bkdbmon_install.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/bkdbmon_install.go index 158f25e9a0..2f3455712e 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/bkdbmon_install.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/bkdbmon_install.go @@ -22,23 +22,26 @@ import ( // ConfServerItem servers配置项 type ConfServerItem struct { - BkBizID string `json:"bk_biz_id" yaml:"bk_biz_id" validate:"required"` - BkCloudID int64 `json:"bk_cloud_id" yaml:"bk_cloud_id"` - App string `json:"app" yaml:"app" validate:"required"` - AppName string `json:"app_name" yaml:"app_name" validate:"required"` - ClusterDomain string `json:"cluster_domain" yaml:"cluster_domain" validate:"required"` - ClusterName string `json:"cluster_name" yaml:"cluster_name" validate:"required"` - ClusterType string `json:"cluster_type" yaml:"cluster_type" validate:"required"` - MetaRole string `json:"meta_role" yaml:"meta_role" validate:"required"` - ServerIP string `json:"server_ip" yaml:"server_ip" validate:"required"` - ServerPorts []int `json:"server_ports" yaml:"server_ports" validate:"required"` - Shard string `json:"shard" yaml:"shard"` + BkBizID string `json:"bk_biz_id" yaml:"bk_biz_id" validate:"required"` + BkCloudID int64 `json:"bk_cloud_id" yaml:"bk_cloud_id"` + App string `json:"app" yaml:"app" validate:"required"` + AppName string `json:"app_name" yaml:"app_name" validate:"required"` + ClusterDomain string `json:"cluster_domain" yaml:"cluster_domain" validate:"required"` + ClusterName string `json:"cluster_name" yaml:"cluster_name" validate:"required"` + ClusterType string `json:"cluster_type" yaml:"cluster_type" validate:"required"` + MetaRole string `json:"meta_role" yaml:"meta_role" validate:"required"` + ServerIP string `json:"server_ip" yaml:"server_ip" validate:"required"` + ServerPorts []int `json:"server_ports" yaml:"server_ports" validate:"required"` + ServerShards map[string]string `json:"server_shards" yaml:"server_shards"` + CacheBackupMode string `json:"cache_backup_mode" yaml:"cache_backup_mode"` // aof or rdb + Shard string `json:"shard" yaml:"shard"` } // BkDbmonInstallParams 安装参数 type BkDbmonInstallParams struct { BkDbmonPkg common.MediaPkg `json:"bkdbmonpkg" validate:"required"` DbToolsPkg common.DbToolsMediaPkg `json:"dbtoolspkg" validate:"required"` + AgentAddress string `json:"agent_address" validate:"required"` GsePath string `json:"gsepath" validate:"required"` RedisFullBackup map[string]interface{} `json:"redis_fullbackup" validate:"required"` RedisBinlogBackup map[string]interface{} `json:"redis_binlogbackup" validate:"required"` @@ -54,6 +57,7 @@ type BkDbmonInstall struct { params BkDbmonInstallParams bkDbmonBinUpdated bool // bk-dbmon介质是否被更新 confFileUpdated bool // 配置文件是否被更新 + isStopped bool // 是否是停止 bkdbmon } // 无实际作用,仅确保实现了 jobruntime.JobRunner 接口 @@ -90,7 +94,7 @@ func (job *BkDbmonInstall) Init(m *jobruntime.JobGenericRuntime) error { } } for _, svrItem := range job.params.Servers { - if len(svrItem.ServerPorts) >= 0 { + if len(svrItem.ServerPorts) > 0 { if svrItem.ServerIP == "" { job.runtime.Logger.Error("BkDbmonInstall Init params validate failed,err:ServerIP is empty") return fmt.Errorf("ServerIP is empty") @@ -123,7 +127,10 @@ func (job *BkDbmonInstall) Name() string { // Run 执行 func (job *BkDbmonInstall) Run() (err error) { - var isStopped bool + err = job.checkIsStopped() + if err != nil { + return + } err = job.UntarMedia() if err != nil { return @@ -132,11 +139,11 @@ func (job *BkDbmonInstall) Run() (err error) { if err != nil { return } - isStopped, err = job.stopDbmonWhenNoServers() + err = job.stopDbmonWhenNoServers() if err != nil { return } - if isStopped { + if job.isStopped { return } if !job.bkDbmonBinUpdated && !job.confFileUpdated { @@ -155,23 +162,26 @@ func (job *BkDbmonInstall) Run() (err error) { return } -// stopDbmonWhenNoServers servers为空,没有任何需要监控的 redis-servers/proxy -// 直接stop bkdbmon即可 -func (job *BkDbmonInstall) stopDbmonWhenNoServers() (isStopped bool, err error) { +func (job *BkDbmonInstall) checkIsStopped() (err error) { if len(job.params.Servers) == 0 { - err = job.StopBkDbmon() - isStopped = true + job.isStopped = true return } - isStopped = true + job.isStopped = true for _, svrItem := range job.params.Servers { if len(svrItem.ServerPorts) > 0 { // 存在实例 - isStopped = false + job.isStopped = false break } } - if isStopped { + return +} + +// stopDbmonWhenNoServers servers为空,没有任何需要监控的 redis-servers/proxy +// 直接stop bkdbmon即可 +func (job *BkDbmonInstall) stopDbmonWhenNoServers() (err error) { + if job.isStopped { err = job.StopBkDbmon() return } @@ -182,6 +192,10 @@ func (job *BkDbmonInstall) stopDbmonWhenNoServers() (isStopped bool, err error) // 如果/home/mysql/bk-dbmon/bk-dbmon 存在,且版本正确,则不解压 // 否则解压最新bk-dbmon,并修改 /home/mysql/bk-dbmon 的指向; func (job *BkDbmonInstall) UntarMedia() (err error) { + if job.isStopped { + // 如果是停止 bkdbmon,则不需要解压介质 + return nil + } var remoteVersion, localVersion string err = job.params.BkDbmonPkg.Check() if err != nil { @@ -305,6 +319,7 @@ type bkDbmonConf struct { ReportSaveDir string `json:"report_save_dir" yaml:"report_save_dir"` ReportLeftDay int `json:"report_left_day" yaml:"report_left_day"` HTTPAddress string `json:"http_address" yaml:"http_address"` + AgentAddress string `json:"agent_address" yaml:"agent_address"` GsePath string `json:"gsepath" yaml:"gsepath"` RedisFullBackup map[string]interface{} `json:"redis_fullbackup" yaml:"redis_fullbackup"` RedisBinlogBackup map[string]interface{} `json:"redis_binlogbackup" yaml:"redis_binlogbackup"` @@ -329,6 +344,7 @@ func (job *BkDbmonInstall) GenerateConfigFile() (err error) { ReportSaveDir: consts.DbaReportSaveDir, ReportLeftDay: consts.RedisReportLeftDay, HTTPAddress: consts.BkDbmonHTTPAddress, + AgentAddress: job.params.AgentAddress, GsePath: job.params.GsePath, RedisFullBackup: job.params.RedisFullBackup, RedisBinlogBackup: job.params.RedisBinlogBackup, diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_backup.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_backup.go index ee20d99f07..1fef31bae8 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_backup.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_backup.go @@ -21,6 +21,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/gofrs/flock" + "gopkg.in/yaml.v2" ) // TendisSSDSetLogCount tendisSSD设置log参数 @@ -225,8 +226,8 @@ func (job *RedisBackup) GetBackupClient() (err error) { if job.params.BackupType == consts.ForeverBackupType { bkTag = consts.RedisForeverBackupTAG } - job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, bkTag) - // job.backupClient,err=backupsys.NewCosBackupClient(consts.IBSBackupClient,"", bkTag) + // job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, bkTag) + job.backupClient, err = backupsys.NewCosBackupClient(consts.COSBackupClient, consts.COSInfoFile, bkTag) return } @@ -250,8 +251,9 @@ type BackupTask struct { BackupFile string `json:"backup_file"` // 备份的目标文件,如果文件过大会切割成多个 BackupFileSize int64 `json:"backup_file_size"` // 备份文件大小(已切割 or 已压缩 or 已打包) BackupTaskID string `json:"backup_taskid"` - BackupMD5 string `json:"backup_md5"` // 目前为空 - BackupTag string `json:"backup_tag"` // REDIS_FULL or REDIS_BINLOG + BackupMD5 string `json:"backup_md5"` // 目前为空 + BackupTag string `json:"backup_tag"` // REDIS_FULL or REDIS_BINLOG + ShardValue string `json:"shard_value"` // shard值 // 全备尽管会切成多个文件,但其生成的起始时间、结束时间一样 StartTime customtime.CustomTime `json:"start_time"` // 生成全备的起始时间 EndTime customtime.CustomTime `json:"end_time"` // //生成全备的结束时间 @@ -359,6 +361,10 @@ func (task *BackupTask) GoFullBakcup() { if task.Err != nil { return } + task.getRedisShardVal() + if task.Err != nil { + return + } // 如果有备份正在执行,则先等待其完成 task.Err = task.Cli.WaitForBackupFinish() @@ -413,6 +419,7 @@ func (task *BackupTask) newConnect() { if task.Err != nil { return } + mylog.Logger.Info("redis(%s) role:%s,dataDir:%s,dbType:%s", task.Addr(), task.Role, task.DataDir, task.DbType) // 获取数据量大小 if task.DbType == consts.TendisTypeRedisInstance { task.DataSize, task.Err = task.Cli.RedisInstanceDataSize() @@ -433,11 +440,13 @@ func (task *BackupTask) PrecheckDisk() { bakDiskUsg, err := util.GetLocalDirDiskUsg(task.BackupDir) task.Err = err if task.Err != nil { + mylog.Logger.Error("redis:%s backupDir:%s GetLocalDirDiskUsg fail,err:%v", task.Addr(), task.BackupDir, err) return } dataDiskUsg, err := util.GetLocalDirDiskUsg(task.DataDir) task.Err = err if task.Err != nil { + mylog.Logger.Error("redis:%s dataDir:%s GetLocalDirDiskUsg fail,err:%v", task.Addr(), task.DataDir, err) return } // 磁盘空间使用已有85%,则报错 @@ -469,6 +478,54 @@ func (task *BackupTask) PrecheckDisk() { task.Addr(), task.DataSize/1024/1024, task.BackupDir, bakDiskUsg.AvailSize/1024/1024)) } +func (task *BackupTask) getRedisShardVal() { + var enabled bool + var masterNode *myredis.ClusterNodeData + enabled, task.Err = task.Cli.IsClusterEnabled() + if task.Err != nil { + return + } + if enabled { + masterNode, task.Err = task.Cli.RedisClusterGetMasterNode(task.Addr()) + if task.Err != nil { + return + } + task.ShardValue = masterNode.SlotSrcStr + return + } + if util.FileExists(consts.BkDbmonConfFile) { + confData, err := os.ReadFile(consts.BkDbmonConfFile) + if err != nil { + err = fmt.Errorf("read file(%s) fail,err:%v", consts.BkDbmonConfFile, err) + mylog.Logger.Warn(err.Error()) + return + } + if !strings.Contains(string(confData), "server_shards:") { + return + } + type servers struct { + Servers []struct { + ServerShards map[string]string `yaml:"server_shards"` + } `yaml:"servers"` + } + var serversObj servers + err = yaml.Unmarshal(confData, &serversObj) + if err != nil { + err = fmt.Errorf("yaml.Unmarshal fail,err:%v", err) + mylog.Logger.Warn(err.Error()) + return + } + for _, server := range serversObj.Servers { + for ipPort, shardVal := range server.ServerShards { + if ipPort == task.Addr() { + task.ShardValue = shardVal + return + } + } + } + } +} + // RedisInstanceBackup redis(cache)实例备份 func (task *BackupTask) RedisInstanceBackup() { var srcFile string @@ -625,7 +682,7 @@ func (task *BackupTask) TendisSSDInstanceBackup() { mylog.Logger.Error(task.Err.Error()) return } - task.BackupFile = filepath.Join(task.BackupDir, tarFile) + task.BackupFile = tarFile task.GetBakFilesSize() if task.Err != nil { return @@ -688,14 +745,14 @@ func (task *BackupTask) TendisSSDSetLougCount() { // TransferToBackupSystem 备份文件上传到备份系统 func (task *BackupTask) TransferToBackupSystem() { var msg string - cliFileInfo, err := os.Stat(consts.IBSBackupClient) + cliFileInfo, err := os.Stat(consts.COSBackupClient) if err != nil { - err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.IBSBackupClient, err) + err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.COSBackupClient, err) mylog.Logger.Error(err.Error()) return } if !util.IsExecOther(cliFileInfo.Mode().Perm()) { - err = fmt.Errorf("%s is unable to execute by other", consts.IBSBackupClient) + err = fmt.Errorf("%s is unable to execute by other", consts.COSBackupClient) mylog.Logger.Error(err.Error()) return } diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_cluster_failover.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_cluster_failover.go new file mode 100644 index 0000000000..26e31d449e --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_cluster_failover.go @@ -0,0 +1,483 @@ +package atomredis + +import ( + "encoding/json" + "fmt" + "strconv" + "sync" + "time" + + "github.com/go-playground/validator/v10" + + "dbm-services/redis/db-tools/dbactuator/models/myredis" + "dbm-services/redis/db-tools/dbactuator/mylog" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/jobruntime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +type instItem struct { + IP string `json:"ip" validate:"required"` + Port int `json:"port" validate:"required"` +} + +// Addr TODO +func (item instItem) Addr() string { + return fmt.Sprintf("%s:%d", item.IP, item.Port) +} + +type masterSlavePair struct { + Master instItem `json:"master" validate:"required"` + Slave instItem `json:"slave" validate:"required"` +} + +// RedisClusterFailoverParam redis cluster failover param +type RedisClusterFailoverParam struct { + RedisPassword string `json:"redis_password" validate:"required"` + RedisMasterSlavePairs []masterSlavePair `json:"redis_master_slave_pairs" validate:"required"` // {"master_ip:master_port","slave_ip:slave_port"} + // 如果是强制failover,则不检查集群状态是否ok,不检查所有slave的link状态是否ok,failover时加上force 参数,failover后也不检查new_slave(old_master)同步是否跟上 + Force bool `json:"force"` +} + +// RedisClusterFailover redis cluster failover +type RedisClusterFailover struct { + runtime *jobruntime.JobGenericRuntime + params RedisClusterFailoverParam +} + +// 无实际作用,仅确保实现了 jobruntime.JobRunner 接口 +var _ jobruntime.JobRunner = (*RedisClusterFailover)(nil) + +// NewRedisClusterFailover new +func NewRedisClusterFailover() jobruntime.JobRunner { + return &RedisClusterFailover{} +} + +// Init 初始化 +func (job *RedisClusterFailover) Init(m *jobruntime.JobGenericRuntime) error { + job.runtime = m + err := json.Unmarshal([]byte(job.runtime.PayloadDecoded), &job.params) + if err != nil { + job.runtime.Logger.Error(fmt.Sprintf("json.Unmarshal failed,err:%+v", err)) + return err + } + // 参数有效性检查 + validate := validator.New() + err = validate.Struct(job.params) + if err != nil { + if _, ok := err.(*validator.InvalidValidationError); ok { + job.runtime.Logger.Error("RedisClusterFailover Init params validate failed,err:%v,params:%+v", + err, job.params) + return err + } + for _, err := range err.(validator.ValidationErrors) { + job.runtime.Logger.Error("RedisClusterFailover Init params validate failed,err:%v,params:%+v", + err, job.params) + return err + } + } + return nil +} + +// Name 原子任务名 +func (job *RedisClusterFailover) Name() string { + return "redis_cluster_failover" +} + +// Run Command 执行 +func (job *RedisClusterFailover) Run() (err error) { + if job.params.Force { + err = job.checkAllSlaveConnected() + if err != nil { + return + } + err = job.checkAllRedisInCluster() + if err != nil { + return + } + } else { + err = job.checkAllRedisConnected() + if err != nil { + return + } + err = job.checkClusterStatus() + if err != nil { + return + } + err = job.checkAllRedisInCluster() + if err != nil { + return + } + err = job.checkAllSlaveLinkStatus() + if err != nil { + return + } + } + err = job.groupRunFailoverAndWaitReplicateStateOk() + if err != nil { + return + } + return nil +} + +func (job *RedisClusterFailover) checkAllRedisConnected() (err error) { + allRedisAddr := make([]string, 0, len(job.params.RedisMasterSlavePairs)*2) + for _, ms := range job.params.RedisMasterSlavePairs { + allRedisAddr = append(allRedisAddr, ms.Master.Addr(), ms.Slave.Addr()) + } + err = myredis.CheckMultiRedisConnected(allRedisAddr, job.params.RedisPassword) + if err != nil { + job.runtime.Logger.Error("checkAllRedisConnected failed,err:%v", err) + return + } + job.runtime.Logger.Info("checkAllRedisConnected success") + return nil +} + +// checkAllSlaveConnected 检查所有 slave 是否可连接 +func (job *RedisClusterFailover) checkAllSlaveConnected() (err error) { + allSlaveAddr := make([]string, 0, len(job.params.RedisMasterSlavePairs)) + for _, ms := range job.params.RedisMasterSlavePairs { + allSlaveAddr = append(allSlaveAddr, ms.Slave.Addr()) + } + err = myredis.CheckMultiRedisConnected(allSlaveAddr, job.params.RedisPassword) + if err != nil { + job.runtime.Logger.Error("checkAllSlaveConnected failed,err:%v", err) + return + } + job.runtime.Logger.Info("checkAllSlaveConnected success") + return nil +} + +// checkClusterStatus 连接第一个 master,检查集群状态是否 ok +func (job *RedisClusterFailover) checkClusterStatus() (err error) { + firstMasterAddr := "" + for _, ms := range job.params.RedisMasterSlavePairs { + firstMasterAddr = ms.Master.Addr() + break + } + rc, err := myredis.NewRedisClientWithTimeout(firstMasterAddr, job.params.RedisPassword, 0, + consts.TendisTypeRedisInstance, 5*time.Second) + if err != nil { + return + } + defer rc.Close() + clusterStatus, err := rc.ClusterInfo() + if err != nil { + return + } + if clusterStatus.ClusterState != consts.ClusterStateOK { + err = fmt.Errorf("cluster state not ok,clusterState:%s", clusterStatus.ClusterState) + job.runtime.Logger.Error("checkClusterStatus failed,err:%v", err) + return + } + job.runtime.Logger.Info("checkClusterStatus success") + return nil +} + +// checkAllRedisInCluster 连接第一个 slave,获取cluster nodes 信息,确保所有redis节点都在集群中 +func (job *RedisClusterFailover) checkAllRedisInCluster() (err error) { + firstSlaveAddr := "" + for _, ms := range job.params.RedisMasterSlavePairs { + firstSlaveAddr = ms.Slave.Addr() + break + } + rc, err := myredis.NewRedisClientWithTimeout(firstSlaveAddr, job.params.RedisPassword, 0, + consts.TendisTypeRedisInstance, 5*time.Second) + if err != nil { + return + } + defer rc.Close() + addrToClusterNode, err := rc.GetAddrMapToNodes() + if err != nil { + return + } + for _, ms := range job.params.RedisMasterSlavePairs { + if _, ok := addrToClusterNode[ms.Master.Addr()]; !ok { + err = fmt.Errorf("redis node:%s not in cluster,firstMasterAddr:%s", ms.Master.Addr(), firstSlaveAddr) + job.runtime.Logger.Error("checkAllRedisInCluster failed,err:%v", err) + return + } + if _, ok := addrToClusterNode[ms.Slave.Addr()]; !ok { + err = fmt.Errorf("redis node:%s not in cluster,firstMasterAddr:%s", ms.Slave.Addr(), firstSlaveAddr) + job.runtime.Logger.Error("checkAllRedisInCluster failed,err:%v", err) + return + } + } + job.runtime.Logger.Info("checkAllRedisInCluster success") + return nil +} + +// checkAllSlaveLinkStatus 连接所有redis slave, +// 根据 info replication 获取其role 信息, +// 如果role 是 slave,则获取其 master addr, +// 确保其 master addr 与 job.params.RedisMasterSlavePair 中的 master addr 一致, +// 如果一致则继续检查master_link_status==up、master_last_binlog_seconds_ago<10 ,不一致报错; +// 如果 role 是 master,则获取其 slave 列表, +// 如果job.params.RedisMasterSlavePair 中的 master addr 在 slave 列表中, +// 则代表已经 cluster failover过了,否则报错; +func (job *RedisClusterFailover) checkAllSlaveLinkStatus() (err error) { + var replMasterHost, replMasterPort, replMasterAddr, replLinkStatus string + var masterLastIOSecAgo int + for _, ms := range job.params.RedisMasterSlavePairs { + rc, err := myredis.NewRedisClientWithTimeout(ms.Slave.Addr(), job.params.RedisPassword, 0, + consts.TendisTypeRedisInstance, 5*time.Second) + if err != nil { + return err + } + defer rc.Close() + infoRepl, err := rc.Info("replication") + if err != nil { + return err + } + if infoRepl["role"] == consts.RedisSlaveRole { + replMasterHost = infoRepl["master_host"] + replMasterPort = infoRepl["master_port"] + replLinkStatus = infoRepl["master_link_status"] + replMasterAddr = fmt.Sprintf("%s:%s", replMasterHost, replMasterPort) + if replMasterAddr != ms.Master.Addr() { + err = fmt.Errorf("slave:%s master addr:%s not equal to master addr:%s", ms.Slave.Addr(), + replMasterAddr, ms.Master.Addr()) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + if replLinkStatus != consts.MasterLinkStatusUP { + err = fmt.Errorf("slave:%s master link status:%s not equal to up", ms.Slave.Addr(), replLinkStatus) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + masterLastIOSecAgo, err = strconv.Atoi(infoRepl["master_last_io_seconds_ago"]) + if err != nil { + err = fmt.Errorf("slave:%s master last io seconds ago:%s convert to int failed,err:%v", + ms.Slave.Addr(), infoRepl["master_last_io_seconds_ago"], err) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + if masterLastIOSecAgo > 10 { + err = fmt.Errorf("slave:%s master last binlog seconds ago:%d greater than 10", ms.Slave.Addr(), masterLastIOSecAgo) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + } else if infoRepl["role"] == consts.RedisMasterRole { + _, slaveMap, err := rc.GetInfoReplSlaves() + if err != nil { + return err + } + if _, ok := slaveMap[ms.Master.Addr()]; !ok { + err = fmt.Errorf("old_slave:%s now is master,but old_master not in new_slaves:[%s]", + ms.Slave.Addr(), util.ToString(slaveMap)) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + } else { + err = fmt.Errorf("redis node:%s role:%s not equal to slave or master", ms.Slave.Addr(), infoRepl["role"]) + job.runtime.Logger.Error("checkAllSlaveLinkStatus failed,err:%v", err) + return err + } + } + job.runtime.Logger.Info("checkAllSlaveLinkStatus success") + return nil +} + +// groupRunFailoverAndWaitReplicateStateOk 按照 slave_ip 分组, +// 生成多个 redisFailOverTask保存在 groupTasks=map[string][]*redisFailOverTask中,同时记录下slave_ip对应tasks 的最大数量 +// 例如:groupTasks=map[string][]*redisFailOverTask{"slave_ip1":[task1,task2],"slave_ip2":[task3,task4,task5]} +// 利用 groupTasks,实现相同 slave_ip 上 tasks 串行执行,多个 slave_ip 上 tasks 并行执行 +func (job *RedisClusterFailover) groupRunFailoverAndWaitReplicateStateOk() (err error) { + var slaveIP string + groupTasks := make(map[string][]*redisFailOverTask) + maxTaskCount := 0 + for _, ms := range job.params.RedisMasterSlavePairs { + slaveIP, _, err = util.AddrToIpPort(ms.Slave.Addr()) + if err != nil { + job.runtime.Logger.Error(err.Error()) + return err + } + if _, ok := groupTasks[slaveIP]; !ok { + groupTasks[slaveIP] = []*redisFailOverTask{} + } + task := &redisFailOverTask{ + MasterAddr: ms.Master.Addr(), + SlaveAddr: ms.Slave.Addr(), + RedisPassword: job.params.RedisPassword, + Force: job.params.Force, + } + groupTasks[slaveIP] = append(groupTasks[slaveIP], task) + if len(groupTasks[slaveIP]) > maxTaskCount { + maxTaskCount = len(groupTasks[slaveIP]) + } + } + job.runtime.Logger.Info("groupTasks:%+v,maxTaskCount:%d", groupTasks, maxTaskCount) + for i := 0; i < maxTaskCount; i++ { + currTasks := []*redisFailOverTask{} + for slaveIP := range groupTasks { + if len(groupTasks[slaveIP]) > i { + currTasks = append(currTasks, groupTasks[slaveIP][i]) + } + } + // 串行执行 cluster failover + for _, task := range currTasks { + taskItem := task + taskItem.RunFailOverAndWaitDone() + if taskItem.Err != nil { + return taskItem.Err + } + } + // 并行执行 waitReplicateStateOK + wg := sync.WaitGroup{} + for _, task := range currTasks { + taskItem := task + wg.Add(1) + go func(item *redisFailOverTask) { + defer wg.Done() + item.WaitReplicateStateOK() + }(taskItem) + } + wg.Wait() + for _, task := range currTasks { + taskItem := task + if taskItem.Err != nil { + return taskItem.Err + } + } + } + job.runtime.Logger.Info("groupRunFailoverAndWaitReplicateStateOk success") + return nil +} + +// Retry times +func (job *RedisClusterFailover) Retry() uint { + return 2 +} + +// Rollback rollback +func (job *RedisClusterFailover) Rollback() error { + return nil +} + +type redisFailOverTask struct { + MasterAddr string `json:"master_addr"` + SlaveAddr string `json:"slave_addr"` + RedisPassword string `json:"redis_password"` + Force bool `json:"force"` + slaveCli *myredis.RedisClient + Err error `json:"err"` +} + +// newSlaveCli 新建slaveCli +func (task *redisFailOverTask) newSlaveCli() { + task.slaveCli, task.Err = myredis.NewRedisClientWithTimeout(task.SlaveAddr, task.RedisPassword, 0, + consts.TendisTypeRedisInstance, 5*time.Second) +} + +// isFailOverDone 是否fail over 完成,如果slave 已经是 master,且master 已经是'它'的slave,则认为fail over 完成 +func (task *redisFailOverTask) isFailOverDone() (done bool) { + infoRepl, err := task.slaveCli.Info("replication") + if err != nil { + return + } + var slaveMap map[string]*myredis.InfoReplSlave + if infoRepl["role"] == consts.RedisMasterRole { + if task.Force { + // 如果是强制 failover,则不检查old_master 是否变成了 new_slave + done = true + return + } + _, slaveMap, task.Err = task.slaveCli.GetInfoReplSlaves() + if task.Err != nil { + return + } + if _, ok := slaveMap[task.MasterAddr]; ok { + done = true + return + } + } + return done +} + +// RunFailOver slave 上 s执行 cluster failover +func (task *redisFailOverTask) RunFailOver() { + if task.Force { + task.Err = task.slaveCli.ClusterFailOver("takeover") + } else { + task.Err = task.slaveCli.ClusterFailOver("") + } + if task.Err != nil { + return + } + return +} + +// RunFailOverAndWaitDone 执行 cluster failover后,直到slave 成为 master,且master 成为 slave +// 最大等待 60s,每隔 2s 检查一次,每隔10秒打印一次日志,如果超时,则报错 +func (task *redisFailOverTask) RunFailOverAndWaitDone() { + task.newSlaveCli() + if task.Err != nil { + return + } + defer task.slaveCli.Close() + done := task.isFailOverDone() + if done { + mylog.Logger.Info("slave:%s is already master,do nothing", task.SlaveAddr) + return + } + task.RunFailOver() + if task.Err != nil { + return + } + for i := 0; i < 30; i++ { + time.Sleep(2 * time.Second) + done = task.isFailOverDone() + if done { + mylog.Logger.Info("slave:%s is already master,'cluster failover' success", task.SlaveAddr) + return + } + if i%5 == 0 { + mylog.Logger.Info("waitFailOverDone slave:%s not become master,wait 2s", task.SlaveAddr) + } + } + task.Err = fmt.Errorf("waitFailOverDone slave:%s not become master,wait 60s timeout", task.SlaveAddr) + mylog.Logger.Error(task.Err.Error()) + return +} + +// WaitReplicateStateOK 等待master 成为 slave,'它'的master_host:master_port 等于 SlaveAddr,且 master_link_status为up +// 最大等待 2h,每隔 2s 检查一次,每隔30秒打印一次日志,如果超时,则报错; +func (task *redisFailOverTask) WaitReplicateStateOK() { + if task.Force { + mylog.Logger.Info(fmt.Sprintf("force failover,not wait old_master:%s replicate state ok", task.MasterAddr)) + return + } + var masterCli *myredis.RedisClient + masterCli, task.Err = myredis.NewRedisClientWithTimeout(task.MasterAddr, task.RedisPassword, 0, + consts.TendisTypeRedisInstance, 5*time.Second) + if task.Err != nil { + return + } + defer masterCli.Close() + for i := 0; i < 3600; i++ { + time.Sleep(2 * time.Second) + infoRepl, err := masterCli.Info("replication") + if err != nil { + task.Err = err + return + } + if infoRepl["role"] == consts.RedisSlaveRole { + currMasterAddr := fmt.Sprintf("%s:%s", infoRepl["master_host"], infoRepl["master_port"]) + if currMasterAddr == task.SlaveAddr && infoRepl["master_link_status"] == consts.MasterLinkStatusUP { + mylog.Logger.Info("master:%s become a slave of slave:%s and master_link_status==up", + task.MasterAddr, task.SlaveAddr) + masterCli.ConfigRewrite() + return + } + } + if i%15 == 0 { + mylog.Logger.Info("waitReplicateStateOK master:%s not become slave of slave:%s and master_link_status:%s,wait 30s", + task.MasterAddr, task.SlaveAddr, infoRepl["master_link_status"]) + } + } + task.Err = fmt.Errorf("waitReplicateStateOK master:%s not become slave of slave:%s,wait 2h timeout", + task.MasterAddr, task.SlaveAddr) + mylog.Logger.Error(task.Err.Error()) + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_recovery.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_recovery.go index d595d4f7e9..656d20bdd4 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_recovery.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_recovery.go @@ -105,7 +105,7 @@ func (task *RedisDataRecover) Init(m *jobruntime.JobGenericRuntime) error { // Name 原子任务名 func (task *RedisDataRecover) Name() string { - return "redis_data_structure" + return "redis_data_structure_old" } // Retry times diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_structure.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_structure.go new file mode 100644 index 0000000000..f5171eb4b3 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_data_structure.go @@ -0,0 +1,230 @@ +package atomredis + +import ( + "encoding/json" + "fmt" + "os" + + "strconv" + "sync" + + "dbm-services/redis/db-tools/dbactuator/models/myredis" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/datastructure" + "dbm-services/redis/db-tools/dbactuator/pkg/jobruntime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" + + "github.com/go-playground/validator/v10" +) + +// RedisDataStructureParams redis 数据构造参数 +type RedisDataStructureParams struct { + SourceIP string `json:"source_ip" validate:"required"` + SourcePorts []int `json:"source_ports" validate:"required"` + NeWTempIP string `json:"new_temp_ip" validate:"required"` + NewTempPorts []int `json:"new_temp_ports" validate:"required" ` + RecoveryTimePoint string `json:"recovery_time_point" validate:"required"` + IsIncludeSlave bool `json:"is_include_slave" ` + TendisType string `json:"tendis_type" validate:"required"` + DestDir string `json:"dest_dir"` // 备份下载/存放目录 + FullFileList []datastructure.FileDetail `json:"full_file_list" validate:"required"` //全备文件列表 + BinlogFileList []datastructure.FileDetail `json:"binlog_file_list" ` //binlog文件列表 +} + +// RedisDataStructure redis 数据构造 +type RedisDataStructure struct { + runtime *jobruntime.JobGenericRuntime + params RedisDataStructureParams + RecoverDir string + password string + TendisType string `json:"tendis_type"` +} + +// 无实际作用,仅确保实现了 taskruntime.JobRunner 接口 +var _ jobruntime.JobRunner = (*RedisDataStructure)(nil) + +// NewRedisDataStructure new +func NewRedisDataStructure() jobruntime.JobRunner { + return &RedisDataStructure{} +} + +// Init 初始化 +func (task *RedisDataStructure) Init(m *jobruntime.JobGenericRuntime) error { + task.runtime = m + + err := json.Unmarshal([]byte(task.runtime.PayloadDecoded), &task.params) + if err != nil { + task.runtime.Logger.Error(fmt.Sprintf("json.Unmarshal failed,err:%+v", err)) + return err + } + // 参数有效性检查 + validate := validator.New() + err = validate.Struct(task.params) + if err != nil { + if _, ok := err.(*validator.InvalidValidationError); ok { + task.runtime.Logger.Error("RedisDataStructure Init params validate failed,err:%v,params:%+v", + err, task.params) + return err + } + for _, err := range err.(validator.ValidationErrors) { + task.runtime.Logger.Error("RedisDataStructure Init params validate failed,err:%v,params:%+v", + err, task.params) + return err + } + } + // 检查传入的端口不能为空 + if len(task.params.SourcePorts) == 0 || len(task.params.NewTempPorts) == 0 { + err = fmt.Errorf("RedisDataStructure SourcePorts(%d) or NewTempPorts(%d) =0 , is invalid ", + task.params.SourcePorts, task.params.NewTempPorts) + task.runtime.Logger.Error(err.Error()) + return err + } + + //传入的源端口数应该等于临时节点端口数 + if len(task.params.SourcePorts) != len(task.params.NewTempPorts) { + err = fmt.Errorf("RedisDataStructure SourcePorts(%d) != NewTempPorts(%d) , is invalid ", + task.params.SourcePorts, task.params.NewTempPorts) + task.runtime.Logger.Error(err.Error()) + return err + } + + return nil +} + +// Name 原子任务名 +func (task *RedisDataStructure) Name() string { + return "redis_data_structure" +} + +// Retry times +func (task *RedisDataStructure) Retry() uint { + return 2 +} + +// Rollback rollback +func (task *RedisDataStructure) Rollback() error { + return nil + +} + +// Run 执行 +// NOCC:golint/fnsize(设计如此) +func (task *RedisDataStructure) Run() (err error) { + + // 检查构造目录是否存在 + task.RecoverDir = task.params.DestDir + err = task.CheckRecoverDir() + if err != nil { + return err + } + + task.runtime.Logger.Info(task.params.RecoveryTimePoint) + // 构造任务初始化 + recoverTasks := make([]*datastructure.TendisInsRecoverTask, 0, len(task.params.SourcePorts)) + for idx, sourceRort := range task.params.SourcePorts { + newTmpPort := task.params.NewTempPorts[idx] + task.TendisType = task.params.TendisType + task.password = "" + // 数据构造时从本地获取密码信息 + task.password, err = myredis.GetPasswordFromLocalConfFile(newTmpPort) + if err != nil { + return err + } + + redisAddr := fmt.Sprintf("%s:%s", task.params.NeWTempIP, strconv.Itoa(task.params.NewTempPorts[0])) + // 验证节点是否可连接 + redisCli, err := myredis.NewRedisClient(redisAddr, task.password, 0, consts.TendisTypeRedisInstance) + if err != nil { + return err + } + defer redisCli.Close() + // 获取节点类型 + task.TendisType, err = redisCli.GetTendisType() + if err != nil { + err = fmt.Errorf("GetTendisType Err:%v", err) + task.runtime.Logger.Error(err.Error()) + return err + } + task.runtime.Logger.Info("TendisType:%s", task.TendisType) + + // 构造任务 + recoverTask, err := datastructure.NewTendisInsRecoverTask(task.params.SourceIP, sourceRort, + task.params.NeWTempIP, newTmpPort, task.password, + task.params.RecoveryTimePoint, task.RecoverDir, task.TendisType, + task.params.IsIncludeSlave, task.runtime, + task.params.FullFileList, task.params.BinlogFileList) + if err != nil { + return err + } + // 获取链接 + err = recoverTask.GetRedisCli() + if err != nil { + return err + } + + recoverTasks = append(recoverTasks, recoverTask) + + } + + // 停BkDbmon + err = util.StopBkDbmon() + if err != nil { + return err + } + + wg := sync.WaitGroup{} + genChan := make(chan *datastructure.TendisInsRecoverTask) + limit := 3 // 并发度 + for worker := 0; worker < limit; worker++ { + wg.Add(1) + go func() { + defer wg.Done() + for taskItem := range genChan { + // 执行回档任务 + taskItem.Run() + } + }() + } + go func() { + // 关闭genChan,以便让所有goroutine退出 + defer close(genChan) + for _, task := range recoverTasks { + recoverItem := task + genChan <- recoverItem + } + }() + wg.Wait() + for _, task := range recoverTasks { + recoverItem := task + if recoverItem.Err != nil { + return recoverItem.Err + } + } + + // 拉起BkDbmon + err = util.StartBkDbmon() + if err != nil { + return err + } + + return nil +} + +// CheckRecoverDir 数据构造本地数据目录 +func (task *RedisDataStructure) CheckRecoverDir() (err error) { + + // 检查构造目录是否存在 + _, err = os.Stat(task.RecoverDir) + if err != nil && os.IsNotExist(err) { + err = fmt.Errorf("目录:%s不存在,err:%v", task.RecoverDir, err) + task.runtime.Logger.Error(err.Error()) + return err + } else if err != nil { + err = fmt.Errorf("访问目录:%s 失败,err:%v", task.RecoverDir, err) + task.runtime.Logger.Error(err.Error()) + return err + + } + task.runtime.Logger.Info("CheckRecoverDir:%s success", task.RecoverDir) + return nil +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_keyspattern.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_keyspattern.go index 086af7890c..fcc17fb4c6 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_keyspattern.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_keyspattern.go @@ -622,13 +622,17 @@ func (task *RedisInsKeyPatternTask) getTargetKeysByPartten(db int) { } // 过滤掉节点心跳检测数据 - Heartbeat := fmt.Sprintf("%s_%s:heartbeat", task.MasterIP, task.MasterPort) + masterHeartbeat := fmt.Sprintf("%s_%s:heartbeat", task.MasterIP, task.MasterPort) + slaveHeartbeat := "" + if task.MasterIP != task.IP { + slaveHeartbeat = fmt.Sprintf("|^%s_%d:heartbeat", task.IP, task.Port) + } DbhaAgent := fmt.Sprintf("dbha:agent:%s", task.MasterIP) if grepPattern == "" { - grepPattern = fmt.Sprintf("^%s|^%s", Heartbeat, DbhaAgent) + grepPattern = fmt.Sprintf("^%s|^%s%s", masterHeartbeat, DbhaAgent, slaveHeartbeat) } else { - grepPattern = fmt.Sprintf("%s|^%s|^%s", grepPattern, Heartbeat, DbhaAgent) + grepPattern = fmt.Sprintf("%s|^%s|^%s%s", grepPattern, masterHeartbeat, DbhaAgent, slaveHeartbeat) } diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_switch.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_switch.go index 3208a039b6..bdedc83864 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_switch.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_switch.go @@ -266,6 +266,10 @@ func (job *RedisSwitch) doSlaveOfNoOne4NewMaster(ip string, port int, pass strin job.runtime.Logger.Error("[%s] exec slaveof No oNE for failed:%s", newMasterAddr, rst) return fmt.Errorf("[%s] slaveofNooNE:%s", newMasterAddr, rst) } + _, err = newMasterConn.ConfigRewrite() + if err != nil { + return fmt.Errorf("[%s] exec ConfigRewrite for failed:%+v", newMasterAddr, err) + } job.runtime.Logger.Info("[%s] exec slaveof No oNE for result:%s", newMasterAddr, rst) return nil } diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_version_update.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_version_update.go new file mode 100644 index 0000000000..808a972405 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/redis_version_update.go @@ -0,0 +1,486 @@ +package atomredis + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strconv" + "time" + + "github.com/go-playground/validator/v10" + + "dbm-services/redis/db-tools/dbactuator/models/myredis" + "dbm-services/redis/db-tools/dbactuator/pkg/common" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/jobruntime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +// RedisVersionUpdateParams redis 版本更新参数 +type RedisVersionUpdateParams struct { + common.MediaPkg + IP string `json:"ip" validate:"required"` + Ports []int `json:"ports" validate:"required"` + Password string `json:"password" validate:"required"` + Role string `json:"role" validate:"required"` // redis_master or redis_slave +} + +// RedisVersionUpdate TODO +type RedisVersionUpdate struct { + runtime *jobruntime.JobGenericRuntime + params RedisVersionUpdateParams + localPkgBaseName string + AddrMapCli map[string]*myredis.RedisClient `json:"addr_map_cli"` +} + +// 无实际作用,仅确保实现了 jobruntime.JobRunner 接口 +var _ jobruntime.JobRunner = (*RedisVersionUpdate)(nil) + +// NewRedisVersionUpdate new +func NewRedisVersionUpdate() jobruntime.JobRunner { + return &RedisVersionUpdate{} +} + +// Init prepare run env +func (job *RedisVersionUpdate) Init(m *jobruntime.JobGenericRuntime) error { + job.runtime = m + err := json.Unmarshal([]byte(job.runtime.PayloadDecoded), &job.params) + if err != nil { + job.runtime.Logger.Error(fmt.Sprintf("json.Unmarshal failed,err:%+v", err)) + return err + } + // 参数有效性检查 + validate := validator.New() + err = validate.Struct(job.params) + if err != nil { + if _, ok := err.(*validator.InvalidValidationError); ok { + job.runtime.Logger.Error("RedisVersionUpdate Init params validate failed,err:%v,params:%+v", + err, job.params) + return err + } + for _, err := range err.(validator.ValidationErrors) { + job.runtime.Logger.Error("RedisVersionUpdate Init params validate failed,err:%v,params:%+v", + err, job.params) + return err + } + } + if len(job.params.Ports) == 0 { + err = fmt.Errorf("RedisVersionUpdate Init ports(%+v) is empty", job.params.Ports) + job.runtime.Logger.Error(err.Error()) + return err + } + return nil +} + +// Name 原子任务名 +func (job *RedisVersionUpdate) Name() string { + return "redis_version_update" +} + +// Run Command Run +func (job *RedisVersionUpdate) Run() (err error) { + err = myredis.LocalRedisConnectTest(job.params.IP, job.params.Ports, job.params.Password) + if err != nil { + return err + } + err = job.allInstsAbleToConnect() + if err != nil { + return err + } + defer job.allInstDisconnect() + + if job.params.Role == consts.MetaRoleRedisMaster { + err = job.isAllInstanceMaster() + if err != nil { + return err + } + } else if job.params.Role == consts.MetaRoleRedisSlave { + err = job.isAllInstanceSlave() + if err != nil { + return err + } + } else { + err = fmt.Errorf("role:%s not support", job.params.Role) + job.runtime.Logger.Error(err.Error()) + return err + } + err = job.getLocalRedisPkgBaseName() + if err != nil { + return err + } + err = job.params.Check() + if err != nil { + job.runtime.Logger.Error(err.Error()) + return err + } + err = job.checkRedisLocalPkgAndTargetPkgSameType() + if err != nil { + return err + } + // 当前/usr/local/redis 指向版本不是 目标版本 + if job.localPkgBaseName != job.params.GePkgBaseName() { + err = job.untarMedia() + if err != nil { + return err + } + // 先 stop 所有 redis + for _, port := range job.params.Ports { + err = job.checkAndBackupRedis(port) + if err != nil { + return + } + err = job.stopRedis(port) + if err != nil { + return err + } + } + // 更新 /usr/local/redis 软链接 + err = job.updateFileLink() + if err != nil { + return err + } + // 再 start 所有 redis + for _, port := range job.params.Ports { + err = job.startRedis(port) + if err != nil { + return err + } + } + } + // 当前 /usr/local/redis 指向版本已经是 目标版本 + // 检查每个redis 运行版本是否是目标版本,如果不是则重启 + for _, port := range job.params.Ports { + addr := fmt.Sprintf("%s:%d", job.params.IP, port) + cli := job.AddrMapCli[addr] + ok, err := job.isRedisRuntimeVersionOK(cli) + if err != nil { + return err + } + if ok { + // 当前 redis 运行版本已经是目标版本 + continue + } + err = job.checkAndBackupRedis(port) + if err != nil { + return err + } + // 当前 redis 运行版本不是目标版本 + err = job.stopRedis(port) + if err != nil { + return err + } + err = job.startRedis(port) + if err != nil { + return err + } + } + + return nil +} + +func (job *RedisVersionUpdate) getLocalRedisPkgBaseName() (err error) { + redisSoftLink := filepath.Join(consts.UsrLocal, "redis") + _, err = os.Stat(redisSoftLink) + if err != nil && os.IsNotExist(err) { + err = fmt.Errorf("redis soft link(%s) not exist", redisSoftLink) + job.runtime.Logger.Error(err.Error()) + return err + } + realLink, err := os.Readlink(redisSoftLink) + if err != nil { + err = fmt.Errorf("readlink redis soft link(%s) failed,err:%+v", redisSoftLink, err) + job.runtime.Logger.Error(err.Error()) + return err + } + job.localPkgBaseName = filepath.Base(realLink) + job.runtime.Logger.Info("before update,%s->%s", redisSoftLink, realLink) + return nil +} + +// checkRedisLocalPkgAndTargetPkgSameType 检查reids本地包与目标包是同一类型,避免 cache redis 传的是 tendisplus 的包 +func (job *RedisVersionUpdate) checkRedisLocalPkgAndTargetPkgSameType() (err error) { + targetPkgName := job.params.GePkgBaseName() + targetDbType := util.GetRedisDbTypeByPkgName(targetPkgName) + localDbType := util.GetRedisDbTypeByPkgName(job.localPkgBaseName) + if targetDbType != localDbType { + err = fmt.Errorf("/usr/local/redis->%s cannot update to %s", job.localPkgBaseName, targetPkgName) + job.runtime.Logger.Error(err.Error()) + return err + } + return nil +} + +// allInstsAbleToConnect 检查所有实例可连接 +func (job *RedisVersionUpdate) allInstsAbleToConnect() (err error) { + instsAddrs := make([]string, 0, len(job.params.Ports)) + job.AddrMapCli = make(map[string]*myredis.RedisClient, len(job.params.Ports)) + for _, port := range job.params.Ports { + instsAddrs = append(instsAddrs, fmt.Sprintf("%s:%d", job.params.IP, port)) + } + for _, addr := range instsAddrs { + cli, err := myredis.NewRedisClientWithTimeout(addr, job.params.Password, 0, + consts.TendisTypeRedisInstance, 5*time.Second) + if err != nil { + return err + } + job.AddrMapCli[addr] = cli + } + job.runtime.Logger.Info("all redis instances able to connect,(%+v)", instsAddrs) + return nil +} + +// allInstDisconnect 所有实例断开连接 +func (job *RedisVersionUpdate) allInstDisconnect() { + for _, cli := range job.AddrMapCli { + cli.Close() + } +} + +func (job *RedisVersionUpdate) isAllInstanceMaster() (err error) { + for _, item := range job.AddrMapCli { + cli := item + repls, err := cli.Info("replication") + if err != nil { + return err + } + if repls["role"] != consts.RedisMasterRole { + err = fmt.Errorf("redis instance(%s) is not master", cli.Addr) + job.runtime.Logger.Error(err.Error()) + return err + } + // 是否要检查 master 是否还有 slave? + } + return nil +} +func (job *RedisVersionUpdate) isAllInstanceSlave() (err error) { + for _, item := range job.AddrMapCli { + cli := item + repls, err := cli.Info("replication") + if err != nil { + return err + } + if repls["role"] != consts.RedisSlaveRole { + err = fmt.Errorf("redis instance(%s) is not slave", cli.Addr) + job.runtime.Logger.Error(err.Error()) + return err + } + if repls["master_link_status"] != consts.MasterLinkStatusUP { + err = fmt.Errorf("redis instance(%s) master_link_status:%s is not UP", cli.Addr, repls["master_link_status"]) + job.runtime.Logger.Error(err.Error()) + return err + } + master_last_io_seconds_ago, err := strconv.Atoi(repls["master_last_io_seconds_ago"]) + if err != nil { + err = fmt.Errorf("redis instance(%s) master_last_io_seconds_ago:%s is not int", cli.Addr, + repls["master_last_io_seconds_ago"]) + job.runtime.Logger.Error(err.Error()) + return err + } + if master_last_io_seconds_ago > 20 { + err = fmt.Errorf("redis instance(%s) master_last_io_seconds_ago:%d is greater than 20", cli.Addr, + master_last_io_seconds_ago) + job.runtime.Logger.Error(err.Error()) + return err + } + job.runtime.Logger.Info( + "redis instance(%s) is slave,master(%s:%s),master_link_status:%s,master_last_io_seconds_ago:%d", + cli.Addr, repls["master_host"], repls["master_port"], + repls["master_link_status"], master_last_io_seconds_ago) + } + return nil +} + +// untarMedia 解压介质 +func (job *RedisVersionUpdate) untarMedia() (err error) { + err = job.params.Check() + if err != nil { + job.runtime.Logger.Error(err.Error()) + return err + } + pkgAbsPath := job.params.GetAbsolutePath() + untarCmd := fmt.Sprintf("tar -zxf %s -C %s", pkgAbsPath, consts.UsrLocal) + job.runtime.Logger.Info(untarCmd) + _, err = util.RunBashCmd(untarCmd, "", nil, 10*time.Minute) + if err != nil { + return err + } + job.runtime.Logger.Info("untar %s success", pkgAbsPath) + return nil +} + +// updateFileLink 更新 /usr/local/redis 软链接 +func (job *RedisVersionUpdate) updateFileLink() (err error) { + pkgBaseName := job.params.GePkgBaseName() + redisSoftLink := filepath.Join(consts.UsrLocal, "redis") + _, err = os.Stat(redisSoftLink) + if err == nil { + // 删除 /usr/local/redis 软链接 + err = os.Remove(redisSoftLink) + if err != nil { + err = fmt.Errorf("remove redis soft link(%s) failed,err:%+v", redisSoftLink, err) + job.runtime.Logger.Error(err.Error()) + return err + } + } + // 创建 /usr/local/redis -> /usr/local/$pkgBaseName 软链接 + err = os.Symlink(filepath.Join(consts.UsrLocal, pkgBaseName), redisSoftLink) + if err != nil { + err = fmt.Errorf("os.Symlink %s -> %s fail,err:%s", redisSoftLink, filepath.Join(consts.UsrLocal, pkgBaseName), err) + job.runtime.Logger.Error(err.Error()) + return + } + util.LocalDirChownMysql(redisSoftLink) + util.LocalDirChownMysql(redisSoftLink + "/") + job.runtime.Logger.Info("create softLink success,%s -> %s", redisSoftLink, filepath.Join(consts.UsrLocal, pkgBaseName)) + return nil +} + +// checkAndBackupRedis 如果有必要先备份reids +func (job *RedisVersionUpdate) checkAndBackupRedis(port int) (err error) { + // 如果是 master 且是 cache,则先备份 + addr := fmt.Sprintf("%s:%d", job.params.IP, port) + if job.params.Role != consts.MetaRoleRedisMaster { + job.runtime.Logger.Info("redis instance(%s) is not master,skip backup", addr) + return nil + } + cli := job.AddrMapCli[addr] + var dbType string + dbType, err = cli.GetTendisType() + if err != nil { + return err + } + if dbType != consts.TendisTypeRedisInstance { + job.runtime.Logger.Info("redis instance(%s) is not cache,skip backup", addr) + return nil + } + job.runtime.Logger.Info("redis instance(%s) is cache,start bgsave", addr) + err = cli.BgSaveAndWaitForFinish() + if err != nil { + return nil + } + return +} + +func (job *RedisVersionUpdate) stopRedis(port int) (err error) { + stopScript := filepath.Join(consts.UsrLocal, "redis", "bin", "stop-redis.sh") + // 先执行 stop-redis.sh 脚本,再检查端口是否还在使用 + job.runtime.Logger.Info(fmt.Sprintf("su %s -c \"%s\"", + consts.MysqlAaccount, stopScript+" "+strconv.Itoa(port)+" xxxx")) + _, err = util.RunLocalCmd("su", + []string{consts.MysqlAaccount, "-c", stopScript + " " + strconv.Itoa(port) + " " + job.params.Password}, + "", nil, 10*time.Minute) + if err != nil { + return err + } + maxRetryTimes := 5 + inUse := false + for maxRetryTimes >= 0 { + maxRetryTimes-- + inUse, err = util.CheckPortIsInUse(job.params.IP, strconv.Itoa(port)) + if err != nil { + job.runtime.Logger.Error(fmt.Sprintf("check %s:%d inUse failed,err:%v", job.params.IP, port, err)) + return err + } + if !inUse { + break + } + time.Sleep(2 * time.Second) + } + if inUse { + err = fmt.Errorf("stop redis instance(%s:%d) failed,port:%d still using", job.params.IP, port, port) + job.runtime.Logger.Error(err.Error()) + return err + } + job.runtime.Logger.Info("stop redis instance(%s:%d) success", job.params.IP, port) + return nil +} + +func (job *RedisVersionUpdate) startRedis(port int) (err error) { + startScript := filepath.Join(consts.UsrLocal, "redis", "bin", "start-redis.sh") + job.runtime.Logger.Info(fmt.Sprintf("su %s -c \"%s\" 2>/dev/null", + consts.MysqlAaccount, startScript+" "+strconv.Itoa(port))) + _, err = util.RunLocalCmd("su", + []string{consts.MysqlAaccount, "-c", startScript + " " + strconv.Itoa(port) + " 2>/dev/null"}, + "", nil, 10*time.Minute) + if err != nil { + return err + } + addr := fmt.Sprintf("%s:%d", job.params.IP, port) + cli, err := myredis.NewRedisClientWithTimeout(addr, job.params.Password, 0, + consts.TendisTypeRedisInstance, 10*time.Second) + if err != nil { + return err + } + job.AddrMapCli[addr] = cli + job.runtime.Logger.Info("start redis instance(%s:%d) success", job.params.IP, port) + + if job.params.Role == consts.MetaRoleRedisMaster { + return nil + } + // 多次检测直到 redis instance 成为 slave,且同步状态正常 + _, err = job.isReplStateOK(cli, 1*time.Minute) + if err != nil { + return err + } + return nil +} + +func (job *RedisVersionUpdate) isReplStateOK(cli *myredis.RedisClient, timeout time.Duration) (ok bool, err error) { + maxRetryTimes := timeout / (2 * time.Second) + if maxRetryTimes == 0 { + maxRetryTimes = 1 + } + for maxRetryTimes >= 0 { + maxRetryTimes-- + time.Sleep(2 * time.Second) + err = nil + repls, err := cli.Info("replication") + if err != nil { + return false, err + } + if repls["role"] != consts.RedisSlaveRole { + job.runtime.Logger.Info("redis instance(%s) role:%s is not slave", cli.Addr, repls["role"]) + continue + } + if repls["master_link_status"] != consts.MasterLinkStatusUP { + job.runtime.Logger.Info("redis instance(%s) master_link_status:%s is not UP", cli.Addr, repls["master_link_status"]) + continue + } + job.runtime.Logger.Info("redis instance(%s) is slave,master(%s:%s),master_link_status:%s", + cli.Addr, repls["master_host"], repls["master_port"], repls["master_link_status"]) + return true, nil + } + err = fmt.Errorf("cost %d seconds, redis instance(%s) is not slave", int(timeout.Seconds()), cli.Addr) + job.runtime.Logger.Error(err.Error()) + return false, err +} + +func (job *RedisVersionUpdate) isRedisRuntimeVersionOK(cli *myredis.RedisClient) (ok bool, err error) { + repls, err := cli.Info("server") + if err != nil { + return false, err + } + runtimeBaseVer, runtimeSubVer, err := util.VersionParse(repls["redis_version"]) + if err != nil { + return false, err + } + pkgBaseVer, pkgSubVer, err := util.VersionParse(job.params.GePkgBaseName()) + if err != nil { + return false, err + } + if runtimeBaseVer != pkgBaseVer || runtimeSubVer != pkgSubVer { + return false, nil + } + return true, nil +} + +// Retry times +func (job *RedisVersionUpdate) Retry() uint { + return 2 +} + +// Rollback rollback +func (job *RedisVersionUpdate) Rollback() error { + return nil +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/consts/consts.go b/dbm-services/redis/db-tools/dbactuator/pkg/consts/consts.go index 02b11b418f..5582cdbd69 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/consts/consts.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/consts/consts.go @@ -157,6 +157,7 @@ const ( ForeverBackupType = "forever_backup" IBSBackupClient = "/usr/local/bin/backup_client" COSBackupClient = "/usr/local/backup_client/bin/backup_client" + COSInfoFile = "/home/mysql/.cosinfo.toml" BackupTarSplitSize = "8G" RedisFullBackupTAG = "REDIS_FULL" RedisBinlogTAG = "REDIS_BINLOG" diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/fullback.go b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/fullback.go new file mode 100644 index 0000000000..7316aff13a --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/fullback.go @@ -0,0 +1,1557 @@ +package datastructure + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + "time" + + "dbm-services/redis/db-tools/dbactuator/models/myredis" + "dbm-services/redis/db-tools/dbactuator/mylog" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/customtime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +// TendisFullBackItem 全备信息项 +type TendisFullBackItem struct { + Incr int `json:"incr"` + NodeIP string `json:"node_ip"` + FileName string `json:"filename"` + BackupFile string `json:"backup_file"` + //DecpDir: 全备解压目录 + //如全备名是 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140.tar + //则值为 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140 + DecpDir string `json:"decpDir"` + ClusterMeataDir string `json:"decompressedFile"` //解压后,全备clusterMeta所在目录 + BackupTaskid int64 `json:"backup_taskid"` + BackupSize int64 `json:"backup_size"` + SplitFileIdx int `json:"split_file_idx"` + BackupStart customtime.CustomTime `json:"backup_start"` //备份开始时间,从备份文件名中获取 + BackupEnd customtime.CustomTime `json:"backup_end"` //备份结束时间 + StartPos uint64 `json:"startPos"` //ssd 回档导入增备时,--start-position + +} + +// TendisFullBackPull 拉取全备 +type TendisFullBackPull struct { + FileHead string `json:"fileHead"` // 文件正则匹配过滤查询 + SourceIP string `json:"sourceIp"` + + //保存备份文件的本地目录 :传入的 task.RecoverDir + SaveDir string `json:"saveDir"` + SaveHost string `json:"saveHost"` + RollbackDstTime time.Time `json:"rollbackDstTime"` //回档目标时间,拉取离这个时间点最近的备份 + //2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.000 + //2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.001 + //2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.002 + //key: 0 1 2 ... 文件分割后缀 + //value: 文件对应的fullbackup项 + ResultFullbackup []*TendisFullBackItem `json:"resultFullbackup"` + //key: fullbackup file name -> 去重 + //value: 文件对应的fullbackup项 + ResultFullbackMap map[string]*TendisFullBackItem `json:"resultFullbackMap"` + + //全备文件去掉后缀 + LocalFullBackupDir string `json:"local_full_backup_dir"` + Err error `json:"-"` //错误信息 + KvstoreNums int + TendisType string `json:"tendis_type"` +} + +// NewFullbackPull 新建全备拉取任务 +func NewFullbackPull(sourceIP, filehead, rollbackTime, + saveHost, saveDir string, kvstoreNums int, tendisType string) (ret *TendisFullBackPull) { + ret = &TendisFullBackPull{ + SourceIP: sourceIP, + FileHead: filehead, + SaveHost: saveHost, + SaveDir: saveDir, + KvstoreNums: kvstoreNums, + TendisType: tendisType, + } + layout := "2006-01-02 15:04:05" + ret.RollbackDstTime, ret.Err = time.ParseInLocation(layout, rollbackTime, time.Local) + if ret.Err != nil { + ret.Err = fmt.Errorf("rollbackTime:%s time.parese fail,err:%s,layout:%s", rollbackTime, ret.Err, layout) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + if ret.RollbackDstTime.After(time.Now()) == true { + //未来时间 + ret.Err = fmt.Errorf("rollbackTime:%s > time.Now()", ret.RollbackDstTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + ret.ResultFullbackup = []*TendisFullBackItem{} + ret.ResultFullbackMap = make(map[string]*TendisFullBackItem) + mylog.Logger.Info("FileHead:%s", ret.FileHead) + return +} + +// LastNDaysFullBack 需要最近N天的全备 +func LastNDaysFullBack() int { + lastNDays := 2 + return lastNDays +} + +// GetFullFilesSpecTimeRange 获取某个正则指定时间范围内的所有全备文件 +// NOCC:golint/fnsize(设计如此) +func (full *TendisFullBackPull) GetFullFilesSpecTimeRange(fullFileList []FileDetail) (backs []*TendisFullBackItem) { + mylog.Logger.Info("GetFullFilesSpecTimeRange start ... ") + + mylog.Logger.Info("fileName 正则匹配:%s", full.FileHead) + // 如没有切割的备份文件: + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30008-20230323-214618.tar + // 2005000191-TENDISSSD-FULL-slave-127.0.0.x-30000-20230418-050000-227999.tar + // 有切割的备份文件: + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30008-20230326-131129.split.000 + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30008-20230326-131129.split.001 + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30003-20230629-130151.tar + // 获得最后的: 20230326-131129 + // tendisplus + var lastDateReg *regexp.Regexp + var lastDateReg1 *regexp.Regexp + if full.TendisType == consts.TendisTypeTendisplusInsance { + lastDateReg = regexp.MustCompile(`^.*?(\d+-\d+).tar`) + lastDateReg1 = regexp.MustCompile(`^.*?(\d+-\d+).split.(\d+)`) + + } else if full.TendisType == consts.TendisTypeTendisSSDInsance { + // tendis ssd + lastDateReg = regexp.MustCompile(`^.*?(\d+-\d+)-(\d+).tar`) + lastDateReg1 = regexp.MustCompile(`^.*?(\d+-\d+-\d+).split.(\d+)`) + } else { + // tendis cache (cache 这里没有做文件分割) + // 2005000194-redis-master-127.0.0.x-30000-20230426-210004.rdb + // 2005000194-redis-slave-127.0.0.x-30000-20230508-130108.aof.zst + // rdb 文件不会压缩,因为redis本身有做压缩 + // aof 文件会压缩,需要解压 + lastDateReg = regexp.MustCompile(`^.*?(\d+-\d+).aof.zst`) + lastDateReg1 = regexp.MustCompile(`^.*?(\d+-\d+).rdb`) + } + + layout1 := "20060102-150405" + for _, str01 := range fullFileList { + back01 := &TendisFullBackItem{} + taskID, _ := strconv.Atoi(str01.TaskID) + // size, _ := strconv.Atoi(str01.Size) + // size := str01.Size + if taskID < 0 || str01.Size < 0 { + //backup_taskid 小于0 或backup_size 小于0的备份,是无效备份 + msg := fmt.Sprintf("fileNameHead:%s fullbackup:%s backupTaskid:%s<0 backupSize:%d<0 is invalid,skip...", + full.FileHead, str01.FileName, str01.TaskID, str01.Size) + mylog.Logger.Info(msg) + continue + } + + back01.BackupTaskid, _ = strconv.ParseInt(str01.TaskID, 10, 64) + back01.BackupSize, _ = strconv.ParseInt(strconv.Itoa(str01.Size), 10, 64) + mylog.Logger.Info("back01.BackupSize:%d", back01.BackupSize) + back01.BackupFile = str01.FileName + back01.NodeIP = str01.SourceIP + mylog.Logger.Debug("str01.FileName:%s", str01.FileName) + match01 := lastDateReg.FindStringSubmatch(str01.FileName) + mylog.Logger.Debug("match01:%s", match01) + + //备份文件有切割 + if match01 == nil { + match01 = lastDateReg1.FindStringSubmatch(str01.FileName) + if full.TendisType == consts.TendisTypeTendisSSDInsance || full.TendisType == consts.TendisTypeTendisplusInsance { + back01.SplitFileIdx, _ = strconv.Atoi(match01[2]) + } + } + + if len(match01) < 2 { + err := fmt.Errorf("filename:%s backup:%v format not correct,cann't find createTime", full.FileHead, str01) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + bkCreateTime, err01 := time.ParseInLocation(layout1, match01[1], time.Local) + + // 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140.tar + // 3-TENDISSSD-FULL-slave-127.0.0.x-30000-20230809-105510-52447.tar + if full.TendisType == consts.TendisTypeTendisSSDInsance { + back01.StartPos, _ = strconv.ParseUint(match01[2], 10, 64) + mylog.Logger.Info("全备文件名中获取的 StartPos:%d,文件:%s", back01.StartPos, back01.BackupFile) + } + + if err01 != nil { + full.Err = fmt.Errorf("backup file createTime:%s time.parese fail,err:%s,layout1:%s", match01[1], err01, layout1) + mylog.Logger.Error(full.Err.Error()) + return + } + back01.BackupStart.Time = bkCreateTime + back01.FileName = str01.FileName + // 过滤节点维度的文件,这里比较重要,因为flow传下来的是这台机器涉及到的所有节点信息, + // 这里是针对单节点的,所以需要过滤出来,这个值返回给前置函数 + if strings.Contains(back01.BackupFile, full.FileHead) { + backs = append(backs, back01) + } + + } + mylog.Logger.Info("GetFullFilesSpecTimeRange backs[0]:%v", backs[0]) + return +} + +// GetTendisFullbackNearestRkTime 获取Trendis最靠近 回档目的时间 的全备 +func (full *TendisFullBackPull) GetTendisFullbackNearestRkTime(fullFileList []FileDetail) { + mylog.Logger.Info("Check TendisFullbackNearestRkTime start ... ") + //从备份列表中选择最靠近 回档目标时间 的备份 + var nearestFullbk *TendisFullBackItem = nil + + backs := full.GetFullFilesSpecTimeRange(fullFileList) + if full.Err != nil { + err := fmt.Errorf("Check GetFullFilesSpecTimeRange failed :%v", full.Err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + mylog.Logger.Info("Check GetFullFilesSpecTimeRange finish ") + // 1、先找到一个最靠近 回档目标时间 的备份文件 + for _, bk01 := range backs { + bkItem := bk01 + //只需要那些BackupStart 小于等于 回档目标时间 的备份 + if bkItem.BackupStart.Before(full.RollbackDstTime) == true || + bkItem.BackupStart.Time == full.RollbackDstTime { + if nearestFullbk == nil { + //第一次找到 开始时间 小于 回档目标时间的备份 + nearestFullbk = bkItem + } else { + // nearestFullbk.BackupStart < 该备份BackupStart <= full.RollbackDstTime + if bkItem.BackupStart.After(nearestFullbk.BackupStart.Time) == true { + nearestFullbk = bkItem + } + } + } + } + if nearestFullbk != nil { + //已经找到 + mylog.Logger.Info("GetTendisFullbackNearestRkTime filename 正则:%s nearestFullbk:%v", full.FileHead, nearestFullbk) + // 2、再查找同时段的其他分割文件,怎么判断分割文件是否完备呢? -》 isGetAllFileInfo + for _, bk01 := range backs { + bkItem := bk01 + //找到同一时间的分割文件 + if bkItem.BackupStart.Time == nearestFullbk.BackupStart.Time { + if _, ok := full.ResultFullbackMap[bkItem.BackupFile]; ok == true { + //去重 + return + } + full.ResultFullbackMap[bkItem.BackupFile] = bkItem + full.ResultFullbackup = append(full.ResultFullbackup, bkItem) + + } + } + layout := "2006-01-02 15:04:05" + if nearestFullbk == nil { + full.Err = fmt.Errorf("filename 正则:%s 最近%d天内没找到小于回档目标时间[%s]的全备", + full.FileHead, LastNDaysFullBack(), full.RollbackDstTime.Local().Format(layout)) + mylog.Logger.Error(full.Err.Error()) + return + } + msg := fmt.Sprintf("找到距离回档目标时间:%s最近的全备:%s", + full.RollbackDstTime, nearestFullbk.BackupFile) + mylog.Logger.Info(msg) + + //按照splitfile index排序 + sort.Slice(full.ResultFullbackup, func(i, j int) bool { + return full.ResultFullbackup[i].SplitFileIdx < full.ResultFullbackup[j].SplitFileIdx + }) + // 校验获取到的分割/tar文件信息:检查是否完整 + full.isGetAllFileInfo() + if full.Err != nil { + mylog.Logger.Error("isGetAllFileInfo failed,err:%v", full.Err.Error()) + return + } + return + } + layout := "2006-01-02 15:04:05" + full.Err = fmt.Errorf("GetTendisFullbackNearestRkTime: filename 正则:%s 最近%d天内没找到小于回档目标时间[%s]的全备", + full.FileHead, LastNDaysFullBack(), full.RollbackDstTime.Local().Format(layout)) + mylog.Logger.Error(full.Err.Error()) + + return +} + +/* +判断split文件是否连续,是否重复; +- 重复则报错; +- 不连续则返回缺失的split index,如 2,3,5,8 则返回缺失的4,6,7 +*/ +func getNotReadySplitFile(resultBackItem []*TendisFullBackItem) ([]string, error) { + var ret []string + var err error + prelistIdx := 000 + preSplitFileIdx := resultBackItem[0].SplitFileIdx + for idx, item := range resultBackItem { + if idx == prelistIdx { + // 第一个元素忽略 + continue + } + if item.SplitFileIdx <= preSplitFileIdx { + //如果后面的split index小于等于前一个 index + err = fmt.Errorf("当前split index:%d <= 前一个split index:%d", item.SplitFileIdx, preSplitFileIdx) + mylog.Logger.Error(err.Error()) + mylog.Logger.Error(err.Error()) + return ret, err + } + if item.SplitFileIdx == preSplitFileIdx+1 { + // 递增符合预期 + preSplitFileIdx = item.SplitFileIdx + continue + } + preSplitFileIdx++ + for preSplitFileIdx < item.SplitFileIdx { + ret = append(ret, fmt.Sprintf("%d", preSplitFileIdx)) + preSplitFileIdx++ + } + + } + return ret, nil +} + +/* +判断所需split/tar file文件信息是否已全部获取到; +- ResultFullbackup 第二个split文件序号 必须 只比 第一个split 文件序号大1 +- ResultFullbackup 倒数第一个split文件序号 必须 只比 倒数第二个split文件序号大 1 +- 最后一个文件序号 减去 第一个文件序号 等于 len(ResultFullbackup)+1 +- ResultFullbackup split.BackupStart都相等 +*/ +func (full *TendisFullBackPull) isGetAllFileInfo() (ret bool) { + mylog.Logger.Info("isGetAllFileInfo start ...") + cnt := len(full.ResultFullbackup) + mylog.Logger.Info("ResultFullbackup len:%d", cnt) + // 没有分割,文件小于8G + if cnt == 1 { + for _, bk01 := range full.ResultFullbackup { + mylog.Logger.Info(bk01.BackupFile) + msg := fmt.Sprintf(`filename:%s 找到所有[%s~%s]时间段的tar文件,共%d个:%s`, + full.FileHead, + full.ResultFullbackup[0].BackupStart, + full.ResultFullbackup[0].BackupEnd, + cnt, + bk01.BackupFile, + ) + mylog.Logger.Info(msg) + return + + } + } + firstSplit := full.ResultFullbackup[0] + secondSplit := full.ResultFullbackup[1] + + lastSplit := full.ResultFullbackup[cnt-1] + beforeLastSplit := full.ResultFullbackup[cnt-2] + + //第二个split文件序号 必须 只比 第一个split 文件序号大1 + if secondSplit.SplitFileIdx-firstSplit.SplitFileIdx != 1 { + full.Err = fmt.Errorf("filename:%s 拉取[%s ~ %s] 时间段的split file,第一个分割文件:%s 和 第二个分割文件:%s 不连续", + full.FileHead, full.ResultFullbackup[0].BackupStart, full.ResultFullbackup[0].BackupEnd, + firstSplit.BackupFile, secondSplit.BackupFile) + mylog.Logger.Error(full.Err.Error()) + return + } + + //倒数第一个split文件序号 必须 只比 倒数第二个split文件序号大 1 + if lastSplit.SplitFileIdx-beforeLastSplit.SplitFileIdx != 1 { + full.Err = fmt.Errorf("filename:%s 拉取[%s ~ %s] 时间段的split file,倒数第一个分割文件:%s 和 倒数第二个分割文件:%s 不连续", + full.FileHead, full.ResultFullbackup[0].BackupStart, full.ResultFullbackup[0].BackupEnd, + lastSplit.BackupFile, beforeLastSplit.BackupFile) + mylog.Logger.Error(full.Err.Error()) + return + } + //全部是否连续 + splitIndexList, err := getNotReadySplitFile(full.ResultFullbackup) + if err != nil { + full.Err = err + return false + } + + if len(splitIndexList) > 0 { + full.Err = fmt.Errorf("缺失的split共%d个,缺失的split index是:%s", + len(splitIndexList), strings.Join(splitIndexList, ",")) + mylog.Logger.Error(full.Err.Error()) + return false + } + // 判断时间相等 + baseTime := full.ResultFullbackup[0].BackupStart + if len(full.ResultFullbackup) > 1 { + for _, bk01 := range full.ResultFullbackup { + if bk01.BackupStart != baseTime { + full.Err = fmt.Errorf("filename:%s 拉取[%s ~ %s] 时间段的split file 的时间不一致,第一个文件是:%s,不一致的文件是:%s", + full.FileHead, full.ResultFullbackup[0].BackupStart, full.ResultFullbackup[0].BackupEnd, + full.ResultFullbackup[0].BackupFile, bk01.BackupFile) + } + } + + } + msg := fmt.Sprintf(`filename:%s 找到所有[%s~%s]时间段的splitFile,共%d个,第一个splitFile:%s,最后一个splitFile:%s`, + full.FileHead, + full.ResultFullbackup[0].BackupStart, + full.ResultFullbackup[0].BackupEnd, + cnt, + firstSplit.BackupFile, + lastSplit.BackupFile, + ) + mylog.Logger.Info(msg) + return + +} + +// RetryDownloadFiles 需要flow重新下载文件到对应位置 +func (full *TendisFullBackPull) RetryDownloadFiles() { + + full.Err = fmt.Errorf("no all files need retryDownloadFiles") + +} + +// TotalSize 全备文件的大小 +func (full *TendisFullBackPull) TotalSize() int64 { + var ret int64 = 0 + for _, bk01 := range full.ResultFullbackup { + bkItem := bk01 + ret = ret + bkItem.BackupSize + } + return ret +} + +// findDstFileInDir 在指定文件夹下找到目标文件 +func findDstFileInDir(dir string, dstFile string) (dstFilePos string, err error) { + err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.Name() == dstFile { + dstFilePos = path + return nil + } + return nil + }) + if err != nil { + err = fmt.Errorf("findDstFileInDir filepath.Walk fail,err:%v,dir:%s dstFile:%s", err, dir, dstFile) + mylog.Logger.Error(err.Error()) + return "", err + } + if dstFilePos == "" { + err = fmt.Errorf("the destination file was not found in dir,dstFile:%s,dir:%s", + dstFile, dir) + mylog.Logger.Error(err.Error()) + return "", util.NewNotFoundErr() + } + return +} + +// GetBackupFileExt 获取全备文件后缀 +func (full *TendisFullBackPull) GetBackupFileExt() (fileExt string) { + + if len(full.ResultFullbackup) != 0 { + fileExt = filepath.Ext(full.ResultFullbackup[0].BackupFile) + } else { + full.Err = fmt.Errorf("结果文件为空,无法获取文件后缀,请检查") + mylog.Logger.Error(full.Err.Error()) + return + } + + if fileExt == ".tar" || fileExt == ".tgz" { + return fileExt + } else if strings.HasSuffix(full.ResultFullbackup[0].BackupFile, ".tar.gz") { + fileExt = ".tar.gz" + } else if strings.HasSuffix(full.ResultFullbackup[0].BackupFile, ".zst") { + fileExt = ".zst" + } else if strings.HasSuffix(full.ResultFullbackup[0].BackupFile, ".rdb") { + fileExt = ".rdb" + } else if strings.Contains(full.ResultFullbackup[0].BackupFile, ".split.") { + fileExt = "split" + } else { + full.Err = fmt.Errorf("不支持解压的全备文件类型:%s", full.ResultFullbackup[0].BackupFile) + mylog.Logger.Error(full.Err.Error()) + return + } + mylog.Logger.Info("GetBackupFileExt: fileExt is %s", fileExt) + return +} + +// SetDecompressedDir 设置解压目录 +func (full *TendisFullBackPull) SetDecompressedDir() { + bkFileExt := full.GetBackupFileExt() + if full.Err != nil { + return + } + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s", bkFileExt) + var prefix, cmd01 string + if bkFileExt == "split" { + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.004 + // 需要的:2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752 + prefix = strings.Split(full.ResultFullbackup[0].BackupFile, ".split")[0] + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, prefix) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + } else if bkFileExt == ".tar" { + prefix = strings.TrimSuffix(full.ResultFullbackup[0].BackupFile, bkFileExt) + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, prefix) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + } else if bkFileExt == ".zst" { + // xx-xx-xx.aof.zst + prefix = strings.TrimSuffix(full.ResultFullbackup[0].BackupFile, ".aof.zst") + mylog.Logger.Info("prefix:%s", prefix) + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, prefix) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + } else if bkFileExt == ".rdb" { + // xx-xx.rdb + prefix = strings.TrimSuffix(full.ResultFullbackup[0].BackupFile, ".rdb") + mylog.Logger.Info("prefix:%s", prefix) + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, prefix) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + } + mylog.Logger.Info("SetDecompressedDir cmd01:%s", cmd01) + full.LocalFullBackupDir = prefix + mylog.Logger.Info("GetDecompressedDir: Decompressed Dir is:%s", full.LocalFullBackupDir) +} + +// GetDecompressedDir 获取 DecpDir 的值,全备解压目录 +// 如全备名是 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140.tar +// 则值为 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140 +func (full *TendisFullBackPull) GetDecompressedDir() (decpDir string) { + if full.LocalFullBackupDir != "" { + return full.LocalFullBackupDir + } + full.SetDecompressedDir() + if full.Err != nil { + return + } + return full.LocalFullBackupDir +} + +// CheckDecompressedDirIsOK 检查全备解压文件夹 是否存在,数据是否完整 +// 数据是否完整:通过判断是否有clustermeta.txt、${rocksdbIdx}/backup_meta文件来确认 +func (full *TendisFullBackPull) CheckDecompressedDirIsOK() (isExists, isCompelete bool, msg string) { + + mylog.Logger.Info("开始检查全备(已解压)目录是否存在,是否完整") + isExists = false + isCompelete = false + + decpDir := full.GetDecompressedDir() + if full.Err != nil { + return + } + decpFullPath := filepath.Join(full.SaveDir, decpDir) + if _, err := os.Stat(decpFullPath); os.IsNotExist(err) { + msg = fmt.Sprintf("全备解压目录:%s 不存在", decpFullPath) + mylog.Logger.Info(msg) + return + } + isExists = true //解压目录存在 + if full.TendisType == consts.TendisTypeTendisplusInsance { + var metaFile string + metaFile, _ = findDstFileInDir(decpFullPath, "clustermeta.txt") + + if _, err := os.Stat(metaFile); os.IsNotExist(err) { + //clustermeta.txt 不存在 + msg = fmt.Sprintf("全备解压目录:%s 中找不到 clustermeta.txt 文件", metaFile) + mylog.Logger.Info(msg) + isCompelete = false + return + } + full.ResultFullbackup[0].ClusterMeataDir = filepath.Dir(metaFile) + for i := 0; i < full.KvstoreNums; i++ { + rocksdbBackupMeta := filepath.Join(full.ResultFullbackup[0].ClusterMeataDir, fmt.Sprintf("%d/backup_meta", i)) + if _, err := os.Stat(rocksdbBackupMeta); os.IsNotExist(err) { + msg = fmt.Sprintf("全备解压目录:%s/%d/backup_meta 找不到", rocksdbBackupMeta, i) + mylog.Logger.Info(msg) + isCompelete = false + return + } + } + + } else if full.TendisType == consts.TendisTypeTendisSSDInsance { + //todo 这里不存在会有errlog ,预期内的情况? 看看怎么优化 + mylog.Logger.Info("检查tendis ssd 的全备解压是否有效") + err := full.tendisSSDBackupVerify(decpFullPath) + if err != nil { + msg = fmt.Sprintf("全备解压目录Verify 无效:%s", decpFullPath) + isCompelete = false + return + } + } else if full.TendisType == consts.TendisTypeRedisInstance { + // todo 怎样判断是否完整? + // 1、存在 + // 2、大小接近 + var file, backupFile string + mylog.Logger.Info("decpFullPath:%s", decpFullPath) + bkFileExt := full.GetBackupFileExt() + if full.Err != nil { + return + } + if bkFileExt == ".zst" { + backupFile = strings.TrimSuffix(full.ResultFullbackup[0].BackupFile, ".zst") + file, _ = findDstFileInDir(decpFullPath, backupFile) + + } else if bkFileExt == ".rdb" { + backupFile = full.ResultFullbackup[0].BackupFile + file, _ = findDstFileInDir(decpFullPath, backupFile) + } + + if _, err := os.Stat(file); os.IsNotExist(err) { + msg = fmt.Sprintf("全备解压目录:%s 中找不到 %s 文件", decpFullPath, backupFile) + mylog.Logger.Info(msg) + isCompelete = false + return + } + + } + + msg = fmt.Sprintf("解压目录存在且完整:%s", decpFullPath) + mylog.Logger.Info(msg) + //解压文件存在且是完整的 + return true, true, msg +} + +// tendisSSDBackupVerify 确定tendissd备份是否是有效的 +func (task *TendisFullBackPull) tendisSSDBackupVerify(backupFullDir string) (err error) { + + verifyBin := consts.TredisverifyBin + if !util.FileExists(verifyBin) { + task.Err = fmt.Errorf("%s not exists", verifyBin) + mylog.Logger.Error(task.Err.Error()) + return + } + cmd := fmt.Sprintf(` +export LD_PRELOAD=/usr/local/redis/bin/deps/libjemalloc.so; +export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/local/redis/bin/deps; +%s %s 1 2>/dev/null + `, verifyBin, backupFullDir) + mylog.Logger.Info(cmd) + _, err = util.RunBashCmd(cmd, "", nil, 1*time.Hour) + if err != nil { + err = fmt.Errorf("backupData(%s) verify failed", backupFullDir) + mylog.Logger.Error(err.Error()) + return + } + return +} + +// CheckLocalBackupFileIsOK 检查本地全备(未解压) 是否存在,是否完整 +func (full *TendisFullBackPull) CheckLocalBackupFileIsOK() (isExists, isCompelete bool, msg string) { + mylog.Logger.Info("开始检查本地全备文件(未解压)是否存在,是否完整") + + mylog.Logger.Info("full.LocalFullBackupDir:%s", full.LocalFullBackupDir) + //TODO 通过gse检查saveRemoteDidr备份文件是否存在,大小如何 + // 这里当前只是 简单检查下saveMyyDir中备份文件是否存在,大小是否ok + full.SetDecompressedDir() + if full.Err != nil { + msg = fmt.Sprintf("本地全备(未解压):%s 不存在", full.LocalFullBackupDir) + mylog.Logger.Info(msg) + return false, false, msg + } + if full.SaveDir != "" { + bkFileFullPath := filepath.Join(full.SaveDir, full.LocalFullBackupDir) + mylog.Logger.Info("bkFileFullPath:%s", bkFileFullPath) + var bkFileFullPathFile string + if full.TendisType == consts.TendisTypeTendisplusInsance || full.TendisType == consts.TendisTypeTendisSSDInsance { + bkFileFullPathFile = fmt.Sprintf("%s%s", bkFileFullPath, ".tar") + } else if full.TendisType == consts.TendisTypeRedisInstance { + bkFileExt := full.GetBackupFileExt() + if full.Err != nil { + return + } + if bkFileExt == ".zst" { + bkFileFullPathFile = fmt.Sprintf("%s%s", bkFileFullPath, ".aof.zst") + } else if bkFileExt == ".rdb" { + bkFileFullPathFile = fmt.Sprintf("%s%s", bkFileFullPath, ".rdb") + } + + } + + mylog.Logger.Info("bkFileFullPathFile:%s", bkFileFullPathFile) + bkFileOsInfo, err := os.Stat(bkFileFullPathFile) + if os.IsNotExist(err) { + // 解压后就会删除,基本是不存在的 + msg = fmt.Sprintf("本地全备(未解压):%s 不存在", bkFileFullPathFile) + mylog.Logger.Info(msg) + return false, false, msg + } + + isExists = true + + msg = fmt.Sprintf("本地全备(未解压):%s 大小%dGB, 目标大小:%dGB", + full.LocalFullBackupDir, + bkFileOsInfo.Size()/1024/1024/1024, + full.TotalSize()/1024/1024/1024) + mylog.Logger.Info(msg) + mylog.Logger.Info("size:%d,full.TotalSize():%d", bkFileOsInfo.Size(), full.TotalSize()) + // 这里获取的文件夹大小和单个文件大小,数据会不一致,有很少的差异,所以比较单位换算为GB + if bkFileOsInfo.Size()/1024/1024/1024 != full.TotalSize()/1024/1024/1024 { + msg = fmt.Sprintf("本地全备(未解压):%s 大小%dGB != 目标大小:%dGB", + full.LocalFullBackupDir, + bkFileOsInfo.Size()/1024/1024/1024, + full.TotalSize()/1024/1024/1024) + mylog.Logger.Info(msg) + isCompelete = false + return + } + mylog.Logger.Info("CheckLocalBackupFileIsOK: result is ok") + return true, true, "" + } + msg = fmt.Sprintf("SaveDir:%s is empty", full.SaveDir) + return false, false, msg +} + +// DirSize 获取文件夹的大小 +func (full *TendisFullBackPull) DirSize(path string) (int64, error) { + var size int64 + err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { + if !info.IsDir() { + size += info.Size() + } + return err + }) + return size, err +} + +// RmDecompressedDir 删除本地全备解压文件夹 +func (full *TendisFullBackPull) RmDecompressedDir() { + decpDir := full.GetDecompressedDir() + if full.Err != nil { + return + } + decpFullPath := filepath.Join(full.SaveDir, decpDir) + if _, err := os.Stat(decpFullPath); os.IsNotExist(err) { + //本地全备解压文件夹不存在 + return + } + rmCmd := fmt.Sprintf("cd %s && rm -rf %s 2>/dev/null", full.SaveDir, decpDir) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if full.Err != nil { + return + } + msg := fmt.Sprintf("全备文件夹(已解压):%s 删除成功", decpDir) + mylog.Logger.Info(msg) + return +} + +// RmLocalBakcupFile 删除本地全备(未解压)文件 +func (full *TendisFullBackPull) RmLocalBakcupFile() { + bkFileFullPath := filepath.Join(full.SaveDir, full.LocalFullBackupDir) + if _, err := os.Stat(bkFileFullPath); os.IsNotExist(err) { + return + } + bkFileExt := full.GetBackupFileExt() + if full.Err != nil { + return + } + var backupFiles string + // rdb 没压缩,不用处理 + if bkFileExt == "split" { + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.004 + // 需要的:2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752 + backupFiles = fmt.Sprintf("%s.split.*", full.GetDecompressedDir()) + } else if bkFileExt == ".tar" { + backupFiles = fmt.Sprintf("%s.tar", full.GetDecompressedDir()) + } else if bkFileExt == ".zst" { + backupFiles = fmt.Sprintf("%s.aof.zst", full.GetDecompressedDir()) + DecompressDir := filepath.Join(full.SaveDir, full.GetDecompressedDir()) + rmCmd := fmt.Sprintf("cd %s && rm -rf %s 2>/dev/null", DecompressDir, backupFiles) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if full.Err != nil { + return + } + msg := fmt.Sprintf("本地全备(未解压):%s 删除成功", backupFiles) + mylog.Logger.Info(msg) + return + } + rmCmd := fmt.Sprintf("cd %s && rm -rf %s 2>/dev/null", full.SaveDir, backupFiles) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if full.Err != nil { + return + } + msg := fmt.Sprintf("本地全备(未解压):%s 删除成功", backupFiles) + mylog.Logger.Info(msg) + return +} + +// Decompressed ... 解压文件 +// NOCC:golint/fnsize(设计如此) +func (full *TendisFullBackPull) Decompressed() { + mylog.Logger.Info("Decompressed start ...") + var cmd01 string + bkFileExt := full.GetBackupFileExt() + if full.Err != nil { + return + } + + if bkFileExt == ".tar" { + // 只有一个备份文件,并且后缀为.tar + if len(full.ResultFullbackup) == 1 { + cmd01 = fmt.Sprintf("tar -xf %s", full.ResultFullbackup[0].BackupFile) + } + + } else if bkFileExt == ".tar.gz" || bkFileExt == ".tgz" { + if len(full.ResultFullbackup) == 1 { + cmd01 = fmt.Sprintf("tar -xf %s", full.ResultFullbackup[0].BackupFile) + } + } else if bkFileExt == ".zst" { + if len(full.ResultFullbackup) == 1 { + // 检查 zst 是否存在 + _, err := os.Stat(consts.ZstdBin) + if err != nil && os.IsNotExist(err) { + + err = fmt.Errorf("Decompress: 解压工具 zst 不存在,"+ + "请检查 %s是否存在 err:%v", consts.ZstdBin, err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + + } + // 未解压文件 + cmd01 = fmt.Sprintf(" cd %s && %s -d %s ", full.GetDecompressedDir(), + consts.ZstdBin, full.ResultFullbackup[0].BackupFile) + } + prefix := strings.TrimSuffix(full.ResultFullbackup[0].BackupFile, ".aof.zst") + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, prefix) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + // 将备份文件mv到解压目录下 + DecompressDir := filepath.Join(full.SaveDir, full.GetDecompressedDir()) + mvCmd := fmt.Sprintf("cd %s && mv %s %s ", full.SaveDir, full.ResultFullbackup[0].BackupFile, DecompressDir) + mylog.Logger.Info("将备份文件mv到解压目录下 mvCmd:%s", mvCmd) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", mvCmd}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + + } else if bkFileExt == ".rdb" { + // 将备份文件mv到目录下,rdb不用解压 + DecompressDir := filepath.Join(full.SaveDir, full.GetDecompressedDir()) + cmd01 := fmt.Sprintf("cd %s && mkdir -p %s ", full.SaveDir, DecompressDir) + mylog.Logger.Info("SetDecompressedDir bkFileExt:%s, cmd01:%s", bkFileExt, cmd01) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + + mvCmd := fmt.Sprintf("cd %s && mv %s %s ", full.SaveDir, full.ResultFullbackup[0].BackupFile, DecompressDir) + mylog.Logger.Info("将备份文件mv到解压目录下 mvCmd:%s", mvCmd) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", mvCmd}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + } else if bkFileExt == "split" { + // 2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30000-20230311-214752.split.004 + backupFilesPrefix := strings.Split(full.ResultFullbackup[0].BackupFile, ".split")[0] + cmd01 = fmt.Sprintf("cat %s.* |tar x ", backupFilesPrefix) + mylog.Logger.Info("Decompressed cmd01:%s", cmd01) + } + if cmd01 != "" { + decDir01 := full.GetDecompressedDir() + mylog.Logger.Info("Decompressed: decDir01 is:%s", decDir01) + //将全备文件解压到指定目录下 + cmd01 = fmt.Sprintf("cd %s && %s", full.SaveDir, cmd01) + msg := fmt.Sprintf("解压命令:%s", cmd01) + mylog.Logger.Info(msg) + _, full.Err = util.RunLocalCmd("bash", []string{"-c", cmd01}, "", nil, 1800*time.Second) + if full.Err != nil { + return + } + isExists, isCompelete, msg := full.CheckDecompressedDirIsOK() + if full.Err != nil { + return + } + if isExists == false || isCompelete == false { + //如果不存在或不完整 + full.Err = errors.New(msg) + mylog.Logger.Error(full.Err.Error()) + return + } + //rm 源文件 + full.RmLocalBakcupFile() + } + return +} + +// PullFullbackDecompressed 拉取全备文件并解压,可重试 +// 1: 本地全备.tar, 全备(已解压)文件夹 均不存在 =>拉取、解压; +// 2. 本地全备.tar不存在、全备(已解压)文件夹 存在: +// - 全备(已解压)文件夹 完整 => 直接返回; +// - 全备(已解压)文件夹 不完整 => 删除全备(已解压)文件夹,重新拉取、解压; +// 3. 本地全备.tar存在、全备(已解压)文件夹 不存在: +// - 本地全备.tar 完整, => 解压; +// - 本地全备.tar 不完整 => 删除 本地全备.tar,重新拉取、解压; +// 4. 本地全备.tar存在、全备(已解压)文件夹 存在 +// - 本地全备.tar 完整 => 删除 全备(已解压)文件夹,重新解压(有理由怀疑上一次解压失败了,本地全备.tar 来不及删除) +// - 本地全备.tar 不完整 => 删除本地全备.tar + 删除 全备(已解压)文件夹, 重新拉取、解压; +// NOCC:golint/fnsize(设计如此) +func (full *TendisFullBackPull) PullFullbackDecompressed() { + + // 备份文件 (未解压) + localBkIsExists, localBkIsCompelete, _ := full.CheckLocalBackupFileIsOK() + if full.Err != nil { + return + } + mylog.Logger.Info("localBkIsExists:%v,localBkIsCompelete:%v ", localBkIsExists, localBkIsCompelete) + // 已解压的备份文件 + decpDirIsExists, decpIsCompelete, _ := full.CheckDecompressedDirIsOK() + if full.Err != nil { + return + } + mylog.Logger.Info("decpDirIsExists:%v,decpIsCompelete:%v", decpDirIsExists, decpIsCompelete) + + //1: 本地全备.tar, 全备(已解压)文件夹 均不存在 =>报错,需要flow重新下载; + if localBkIsExists == false && decpDirIsExists == false { + full.RetryDownloadFiles() + if full.Err != nil { + return + } + + } else if localBkIsExists == false && decpDirIsExists == true { + //2. 本地全备.tar不存在、全备(已解压)文件夹 存在: + //- 全备(已解压)文件夹 完整 => 直接返回; + //- 全备(已解压)文件夹 不完整 => 删除全备(已解压)文件夹,报错,需要flow重新下载; + if decpIsCompelete == true { + return + } + full.RmDecompressedDir() + if full.Err != nil { + return + } + full.RetryDownloadFiles() + if full.Err != nil { + return + } + + } else if localBkIsExists == true && decpDirIsExists == false { + //3. 本地全备.tar存在、全备(已解压)文件夹 不存在: + //- 本地全备.tar 完整, => 解压; + //- 本地全备.tar 不完整 => 删除 本地全备.tar,报错,需要flow重新下载;; + if localBkIsCompelete == true { + full.Decompressed() + return + } + full.RmLocalBakcupFile() + if full.Err != nil { + return + } + full.RetryDownloadFiles() + if full.Err != nil { + return + } + + } else if localBkIsExists == true && decpDirIsExists == true { + //4. 本地全备.tar存在、全备(已解压)文件夹 存在 + //- 本地全备.tar 完整 => 删除 全备(已解压)文件夹,重新解压(有理由怀疑上一次解压失败了,本地全备.tar 来不及删除) + //- 本地全备.tar 不完整 => 删除本地全备.tar + 删除 全备(已解压)文件夹, 报错,需要flow重新下载;; + if localBkIsCompelete == true { + full.RmDecompressedDir() + if full.Err != nil { + return + } + full.Decompressed() + return + } + full.RmDecompressedDir() + if full.Err != nil { + return + } + full.RmLocalBakcupFile() + if full.Err != nil { + return + } + full.RetryDownloadFiles() + if full.Err != nil { + return + } + return + } + +} + +// RestoreBackup 在目标tendisplus上执行restorebackup命令 +// 参数backupDir: 代表从目标tendisplus来看,全备的位置 +// (其实 参数backupDir 和 full.SaveLocalDir full.SaveRemoteDir是同一个文件夹, 但是是不同视角) +func (full *TendisFullBackPull) RestoreBackup(dstTendisIP string, dstTendisPort int, dstTendisPasswd string) error { + + redisAddr := fmt.Sprintf("%s:%s", dstTendisIP, strconv.Itoa(dstTendisPort)) + msg := fmt.Sprintf("master:%s开始导入全备", redisAddr) + mylog.Logger.Info(msg) + //再次探测tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, dstTendisPasswd, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + defer redisCli.Close() + + if full.ResultFullbackup[0].ClusterMeataDir == "" { + err = fmt.Errorf("全备文件夹不存在,请检查:%s", full.ResultFullbackup[0].ClusterMeataDir) + mylog.Logger.Error(err.Error()) + return err + + } + mylog.Logger.Info("full.ResultFullbackup[0].ClusterMeataDir:%s", full.ResultFullbackup[0].ClusterMeataDir) + //这里会强制(force)恢复全备,检查tendisplus是否为空需要自己完成 + restoreCmd := fmt.Sprintf("redis-cli -h %s -p %d -a %s restorebackup all %s force", + dstTendisIP, dstTendisPort, dstTendisPasswd, full.ResultFullbackup[0].ClusterMeataDir) + logCmd := fmt.Sprintf("redis-cli -h %s -p %d -a xxxx restorebackup all %s force", + dstTendisIP, dstTendisPort, full.ResultFullbackup[0].ClusterMeataDir) + mylog.Logger.Info("开始恢复全备,恢复命令:%s", logCmd) + + ret01, err := util.RunLocalCmd("bash", []string{"-c", restoreCmd}, "", nil, 600*time.Second) + mylog.Logger.Info("恢复全备执行结果:%v", ret01) + if err != nil { + mylog.Logger.Error(fmt.Sprintf("恢复全备失败,详情:%v", err)) + return err + } + ret01 = strings.TrimSpace(ret01) + if strings.Contains(ret01, "ERR:") == true { + mylog.Logger.Error(fmt.Sprintf("恢复全备失败,err:%v,cmd:%s", err, logCmd)) + + return err + } + msg = fmt.Sprintf("%s:%d 恢复全备成功", dstTendisIP, dstTendisPort) + mylog.Logger.Info(msg) + + return nil +} + +// GetTendisplusHearbeatKey 根据tendisplus ip port 获取心跳key +func (full *TendisFullBackPull) GetTendisplusHearbeatKey(masterIP string, masterPort int) string { + Heartbeat := fmt.Sprintf("%s_%s:heartbeat", masterIP, strconv.Itoa(masterPort)) + return Heartbeat +} + +// ClusterMeta 全备的meta信息 +type ClusterMeta struct { + Slot string `json:"slot"` + Flag string `json:"flag"` + ConfigEpoch int `json:"configEpoch"` + CurrentEpoch int `json:"currentEpoch"` + LastVoteEpoch int `json:"lastVoteEpoch"` +} + +// GetClusterMeata 从解压的目录中读取clustermeta.txt文件信息 +func (task *TendisInsRecoverTask) GetClusterMeata() (meta *ClusterMeta, err error) { + // 新增逻辑,在不执行binlog相关的代码时,这里会报错 + // "msg":"task.BackupFileDir: 为空,请检查RestoreBackup功能处的解压和赋值情况" + task.BackupFileDir = task.FullBackup.LocalFullBackupDir + mylog.Logger.Info("task BackupFileDir:%s", task.BackupFileDir) + // 上面2行为新增逻辑, + if task.BackupFileDir == "" { + err = fmt.Errorf("task.BackupFileDir:%s 为空,请检查RestoreBackup功能处的解压和赋值情况", task.BackupFileDir) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + metaFile := filepath.Join(task.RecoverDir, task.BackupFileDir, "clustermeta.txt") + _, err = os.Stat(metaFile) + if err != nil { + err = fmt.Errorf("%s os.Stat fail,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return + } + fileData, err := os.ReadFile(metaFile) + if err != nil { + err = fmt.Errorf("读取clusterMeta文件:%s失败,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return + } + task.runtime.Logger.Info("clustermeta:%s,fileData:%s", metaFile, fileData) + meta = &ClusterMeta{} + fileLines := strings.Split(string(fileData), "\n") + for _, line := range fileLines { + line = strings.TrimSpace(line) + list01 := strings.Split(line, ":") + if len(list01) == 0 { + continue + } + if len(list01) < 2 { + continue + } + if list01[0] == "slot" { + meta.Slot = list01[1] + } else if list01[0] == "flag" { + meta.Flag = list01[1] + } else if list01[0] == "configEpoch" { + meta.ConfigEpoch, _ = strconv.Atoi(list01[1]) + } else if list01[0] == "currentEpoch" { + meta.CurrentEpoch, _ = strconv.Atoi(list01[1]) + } else if list01[0] == "lastVoteEpoch" { + meta.LastVoteEpoch, _ = strconv.Atoi(list01[1]) + } + } + if meta.Slot == "" { + err = fmt.Errorf("读取clusterMeta文件:%s失败,meta.Slot(%s)信息为空", metaFile, meta.Slot) + task.runtime.Logger.Error(err.Error()) + return + } + return +} + +// RocksdbBackupMeta Rocksdb 备份元数据 +type RocksdbBackupMeta struct { + BackupType int `json:"backupType"` + BinlogPos uint64 `json:"binlogpos"` + StartTimeSec int64 `json:"startTimeSec"` + StartTime time.Time `json:"startTime"` + EndTimeSec int64 `json:"endTimeSec"` + EndTime time.Time `json:"endTime"` + UseTimeSec int `json:"useTimeSec"` + BinlogVersion int `json:"binlogVersion"` +} + +// GetRocksdbBackupMeta 获取全备中某个kvstore(rocksdb)的元数据信息 +func (task *TendisInsRecoverTask) GetRocksdbBackupMeta(rocksIdx int) (meta *RocksdbBackupMeta, err error) { + task.runtime.Logger.Info("GetRocksdbBackupMeta start ... ") + // 解压后的文件和文件名有关,在RestoreBackup 中确定 + // 直接赋值测试 + // task.BackupFileDir = "/data/dbbak/recover_redis/2005000194-TENDISPLUS-FULL-slave-127.0.0.x-30010-20230311-214730" + task.BackupFileDir = task.FullBackup.LocalFullBackupDir + mylog.Logger.Info("task BackupFileDir:%s", task.BackupFileDir) + if task.BackupFileDir == "" { + err = fmt.Errorf("task.BackupFileDir:%s 为空,请检查RestoreBackup功能处的解压和赋值情况", task.BackupFileDir) + task.runtime.Logger.Error(err.Error()) + return + } + metaFile := filepath.Join(task.RecoverDir, task.BackupFileDir, strconv.Itoa(rocksIdx), "backup_meta") + _, err = os.Stat(metaFile) + if err != nil { + err = fmt.Errorf("%s os.Stat fail,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return + } + task.runtime.Logger.Info("backup_meta metaFile:%s", metaFile) + fileData, err := os.ReadFile(metaFile) + if err != nil { + err = fmt.Errorf("读取backup_meta文件:%s失败,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return + } + meta = &RocksdbBackupMeta{} + err = json.Unmarshal(fileData, meta) + if err != nil { + err = fmt.Errorf("GetRocksdbBackupMeta json.Unmarshal fail,err:%v,fileData:%s", err, string(fileData)) + task.runtime.Logger.Error(err.Error()) + return + } + if meta.StartTimeSec <= 0 { + err = fmt.Errorf("读取backup_meta文件:%s失败,meta.StartTimeSec(%d)<=0", metaFile, meta.StartTimeSec) + task.runtime.Logger.Error(err.Error()) + return + } + meta.StartTime = time.Unix(meta.StartTimeSec, 0) + meta.EndTime = time.Unix(meta.EndTimeSec, 0) + return + +} + +// RecoverTredisFromRocksdb 恢复目标tendis ssd +// (其实 参数backupDir 和 full.SaveLocalDir full.SaveRemoteDir是同一个文件夹, 但是是不同视角) +// NOCC:golint/fnsize(设计如此) +func (full *TendisFullBackPull) RecoverTredisFromRocksdb(dstTendisIP string, + dstTendisPort int, dstTendisPasswd string) error { + + redisAddr := fmt.Sprintf("%s:%s", dstTendisIP, strconv.Itoa(dstTendisPort)) + msg := fmt.Sprintf("master:%s开始导入全备", redisAddr) + mylog.Logger.Info(msg) + //再次探测tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, dstTendisPasswd, 0, consts.TendisTypeTendisSSDInsance) + if err != nil { + return err + } + defer redisCli.Close() + + var infoRet map[string]string + infoRet, full.Err = redisCli.Info("server") + if full.Err != nil { + return full.Err + } + masterVersion := infoRet["redis_version"] + mylog.Logger.Info("Get redis_version success redis_version:%s", masterVersion) + + var ssdDataDir string + ssdDataDir, full.Err = redisCli.GetDir() + if full.Err != nil { + return full.Err + } + // "Get SsdDataDir success SsdDataDir:/data1/redis/15000/data" + mylog.Logger.Info("Get SsdDataDir success SsdDataDir:%s", ssdDataDir) + + //1、shutdown + err = redisCli.Shutdown() + if err != nil { + return err + } + mylog.Logger.Info("master(%s) shutdown success", redisAddr) + + if full.LocalFullBackupDir == "" { + err = fmt.Errorf("全备文件夹不存在,请检查:%s", full.LocalFullBackupDir) + mylog.Logger.Error(err.Error()) + return err + + } + mylog.Logger.Info("full.LocalFullBackupDir:%s", full.LocalFullBackupDir) + + fullFilePath := fmt.Sprintf("%v/%v", full.SaveDir, full.LocalFullBackupDir) + if _, err := os.Stat(fullFilePath); os.IsNotExist(err) { + err = fmt.Errorf("全备文件夹不存在,请检查:%s", full.LocalFullBackupDir) + mylog.Logger.Error(err.Error()) + return err + } + + DepsDir := "/usr/local/redis/bin/deps" + if _, err := os.Stat(DepsDir); os.IsNotExist(err) { + err = fmt.Errorf("%s:不存在,请检查:%s", DepsDir, DepsDir) + mylog.Logger.Error(err.Error()) + return err + } + + nowtime := time.Now().Local().Format(consts.FilenameTimeLayout) + rockdbDir := filepath.Join(ssdDataDir, "rocksdb") + bakDir := filepath.Join(filepath.Dir(ssdDataDir), "backup_rocksdb."+nowtime) + // 2、mv 掉本地的数据,mv 到备份目录 + mvCmd := fmt.Sprintf("mv %s %s", rockdbDir, bakDir) + mylog.Logger.Info(mvCmd) + util.RunBashCmd(mvCmd, "", nil, 2*time.Hour) + util.LocalDirChownMysql(bakDir) + + // 3、备份文件恢复 + var extraOpt string + if strings.Contains(masterVersion, "v1.2") { + extraOpt = " 1" + } else if strings.Contains(masterVersion, "v1.3") { + extraOpt = "" + } else { + full.Err = fmt.Errorf("unsupported tendis version:%s,exit.", masterVersion) + mylog.Logger.Error(full.Err.Error()) + return full.Err + } + restoreTool := full.getRestoreTool(dstTendisIP, masterVersion, dstTendisPort) + if full.Err != nil { + return full.Err + } + + restoreCmd := fmt.Sprintf(` + export LD_PRELOAD=%s/libjemalloc.so + export LD_LIBRARY_PATH=LD_LIBRARY_PATH:%s + %s %s %s %s + `, DepsDir, DepsDir, restoreTool, fullFilePath, rockdbDir, extraOpt) + mylog.Logger.Info(restoreCmd) + + var ret string + ret, full.Err = util.RunLocalCmd("bash", []string{"-c", restoreCmd}, "", nil, 2*time.Hour) + mylog.Logger.Info("restore command result:" + ret) + if full.Err != nil { + mylog.Logger.Error(fmt.Sprintf("恢复全备失败,详情:%v", err)) + return full.Err + } + + if util.FileExists(rockdbDir) { + mylog.Logger.Info("restore ok, %s generated", rockdbDir) + } else { + full.Err = fmt.Errorf("restore command failed, %s not generated", rockdbDir) + mylog.Logger.Error(full.Err.Error()) + return full.Err + } + util.LocalDirChownMysql(rockdbDir) + + ret01 := strings.TrimSpace(ret) + if strings.Contains(ret01, "ERR:") == true { + mylog.Logger.Error(fmt.Sprintf("恢复全备失败,err:%v,cmd:%s", err, restoreCmd)) + return full.Err + } + + // 4、拉起节点 + startScript := filepath.Join("/usr/local/redis/bin", "start-redis.sh") + _, full.Err = util.RunLocalCmd("su", []string{consts.MysqlAaccount, "-c", startScript + " " + strconv.Itoa( + dstTendisPort)}, "", nil, 30*time.Second) + if full.Err != nil { + return full.Err + } + mylog.Logger.Info(fmt.Sprintf("su %s -c \"%s\"", consts.MysqlAaccount, + startScript+" "+strconv.Itoa(dstTendisPort))) + time.Sleep(2 * time.Second) + + //再次探测tendisplus连接性->拉起是否成功 + redisCli, err = myredis.NewRedisClient(redisAddr, dstTendisPasswd, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + defer redisCli.Close() + + msg = fmt.Sprintf("%s:%d 恢复全备成功", dstTendisIP, dstTendisPort) + mylog.Logger.Info(msg) + + return nil +} + +func (full *TendisFullBackPull) getRestoreTool(dstTendisIP, masterVersion string, dstTendisPort int) (restoreTool string) { + + if strings.Contains(masterVersion, "v1.2.") { + restoreTool = "/usr/local/redis/bin/rr_restore_backup" + } else if strings.Contains(masterVersion, "v1.3.") { + restoreTool = "/usr/local/redis/bin/tredisrestore" + } else { + full.Err = fmt.Errorf("redisMaster(%s:%d) version:%s cannot find restore-tool", + dstTendisIP, dstTendisPort, masterVersion) + mylog.Logger.Error(full.Err.Error()) + return + } + if !util.FileExists(restoreTool) { + full.Err = fmt.Errorf("redis(%s) restore_tool:%s not exists", dstTendisIP, restoreTool) + mylog.Logger.Error(full.Err.Error()) + return + } + return +} + +// RecoverCacheRedisFromBackupFile 恢复目标tendis cache +// NOCC:golint/fnsize(其他) +func (full *TendisFullBackPull) RecoverCacheRedisFromBackupFile(sourceIP string, + sourcePort int, dstTendisIP string, dstTendisPort int, dstTendisPasswd string) { + + newRedisAddr := fmt.Sprintf("%s:%s", dstTendisIP, strconv.Itoa(dstTendisPort)) + oldnewRedisAddr := fmt.Sprintf("%s:%s", sourceIP, strconv.Itoa(sourcePort)) + msg := fmt.Sprintf("master:%s开始导入全备", newRedisAddr) + mylog.Logger.Info("RecoverCacheRedisFromBackupFile: start recover"+ + "redis:%s from redis:%s aof or rdb ... ", newRedisAddr, oldnewRedisAddr) + mylog.Logger.Info(msg) + //再次探测tendis连接性 + redisCli, err := myredis.NewRedisClient(newRedisAddr, dstTendisPasswd, 0, consts.TendisTypeRedisInstance) + if err != nil { + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + defer redisCli.Close() + + //1、检查全备文件是否存在 + if full.LocalFullBackupDir == "" { + err = fmt.Errorf("全备文件夹不存在,请检查:%s", full.LocalFullBackupDir) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + mylog.Logger.Info("full.LocalFullBackupDir:%s", full.LocalFullBackupDir) + + //全备解压完整目录 + fullFilePath := fmt.Sprintf("%v/%v", full.SaveDir, full.LocalFullBackupDir) + if _, err := os.Stat(fullFilePath); os.IsNotExist(err) { + err = fmt.Errorf("全备文件夹不存在,请检查:%s", full.LocalFullBackupDir) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + + // 2、停dbmon 作为整体在所有任务开始前操作(前置任务已完成) + + //3、shutdown 关闭节点 + mylog.Logger.Info("redis:%s begin to shutdown", newRedisAddr) + err = redisCli.Shutdown() + if err != nil { + mylog.Logger.Error("执行shutdown失败:err:%v", err) + full.Err = err + return + } + mylog.Logger.Info("master(%s) shutdown success", newRedisAddr) + + //4、 修改 配置文件appendonly 可以采用命令模式 先config set appendonly yes,在config rewrite 写入配置文件, + // 只是这样兼容不了以前的instance.conf 配置模式 + redisConfDir := filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), "redis.conf") + _, err = os.Stat(redisConfDir) + if err != nil && os.IsNotExist(err) { + redisConfDir = filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), "instance.conf") + _, err = os.Stat(redisConfDir) + if err != nil && os.IsNotExist(err) { + err := fmt.Errorf("没有找到redis.conf配置文件和instance.conf配置文件") + mylog.Logger.Error("recoverRedisFromAof failed 没有找到redis.conf配置文件和instance.conf配置文件") + full.Err = err + return + } + + } + mylog.Logger.Info("配置文件为:%s", redisConfDir) + + // 获取 appendonly 值 + getAppendonlyCmd := fmt.Sprintf(`grep -E '^appendonly' %s|awk '{print $2}'|head -1`, redisConfDir) + appendonly, err := util.RunBashCmd(getAppendonlyCmd, "", nil, 10*time.Minute) + if err != nil { + mylog.Logger.Error("get appendonly failed: %v", err) + full.Err = err + return + } + mylog.Logger.Info("appendonly:%s", appendonly) + var dataPath, backupFile, backupFilePath string + + if strings.Contains(full.ResultFullbackup[0].BackupFile, ".aof.zst") { + // 解压后文件 + backupFile = strings.Trim(full.ResultFullbackup[0].BackupFile, ".zst") + backupFilePath = filepath.Join(fullFilePath, backupFile) + dataPath = filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), "data", "appendonly.aof") + if appendonly != "yes" { + // 修改appendonly 值为yes ,用aof 文件拉起redis + modifyAppendonlyCmd := fmt.Sprintf("sed -i 's/appendonly no/appendonly yes/' %s", redisConfDir) + mylog.Logger.Info(modifyAppendonlyCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", modifyAppendonlyCmd}, "", nil, 10*time.Minute) + if err != nil { + err = fmt.Errorf("modify appendonly 失败,err:%v", err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + + } + // 如果存在原来的aof文件,则删除,一般是新部署的节点不会存在 + oldAofdir := filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), + "data", "appendonly.aof") + rmAofCmd := fmt.Sprintf("rm %s", oldAofdir) + _, err = os.Stat(oldAofdir) + if err == nil && !os.IsNotExist(err) { + mylog.Logger.Info("删除原来存在的aof文件:%s", rmAofCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", rmAofCmd}, "", nil, 10*time.Minute) + if err != nil { + err = fmt.Errorf("rm appendonly 失败,err:%v", err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + } + + } else if strings.Contains(full.ResultFullbackup[0].BackupFile, ".rdb") { + backupFile = full.ResultFullbackup[0].BackupFile + backupFilePath = filepath.Join(fullFilePath, backupFile) + dataPath = filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), "data", "dump.rdb") + if appendonly == "yes" { + mylog.Logger.Info("appendonly value is:%s,need modify appendonly=no to use rdb", appendonly) + // 修改appendonly 值为no ,用rdb 文件拉起redis + modifyAppendonlyCmd := fmt.Sprintf("sed -i 's/appendonly yes/appendonly no/' %s", redisConfDir) + mylog.Logger.Info(modifyAppendonlyCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", modifyAppendonlyCmd}, "", nil, 10*time.Minute) + if err != nil { + err = fmt.Errorf("modify appendonly 失败,err:%v", err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + } + + // 如果存在原来的rdb文件,则删除,用最新的rdb拉起 + oldRdbdir := filepath.Join(consts.GetRedisDataDir(), "redis", strconv.Itoa(dstTendisPort), "data", "dump.rdb") + rmRdbCmd := fmt.Sprintf("rm %s", oldRdbdir) + _, err = os.Stat(oldRdbdir) + if err == nil && !os.IsNotExist(err) { + mylog.Logger.Info("删除原来存在的dump.rdb文件:%s", rmRdbCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", rmRdbCmd}, "", nil, 10*time.Minute) + if err != nil { + err = fmt.Errorf("rm dump.rdb 失败,err:%v", err) + mylog.Logger.Error(err.Error()) + full.Err = err + return + } + } + + } + mylog.Logger.Info("dataPath:%s", dataPath) + + // 确保data 目录不为空 + if dataPath == "" { + err = fmt.Errorf("get dataPath failed,dataPath:%s", dataPath) + mylog.Logger.Error(err.Error()) + return + } + // 5、移动和重命名 备份文件 + util.LocalDirChownMysql(backupFilePath) + mvCmd := fmt.Sprintf("mv -f %s %s ", backupFilePath, dataPath) + mylog.Logger.Info("RecoverCacheRedisFromBackupFile: mvCmd:%s", mvCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", mvCmd}, "", nil, 10*time.Minute) + if err != nil { + err = fmt.Errorf("mv aof file failed,err:%v", err) + full.Err = err + mylog.Logger.Error(err.Error()) + return + } + + // 6、加载备份文件,拉起节点 + err = full.WaitForStartRedis(dstTendisIP, dstTendisPort, dstTendisPasswd) + if err != nil { + mylog.Logger.Error("WaitForStartRedis failed :%v", err) + full.Err = err + return + } + + //再次探测tendis连接性->拉起是否成功 + redisCli, err = myredis.NewRedisClient(newRedisAddr, dstTendisPasswd, 0, consts.TendisTypeRedisInstance) + if err != nil { + mylog.Logger.Error("NewRedisClient failed :%v", err) + full.Err = err + return + } + defer redisCli.Close() + // 7、拉起Dbmon 作为整体在所有任务结束后操作 (前置任务来完成) + + msg = fmt.Sprintf("%s:%d 恢复全备成功", dstTendisIP, dstTendisPort) + mylog.Logger.Info(msg) + + return +} + +// WaitForStartRedis 加载redis +func (full *TendisFullBackPull) WaitForStartRedis(dstTendisIP string, dstTendisPort int, dstTendisPasswd string) error { + + mylog.Logger.Info("WaitForStartRedis:start-redis.sh,addr:%s:%d", dstTendisIP, dstTendisPort) + // 加载备份文件,拉起节点 + startScript := filepath.Join(consts.UsrLocal, "redis", "bin", "start-redis.sh") + mylog.Logger.Info(fmt.Sprintf("su %s -c \"%s\"", + consts.MysqlAaccount, startScript+" "+strconv.Itoa(dstTendisPort))) + _, err := util.RunLocalCmd("su", []string{consts.MysqlAaccount, "-c", + startScript + " " + strconv.Itoa(dstTendisPort)}, "", nil, 20*time.Minute) + if err != nil { + err = fmt.Errorf("WaitForStartRedis failed:%v", err) + return err + } + time.Sleep(30 * time.Second) + + newRedisAddr := fmt.Sprintf("%s:%s", dstTendisIP, strconv.Itoa(dstTendisPort)) + retryTimeLimit := 6 + // 等待加载redis + for { + if retryTimeLimit == 0 { + break + } + // NewRedisClient 这里也会去ping + _, err = myredis.NewRedisClient(newRedisAddr, dstTendisPasswd, 0, consts.TendisTypeRedisInstance) + if err != nil { + if retryTimeLimit > 0 { + mylog.Logger.Warn("WaitForStartRedis info:%v", err) + retryTimeLimit-- + time.Sleep(10 * time.Second) + continue + } + mylog.Logger.Error("WaitForStartRedis fail newRedisAddr:%s,retry times:%d,err:%v", newRedisAddr, retryTimeLimit, err) + return err + } + mylog.Logger.Info("WaitForStartRedis finish success") + break + } + return nil + +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/rollback.go b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/rollback.go new file mode 100644 index 0000000000..a19ef48096 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/rollback.go @@ -0,0 +1,1279 @@ +package datastructure + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "dbm-services/redis/db-tools/dbactuator/models/myredis" + "dbm-services/redis/db-tools/dbactuator/mylog" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/jobruntime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +// TendisInsRecoverTask 节点数据构造任务 +type TendisInsRecoverTask struct { + SourceIP string `json:"source_ip"` + SourcePort int `json:"source_ports" ` + NeWTempIP string `json:"new_temp_ip" ` + NewTmpPort int `json:"new_temp_ports"` + NewTmpPassword string `json:"new_tmp_password"` + RecoveryTimePoint string `json:"recovery_time_point"` + BackupFileDir string `json:"backup_file_dir"` // 解压后文件 + RecoverDir string `json:"recoverDir"` // 备份目录 + BackupFile string `json:"backup_file"` // 备份文件名 + FullBackup *TendisFullBackPull `json:"fullBackup"` // cache、ssd、plus 全备 + IncrBackup *TplusIncrBackPull `json:"incrBackup"` //tendisplus binlog + SSDIncrBackup *TredisRocksDBIncrBack `json:"ssdIncrBackup"` //ssd binlog + + TendisType string `json:"tendis_type"` + IsIncludeSlave bool `json:"is_include_slave"` + KvstoreNums int `json:"kvstore_nums"` + MasterVersion string `json:"master_version"` // 确定ssd 加载全备工具版本 + RestoreTool string `json:"restore_tool"` // ssd 加载全备工具 + SsdDataDir string `json:"ssd_data_dir"` // ssd 数据目录 + DepsDir string `json:"deps_dir"` // /usr/local/redis/bin/deps + redisCli *myredis.RedisClient + runtime *jobruntime.JobGenericRuntime + Err error `json:"-"` + FullFileList []FileDetail `json:"full_file_list"` //全备文件列表 + BinlogFileList []FileDetail `json:"binlog_file_list" ` //增备文件列表 + +} + +// FileDetail 备份文件结果记录详情 +type FileDetail struct { + TaskID string `json:"task_id"` //任务ID,用于拉取备份文件 + Uptime string `json:"uptime"` //备份任务上报时间 + FileLastMtime string `json:"file_last_mtime"` // 文件最后修改时间 + SourceIP string `json:"source_ip"` //备份源IP + Size int `json:"size" validate:"required"` + FileTag string `json:"file_tag"` //文件类型 REDIS_FULL、REDIS_BINLOG + Status string `json:"status"` + FileName string `json:"file_name" validate:"required"` +} + +// NewTendisInsRecoverTask 新建数据构建任务 +func NewTendisInsRecoverTask(sourceIP string, sourcePort int, neWTempIP string, newTmpPort int, + newTmpPasswordsword, recoveryTimePoint, recoverDir, tendisType string, isIncludeSlave bool, + runtime *jobruntime.JobGenericRuntime, fullFileList []FileDetail, + binlogFileList []FileDetail) (task *TendisInsRecoverTask, err error) { + return &TendisInsRecoverTask{ + SourceIP: sourceIP, + SourcePort: sourcePort, + NeWTempIP: neWTempIP, + NewTmpPort: newTmpPort, + NewTmpPassword: newTmpPasswordsword, + RecoveryTimePoint: recoveryTimePoint, + RecoverDir: recoverDir, + TendisType: tendisType, + IsIncludeSlave: isIncludeSlave, + runtime: runtime, + FullFileList: fullFileList, + BinlogFileList: binlogFileList, + }, nil +} + +// GetRedisCli 获取redis连接 +func (task *TendisInsRecoverTask) GetRedisCli() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始获取master:%s的连接...", redisAddr) + task.runtime.Logger.Info(msg) + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + err = fmt.Errorf("获取连接失败:%v", err) + task.runtime.Logger.Error(err.Error()) + return err + } + task.runtime.Logger.Info("获取master:%s的连接成功", redisAddr) + task.redisCli = redisCli + return nil +} + +// GetRocksdbNum 获取tendisplus kvstore 个数 +func (task *TendisInsRecoverTask) GetRocksdbNum() (kvstorecounts int, err error) { + task.runtime.Logger.Info("GetRocksdbNum start ...") + + // 获取kvstore个数 + var kvstorecount string + kvstorecount, err = task.redisCli.GetKvstoreCount() + if err != nil { + err = fmt.Errorf("GetRocksdbNum GetKvstoreCount Err:%v", err) + task.runtime.Logger.Error(err.Error()) + return + } + task.runtime.Logger.Info("kvstorecount:%s", kvstorecount) + kvstorecounts, err = strconv.Atoi(kvstorecount) + if err != nil { + errMsg := fmt.Sprintf(" kvstorecount string to int failed err:%v", err) + task.runtime.Logger.Error(errMsg) + } + task.KvstoreNums = kvstorecounts + return +} + +// PrecheckTendis tendis 前置检查 +func (task *TendisInsRecoverTask) PrecheckTendis() error { + + task.runtime.Logger.Info("Precheck:检查链接是否可用") + // 检查tendis 是否可连接,是否在使用中 + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + replInfo, err := task.redisCli.Info("replication") + if err != nil { + return err + } + role, _ := replInfo["role"] + + // 校验角色是否是master + if role != consts.RedisMasterRole { + err = fmt.Errorf("Precheck failed: target tendis:%s role:%s !=master", redisAddr, role) + task.runtime.Logger.Error(err.Error()) + return err + } + task.runtime.Logger.Info("%s: role:%s", redisAddr, role) + + //校验集群是否有业务在使用 + isUsing, cmds, err := task.redisCli.IsRedisUsing("redis-cli ", 10*time.Second) + if err != nil { + err = fmt.Errorf("Precheck failed: target tendis:%s isUsing:%v", redisAddr, err) + return err + } + if isUsing == true { + err = fmt.Errorf("Precheck failed: target tendis:%s is in use
cmds:%s", redisAddr, strings.Join(cmds, "
")) + return err + } + task.runtime.Logger.Info("target tendis:%s no using", redisAddr) + + return nil + +} + +// ClearAllData 清理目标集群数据 +func (task *TendisInsRecoverTask) ClearAllData() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始清理master:%s数据(fluashall)", redisAddr) + task.runtime.Logger.Info(msg) + + cmd := []string{consts.TendisPlusFlushAllRename} + result, err := task.redisCli.DoCommand(cmd, 0) + if err != nil { + return err + } + + if !strings.Contains(result.(string), "OK") { + err = fmt.Errorf("flush all master[%s]", redisAddr) + task.runtime.Logger.Error(err.Error()) + return err + } + + msg = fmt.Sprintf("清理master:%s数据(fluashall)完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// ClusterResetMaster 断开目的回档节点和集群的联系(cluster reset) +func (task *TendisInsRecoverTask) ClusterResetMaster() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始断开master:%s与集群的联系(cluster reset)...", redisAddr) + task.runtime.Logger.Info(msg) + + err := task.redisCli.ClusterReset() + if err != nil { + return err + } + time.Sleep(5 * time.Second) //sleep 2 seconds + //检查确实与集群断开联系 + runningMasters, err := task.redisCli.GetRunningMasters() + if err != nil { + return err + } + if len(runningMasters) != 1 { + err = fmt.Errorf("master:%s cluster reset fail,running master count:%d > 1", + redisAddr, len(runningMasters)) + str, _ := task.redisCli.GetClusterNodesStr() + task.runtime.Logger.Error("cluster nodes%v,err:%v", str, err) + + } + msg = fmt.Sprintf("断开master:%s与集群的联系(cluster reset)成功", redisAddr) + task.runtime.Logger.Info(msg) + + return nil + +} + +// StopSlave 断开slave到master的同步关系 +func (task *TendisInsRecoverTask) StopSlave() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始断开slave到master:%s的同步关系...", redisAddr) + task.runtime.Logger.Info(msg) + + //找到目标tendisplus 的slave + slaveNodeList, err := task.redisCli.GetAllSlaveNodesByMasterAddr(redisAddr) + if err != nil && util.IsNotFoundErr(err) == false { + return err + } + if err != nil && util.IsNotFoundErr(err) == true { + msg = fmt.Sprintf("master:%s 没有发现连接的slave,无需断开slave连接", redisAddr) + task.runtime.Logger.Error(msg) + return err + } + for _, slaveNodeTmp := range slaveNodeList { + slaveNode01 := slaveNodeTmp + + msg = fmt.Sprintf("master:%s开始断开slave:%s同步关系", redisAddr, slaveNode01.Addr) + task.runtime.Logger.Info(msg) + + //断开同步关系 + newCli01, err := myredis.NewRedisClient(slaveNode01.Addr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + err = newCli01.ClusterReset() + if err != nil { + newCli01.Close() + return err + } + time.Sleep(5 * time.Second) + + //检查同步关系确实已断开 + infoData, err := newCli01.Info("replication") + if err != nil { + newCli01.Close() + return err + } + newCli01.Close() + role, _ := infoData["role"] + if role != "master" { + err = fmt.Errorf("%s 执行'cluster reset'失败,info replication结果role:%s,而不是master", slaveNode01.Addr, role) + task.runtime.Logger.Error(err.Error()) + return err + } + msg = fmt.Sprintf("master:%s 断开slave:%s同步成功,slave Role:%s", redisAddr, slaveNode01.Addr, role) + task.runtime.Logger.Info(msg) + } + + msg = fmt.Sprintf("master:%s 共断开%d个slave同步关系", redisAddr, len(slaveNodeList)) + task.runtime.Logger.Info(msg) + return nil +} + +// GetBackupFileExt 获取全备文件后缀 +func (task *TendisInsRecoverTask) GetBackupFileExt(backupFilePath string) (fileExt string, err error) { + fileExt = filepath.Ext(backupFilePath) + if fileExt == ".tar" || fileExt == ".tgz" { + return fileExt, nil + } else if strings.HasSuffix(backupFilePath, ".tar.gz") { + fileExt = ".tar.gz" + } else { + err = fmt.Errorf("无法解压全备文件:%s", backupFilePath) + task.runtime.Logger.Error(err.Error()) + return "", err + } + return fileExt, nil +} + +// GetDecompressedDir 获取 recoverDir 的值,全备解压目录 +// 如全备名是 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140.tar +// 则值为 3-TENDISPLUS-FULL-slave-127.0.0.x-30002-20230810-050140 +func (task *TendisInsRecoverTask) GetDecompressedDir() (decpDir string, err error) { + if task.BackupFileDir != "" { + return task.BackupFileDir, nil + } + err = fmt.Errorf("BackupFileDir:%s 没有复赋值", task.BackupFileDir) + task.runtime.Logger.Error(err.Error()) + return decpDir, err + +} + +// FindDstFileInDir 在指定文件夹下找到目标文件 +func (task *TendisInsRecoverTask) FindDstFileInDir(dir string, dstFile string) (dstFilePos string, err error) { + err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.Name() == dstFile { + dstFilePos = path + return nil + } + return nil + }) + if err != nil { + err = fmt.Errorf("findDstFileInDir filepath.Walk fail,err:%v,dir:%s dstFile:%s", err, dir, dstFile) + task.runtime.Logger.Error(err.Error()) + return "", err + } + if dstFilePos == "" { + info := fmt.Sprintf("the destination file was not found in dir,dstFile:%s,dir:%s", dstFile, dir) + task.runtime.Logger.Info(info) + return "", util.NewNotFoundErr() + } + return +} + +// CheckDecompressedDirIsOK 检查全备解压文件夹 是否存在,数据是否完整 +// 数据是否完整:通过判断是否有clustermeta.txt、${rocksdbIdx}/backup_meta文件来确认 +func (task *TendisInsRecoverTask) CheckDecompressedDirIsOK() (isExists, isCompelete bool, msg string) { + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg = fmt.Sprintf("开始检查全备(已解压)目录是否存在,是否完整") + task.runtime.Logger.Info(msg) + //测试tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return false, false, msg + } + defer redisCli.Close() + + isExists = false + isCompelete = false + + decpDir, err := task.GetDecompressedDir() + if err != nil { + return + } + + if _, err := os.Stat(decpDir); os.IsNotExist(err) { + msg = fmt.Sprintf("全备解压目录:%s 不存在", decpDir) + task.runtime.Logger.Info(msg) + return + } + isExists = true //解压目录存在 + var metaFile string + metaFile, err = task.FindDstFileInDir(decpDir, "clustermeta.txt") + if err != nil { + return + } + if _, err := os.Stat(metaFile); os.IsNotExist(err) { + //clustermeta.txt 不存在 + msg = fmt.Sprintf("全备解压目录:%s 中找不到 clustermeta.txt 文件", decpDir) + task.runtime.Logger.Info(msg) + isCompelete = false + return + } + ClusterMeataDir := filepath.Dir(metaFile) + + // 获取kvstore个数 + var kvstorecount string + kvstorecount, err = redisCli.GetKvstoreCount() + if err != nil { + err = fmt.Errorf("CheckDecompressedDirIsOK GetKvstoreCount Err:%v", err) + task.runtime.Logger.Error(err.Error()) + return + } + task.runtime.Logger.Info("kvstorecount:%s", kvstorecount) + kvstorecounts, err := strconv.Atoi(kvstorecount) + if err != nil { + errMsg := fmt.Sprintf("%s kvstorecount string to int failed err:%v", redisAddr, task.Err) + task.runtime.Logger.Error(errMsg) + } + + for i := 0; i < kvstorecounts; i++ { + rocksdbBackupMeta := filepath.Join(ClusterMeataDir, fmt.Sprintf("%d/backup_meta", i)) + if _, err := os.Stat(rocksdbBackupMeta); os.IsNotExist(err) { + msg = fmt.Sprintf("全备解压目录:%s/%d/backup_meta 找不到", decpDir, i) + task.runtime.Logger.Info(msg) + isCompelete = false + return + } + } + msg = fmt.Sprintf("解压目录存在且完整:%s", decpDir) + task.runtime.Logger.Info(msg) + //解压文件存在且是完整的 + return true, true, msg +} + +// Decompress 解压文件 +func (task *TendisInsRecoverTask) Decompress(fileName string) error { + + // 解压 .lzo 类型文件 + if strings.HasSuffix(fileName, ".lzo") { + // 检查 lzop 是否存在 + lzopBin := consts.LzopBin + _, err := os.Stat(lzopBin) + if err != nil && os.IsNotExist(err) { + task.runtime.Logger.Error("Decompress: 解压工具 lzop 不存在,"+ + "请检查 %s 是否存在 err:%v", consts.LzopBin, err) + task.runtime.Logger.Error(err.Error()) + return err + + } + // 解压 + DecompressCmd := fmt.Sprintf("%s -d %s", lzopBin, fileName) + task.runtime.Logger.Info("DecompressCmd:%s", DecompressCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", DecompressCmd}, "", nil, 10*time.Minute) + if err != nil { + task.runtime.Logger.Error("Decompress: 解压失败,请检查 %s 是否异常 err:%v", fileName, err) + return err + } + return nil + } + + var DecompressCmd string + bkFileExt, err := task.GetBackupFileExt(fileName) + if err != nil { + return err + } + if bkFileExt == ".tar" { + DecompressCmd = fmt.Sprintf("tar -xf %s", fileName) + } else if bkFileExt == ".tar.gz" || bkFileExt == ".tgz" { + DecompressCmd = fmt.Sprintf("tar -zxf %s", fileName) + } + + if DecompressCmd != "" { + + //将全备文件解压到指定目录下 + DecompressCmd = fmt.Sprintf("cd %s && %s -C %s", task.RecoverDir, DecompressCmd, task.RecoverDir) + msg := fmt.Sprintf("解压命令:%s", DecompressCmd) + task.runtime.Logger.Info(msg) + _, err = util.RunLocalCmd("bash", []string{"-c", DecompressCmd}, "", nil, 10*time.Minute) + if err != nil { + return err + } + if task.TendisType == consts.TendisTypeTendisplusInsance { + isExists, isCompelete, msg := task.CheckDecompressedDirIsOK() + if err != nil { + return err + } + if isExists == false || isCompelete == false { + //如果不存在或不完整 + err = errors.New(msg) + task.runtime.Logger.Error(err.Error()) + return err + } + + } else if task.TendisType == consts.TendisTypeTendisSSDInsance { + // todo + task.runtime.Logger.Info("检查tendis ssd 的全备解压文件是否有效") + decpDir, err := task.GetDecompressedDir() + if err != nil { + return err + } + task.FullBackup.tendisSSDBackupVerify(decpDir) + } + + // (测试先不删)删除 源文件 + err = task.RmLocalBakcupFile() + if err != nil { + return err + } + } + + return nil +} + +// RmLocalBakcupFile 删除本地全备(未解压)文件 +func (task *TendisInsRecoverTask) RmLocalBakcupFile() error { + bkFileFullPath := filepath.Join(task.RecoverDir, task.BackupFile) + if _, err := os.Stat(bkFileFullPath); os.IsNotExist(err) { + return err + } + rmCmd := fmt.Sprintf("cd %s && rm -rf %s 2>/dev/null", task.RecoverDir, task.BackupFile) + _, err := util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if err != nil { + return err + } + msg := fmt.Sprintf("本地全备(未解压):%s 删除成功", task.BackupFile) + task.runtime.Logger.Info(msg) + return nil +} + +// RecoverClusterSlots 恢复tendisplus slots信息 +// 依据全备clustermeta.txt文件中slot:xxx-xxxx信息,cluster addslot +func (task *TendisInsRecoverTask) RecoverClusterSlots() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始恢复master:%s slots信息", redisAddr) + task.runtime.Logger.Info(msg) + + fullClusterMeta, err := task.GetClusterMeata() + if err != nil { + return err + } + msg = fmt.Sprintf("redisAddr:%s全备中slots:%s", redisAddr, fullClusterMeta.Slot) + task.runtime.Logger.Info(msg) + + slotList, _, _, _, err := myredis.DecodeSlotsFromStr(fullClusterMeta.Slot, "") + if err != nil { + return err + } + _, err = task.redisCli.ClusterAddSlots(slotList) + if err != nil { + return err + } + msg = fmt.Sprintf("恢复master:%s slots信息:%s 完成", redisAddr, fullClusterMeta.Slot) + task.runtime.Logger.Info(msg) + return nil +} + +// RecoverSlave 恢复slave同步关系 +// NOCC:golint/fnsize(设计如此) +func (task *TendisInsRecoverTask) RecoverSlave() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始恢复slave到master:%s的同步关系...", redisAddr) + task.runtime.Logger.Info(msg) + + //获取master的nodeiD + var rbTenplusNodeData *myredis.ClusterNodeData = nil + _, err := task.redisCli.GetClusterNodes() + if err != nil { + return err + } + clusterNodes, err := task.redisCli.GetAddrMapToNodes() + if err != nil { + return err + } + rbTenplusNodeData, ok := clusterNodes[redisAddr] + if ok == false { + err = fmt.Errorf("获取%s cluster nodes信息失败,结果为空", redisAddr) + str01, _ := task.redisCli.GetClusterNodesStr() + task.runtime.Logger.Info("cluster nodes:%v", str01) + task.runtime.Logger.Error(err.Error()) + return err + } + msg = fmt.Sprintf("master:%s 对应NodeID:%s", redisAddr, rbTenplusNodeData.NodeID) + task.runtime.Logger.Info(msg) + + // 从恢复目录的cluster_nodes.txt获取slave信息,cluster_nodes.txt是任务开始时生成的 + slaveNodes, err := task.GetTendisSlaveNodes(redisAddr) + if err != nil { + err = fmt.Errorf("master:%s 从cluster_nodes.txt中没有找到任何slave", redisAddr) + task.runtime.Logger.Error(err.Error()) + return err + } + + msg = fmt.Sprintf("master:%s 从cluster nodes中共找到%d个slave", redisAddr, len(slaveNodes)) + task.runtime.Logger.Info(msg) + maxRetryTimes := 10 //最多重试10次 + isOK := false + for _, slaveNode01 := range slaveNodes { + slaveNodeItem := slaveNode01 + slaveAddr := slaveNodeItem.Addr + slaveCli02, err := myredis.NewRedisClient(slaveAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + msg = fmt.Sprintf("master:%s 'cluster meet' slave:%s", redisAddr, slaveAddr) + task.runtime.Logger.Info(msg) + + list01 := strings.Split(slaveAddr, ":") + //cluster meet slave + _, err = task.redisCli.ClusterMeet(list01[0], list01[1]) + if err != nil { + slaveCli02.Close() + return err + } + //确保slave 和 master已connected + idx := 0 + for ; idx < maxRetryTimes; idx++ { + time.Sleep(5 * time.Second) + _, err = slaveCli02.GetClusterNodes() + if err != nil { + return err + } + clusterNodes, err = slaveCli02.GetAddrMapToNodes() + if err != nil { + return err + } + _, isOK = clusterNodes[redisAddr] + if isOK == true { + msg = fmt.Sprintf("get master info success in slave after 'cluster meet',master:%s,slave:%s", + redisAddr, slaveAddr) + task.runtime.Logger.Info(msg) + break + } + msg = fmt.Sprintf("slave:%s still not connected master:%s", slaveAddr, redisAddr) + task.runtime.Logger.Info(msg) + str01, _ := slaveCli02.GetClusterNodesStr() + task.runtime.Logger.Info("print slave cluster nodes:%v", str01) + } + if isOK == false { + err = fmt.Errorf("slave cannot connect master after 'cluster meet',slave:%s,master:%s", + slaveAddr, redisAddr) + task.runtime.Logger.Error(err.Error()) + return err + } + msg = fmt.Sprintf("slave:%s 'cluster replicate' master nodeID:%s", slaveAddr, rbTenplusNodeData.NodeID) + task.runtime.Logger.Info(msg) + //cluster replicate + _, err = slaveCli02.ClusterReplicate(rbTenplusNodeData.NodeID) + if err != nil { + slaveCli02.Close() + return err + } + time.Sleep(5 * time.Second) + //检查同步确实恢复 + infoData, err := slaveCli02.Info("replication") + if err != nil { + slaveCli02.Close() + return err + } + slaveCli02.Close() + role, _ := infoData["role"] + if role != consts.RedisSlaveRole { + err = fmt.Errorf("%s 执行'cluster replicate %s'失败,info replication结果role:%s,而不是slave", + slaveAddr, rbTenplusNodeData.NodeID, role) + task.runtime.Logger.Error(err.Error()) + return err + } + msg = fmt.Sprintf("slave:%s 'info replication'=>role:%s", slaveAddr, role) + task.runtime.Logger.Info(msg) + } + msg = fmt.Sprintf("master:%s成功恢复%d个slave同步关系", redisAddr, len(slaveNodes)) + task.runtime.Logger.Info(msg) + return nil +} + +// GetClusterNodes 从备份文件目录获取clusternode信息,从而获取master的slaves信息 +func (task *TendisInsRecoverTask) GetClusterNodes() (fileData []byte, err error) { + if task.RecoverDir == "" { + err = fmt.Errorf("task.RecoverDir:%s 为空,请检查RestoreBackup功能处的解压和赋值情况", task.RecoverDir) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + metaFile := filepath.Join(task.RecoverDir, "cluster_nodes.txt") + _, err = os.Stat(metaFile) + if err != nil { + err = fmt.Errorf("%s os.Stat fail,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + fileData, err = os.ReadFile(metaFile) + if err != nil { + err = fmt.Errorf("读取cluster_nodes文件:%s失败,err:%v", metaFile, err) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + task.runtime.Logger.Info("cluster_nodes:%s,fileData:%s", metaFile, fileData) + + return fileData, nil +} + +// GetTendisSlaveNodes 从本地记录的cluster nodes中获得master的slave +func (task *TendisInsRecoverTask) GetTendisSlaveNodes(masterAddr string) ( + + slaveNodes []*myredis.ClusterNodeData, err error) { + fileData, err := task.GetClusterNodes() + if err != nil { + return nil, err + } + + nodesData, err := myredis.DecodeClusterNodes(string(fileData)) + if err != nil { + return nil, err + } + task.runtime.Logger.Info("get nodesData from cluster_nodes.txt success:%v", nodesData) + m01 := make(map[string]*myredis.ClusterNodeData) + for _, tmpItem := range nodesData { + infoItem := tmpItem + m01[infoItem.Addr] = infoItem + } + masterNode, ok := m01[masterAddr] + if ok == false { + err = fmt.Errorf("not found master node:%s", masterAddr) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + if masterNode.Role != consts.RedisMasterRole { + err = fmt.Errorf("node:%s not a master(role:%s)", masterAddr, masterNode.Role) + task.runtime.Logger.Error(err.Error()) + return nil, err + } + for _, info01 := range m01 { + infoItem := info01 + // NOCC:tosa/linelength(其他) + if infoItem.Role == consts.RedisSlaveRole && infoItem.LinkState == consts.RedisLinkStateConnected && infoItem.MasterID == masterNode.NodeID { + msg := fmt.Sprintf("master:%s 找到一个slave:%s ", masterAddr, infoItem.Addr) + task.runtime.Logger.Info(msg) + slaveNodes = append(slaveNodes, infoItem) + } + } + if len(slaveNodes) == 0 { + msg := fmt.Sprintf("master:%s 没有找到任何slave信息", masterAddr) + task.runtime.Logger.Info(msg) + err = util.NewNotFoundErr() + task.runtime.Logger.Error(err.Error()) + return nil, err + } + task.runtime.Logger.Info("master:%s, get slaveNodes from cluster_nodes.txt success,slaveNodes:%v", + masterAddr, slaveNodes) + + return slaveNodes, nil + +} + +// PullFullbackup 校验全备 +func (task *TendisInsRecoverTask) PullFullbackup() error { + fullBack := &TendisFullBackPull{} + if task.TendisType == consts.TendisTypeTendisplusInsance { + // 节点维度的 + // 查询时过滤正则 + filename := fmt.Sprintf("TENDISPLUS-FULL-slave-%s-%d", task.SourceIP, task.SourcePort) + task.runtime.Logger.Info("filename:%s", filename) + kvstoreNums, err := task.GetRocksdbNum() + if err != nil { + return err + } + fullBack = NewFullbackPull(task.SourceIP, filename, task.RecoveryTimePoint, + task.NeWTempIP, task.RecoverDir, kvstoreNums, task.TendisType) + if fullBack.Err != nil { + return fullBack.Err + } + // + task.runtime.Logger.Info("Fullbackup fullBack.FileHead :%s", fullBack.FileHead) + + } else if task.TendisType == consts.TendisTypeTendisSSDInsance { + filename := fmt.Sprintf("TENDISSSD-FULL-slave-%s-%d", task.SourceIP, task.SourcePort) + task.runtime.Logger.Info("filename:%s", filename) + fullBack = NewFullbackPull(task.SourceIP, filename, task.RecoveryTimePoint, + task.NeWTempIP, task.RecoverDir, 0, task.TendisType) + if fullBack.Err != nil { + return fullBack.Err + } + + } else if task.TendisType == consts.TendisTypeRedisInstance { + + filename := fmt.Sprintf("%s-%d", task.SourceIP, task.SourcePort) + task.runtime.Logger.Info("需要匹配 filename:%s", filename) + fullBack = NewFullbackPull(task.SourceIP, filename, task.RecoveryTimePoint, + task.NeWTempIP, task.RecoverDir, 0, task.TendisType) + if fullBack.Err != nil { + return fullBack.Err + } + task.FullBackup = fullBack + } + + task.FullBackup = fullBack + //对传入的全备份文件进行校验 + task.runtime.Logger.Info("Fullbackup task.FullBackup.FileHead :%s", task.FullBackup.FileHead) + + // 校验节点维度的所有文件信息 + task.FullBackup.GetTendisFullbackNearestRkTime(task.FullFileList) + if task.FullBackup.Err != nil { + return task.FullBackup.Err + } + // 备份文件解压 + task.FullBackup.PullFullbackDecompressed() + if task.FullBackup.Err != nil { + return task.FullBackup.Err + } + return nil +} + +// RestoreFullbackup 导入全备 +func (task *TendisInsRecoverTask) RestoreFullbackup() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("master:%s开始导入全备", redisAddr) + task.runtime.Logger.Info(msg) + //再次探测tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + defer redisCli.Close() + + task.FullBackup.RestoreBackup(task.NeWTempIP, task.NewTmpPort, task.NewTmpPassword) + if task.FullBackup.Err != nil { + task.Err = task.FullBackup.Err + return err + } + msg = fmt.Sprintf("master:%s导入全备完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// PullIncrbackup 拉取增备 +func (task *TendisInsRecoverTask) PullIncrbackup() { + task.runtime.Logger.Info("PullIncrbackup start...") + + // 节点维度的 + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + fileName := fmt.Sprintf("binlog-%s-%d", task.SourceIP, task.SourcePort) + task.runtime.Logger.Info("fileName:%s", fileName) + // 节点维度增备信息:fileName 过滤,task.SourceIP 备份的源IP + incrBack := NewTplusIncrBackPull(fileName, task.SourceIP) + if incrBack.Err != nil { + task.Err = incrBack.Err + return + } + layout := "2006-01-02 15:04:05" + rbDstTime, _ := time.ParseInLocation(layout, task.RecoveryTimePoint, time.Local) + //回档目标时间 比 用户填写的时间多1秒 + //(因为binlog_tool的--end-datetime参数,--end-datetime这个时间点的binlog是不会被应用的) + rbDstTime = rbDstTime.Add(1 * time.Second) + task.runtime.Logger.Info("回档目标时间 rbDstTime:%v", rbDstTime) + // 获取kvstore个数 + var kvstorecount string + kvstorecount, err := task.redisCli.GetKvstoreCount() + if err != nil { + err = fmt.Errorf("PullIncrbackup GetKvstoreCount Err:%v", err) + task.runtime.Logger.Error(err.Error()) + return + } + task.runtime.Logger.Info("kvstorecount:%s", kvstorecount) + kvstorecounts, err := strconv.Atoi(kvstorecount) + if err != nil { + errMsg := fmt.Sprintf("%s kvstorecount string to int failed err:%v", redisAddr, task.Err) + task.runtime.Logger.Error(errMsg) + } + for i := 0; i < kvstorecounts; i++ { + //每个rocksdb全备的startTimeSec是不一样的(所以其拉取的增备范围也是不一样的) + //其对应的startTimeSec可以从全备文件中获取到 + //其对应的startPos也是不同的,从全备中获取 + backupMeta, err := task.GetRocksdbBackupMeta(i) + if err != nil { + task.Err = err + return + } + // task.runtime.Logger.Info("kvstore:%d ,backupMeta:%v", i, backupMeta) + // kvstore 维度的 的拉取备份文件任务,每个kvstore都是一个任务,因为kvstore的开始时间不一样 + incrBack.NewRocksDBIncrBack(i, backupMeta.BinlogPos+1, backupMeta.StartTime.Local().Format(layout), + rbDstTime.Local().Format(layout), task.NeWTempIP, task.RecoverDir, task.RecoverDir) + if incrBack.Err != nil { + task.Err = incrBack.Err + return + } + } + task.IncrBackup = incrBack + task.runtime.Logger.Info("IncrBackup,特定节点的增备信息:%v", task.IncrBackup) + // 获取节点维度的备份信息 + task.IncrBackup.GetAllIncrBacksInfo(task.BinlogFileList) + if task.IncrBackup.Err != nil { + task.Err = incrBack.Err + return + } + // 检查节点维度的所有binlog文件是否在存在 + task.IncrBackup.CheckAllBinlogFiles() + if task.IncrBackup.Err != nil { + task.Err = task.IncrBackup.Err + return + } + // 解压所有备份文件 + task.IncrBackup.Decompressed() + if task.IncrBackup.Err != nil { + task.Err = task.IncrBackup.Err + return + } + return +} + +// ImportIncrBackup 导入binlog +func (task *TendisInsRecoverTask) ImportIncrBackup() error { + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("master:%s开始导入增备(binlog)", redisAddr) + task.runtime.Logger.Info(msg) + //再次探测tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + task.Err = err + return task.Err + } + defer redisCli.Close() + + task.IncrBackup.ImportBinlogsToTplus(task.NeWTempIP, task.NewTmpPort, task.NewTmpPassword) + if task.Err != nil { + task.Err = task.IncrBackup.Err + return task.Err + } + msg = fmt.Sprintf("master:%s导入增备(binlog)完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// GetTendisplusHearbeatKey 根据tendisplus 节点信息获取心跳key +func (task *TendisInsRecoverTask) GetTendisplusHearbeatKey(masterIP string, masterPort int) string { + Heartbeat := fmt.Sprintf("%s_%s:heartbeat", masterIP, strconv.Itoa(masterPort)) + return Heartbeat +} + +// CheckRollbackResult check rollback result is ok +func (task *TendisInsRecoverTask) CheckRollbackResult() error { + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("CheckRollbackResult: master:%s开始检查回档结果是否正确", redisAddr) + task.runtime.Logger.Info(msg) + // 获取redis连接 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + task.Err = err + return task.Err + } + defer redisCli.Close() + // 检查目的集群是否有源集群的心跳数据 + srcHearbeatKey := task.GetTendisplusHearbeatKey(task.SourceIP, task.SourcePort) + srcNodeHearbeat, err := redisCli.GetTendisplusHeartbeat(srcHearbeatKey) + if err != nil { + task.Err = err + return task.Err + } + + srcRedisAddr := fmt.Sprintf("%s:%s", task.SourceIP, strconv.Itoa(task.SourcePort)) + if len(srcNodeHearbeat) == 0 { + msg = fmt.Sprintf("源tendisplus:%s 没有心跳写入,跳过回档结果校验", srcRedisAddr) + mylog.Logger.Info(msg) + return task.Err + } + kvstoreNums, err := task.GetRocksdbNum() + if err != nil { + task.Err = err + return task.Err + } + + rollbackDstTime, _ := time.ParseInLocation(consts.UnixtimeLayout, task.RecoveryTimePoint, time.Local) + var hearbeatVal time.Time + var ok bool + var errList []string + + for i := 0; i < kvstoreNums; i++ { + if hearbeatVal, ok = srcNodeHearbeat[i]; ok == false { + msg = fmt.Sprintf("源tendisplus:%s rocksdbid:%d 没有心跳写入", srcRedisAddr, i) + mylog.Logger.Warn(msg) + return task.Err + } + symbol := "" + if rollbackDstTime.Sub(hearbeatVal).Minutes() > 10 { + symbol = "<" + } else if rollbackDstTime.Sub(hearbeatVal).Minutes() < -10 { + symbol = ">" + } + if symbol != "" { + msg = fmt.Sprintf("目的tendisplus:%s 源tendisplus:%s rocksdbid:%d 回档到时间:%s %s 目的时间:%s", + redisAddr, srcRedisAddr, i, symbol, + hearbeatVal.Local().Format(consts.UnixtimeLayout), + rollbackDstTime.Local().Format(consts.UnixtimeLayout)) + errList = append(errList) + mylog.Logger.Error(msg) + continue + } + msg = fmt.Sprintf("目的tendisplus:%s 源tendisplus:%s rocksdbid:%d 回档到时间:%s =~ 目的时间:%s", + redisAddr, srcRedisAddr, i, + hearbeatVal.Local().Format(consts.UnixtimeLayout), + rollbackDstTime.Local().Format(consts.UnixtimeLayout)) + mylog.Logger.Info(msg) + } + if len(errList) > 0 { + task.Err = fmt.Errorf("回档失败") + return task.Err + } + return nil +} + +// SSDPullIncrbackup ssd拉取增备 +func (task *TendisInsRecoverTask) SSDPullIncrbackup() { + task.runtime.Logger.Info("SSDPullIncrbackup start...") + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + fileName := fmt.Sprintf("binlog-%s-%d", task.SourceIP, task.SourcePort) + task.runtime.Logger.Info("Source fileName:%s,DstAddr:%s", fileName, redisAddr) + // 节点维度增备信息:fileName 过滤,task.SourceIP 备份的源IP + + layout := "2006-01-02 15:04:05" + rbDstTime, _ := time.ParseInLocation(layout, task.RecoveryTimePoint, time.Local) + //回档目标时间 比 用户填写的时间多1秒 + //(因为binlog_tool的--end-datetime参数,--end-datetime这个时间点的binlog是不会被应用的) + rbDstTime = rbDstTime.Add(1 * time.Second) + task.runtime.Logger.Info("回档目标时间 rbDstTime:%v", rbDstTime) + + //传入全备份开始时间和回档时间 + // startTime 拉取增备的开始时间 -> 全备份的开始时间 + // endTime 拉取增备份的结束时间 -> 回档时间 + ssdIncrBackup := NewTredisRocksDBIncrBack(fileName, task.SourceIP, task.FullBackup.ResultFullbackup[0].StartPos, + task.FullBackup.ResultFullbackup[0].BackupStart.Local().Format(layout), + rbDstTime.Local().Format(layout), task.NeWTempIP, task.RecoverDir, task.RecoverDir, task.RecoveryTimePoint) + if ssdIncrBackup.Err != nil { + task.Err = ssdIncrBackup.Err + return + } + + task.SSDIncrBackup = ssdIncrBackup + task.runtime.Logger.Info("ssdIncrBackup,特定节点的增备信息:%v", task.SSDIncrBackup) + // 获取节点维度的备份信息 + task.SSDIncrBackup.GetTredisIncrbacksSpecRocks(task.BinlogFileList) + if task.SSDIncrBackup.Err != nil { + task.Err = ssdIncrBackup.Err + return + } + // 检验节点维度的所有binlog文件是否存在:解压和未解压的情况: + // 但是当缺失一个解压的时候,会把未解压的也删除了? + task.SSDIncrBackup.CheckAllBinlogFiles() + if task.SSDIncrBackup.Err != nil { + task.Err = task.SSDIncrBackup.Err + return + } + // 解压所有备份文件 + task.SSDIncrBackup.Decompressed() + if task.SSDIncrBackup.Err != nil { + task.Err = task.SSDIncrBackup.Err + return + } + return +} + +// SSDRestoreFullbackup 导入全备 +func (task *TendisInsRecoverTask) SSDRestoreFullbackup() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("master:%s start recover_tredis_from_rocksdb ...", redisAddr) + task.runtime.Logger.Info(msg) + //获取tendis ssd连接 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisSSDInsance) + if err != nil { + return err + } + + defer redisCli.Close() + + task.FullBackup.RecoverTredisFromRocksdb(task.NeWTempIP, task.NewTmpPort, task.NewTmpPassword) + if task.FullBackup.Err != nil { + task.Err = task.FullBackup.Err + return err + } + msg = fmt.Sprintf("master:%s导入全备完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// SSDImportIncrBackup 导入binlog +func (task *TendisInsRecoverTask) SSDImportIncrBackup() error { + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("master:%s开始导入增备(binlog)", redisAddr) + task.runtime.Logger.Info(msg) + //再次探测tendisplus连接性 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeTendisSSDInsance) + if err != nil { + task.Err = err + return task.Err + } + defer redisCli.Close() + + task.SSDIncrBackup.ImportAllBinlogToTredis(task.NeWTempIP, task.NewTmpPort, task.NewTmpPassword) + if task.Err != nil { + task.Err = task.IncrBackup.Err + return task.Err + } + msg = fmt.Sprintf("master:%s导入增备(binlog)完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// CacheRestoreFullbackup 导入全备 +func (task *TendisInsRecoverTask) CacheRestoreFullbackup() error { + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("master:%s start recover redis from aof/rdb ...", redisAddr) + task.runtime.Logger.Info(msg) + //获取tendis 连接 + redisCli, err := myredis.NewRedisClient(redisAddr, task.NewTmpPassword, 0, consts.TendisTypeRedisInstance) + if err != nil { + return err + } + + defer redisCli.Close() + // NOCC:tosa/linelength(其他) + task.FullBackup.RecoverCacheRedisFromBackupFile(task.SourceIP, task.SourcePort, task.NeWTempIP, task.NewTmpPort, task.NewTmpPassword) + if task.FullBackup.Err != nil { + task.Err = task.FullBackup.Err + return task.Err + } + msg = fmt.Sprintf("master:%s导入全备完成", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// getNeWTempIPClusterNodes 生成 cluster_nodes.txt 信息 +func (task *TendisInsRecoverTask) getNeWTempIPClusterNodes() error { + + redisAddr := fmt.Sprintf("%s:%s", task.NeWTempIP, strconv.Itoa(task.NewTmpPort)) + msg := fmt.Sprintf("开始获取master:%s的连接...", redisAddr) + task.runtime.Logger.Info(msg) + password, err := myredis.GetPasswordFromLocalConfFile(task.NewTmpPort) + if err != nil { + return err + } + // 验证节点是否可连接 + redisCli, err := myredis.NewRedisClient(redisAddr, password, 0, consts.TendisTypeTendisplusInsance) + if err != nil { + return err + } + defer redisCli.Close() + if task.RecoverDir == "" { + err := fmt.Errorf("task.RecoverDir为空,请赋值") + task.runtime.Logger.Error(err.Error()) + return err + } + // 获取前先检查是否存在 + clusterNodeInfoFile := filepath.Join(task.RecoverDir, "cluster_nodes.txt") + _, err = os.Stat(clusterNodeInfoFile) + //如存在先删除 + if err == nil { + mvCmd := fmt.Sprintf("cd %s && mv cluster_nodes.txt cluster_nodes_bak.txt", task.RecoverDir) + task.runtime.Logger.Info("mv cluster_nodes.txt文件:%s", mvCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", mvCmd}, "", nil, 600*time.Second) + if err != nil { + task.runtime.Logger.Error(fmt.Sprintf("mv cluster_nodes.txt文件失败,详情:%v", err)) + return err + } + } + + cmd := fmt.Sprintf("cd %s && redis-cli -h %s -p %d -a %s cluster nodes > cluster_nodes.txt", + task.RecoverDir, task.NeWTempIP, task.NewTmpPort, password) + logCmd := fmt.Sprintf("cd %s && redis-cli -h %s -p %d -a xxxx cluster nodes > cluster_nodes.txt", + task.RecoverDir, task.NeWTempIP, task.NewTmpPort) + task.runtime.Logger.Info("获取cluster nodes信息:%s", logCmd) + ret01, err := util.RunLocalCmd("bash", []string{"-c", cmd}, "", nil, 600*time.Second) + if err != nil { + task.runtime.Logger.Error(fmt.Sprintf("获取cluster nodes信息失败,详情:%v", err)) + return err + } + ret01 = strings.TrimSpace(ret01) + if strings.Contains(ret01, "ERR:") == true { + task.runtime.Logger.Error(fmt.Sprintf("获取cluster nodes信息失败,err:%v,cmd:%s", err, logCmd)) + + return err + } + msg = fmt.Sprintf("redisAddr:%s获取cluster nodes信息成功", redisAddr) + task.runtime.Logger.Info(msg) + return nil +} + +// Run 回档逻辑 +// NOCC:golint/fnsize(设计如此) +func (task *TendisInsRecoverTask) Run() { + + // tendis 前置检查:连接,是否在使用 + err := task.PrecheckTendis() + if err != nil { + task.Err = err + return + } + + if task.TendisType == consts.TendisTypeTendisplusInsance { + task.runtime.Logger.Info("开始Tendisplus 回档流程") + // 如果是集群包含slave得情况,获取临时集群的cluster nodes 信息 + if task.IsIncludeSlave { + err := task.getNeWTempIPClusterNodes() + if err != nil { + task.Err = err + return + } + } + + // 全备文件校验 + err := task.PullFullbackup() + if err != nil { + task.Err = err + return + } + // 增备文件校验 + task.PullIncrbackup() + if task.Err != nil { + task.Err = err + return + } + //清理数据,如果已经有部分数据,则会加载失败 + err = task.ClearAllData() + if err != nil { + task.Err = err + return + } + //停slave 断开同步,restorebackup的时候,用于恢复的目标实例不能是从属实例,同时用于恢复的目标实例不能有从属实例,否则会报错 + if task.IsIncludeSlave { + err = task.StopSlave() + if err != nil { + task.Err = err + return + } + + } + //重置集群,去掉集群和slots信息 + err = task.ClusterResetMaster() + if err != nil { + task.Err = err + return + } + // 加载全备 + err = task.RestoreFullbackup() + if err != nil { + task.Err = err + return + } + // 加载binlog + err = task.ImportIncrBackup() + if err != nil { + task.Err = err + return + } + // 回档结果校验 + err = task.CheckRollbackResult() + if err != nil { + task.Err = err + return + } + // 恢复master节点 slots信息(add slot) + err = task.RecoverClusterSlots() + if err != nil { + task.Err = err + return + } + //恢复slave关系 + if task.IsIncludeSlave { + err = task.RecoverSlave() + if err != nil { + task.Err = err + return + } + } + // 恢复集群关系,因为不知道哪些节点回档成功,所以在下发一个actuator 做:由flow传入所以参数 + + } else if task.TendisType == consts.TendisTypeTendisSSDInsance { + task.runtime.Logger.Info("开始Tendis SSD 回档流程") + // 全备文件校验 + err := task.PullFullbackup() + if err != nil { + task.Err = err + return + } + + // 增备文件校验 + task.SSDPullIncrbackup() + if task.Err != nil { + task.Err = err + return + } + // 加载全备 + err = task.SSDRestoreFullbackup() + if err != nil { + task.Err = err + return + } + // 加载binlog + err = task.SSDImportIncrBackup() + if err != nil { + task.Err = err + return + } + + } else if task.TendisType == consts.TendisTypeRedisInstance { + task.runtime.Logger.Info("开始Tendis Cache 回档流程") + + // 备份文件校验 + err := task.PullFullbackup() + if err != nil { + task.Err = err + return + } + + // 加载备份文件 + err = task.CacheRestoreFullbackup() + if err != nil { + task.Err = err + return + } + + } + + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisSSD_incrback.go b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisSSD_incrback.go new file mode 100644 index 0000000000..39af439570 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisSSD_incrback.go @@ -0,0 +1,1137 @@ +package datastructure + +import ( + "bufio" + "fmt" + "os" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + "time" + + "dbm-services/redis/db-tools/dbactuator/mylog" + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/customtime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +// TredisRocksDBIncrBackItem tendisSSD 指定rocksdb的增备信息项 +type TredisRocksDBIncrBackItem struct { + Incr int `json:"incr"` + NodeIP string `json:"node_ip"` + FileName string `json:"filename"` + BackupFile string `json:"backup_file"` + DecompressedFile string `json:"decompressedFile"` //解压后的文件名 + BinlogIdx int64 `json:"binlogIdx"` + BackupTaskid int64 `json:"backup_taskid"` // 任务ID + BackupSize int64 `json:"backup_size"` // 文件大小 + BinlogStartPos uint64 `json:"binlogStartPos"` + BinlogEndPos uint64 `json:"binlogEndPos"` + BackupStart customtime.CustomTime `json:"backup_start"` //binlog文件中获取,代表 上一个binlog文件最后一条binlog的时间 + BackupEnd customtime.CustomTime `json:"backup_end"` //备份文件上传备份系统成功时间 + +} + +// TredisRocksDBIncrBack tendisSSD 节点拉取增备 +type TredisRocksDBIncrBack struct { + FileName string `json:"filename"` + SourceIP string `json:"sourceIp"` + //保存文件的目录(如果是在k8s中,则代表node 上的dir) + SaveNodeDir string `json:"saveRemoteDir"` + //保存备份文件的本地目录 + + SaveMyDir string `json:"saveLocalDir"` + //保存文件的服务器(如果是k8s中,则代表node ip) + SaveHost string `json:"saveHost"` + StartTime time.Time `json:"startTime"` //拉取增备的起始时间 + EndTime time.Time `json:"endTime"` //拉取增备的结束时间 + // #./tredisbinlog logfile --start-datetime=1111 --stop-datetime=22222 --start-position=333333 + // --stop-position=55555 --keys=1,2,4,5,6,7,8,9 + + FullStartPos uint64 `json:"fullStartPos"` //回档导入增备时,--start-position 这里是全备文件传入的position + RecoveryTimePoint string `json:"recovery_time_point"` //回档导入增备时,--end-datetime + //每个rocksdb 最靠近(小于) startTime 的binlog, + //binlog的BackupStart时间小于startTime + PerRocksNearestStart *TredisRocksDBIncrBackItem + //每个rocksdb 最靠近(大于) endTime 的binlog + //binlog的BackupStart时间大于endTime + PerRocksNearestEnd *TredisRocksDBIncrBackItem + + //value: 每个rocksdb对应的binlog列表,按照文件index从小到大排序 + ResultSortBinlog []*TredisRocksDBIncrBackItem `json:"resultSortBinlog"` + //key: binlog file name + //value: 文件对应的binlog项 + ResultBinlogMap map[string]*TredisRocksDBIncrBackItem `json:"resultBinlogMap"` + + Err error `json:"-"` //错误信息 +} + +// NewTredisRocksDBIncrBack 新建tendisssd rocksdb的binlog拉取任务 +// FileName=fileName 过滤信息 +// sourceIP 查询 IP 源 +// startTime 拉取增备的开始时间 -> 全备份的开始时间 +// endTime 拉取增备份的结束时间 -> 回档时间 +func NewTredisRocksDBIncrBack(filename, sourceIP string, fullStartPos uint64, startTime, endTime, + saveHost, saveNodeDir, saveMyDir, recoveryTimePoint string) (ret *TredisRocksDBIncrBack) { + mylog.Logger.Info("NewTredisRocksDBIncrBack start ...") + + ret = &TredisRocksDBIncrBack{ + FileName: filename, + SourceIP: sourceIP, + SaveHost: saveHost, + SaveNodeDir: saveNodeDir, + SaveMyDir: saveMyDir, + FullStartPos: fullStartPos, + RecoveryTimePoint: recoveryTimePoint, + } + layout := "2006-01-02 15:04:05" + var err error + ret.StartTime, err = time.ParseInLocation(layout, startTime, time.Local) + if err != nil { + ret.Err = fmt.Errorf("startTime:%s time.parse fail,err:%s,layout:%s", startTime, err, layout) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + ret.EndTime, err = time.ParseInLocation(layout, endTime, time.Local) + if err != nil { + ret.Err = fmt.Errorf("endTime:%s time.parse fail,err:%s,layout:%s", endTime, err, layout) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + mylog.Logger.Info("StartTime:%s,EndTime:%s", ret.StartTime, ret.EndTime) + if ret.EndTime.Before(ret.StartTime) == true || ret.EndTime.Equal(ret.StartTime) == true { + ret.Err = fmt.Errorf("tendisssd binlog拉取,endtime:%s 小于等于 startTime:%s", + endTime, startTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + if ret.StartTime.After(time.Now()) == true { + //未来时间 + ret.Err = fmt.Errorf("binlogPull startTime:%s > time.Now()", startTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + if ret.EndTime.After(time.Now()) == true { + //未来时间 + ret.Err = fmt.Errorf("binlogPull endTime:%s > time.Now()", endTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + ret.ResultSortBinlog = []*TredisRocksDBIncrBackItem{} + ret.ResultBinlogMap = make(map[string]*TredisRocksDBIncrBackItem) + return +} + +// getSeqFromFile,获取文件中的序列号 +func (incr *TredisRocksDBIncrBack) getSeqFromFile(fpath string) uint64 { + mylog.Logger.Info("getSeqFromFile start ...") + DepsDir := "/usr/local/redis/bin/deps" + //获取文件第一行(包含序列号) + // firstline, err := exec.Command(filepath.Join(binPath, "tredisbinlog"), + // "--with-timestamp", "--with-seq", fpath).Output() + getSeqCmd := fmt.Sprintf(` + export LD_PRELOAD=%s/libjemalloc.so + export LD_LIBRARY_PATH=LD_LIBRARY_PATH:%s + %s --with-timestamp --with-seq %s + `, DepsDir, DepsDir, consts.TredisBinlogBin, fpath) + mylog.Logger.Info("获取 binlog 获取文件第一行(包含序列号),命令:%v", getSeqCmd) + firstline, err := util.RunLocalCmd("bash", []string{"-c", getSeqCmd}, "", nil, 1*time.Hour) + + if err != nil { + mylog.Logger.Error(fmt.Sprintf("解析binlog失败,详情:%v", err)) + incr.Err = err + return 0 + } + mylog.Logger.Info("解析binlog成功") + mylog.Logger.Debug("解析binlog成功,firstline:%v", firstline) + //如果获取到第一行 + if len(firstline) > 0 { + //将第一行按空格分割为三部分 + f := strings.Fields(string(firstline)) + //返回第二部分(序列号) + seq, err := strconv.Atoi(f[1]) + if err != nil { + mylog.Logger.Error(fmt.Sprintf("解析binlog,分割firstline失败,详情:%v", err)) + } + mylog.Logger.Info("getSeqFromFile file:%s seq:%d", fpath, seq) + return uint64(seq) + } + //如果未获取到第一行,返回-1 + return 0 +} + +// AddBinlogToMap 添加binlog项到 ResultBinlogMap,ResultSortBinlog中 +func (incr *TredisRocksDBIncrBack) AddBinlogToMap(item01 *TredisRocksDBIncrBackItem) { + if item01 == nil { + return + } + if _, ok := incr.ResultBinlogMap[item01.BackupFile]; ok == true { + //去重 + return + } + incr.ResultBinlogMap[item01.BackupFile] = item01 + incr.ResultSortBinlog = append(incr.ResultSortBinlog, item01) +} + +// GetTredisIncrbacks 查询特定端口的binlog备份文件 +// NOCC:golint/fnsize(设计如此) +func (incr *TredisRocksDBIncrBack) GetTredisIncrbacks(binlogFileList []FileDetail) (backs []*TredisRocksDBIncrBackItem) { + mylog.Logger.Info("GetTredisIncrbacks start ...") + layout := "2006-01-02 15:04:05" + mylog.Logger.Info("fileName:%s", incr.FileName) + // tredis示例: binlog-127.0.0.x-30000-7-0003612-20230326232536.log.zst + // ssd示例: binlog-127.0.0.x-30000-0000386-20230420021655.log.zst + + binlogReg := regexp.MustCompile(`^*?-(\d+)-(\d+)-(\d+).log.zst`) + layout1 := "20060102150405" + for _, str01 := range binlogFileList { + back01 := &TredisRocksDBIncrBackItem{} + taskID, _ := strconv.Atoi(str01.TaskID) + // size, _ := strconv.Atoi(str01.Size) + if taskID < 0 || str01.Size < 0 { + //backup_taskid 小于0 或backup_size 小于0的备份,是无效备份 + msg := fmt.Sprintf("filename:%s incrBackup:%s backupTaskid:%s<0 backupSize:%d<0 is invalid,skip...", + incr.FileName, str01.FileName, str01.TaskID, str01.Size) + mylog.Logger.Info(msg) + continue + } + back01.BackupTaskid, _ = strconv.ParseInt(str01.TaskID, 10, 64) + back01.BackupSize, _ = strconv.ParseInt(strconv.Itoa(str01.Size), 10, 64) + back01.BackupFile = str01.FileName + mylog.Logger.Info("BackupFile:%s", back01.BackupFile) + back01.NodeIP = str01.SourceIP + mylog.Logger.Info("BackupSize:%d", back01.BackupSize) + mylog.Logger.Debug("BackupTaskid:%d", back01.BackupTaskid) + match01 := binlogReg.FindStringSubmatch(str01.FileName) + + if len(match01) != 4 { + incr.Err = fmt.Errorf( + "filename:%s backup:%v format not correct,backupFile:%s cann't find rocksdbIdx/binlogIdx/createTime", + incr.FileName, back01, str01.FileName) + mylog.Logger.Error(incr.Err.Error()) + return + } + bkCreateTime, err01 := time.ParseInLocation(layout1, match01[3], time.Local) + if err01 != nil { + incr.Err = fmt.Errorf( + "backup file createTime:%s time.parese fail,err:%s,layout1:%s", + match01[3], err01, layout1) + mylog.Logger.Error(incr.Err.Error()) + return + } + + back01.BinlogIdx, _ = strconv.ParseInt(match01[2], 10, 64) + back01.BackupStart.Time = bkCreateTime //不要用backupStart值 + back01.BackupEnd.Time, err01 = time.ParseInLocation(layout, str01.FileLastMtime, time.Local) //文件最后修改时间 + if err01 != nil { + incr.Err = fmt.Errorf( + "backup file lastTime:%s time.parese fail,err:%s,layout:%s", + str01.FileLastMtime, err01, layout) + mylog.Logger.Error(incr.Err.Error()) + return + } + + // 过滤节点维度的文件,这里比较重要,因为flow传下来的是这台机器涉及到的所有节点信息, + // 这里是针对单节点的,所以需要过滤出来,这个值返回给前置函数 + if strings.Contains(back01.BackupFile, incr.FileName) { + backs = append(backs, back01) + } + } + mylog.Logger.Info("len(backs):%d", len(backs)) + mylog.Logger.Info("TredisRocksDBIncrBackItem:%v", backs[0]) + return +} + +// GetTredisIncrbacksSpecRocks 获取startTime~endTime时间段内的binlog +// NOCC:golint/fnsize(设计如此) +func (incr *TredisRocksDBIncrBack) GetTredisIncrbacksSpecRocks(binlogFileList []FileDetail) { + + // 获取startTime~endTime时间段内的binlog + // layout := "20060102" + layout02 := "2006-01-02 15:04:05" + //从备份列表中选择最靠近 startTime 的文件, + // nearestStartBk.BackupStart 小于等于 StartTime + var nearestStartBk *TredisRocksDBIncrBackItem = nil + //从备份列表中选择最靠近 endTime 的文件, + // nearestEndBk.BackupStart 大于等于 EndTime + var nearestEndBk *TredisRocksDBIncrBackItem = nil + //这里查询范围广一些,再过滤 + backs := incr.GetTredisIncrbacks(binlogFileList) + for _, bk01 := range backs { + bkItem := bk01 + //只需要那些BackupStart <= incr.StartTime 的binlog + if bkItem.BackupStart.Before(incr.StartTime) == true || + bkItem.BackupEnd.Equal(incr.StartTime) == true { + if nearestStartBk == nil { + // 第一次找到 BackupStart 小于 startTime 的备份 + nearestStartBk = bkItem + } else { + // nearestStartBk.BackupStart < 该备份BackupStart <= incr.StartTime + // 或者 + // nearestStartBk.BackupStart == 该备份BackupStart 同时 该备份BinlogIdx < nearestStartBk.BinlogIdx + // (同一时间大量写入时可能一秒钟生成多个binlog文件,此时同一秒生成的所有binlog都保留,所以 nearestStartBk.BinlogIdx是最小的) + + // 如binlog-127.0.0.x-30010-0-0002495-20230311124436.log.zst: BinlogIdx是0002495 + if bkItem.BackupStart.After(nearestStartBk.BackupStart.Time) == true || + (bkItem.BackupStart.Equal(nearestStartBk.BackupStart.Time) == true && + bkItem.BinlogIdx < nearestStartBk.BinlogIdx) { + nearestStartBk = bkItem + } + + } + } + + //只需要那些BackupStart >= incr.EndTime 的binlog + if bkItem.BackupStart.After(incr.EndTime) == true || + bkItem.BackupStart.Equal(incr.EndTime) == true { + if nearestEndBk == nil { + //第一次找到 BackupStart 大于等于 endTIme的备份 + nearestEndBk = bkItem + } else { + // incr.EndTime <= 该备份BackupStart < nearestEndBk.BackupStart. + // 或者 + // nearestEndBk.BackupStart == 该备份BackupStart 同时 该备份BinlogIdx > nearestStartBk.BinlogIdx + // (同一时间大量写入时可能一秒钟生成多个binlog文件,此时同一秒生成的所有binlog都保留,所以 nearestEndBk.BinlogIdx是最大的) + if bkItem.BackupStart.Before(nearestEndBk.BackupStart.Time) == true || + (bkItem.BackupStart.Equal(nearestEndBk.BackupStart.Time) == true && + bkItem.BinlogIdx > nearestEndBk.BinlogIdx) { + nearestEndBk = bkItem + } + } + } + + } + + if nearestStartBk == nil { + incr.Err = fmt.Errorf("filename:%s 向前%d天,没有找到时间 小于 startTime:%s的binlog", + incr.FileName, + + LastNDaysIncrBack(), + incr.StartTime.Local().Format(layout02)) + mylog.Logger.Error(incr.Err.Error()) + return + } + + msg := fmt.Sprintf("filename:%s 找到距离startTime:%s最近(小于)的binlog:%s,binlogStart:%s", + incr.FileName, + + incr.StartTime.Local().Format(layout02), + nearestStartBk.BackupFile, + nearestStartBk.BackupStart.Local().Format(layout02)) + mylog.Logger.Info(msg) + + if nearestEndBk == nil { + incr.Err = fmt.Errorf("filename:%s 向后%d天,没有找到时间大于endTime:%s的binlog", + incr.FileName, + + LastNDaysIncrBack(), + incr.EndTime.Local().Format(layout02)) + mylog.Logger.Error(incr.Err.Error()) + return + } + + msg = fmt.Sprintf("filename:%s 找到距离endTime:%s最近(大于)的binlog:%s,binglogEnd:%s", + incr.FileName, + + incr.EndTime.Local().Format(layout02), + nearestEndBk.BackupFile, + nearestEndBk.BackupStart.Local().Format(layout02)) + mylog.Logger.Info(msg) + + //成功获取到 nearestStartBk nearestEndBk,继续获取两者之间的binlog + start01 := nearestStartBk.BackupStart.Time + // end01 := nearestEndBk.BackupStart.Time + // 使用 最后一个binlog文件上传备份系统成功时间, 而不是 binlog 文件名中的时间(也就是binlog文件生成时间) + // 因为6月1日生成的binlog,有可能6月2日才上传成功 + // 而在dba redis中 或者 备份系统中 只有 6月2号的记录里面才能查询到该 binlog文件 + end01 := nearestEndBk.BackupEnd.Time + //start02 对应nearestStartBk.BackupStart 当天0点0分0秒 + //end02 对应nearestEndBk.BackupStart 当天0点0分0秒 + //我们需要将 start02 end02之间所有day的binlog都筛选到 + start02 := time.Date(start01.Year(), start01.Month(), start01.Day(), 0, 0, 0, 0, start01.Location()) + end02 := time.Date(end01.Year(), end01.Month(), end01.Day(), 0, 0, 0, 0, end01.Location()) + incr.AddBinlogToMap(nearestStartBk) + incr.AddBinlogToMap(nearestEndBk) + + incr.PerRocksNearestStart = nearestStartBk + incr.PerRocksNearestEnd = nearestEndBk + + for start02.Before(end02) == true || start02.Equal(end02) == true { + + backs := incr.GetTredisIncrbacks(binlogFileList) + + for _, bk01 := range backs { + bkItem := bk01 + if (bkItem.BackupStart.After(nearestStartBk.BackupStart.Time) == true || + bkItem.BackupStart.Equal(nearestStartBk.BackupStart.Time) == true) && + (bkItem.BackupStart.Before(nearestEndBk.BackupStart.Time) == true || + bkItem.BackupStart.Equal(nearestEndBk.BackupStart.Time) == true) { + incr.AddBinlogToMap(bkItem) + } + } + start02 = start02.Add(1 * 24 * time.Hour) + } + //按照binlog index排序 + sort.Slice(incr.ResultSortBinlog, func(i, j int) bool { + return incr.ResultSortBinlog[i].BinlogIdx < incr.ResultSortBinlog[j].BinlogIdx + }) + + incr.isGetAllBinlogInfo() + if incr.Err != nil { + return + } + return +} + +/* +判断binlog文件是否连续,是否重复; +- 重复则报错; +- 不连续则返回缺失的binlog index,如 2,3,5,8 则返回缺失的4,6,7 +*/ +func getTredisNotReadyBinlogs(sortBinlogs []*TredisRocksDBIncrBackItem) ([]string, error) { + var ret []string + var err error + preListIdx := 0 + preBinlogIdx := sortBinlogs[0].BinlogIdx + for idx, bin01 := range sortBinlogs { + binItem := bin01 + if idx == preListIdx { + //第一个元素忽略 + continue + } + if binItem.BinlogIdx <= preBinlogIdx { + //如果后面的binlog index小于等于前一个binlog index + err = fmt.Errorf("当前binlog index:%d <= 前一个binlog index:%d", binItem.BinlogIdx, preBinlogIdx) + mylog.Logger.Error(err.Error()) + mylog.Logger.Error(err.Error()) + return ret, err + } + if binItem.BinlogIdx == preBinlogIdx+1 { + //符合预期 + preBinlogIdx = binItem.BinlogIdx + continue + } + preBinlogIdx++ + for preBinlogIdx < bin01.BinlogIdx { + ret = append(ret, fmt.Sprintf("%d", preBinlogIdx)) + preBinlogIdx++ + } + } + return ret, nil +} + +/* +判断所需binlog文件信息是否已全部获取到; +- ResultSortBinlog 第二个binlog文件序号 必须 只比 第一个binlog 文件序号大1 +- ResultSortBinlog 倒数第一个binlog文件序号 必须 只比 倒数第二个binlog文件序号大 1 +- 最后一个文件序号 减去 第一个文件序号 等于 len(ResultSortBinlog)+1 +- ResultSortBinlog 第一个binlog.BackupStart必须小于 startTime, 第二个binlog.BackupStart必须大于 startTime +- ResultSortBinlog 最后一个binlog.BackupStart必须大于 endTime, 倒数第二个binlog.BackupStart必须小于 endTime +*/ +// NOCC:golint/fnsize(设计如此) +func (incr *TredisRocksDBIncrBack) isGetAllBinlogInfo() (ret bool) { + mylog.Logger.Info("isGetAllBinlogInfo start ...") + cnt := len(incr.ResultSortBinlog) + mylog.Logger.Info("ResultSortBinlog len:%d", cnt) + layout := "2006-01-02 15:04:05" + + if cnt < 2 { + //至少会包含两个binlog文件,第一个BackupStart小于 startTime, 第二个BackupStart 大于 endTime + str01 := "" + for _, bk01 := range incr.ResultSortBinlog { + str01 = fmt.Sprintf("%s,%s", str01, bk01.BackupFile) + } + incr.Err = fmt.Errorf( + "filename:%s 拉取[%s ~ %s]时间段的binlog,至少包含2个binglo,当前%d个binlog,详情:%s", + incr.FileName, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + cnt, str01) + mylog.Logger.Error(incr.Err.Error()) + mylog.Logger.Error(incr.Err.Error()) + return false + } + firstBinlog := incr.ResultSortBinlog[0] + secondBinlog := incr.ResultSortBinlog[1] + + lastBinlog := incr.ResultSortBinlog[cnt-1] + beforeLastBinlog := incr.ResultSortBinlog[cnt-2] + + if secondBinlog.BinlogIdx-firstBinlog.BinlogIdx != 1 { + incr.Err = fmt.Errorf( + "filename:%s 拉取[%s ~ %s]时间段的binlog,第一binlog:%s 和 第二binlog:%s 不连续", + incr.FileName, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + firstBinlog.BackupFile, secondBinlog.BackupFile, + ) + + mylog.Logger.Error(incr.Err.Error()) + return + } + if lastBinlog.BinlogIdx-beforeLastBinlog.BinlogIdx != 1 { + incr.Err = fmt.Errorf( + "filename:%s 拉取[%s ~ %s]时间段的binlog,倒数第二binlog:%s 和 倒数第一binlog:%s 不连续", + incr.FileName, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + beforeLastBinlog.BackupFile, lastBinlog.BackupFile, + ) + mylog.Logger.Error(incr.Err.Error()) + + return + } + //是否连续 + binIndexList, err := getTredisNotReadyBinlogs(incr.ResultSortBinlog) + if err != nil { + incr.Err = err + return false + } + if len(binIndexList) > 0 { + incr.Err = fmt.Errorf("缺失的binlog共%d个,缺失的binlog index是:%s", + len(binIndexList), strings.Join(binIndexList, ",")) + + mylog.Logger.Error(incr.Err.Error()) + return false + } + //第一个binlog.BackupStart必须小于等于 startTime,大于则报错 + if firstBinlog.BackupStart.After(incr.StartTime) == true { + incr.Err = fmt.Errorf( + "filename:%s ,第一个binog:%s,binlogStart:%s 大于startTime(全备时间):%s", + incr.FileName, + firstBinlog.BackupFile, + firstBinlog.BackupStart.Local().Format(layout), + incr.StartTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + + return false + } + //第二个binlog.BackupStart必须大于(等于) startTime,小于则报错 + for idx01 := 1; secondBinlog.BackupStart.Equal(firstBinlog.BackupStart.Time) == true; idx01++ { + //因为相同时间可能有多个binlog,所以跳过与 firstBinlog.BinlogEnd 相等的 + secondBinlog = incr.ResultSortBinlog[idx01] + } + if secondBinlog.BackupStart.Before(incr.StartTime) { + err = fmt.Errorf( + "filename:%s ,第二个binlog:%s,binlogStart:%s 时间小于startTime(全备时间):%s", + incr.FileName, + secondBinlog.BackupFile, + secondBinlog.BackupStart.Local().Format(layout), + incr.StartTime.Local().Format(layout)) + mylog.Logger.Error(err.Error()) + + return false + } + //倒数第二个binlog.BackupStart必须小于等于 endTime, 大于则报错 + for idx02 := cnt - 2; beforeLastBinlog.BackupStart.Equal(lastBinlog.BackupStart.Time) == true; idx02-- { + //因为相同时间可能有多个binlog,所以跳过与 lastBinlog.BinlogEnd 相等的 + beforeLastBinlog = incr.ResultSortBinlog[idx02] + } + if beforeLastBinlog.BackupStart.After(incr.EndTime) == true { + incr.Err = fmt.Errorf( + "filename:%s ,倒数第二个binlog:%s,binlogStart:%s 时间大于endTime(回档目标时间):%s", + incr.FileName, + beforeLastBinlog.BackupFile, + beforeLastBinlog.BackupStart.Local().Format(layout), + incr.EndTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + + return false + } + //最后一个binlog.BackupStart必须大于等于 endTime,小于则报错 + if lastBinlog.BackupStart.Before(incr.EndTime) == true { + incr.Err = fmt.Errorf( + "filename:%s ,最后一个binlog:%s,binlogStart:%s 时间小于endTime(回档目标时间):%s", + incr.FileName, + lastBinlog.BackupFile, + lastBinlog.BackupStart.Local().Format(layout), + incr.EndTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + return false + } + msg := fmt.Sprintf(`filename:%s找到所有[%s~%s]时间段的binlog, + 共%d个,第一个binlog:%s binlogStart:%s,最后一个binlog:%s binlogStart:%s`, + incr.FileName, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + cnt, + firstBinlog.BackupFile, + firstBinlog.BackupStart.Local().Format(layout), + lastBinlog.BackupFile, + lastBinlog.BackupStart.Local().Format(layout), + ) + mylog.Logger.Info(msg) + return +} + +// TotalSize 所有binlog所需磁盘空间大小 +func (incr *TredisRocksDBIncrBack) TotalSize() int64 { + var ret int64 = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + ret = ret + bkItem.BackupSize + } + return ret +} + +// GetBackupFileExt 获取备份文件后缀(如果后缀无法解压,及时报错) +func (incr *TredisRocksDBIncrBack) GetBackupFileExt( + item *TredisRocksDBIncrBackItem) (bkFileExt string) { + bkFileExt = filepath.Ext(item.BackupFile) + + okExt := map[string]bool{ + ".tar": true, + ".tgz": true, + ".gz": true, + ".zip": true, + ".lzo": true, + ".zst": true, + } + + if strings.HasSuffix(item.BackupFile, ".tar.gz") { + bkFileExt = ".tar.gz" + return + } else if _, ok := okExt[bkFileExt]; ok == true { + return bkFileExt + } else { + incr.Err = fmt.Errorf("无法解压的binlog文件:%s", item.BackupFile) + mylog.Logger.Error(incr.Err.Error()) + return + } +} + +// getDecompressedFile 获取解压文件,已经解压文件完整路径 +func (incr *TredisRocksDBIncrBack) getDecompressedFile( + item *TredisRocksDBIncrBackItem) (decpFile, decpFileFullPath string) { + var bkFileExt string = incr.GetBackupFileExt(item) + if incr.Err != nil { + return + } + item.DecompressedFile = strings.TrimSuffix(item.BackupFile, bkFileExt) + decpFile = item.DecompressedFile + decpFileFullPath = filepath.Join(incr.SaveMyDir, decpFile) + return +} + +// CheckLocalDecompressedFilesIsOk 检查本地 增备解压文件 是否ok +// 返回值: +// totalCnt: 全部增备(解压)文件个数 +// existsCnt: 本地存在的增备(解压)文件个数, existsList: 本地存在的增备(解压)文件详情 +func (incr *TredisRocksDBIncrBack) CheckLocalDecompressedFilesIsOk() ( + totalCnt, existsCnt int, existsList []*TredisRocksDBIncrBackItem, +) { + mylog.Logger.Info("CheckLocalDecompressedFilesIsOk start ...") + totalCnt = 0 + existsCnt = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + _, decpFileFullPath := incr.getDecompressedFile(bkItem) + if incr.Err != nil { + return + } + _, err := os.Stat(decpFileFullPath) + if os.IsNotExist(err) == true { + continue + } + existsCnt++ + existsList = append(existsList, bkItem) + } + return +} + +// rmLocalDecompressedFiles 删除一些本地 增备(已解压)文件 +func (incr *TredisRocksDBIncrBack) rmLocalDecompressedFiles(bkList []*TredisRocksDBIncrBackItem) { + mylog.Logger.Info("rmLocalDecompressedFiles start ... ") + rmCnt := 0 + for _, bk01 := range bkList { + bkItem := bk01 + if bkItem.DecompressedFile == "" { + continue + } + decpFileFullPath := filepath.Join(incr.SaveMyDir, bkItem.DecompressedFile) + if _, err := os.Stat(decpFileFullPath); os.IsNotExist(err) { + continue + } + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, bkItem.DecompressedFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + rmCnt++ + } + msg := fmt.Sprintf("共删除%d个本地binlog(已解压)文件", rmCnt) + mylog.Logger.Info(msg) + return +} + +// CheckLocalBackupfilesIsOk 检查本地增备文件是否全部ok +// 返回值: +// totalCnt: 所需的全部增备文件个数 +// existsCnt: 本地存在的增备文件个数, existsList: 本地存在的增备文件详情 +// sizeOKCnt: 本地存在的增备文件 大小ok 的个数 +func (incr *TredisRocksDBIncrBack) CheckLocalBackupfilesIsOk() ( + totalCnt, existsCnt, sizeOKCnt int, existsList []*TredisRocksDBIncrBackItem, +) { + totalCnt = 0 + existsCnt = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + incrBkFile := filepath.Join(incr.SaveMyDir, bkItem.BackupFile) + incrBkInfo, err := os.Stat(incrBkFile) + if os.IsNotExist(err) == true { + continue + } + existsCnt++ + existsList = append(existsList, bkItem) + if incrBkInfo.Size() == bkItem.BackupSize { + sizeOKCnt++ + } + } + return +} + +// rmLocalBackupFiles 删除一些本地 增备文件 +func (incr *TredisRocksDBIncrBack) rmLocalBackupFiles(bkList []*TredisRocksDBIncrBackItem) { + rmCnt := 0 + for _, bk01 := range bkList { + bkItem := bk01 + bkFileFullPath := filepath.Join(incr.SaveMyDir, bkItem.BackupFile) + if _, err := os.Stat(bkFileFullPath); os.IsNotExist(err) { + continue + } + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, bkItem.BackupFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + rmCnt++ + } + msg := fmt.Sprintf("共删除%d个本地binlog(未解压)文件", rmCnt) + mylog.Logger.Info(msg) + return +} + +// checkPulledFileOK 检查文件下载是否成功 +func (incr *TredisRocksDBIncrBack) checkPulledFileOK(item *TredisRocksDBIncrBackItem) (err error) { + + if incr.SaveMyDir != "" { + incrBkFile := filepath.Join(incr.SaveMyDir, item.BackupFile) + bkFileInfo, err := os.Stat(incrBkFile) + if err != nil { + err = fmt.Errorf("pod:%s 本地binlog文件:%s 信息获取失败,err:%v", + incr.FileName, incrBkFile, err) + mylog.Logger.Error(err.Error()) + return err + } + bkFileSize := bkFileInfo.Size() + if item.BackupSize != bkFileSize { + err = fmt.Errorf("本地binlog文件:%s 大小(%d) 不等于 redis备份记录大小:%d", + incrBkFile, bkFileSize, item.BackupSize) + mylog.Logger.Error(err.Error()) + return err + } + msg := fmt.Sprintf(" 本地binlog文件:%s 确认ok", incrBkFile) + mylog.Logger.Info(msg) + } + return nil +} + +// CheckAllPulledFilesOK 是否所有本地binlog都拉取ok +func (incr *TredisRocksDBIncrBack) CheckAllPulledFilesOK() { + mylog.Logger.Info("CheckAllPulledFilesOK start ... ") + errList := []string{} + successCnt := 0 + failCnt := 0 + totalCnt := 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + err := incr.checkPulledFileOK(bkItem) + if err != nil { + errList = append(errList, err.Error()) + } else { + successCnt++ + } + } + failCnt = len(errList) + if failCnt > 0 { + list01 := []string{} + //只打印前5条信息 + if failCnt > 5 { + list01 = errList[:5] + } else { + list01 = errList + } + incr.Err = fmt.Errorf( + " 检查本地binlog文件失败,成功%d个,失败%d个,共%d个,失败示例:%s", + successCnt, failCnt, totalCnt, strings.Join(list01, "\n"), + ) + mylog.Logger.Error(incr.Err.Error()) + return + } + msg := fmt.Sprintf( + " 检查本地binlog文件全部成功,成功%d个,失败%d个,共%d个", + successCnt, failCnt, totalCnt) + mylog.Logger.Info(msg) + + return +} + +// CheckAllBinlogFiles .. +// - 如果所有 增备(已解压)文件 全部存在,则直接return; +// - 如果所有 增备(未解压)文件 全部存在,且大小校验ok,则直接 return; +// - 否则删除 本地存在的增备(已解压)文件、增备(未解压)文件; +// - 继续拉取文件; +func (incr *TredisRocksDBIncrBack) CheckAllBinlogFiles() { + mylog.Logger.Info("CheckAllBinlogFiles start ... ") + // //检查拉取的文件是否ok,下面逻辑有检查,这部分是不是放在最开始, + // 但是这里只是检查未解压的,对于解压的还是得这个函数检查更全面,所以还需要这个函数功能嘛? + // incr.CheckAllPulledFilesOK() + var msg string + decpTotalCnt, decpExistsCnt, decpExistsList := incr.CheckLocalDecompressedFilesIsOk() + if incr.Err != nil { + return + } + if decpTotalCnt == decpExistsCnt { + msg = fmt.Sprintf("rollbackPod:%s 本地已存在%d个 增备(已解压文件),无需重新拉取增备文件...", + incr.FileName, decpTotalCnt) + mylog.Logger.Info(msg) + return + } + incr.rmLocalDecompressedFiles(decpExistsList) + if incr.Err != nil { + return + } + + localTotalCnt, localExistsCnt, sizeOkCnt, localExistsList := incr.CheckLocalBackupfilesIsOk() + if incr.Err != nil { + return + } + if localTotalCnt == localExistsCnt && localTotalCnt == sizeOkCnt { + msg = fmt.Sprintf("rollbackPod:%s 本地已存在%d个 增备(未解压文件),无需重新拉取增备文件...", + incr.FileName, localTotalCnt) + mylog.Logger.Info(msg) + return + } + mylog.Logger.Info("localExistsList:%v", localExistsList) + // 文件大小不一样,这里先注释 + // incr.rmLocalBackupFiles(localExistsList) + if incr.Err != nil { + return + } +} + +// DecompressedOne 解压一个binlog文件 +func (incr *TredisRocksDBIncrBack) DecompressedOne(item *TredisRocksDBIncrBackItem) { + var cmd string + var bkFileExt string = incr.GetBackupFileExt(item) + if incr.Err != nil { + return + } + if bkFileExt == ".tar" { + cmd = fmt.Sprintf("cd %s && tar -xf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".tar.gz" { + cmd = fmt.Sprintf("cd %s && tar -zxf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".tgz" { + cmd = fmt.Sprintf("cd %s && tar -zxf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".gz" { + cmd = fmt.Sprintf("cd %s && gunzip %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".zip" { + cmd = fmt.Sprintf("cd %s && unzip %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".lzo" { + cmd = fmt.Sprintf("cd %s && lzop -d %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".zst" { + cmd = fmt.Sprintf("cd %s && %s -d %s", + incr.SaveMyDir, consts.ZstdBin, item.BackupFile) + } + if cmd != "" { + var decpFileFullPath string + item.DecompressedFile, decpFileFullPath = incr.getDecompressedFile(item) + msg := fmt.Sprintf("binlog解压命令:%s", cmd) + mylog.Logger.Info(msg) + + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", cmd}, "", nil, 600*time.Second) + if incr.Err != nil { + return + } + _, err := os.Stat(decpFileFullPath) + if err != nil { + incr.Err = fmt.Errorf("解压binlog:%s => %s 失败,err:%v", + item.BackupFile, decpFileFullPath, err) + mylog.Logger.Error(incr.Err.Error()) + + return + } + msg = fmt.Sprintf("解压binlog:%s成功", item.BackupFile) + mylog.Logger.Info(msg) + + //rm 源文件 + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, item.BackupFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + msg = fmt.Sprintf("删除binlog源文件:%s完成", item.BackupFile) + mylog.Logger.Info(msg) + } +} + +// DecompressedAll 解压全部binlog文件 +func (incr *TredisRocksDBIncrBack) DecompressedAll() { + mylog.Logger.Info("DecompressedAll start ...") + if len(incr.ResultSortBinlog) == 0 { + incr.Err = fmt.Errorf( + "filename:%s binlog信息为空(len:%d),无法解压,请先获取binlog信息", + incr.FileName, len(incr.ResultSortBinlog)) + mylog.Logger.Error(incr.Err.Error()) + return + } + errList := []string{} + successCnt := 0 + failCnt := 0 + totalCnt := 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + incr.DecompressedOne(bkItem) + if incr.Err != nil { + errList = append(errList, incr.Err.Error()) + } else { + successCnt++ + } + } + failCnt = len(errList) + if failCnt > 0 { + list01 := []string{} + //只打印前5条信息 + if failCnt > 5 { + list01 = errList[:5] + } else { + list01 = errList + } + incr.Err = fmt.Errorf( + "解压pod:%s binlog文件失败,成功%d个,失败%d个,共%d个,失败示例:%s", + incr.FileName, successCnt, failCnt, totalCnt, strings.Join(list01, "\n"), + ) + mylog.Logger.Error(incr.Err.Error()) + return + } + msg := fmt.Sprintf("解压pod:%s binlog文件全部成功,成功%d个,失败%d个,共%d个", + incr.FileName, successCnt, failCnt, totalCnt) + mylog.Logger.Info(msg) + return +} + +// Decompressed .. +// 如果所有 增备(已解压)文件 全部存在,则直接return; +// 否则删除 本地存在的增备(已解压)文件; +// 继续执行解压; +func (incr *TredisRocksDBIncrBack) Decompressed() { + mylog.Logger.Info("DecompressedAllIfNotExists start .. ") + var msg string + decpTotalCnt, decpExistsCnt, decpExistsList := incr.CheckLocalDecompressedFilesIsOk() + if incr.Err != nil { + return + } + if decpTotalCnt == decpExistsCnt { + msg = fmt.Sprintf("rollbackPod:%s 本地已存在%d个 增备(已解压文件),无需执行解压...", + incr.FileName, decpTotalCnt) + mylog.Logger.Info(msg) + return + } + incr.rmLocalDecompressedFiles(decpExistsList) + if incr.Err != nil { + return + } + incr.DecompressedAll() +} + +// getNewResultSortBinlog 导入全部binlog +func (incr *TredisRocksDBIncrBack) getNewResultSortBinlog() { + mylog.Logger.Info("getNewResultSortBinlog start ...") + var first_incr *TredisRocksDBIncrBackItem + if len(incr.ResultSortBinlog) == 0 || len(incr.ResultSortBinlog) == 1 { + return + } else if len(incr.ResultSortBinlog) > 1 { + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + incrBackFile := filepath.Join(incr.SaveMyDir, bkItem.DecompressedFile) + // # binlog 的start_seq 小于全备份的seq 并且 binlog的end_seq 大于全备份seq :这样就找到了所有需要加载的binlog + // if ( $incr_list[$i]->{start_seq} <= $full_seq and $incr_list[$i]->{end_seq} >= $full_seq ) + // 查询下载的范围更大些 ,再通过bingseq 来决定加载的文件 ?(new_incr_list) 这里获取这个值,必须文件已经下载了才能获取得到 + seq := incr.getSeqFromFile(incrBackFile) + if seq <= 0 { + err := fmt.Errorf("获取到的seq%d<=0,不符合预期", seq) + mylog.Logger.Error(err.Error()) + + } + mylog.Logger.Info("getNewResultSortBinlog filename:%s seq:%d", incrBackFile, seq) + bkItem.BinlogStartPos = seq + + } + // 遍历ResultSortBinlog ,对end_seq赋值,前面已经校验过文件index的连续性和对此排序(GetTredisIncrbacksSpecRocks 函数里) + for i := 0; i < len(incr.ResultSortBinlog)-1; i++ { + incr.ResultSortBinlog[i].BinlogEndPos = incr.ResultSortBinlog[i+1].BinlogStartPos + // binlog 的start_seq 小于全备份的seq 并且 binlog的end_seq 大于全备份seq :这样就找到了第一个binlog文件 + // NOCC:tosa/linelength(设计如此) + if incr.ResultSortBinlog[i].BinlogStartPos <= incr.FullStartPos && incr.ResultSortBinlog[i].BinlogEndPos >= incr.FullStartPos { + first_incr = incr.ResultSortBinlog[i] + } + + } + var newResultSortBinlog []*TredisRocksDBIncrBackItem + // binlog 的start_seq 小于全备份的seq 并且 binlog的end_seq 大于全备份seq -》 第一个binlog文件 + if first_incr != nil { + for i := 0; i < len(incr.ResultSortBinlog); i++ { + //找到第一个文件后面的所有文件 + if incr.ResultSortBinlog[i].BinlogStartPos >= first_incr.BinlogStartPos { + newResultSortBinlog = append(newResultSortBinlog, incr.ResultSortBinlog[i]) + } + } + } + // 找到最后需要加载的所有binlog文件 + incr.ResultSortBinlog = newResultSortBinlog + + } + +} + +// ImportAllBinlogToTredis 导入全部binlog +func (incr *TredisRocksDBIncrBack) ImportAllBinlogToTredis(tplusIP string, tplusPort int, tplusPasswd string) { + mylog.Logger.Info("ImportAllBinlogToTredis start ...") + // 获取需要加载的binlog文件,之前的ResultSortBinlog是范围更大点的 + incr.getNewResultSortBinlog() + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + incr.ImportOneBinlogToTredis(tplusIP, tplusPort, tplusPasswd, bkItem) + if incr.Err != nil { + return + } + } + msg := fmt.Sprintf("filename:%s 共成功导入%d个binlog", + incr.FileName, len(incr.ResultSortBinlog)) + mylog.Logger.Info(msg) + return +} + +// ImportOneBinlogToTredis 导入一个binlog文件到tredis中 +// NOCC:golint/fnsize(设计如此) +func (incr *TredisRocksDBIncrBack) ImportOneBinlogToTredis(tplusIP string, tplusPort int, + tplusPasswd string, bkItem *TredisRocksDBIncrBackItem) { + mylog.Logger.Info("ImportOneBinlogToTredis start ... ") + DepsDir := "/usr/local/redis/bin/deps" + if _, err := os.Stat(DepsDir); os.IsNotExist(err) { + err = fmt.Errorf("目录不存在,请检查:%s", DepsDir) + mylog.Logger.Error(err.Error()) + incr.Err = err + return + } + + incrBackFile := filepath.Join(incr.SaveMyDir, bkItem.DecompressedFile) + incrBackFilePath := strings.TrimSuffix(incrBackFile, filepath.Ext(incrBackFile)) + + cmdfile := fmt.Sprintf("%s.cmd", incrBackFile) + outfile := fmt.Sprintf("%s.out", incrBackFile) + // incr.RecoveryTimePoint := "2022-01-01 00:00:00" // 待转换的字符串时间 + layout := "2006-01-02 15:04:05" // 字符串时间格式 + t, err := time.Parse(layout, incr.RecoveryTimePoint) + if err != nil { + err = fmt.Errorf("%s:时间转换失败,请检查:%v", incr.RecoveryTimePoint, err) + mylog.Logger.Error(err.Error()) + return + } + endtime := t.Unix() * 1000 // 转换为 Unix 时间戳,*1000 转为毫秒 + + restoreCmd := fmt.Sprintf(` + export LD_PRELOAD=%s/libjemalloc.so + export LD_LIBRARY_PATH=LD_LIBRARY_PATH:%s + %s --start-position=%d --end-datetime=%d %s >/%s + `, DepsDir, DepsDir, consts.TredisBinlogBin, incr.FullStartPos, endtime, incrBackFile, cmdfile) + + mylog.Logger.Info("解析binlog,命令:%v", restoreCmd) + ret01, err := util.RunLocalCmd("bash", []string{"-c", restoreCmd}, "", nil, 1*time.Hour) + if err != nil { + mylog.Logger.Error(fmt.Sprintf("解析binlog失败,详情:%v", err)) + incr.Err = err + return + } + ret01 = strings.TrimSpace(ret01) + if strings.Contains(ret01, "ERR:") == true { + mylog.Logger.Error(fmt.Sprintf("解析binlog失败,cmd:%s,err:%s", restoreCmd, ret01)) + incr.Err = fmt.Errorf("解析binlog失败") + return + } + //You can force human readable output when writing to a file or in pipe to other commands by using --no-raw. + // NOCC:tosa/linelength(设计如此) + importCmd := fmt.Sprintf("%s --no-raw --no-auth-warning -h %s -p %d -a %s < %s > %s", consts.RedisCliBin, tplusIP, tplusPort, + tplusPasswd, cmdfile, outfile) + mylog.Logger.Info("binlog 写入命令:%v", importCmd) + _, err = util.RunLocalCmd("bash", []string{"-c", importCmd}, "", nil, 1*time.Hour) + if err != nil { + mylog.Logger.Error(fmt.Sprintf("导入binlog 命令失败,详情:%v", err)) + incr.Err = err + return + } + ok_ret, err_ret, all_ret := 0, 0, 0 + ret := make(map[string]int) + + outF, _ := os.Open(filepath.Join(incrBackFilePath, outfile)) + scanner := bufio.NewScanner(outF) + for scanner.Scan() { + line := scanner.Text() + fields := strings.Split(line, " ") + f1 := fields[0] + + all_ret++ + + var reply_type string + first_char := string(f1[0]) + + if f1 == "OK" { + ok_ret++ + } else if f1 == "(error)" { + err_ret++ + } else if first_char == "\"" { + reply_type = "(string)" + ok_ret++ + } else if first_char == "(" { + reply_type = f1 + ok_ret++ + } else { + reply_type = "unknown" + err_ret++ + } + + ret[reply_type]++ + } + outF.Close() + + msg := "" + for k, v := range ret { + msg += fmt.Sprintf("'%s':%d,", k, v) + } + msg = strings.TrimSuffix(msg, ",") + + msg = (fmt.Sprintf("LOAD BINLOG %s, binlog count: %d, succ: %d, err: %d. detail: %s\n", + incrBackFilePath, all_ret, ok_ret, err_ret, msg)) + mylog.Logger.Info(msg) + if err_ret == 0 && all_ret > 0 { + mylog.Logger.Info("err_ret == 0 && all_ret > 0") + // 先注释测试,后续这些中间文件需要删除 + os.Remove(filepath.Join(incrBackFilePath, cmdfile)) + os.Remove(filepath.Join(incrBackFilePath, outfile)) + } + + mylog.Logger.Info("binlog:%s 导入 %s:%d成功", bkItem.BackupFile, tplusIP, tplusPort) + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisplus_incrback.go b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisplus_incrback.go new file mode 100644 index 0000000000..5192735dd2 --- /dev/null +++ b/dbm-services/redis/db-tools/dbactuator/pkg/datastructure/tendisplus_incrback.go @@ -0,0 +1,1169 @@ +package datastructure + +import ( + "fmt" + "os" + "path/filepath" + "regexp" + "strconv" + + "sort" + + "strings" + "sync" + + "time" + + "dbm-services/redis/db-tools/dbactuator/mylog" + + "dbm-services/redis/db-tools/dbactuator/pkg/consts" + "dbm-services/redis/db-tools/dbactuator/pkg/customtime" + "dbm-services/redis/db-tools/dbactuator/pkg/util" +) + +// TplusRocksDBIncrBackItem 指定tendisplus 指定rocksdb的增备信息项 +type TplusRocksDBIncrBackItem struct { + Incr int `json:"incr"` + NodeIP string `json:"node_ip"` + FileName string `json:"filename"` + BackupFile string `json:"backup_file"` + DecompressedFile string `json:"decompressedFile"` //解压后的文件名 + RocksdbIdx int `json:"rocksdbIdx"` //kvstore + BinlogIdx int64 `json:"binlogIdx"` + BackupTaskid int64 `json:"backup_taskid"` // 任务ID + BackupSize int64 `json:"backup_size"` // 文件大小 + BackupStart customtime.CustomTime `json:"backup_start"` //binlog文件中获取,代表 上一个binlog文件最后一条binlog的时间 + BackupEnd customtime.CustomTime `json:"backup_end"` //备份文件上传备份系统成功时间 + +} + +// TplusRocksDBIncrBack 指定tendisplus 指定rocksdb拉取增备 +type TplusRocksDBIncrBack struct { + FileName string `json:"filename"` + SourceIP string `json:"sourceIp"` + RocksDBIndex int `json:"rocksDbIndex"` + //保存文件的目录(如果是在k8s中,则代表node 上的dir) + SaveNodeDir string `json:"saveRemoteDir"` + //保存备份文件的本地目录 + + SaveMyDir string `json:"saveLocalDir"` + //保存文件的服务器(如果是k8s中,则代表node ip) + SaveHost string `json:"saveHost"` + StartTime time.Time `json:"startTime"` //拉取增备的起始时间 + EndTime time.Time `json:"endTime"` //拉取增备的结束时间 + StartPos uint64 `json:"startPos"` //回档导入增备时,--start-position + //每个rocksdb 最靠近(小于) startTime 的binlog, + //binlog的BackupStart时间小于startTime + PerRocksNearestStart *TplusRocksDBIncrBackItem + //每个rocksdb 最靠近(大于) endTime 的binlog + //binlog的BackupStart时间大于endTime + PerRocksNearestEnd *TplusRocksDBIncrBackItem + //key: 0 1 2 ..,, 每个tendisplus具有10个rocksdb,每个rocksdb都有自己的binlog + //value: 每个rocksdb对应的binlog列表,按照文件index从小到大排序 + ResultSortBinlog []*TplusRocksDBIncrBackItem `json:"resultSortBinlog"` + //key: binlog file name + //value: 文件对应的binlog项 + ResultBinlogMap map[string]*TplusRocksDBIncrBackItem `json:"resultBinlogMap"` + // redisCli *myredis.RedisWorker `json:"-"` //保存备份信息的redis + Err error `json:"-"` //错误信息 + // query QueryReq //备份系统查询 + // recover RecoverReq + // recoverQuery RecoverQueryReq +} + +// NewTplusRocksDBIncrBack 新建tendisplus rocksdb的binlog拉取任务 +// fileName 过滤信息 +// sourceIP 查询 IP 源 +// startTime 拉取增备的开始时间 -> 全备份的开始时间 +// endTime 拉取增备份的结束时间 -> 回档时间 +func NewTplusRocksDBIncrBack(filename, sourceIP string, rocksdbIdx int, startPos uint64, startTime, endTime, + saveHost, saveNodeDir, saveMyDir string) (ret *TplusRocksDBIncrBack) { + mylog.Logger.Info("NewTplusRocksDBIncrBack start ...") + if rocksdbIdx < 0 || rocksdbIdx > 1000 { + ret.Err = fmt.Errorf(" rocksdbIdx:%d cann't <0 or > 1000", rocksdbIdx) + mylog.Logger.Error(ret.Err.Error()) + return + } + ret = &TplusRocksDBIncrBack{ + FileName: filename, + SourceIP: sourceIP, + SaveHost: saveHost, + SaveNodeDir: saveNodeDir, + SaveMyDir: saveMyDir, + RocksDBIndex: rocksdbIdx, + StartPos: startPos, + } + layout := "2006-01-02 15:04:05" + var err error + ret.StartTime, err = time.ParseInLocation(layout, startTime, time.Local) + if err != nil { + ret.Err = fmt.Errorf("startTime:%s time.parse fail,err:%s,layout:%s", startTime, err, layout) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + ret.EndTime, err = time.ParseInLocation(layout, endTime, time.Local) + if err != nil { + ret.Err = fmt.Errorf("endTime:%s time.parse fail,err:%s,layout:%s", endTime, err, layout) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + mylog.Logger.Info("StartTime:%s,EndTime:%s", ret.StartTime, ret.EndTime) + if ret.EndTime.Before(ret.StartTime) == true || ret.EndTime.Equal(ret.StartTime) == true { + ret.Err = fmt.Errorf("tendisplus binlog拉取,endtime:%s 小于等于 startTime:%s", + endTime, startTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + if ret.StartTime.After(time.Now()) == true { + //未来时间 + ret.Err = fmt.Errorf("binlogPull startTime:%s > time.Now()", startTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + if ret.EndTime.After(time.Now()) == true { + //未来时间 + ret.Err = fmt.Errorf("binlogPull endTime:%s > time.Now()", endTime) + mylog.Logger.Error(ret.Err.Error()) + return ret + } + ret.ResultSortBinlog = []*TplusRocksDBIncrBackItem{} + ret.ResultBinlogMap = make(map[string]*TplusRocksDBIncrBackItem) + return +} + +// LastNDaysIncrBack 需要最近N天的增备 +func LastNDaysIncrBack() int { + lastNDays := 1 + return lastNDays +} + +// AddBinlogToMap 添加binlog项到 ResultBinlogMap,ResultSortBinlog中 +func (incr *TplusRocksDBIncrBack) AddBinlogToMap(item01 *TplusRocksDBIncrBackItem) { + if item01 == nil { + return + } + if _, ok := incr.ResultBinlogMap[item01.BackupFile]; ok == true { + //去重 + return + } + incr.ResultBinlogMap[item01.BackupFile] = item01 + incr.ResultSortBinlog = append(incr.ResultSortBinlog, item01) +} + +// GetTplusIncrbacks 过滤特定端口的binlog备份文件 +// NOCC:golint/fnsize(设计如此) +func (incr *TplusRocksDBIncrBack) GetTplusIncrbacks(binlogFileList []FileDetail) (backs []*TplusRocksDBIncrBackItem) { + mylog.Logger.Info("GetTplusIncrbacks...") + layout := "2006-01-02 15:04:05" + mylog.Logger.Info("fileName:%s", incr.FileName) + + // 示例: binlog-127.0.0.x-30000-7-0003612-20230326232536.log.zst + binlogReg := regexp.MustCompile(`^*?-(\d+)-(\d+)-(\d+)-(\d+).log.zst`) + layout1 := "20060102150405" + for _, str01 := range binlogFileList { + back01 := &TplusRocksDBIncrBackItem{} + taskID, _ := strconv.Atoi(str01.TaskID) + // size, _ := strconv.Atoi(str01.Size) + if taskID < 0 || str01.Size < 0 { + //backup_taskid 小于0 或backup_size 小于0的备份,是无效备份 + msg := fmt.Sprintf("filename:%s incrBackup:%s backupTaskid:%s<0 backupSize:%s<0 is invalid,skip...", + incr.FileName, str01.FileName, str01.TaskID, str01.Size) + mylog.Logger.Info(msg) + continue + } + back01.BackupTaskid, _ = strconv.ParseInt(str01.TaskID, 10, 64) + back01.BackupSize, _ = strconv.ParseInt(strconv.Itoa(str01.Size), 10, 64) + back01.BackupFile = str01.FileName + back01.NodeIP = str01.SourceIP + match01 := binlogReg.FindStringSubmatch(str01.FileName) + + if len(match01) != 5 { + incr.Err = fmt.Errorf( + "filename:%s backup:%v format not correct,backupFile:%s cann't find rocksdbIdx/binlogIdx/createTime", + incr.FileName, back01, str01.FileName) + mylog.Logger.Error(incr.Err.Error()) + return + } + bkCreateTime, err01 := time.ParseInLocation(layout1, match01[4], time.Local) + if err01 != nil { + incr.Err = fmt.Errorf( + "backup file createTime:%s time.parese fail,err:%s,layout1:%s", + match01[3], err01, layout1) + mylog.Logger.Error(incr.Err.Error()) + return + } + // binlog-127.0.0.x-30010-0-0002495-20230311124436.log.zst + back01.RocksdbIdx, _ = strconv.Atoi(match01[2]) + back01.BinlogIdx, _ = strconv.ParseInt(match01[3], 10, 64) + back01.BackupStart.Time = bkCreateTime //不要用backupStart值 + back01.BackupEnd.Time, err01 = time.ParseInLocation(layout, str01.FileLastMtime, time.Local) //文件最后修改时间 + if err01 != nil { + incr.Err = fmt.Errorf( + "backup file lastTime:%s time.parese fail,err:%s,layout:%s", + str01.FileLastMtime, err01, layout) + mylog.Logger.Error(incr.Err.Error()) + return + } + + // 过滤节点维度的文件,这里比较重要,因为flow传下来的是这台机器涉及到的所有节点信息, + // 这里是针对单节点的,所以需要过滤出来,这个值返回给前置函数 + if strings.Contains(back01.BackupFile, incr.FileName) { + backs = append(backs, back01) + } + } + mylog.Logger.Info("len(backs):%d", len(backs)) + mylog.Logger.Info("TplusRocksDBIncrBackItem:%v", backs[0]) + return +} + +// GetTplusIncrbacksSpecRocks 获取startTime~endTime时间段内的binlog +// NOCC:golint/fnsize(设计如此) +func (incr *TplusRocksDBIncrBack) GetTplusIncrbacksSpecRocks(binlogFileList []FileDetail) { + + // 获取startTime~endTime时间段内的binlog + // layout := "20060102" + layout02 := "2006-01-02 15:04:05" + //从备份列表中选择最靠近 startTime 的文件, + // nearestStartBk.BackupStart 小于等于 StartTime + var nearestStartBk *TplusRocksDBIncrBackItem = nil + //从备份列表中选择最靠近 endTime 的文件, + // nearestEndBk.BackupStart 大于等于 EndTime + var nearestEndBk *TplusRocksDBIncrBackItem = nil + + backs := incr.GetTplusIncrbacks(binlogFileList) + for _, bk01 := range backs { + bkItem := bk01 + + if bkItem.RocksdbIdx != incr.RocksDBIndex { + // 不是目标rocksdb的binlog,忽略 + continue + } + //只需要那些BackupStart <= incr.StartTime 的binlog + if bkItem.BackupStart.Before(incr.StartTime) == true || + bkItem.BackupEnd.Equal(incr.StartTime) == true { + if nearestStartBk == nil { + // 第一次找到 BackupStart 小于 startTime 的备份 + nearestStartBk = bkItem + } else { + // nearestStartBk.BackupStart < 该备份BackupStart <= incr.StartTime + // 或者 + // nearestStartBk.BackupStart == 该备份BackupStart 同时 该备份BinlogIdx < nearestStartBk.BinlogIdx + // (同一时间大量写入时可能一秒钟生成多个binlog文件,此时同一秒生成的所有binlog都保留,所以 nearestStartBk.BinlogIdx是最小的) + + // 如binlog-127.0.0.x-30010-0-0002495-20230311124436.log.zst: BinlogIdx是0002495 + if bkItem.BackupStart.After(nearestStartBk.BackupStart.Time) == true || + (bkItem.BackupStart.Equal(nearestStartBk.BackupStart.Time) == true && + bkItem.BinlogIdx < nearestStartBk.BinlogIdx) { + nearestStartBk = bkItem + } + + } + } + + //只需要那些BackupStart >= incr.EndTime 的binlog + if bkItem.BackupStart.After(incr.EndTime) == true || + bkItem.BackupStart.Equal(incr.EndTime) == true { + if nearestEndBk == nil { + //第一次找到 BackupStart 大于等于 endTIme的备份 + nearestEndBk = bkItem + } else { + // incr.EndTime <= 该备份BackupStart < nearestEndBk.BackupStart. + // 或者 + // nearestEndBk.BackupStart == 该备份BackupStart 同时 该备份BinlogIdx > nearestStartBk.BinlogIdx + // (同一时间大量写入时可能一秒钟生成多个binlog文件,此时同一秒生成的所有binlog都保留,所以 nearestEndBk.BinlogIdx是最大的) + if bkItem.BackupStart.Before(nearestEndBk.BackupStart.Time) == true || + (bkItem.BackupStart.Equal(nearestEndBk.BackupStart.Time) == true && + bkItem.BinlogIdx > nearestEndBk.BinlogIdx) { + nearestEndBk = bkItem + } + } + } + + } + + if nearestStartBk == nil { + incr.Err = fmt.Errorf("filename:%s rocksdbIdx:%d 向前%d天,没有找到时间 小于 startTime:%s的binlog", + incr.FileName, + incr.RocksDBIndex, + LastNDaysIncrBack(), + incr.StartTime.Local().Format(layout02)) + mylog.Logger.Error(incr.Err.Error()) + return + } + + msg := fmt.Sprintf("filename:%s rocksdbIdx:%d 找到距离startTime:%s最近(小于)的binlog:%s,binlogStart:%s", + incr.FileName, + incr.RocksDBIndex, + incr.StartTime.Local().Format(layout02), + nearestStartBk.BackupFile, + nearestStartBk.BackupStart.Local().Format(layout02)) + mylog.Logger.Info(msg) + + if nearestEndBk == nil { + incr.Err = fmt.Errorf("filename:%s rocksdbIdx:%d 向后%d天,没有找到时间大于endTime:%s的binlog", + incr.FileName, + incr.RocksDBIndex, + LastNDaysIncrBack(), + incr.EndTime.Local().Format(layout02)) + mylog.Logger.Error(incr.Err.Error()) + return + } + + msg = fmt.Sprintf("filename:%s rocksdbIdx:%d 找到距离endTime:%s最近(大于)的binlog:%s,binglogEnd:%s", + incr.FileName, + incr.RocksDBIndex, + incr.EndTime.Local().Format(layout02), + nearestEndBk.BackupFile, + nearestEndBk.BackupStart.Local().Format(layout02)) + mylog.Logger.Info(msg) + + //成功获取到 nearestStartBk nearestEndBk,继续获取两者之间的binlog + start01 := nearestStartBk.BackupStart.Time + // end01 := nearestEndBk.BackupStart.Time + // 使用 最后一个binlog文件上传备份系统成功时间, 而不是 binlog 文件名中的时间(也就是binlog文件生成时间) + // 因为6月1日生成的binlog,有可能6月2日才上传成功 + // 而在dba redis中 或者 备份系统中 只有 6月2号的记录里面才能查询到该 binlog文件 + end01 := nearestEndBk.BackupEnd.Time + //start02 对应nearestStartBk.BackupStart 当天0点0分0秒 + //end02 对应nearestEndBk.BackupStart 当天0点0分0秒 + //我们需要将 start02 end02之间所有day的binlog都筛选到 + start02 := time.Date(start01.Year(), start01.Month(), start01.Day(), 0, 0, 0, 0, start01.Location()) + end02 := time.Date(end01.Year(), end01.Month(), end01.Day(), 0, 0, 0, 0, end01.Location()) + incr.AddBinlogToMap(nearestStartBk) + incr.AddBinlogToMap(nearestEndBk) + + incr.PerRocksNearestStart = nearestStartBk + incr.PerRocksNearestEnd = nearestEndBk + + for start02.Before(end02) == true || start02.Equal(end02) == true { + + backs := incr.GetTplusIncrbacks(binlogFileList) + + for _, bk01 := range backs { + bkItem := bk01 + if bkItem.RocksdbIdx != incr.RocksDBIndex { + //不是目标rocksdb的binlog,直接忽略 + continue + } + if (bkItem.BackupStart.After(nearestStartBk.BackupStart.Time) == true || + bkItem.BackupStart.Equal(nearestStartBk.BackupStart.Time) == true) && + (bkItem.BackupStart.Before(nearestEndBk.BackupStart.Time) == true || + bkItem.BackupStart.Equal(nearestEndBk.BackupStart.Time) == true) { + incr.AddBinlogToMap(bkItem) + } + } + start02 = start02.Add(1 * 24 * time.Hour) + } + //按照binlog index排序 + sort.Slice(incr.ResultSortBinlog, func(i, j int) bool { + return incr.ResultSortBinlog[i].BinlogIdx < incr.ResultSortBinlog[j].BinlogIdx + }) + + incr.isGetAllBinlogInfo() + if incr.Err != nil { + return + } + return +} + +/* +判断binlog文件是否连续,是否重复; +- 重复则报错; +- 不连续则返回缺失的binlog index,如 2,3,5,8 则返回缺失的4,6,7 +*/ +func getNotReadyBinlogs(sortBinlogs []*TplusRocksDBIncrBackItem) ([]string, error) { + var ret []string + var err error + preListIdx := 0 + preBinlogIdx := sortBinlogs[0].BinlogIdx + for idx, bin01 := range sortBinlogs { + binItem := bin01 + if idx == preListIdx { + //第一个元素忽略 + continue + } + if binItem.BinlogIdx <= preBinlogIdx { + //如果后面的binlog index小于等于前一个binlog index + err = fmt.Errorf("当前binlog index:%d <= 前一个binlog index:%d", binItem.BinlogIdx, preBinlogIdx) + mylog.Logger.Error(err.Error()) + mylog.Logger.Error(err.Error()) + return ret, err + } + if binItem.BinlogIdx == preBinlogIdx+1 { + //符合预期 + preBinlogIdx = binItem.BinlogIdx + continue + } + preBinlogIdx++ + for preBinlogIdx < bin01.BinlogIdx { + ret = append(ret, fmt.Sprintf("%d", preBinlogIdx)) + preBinlogIdx++ + } + } + return ret, nil +} + +/* +判断所需binlog文件信息是否已全部获取到; +- ResultSortBinlog 第二个binlog文件序号 必须 只比 第一个binlog 文件序号大1 +- ResultSortBinlog 倒数第一个binlog文件序号 必须 只比 倒数第二个binlog文件序号大 1 +- 最后一个文件序号 减去 第一个文件序号 等于 len(ResultSortBinlog)+1 +- ResultSortBinlog 第一个binlog.BackupStart必须小于 startTime, 第二个binlog.BackupStart必须大于 startTime +- ResultSortBinlog 最后一个binlog.BackupStart必须大于 endTime, 倒数第二个binlog.BackupStart必须小于 endTime +*/ +// NOCC:golint/fnsize(设计如此) +func (incr *TplusRocksDBIncrBack) isGetAllBinlogInfo() (ret bool) { + mylog.Logger.Info("isGetAllBinlogInfo start ...") + cnt := len(incr.ResultSortBinlog) + mylog.Logger.Info("ResultSortBinlog len:%d", cnt) + layout := "2006-01-02 15:04:05" + + if cnt < 2 { + //至少会包含两个binlog文件,第一个BackupStart小于 startTime, 第二个BackupStart 大于 endTime + str01 := "" + for _, bk01 := range incr.ResultSortBinlog { + str01 = fmt.Sprintf("%s,%s", str01, bk01.BackupFile) + } + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d拉取[%s ~ %s]时间段的binlog,至少包含2个binglo,当前%d个binlog,详情:%s", + incr.FileName, incr.RocksDBIndex, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + cnt, str01) + mylog.Logger.Error(incr.Err.Error()) + mylog.Logger.Error(incr.Err.Error()) + return false + } + firstBinlog := incr.ResultSortBinlog[0] + secondBinlog := incr.ResultSortBinlog[1] + + lastBinlog := incr.ResultSortBinlog[cnt-1] + beforeLastBinlog := incr.ResultSortBinlog[cnt-2] + + if secondBinlog.BinlogIdx-firstBinlog.BinlogIdx != 1 { + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d拉取[%s ~ %s]时间段的binlog,第一binlog:%s 和 第二binlog:%s 不连续", + incr.FileName, incr.RocksDBIndex, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + firstBinlog.BackupFile, secondBinlog.BackupFile, + ) + + mylog.Logger.Error(incr.Err.Error()) + return + } + if lastBinlog.BinlogIdx-beforeLastBinlog.BinlogIdx != 1 { + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d拉取[%s ~ %s]时间段的binlog,倒数第二binlog:%s 和 倒数第一binlog:%s 不连续", + incr.FileName, incr.RocksDBIndex, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + beforeLastBinlog.BackupFile, lastBinlog.BackupFile, + ) + mylog.Logger.Error(incr.Err.Error()) + + return + } + //是否连续 + binIndexList, err := getNotReadyBinlogs(incr.ResultSortBinlog) + if err != nil { + incr.Err = err + return false + } + if len(binIndexList) > 0 { + incr.Err = fmt.Errorf("缺失的binlog共%d个,缺失的binlog index是:%s", + len(binIndexList), strings.Join(binIndexList, ",")) + + mylog.Logger.Error(incr.Err.Error()) + return false + } + //第一个binlog.BackupStart必须小于等于 startTime,大于则报错 + if firstBinlog.BackupStart.After(incr.StartTime) == true { + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d,第一个binog:%s,binlogStart:%s 大于startTime(全备时间):%s", + incr.FileName, incr.RocksDBIndex, + firstBinlog.BackupFile, + firstBinlog.BackupStart.Local().Format(layout), + incr.StartTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + + return false + } + //第二个binlog.BackupStart必须大于(等于) startTime,小于则报错 + for idx01 := 1; secondBinlog.BackupStart.Equal(firstBinlog.BackupStart.Time) == true; idx01++ { + //因为相同时间可能有多个binlog,所以跳过与 firstBinlog.BinlogEnd 相等的 + secondBinlog = incr.ResultSortBinlog[idx01] + } + if secondBinlog.BackupStart.Before(incr.StartTime) { + err = fmt.Errorf( + "filename:%s RocksdbIdx:%d,第二个binlog:%s,binlogStart:%s 时间小于startTime(全备时间):%s", + incr.FileName, incr.RocksDBIndex, + secondBinlog.BackupFile, + secondBinlog.BackupStart.Local().Format(layout), + incr.StartTime.Local().Format(layout)) + mylog.Logger.Error(err.Error()) + + return false + } + //倒数第二个binlog.BackupStart必须小于等于 endTime, 大于则报错 + for idx02 := cnt - 2; beforeLastBinlog.BackupStart.Equal(lastBinlog.BackupStart.Time) == true; idx02-- { + //因为相同时间可能有多个binlog,所以跳过与 lastBinlog.BinlogEnd 相等的 + beforeLastBinlog = incr.ResultSortBinlog[idx02] + } + if beforeLastBinlog.BackupStart.After(incr.EndTime) == true { + incr.Err = fmt.Errorf( + "filename:%s RocksdbIdx:%d,倒数第二个binlog:%s,binlogStart:%s 时间大于endTime(回档目标时间):%s", + incr.FileName, incr.RocksDBIndex, + beforeLastBinlog.BackupFile, + beforeLastBinlog.BackupStart.Local().Format(layout), + incr.EndTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + + return false + } + //最后一个binlog.BackupStart必须大于等于 endTime,小于则报错 + if lastBinlog.BackupStart.Before(incr.EndTime) == true { + incr.Err = fmt.Errorf( + "filename:%s RocksdbIdx:%d,最后一个binlog:%s,binlogStart:%s 时间小于endTime(回档目标时间):%s", + incr.FileName, incr.RocksDBIndex, + lastBinlog.BackupFile, + lastBinlog.BackupStart.Local().Format(layout), + incr.EndTime.Local().Format(layout)) + mylog.Logger.Error(incr.Err.Error()) + return false + } + msg := fmt.Sprintf(`filename:%s rocksdbIdx:%d 找到所有[%s~%s]时间段的binlog, + 共%d个,第一个binlog:%s binlogStart:%s,最后一个binlog:%s binlogStart:%s`, + incr.FileName, incr.RocksDBIndex, + incr.StartTime.Local().Format(layout), + incr.EndTime.Local().Format(layout), + cnt, + firstBinlog.BackupFile, + firstBinlog.BackupStart.Local().Format(layout), + lastBinlog.BackupFile, + lastBinlog.BackupStart.Local().Format(layout), + ) + mylog.Logger.Info(msg) + return +} + +// TplusIncrBackPull 指定tendisplus增备拉取 +type TplusIncrBackPull struct { + FileName string `json:"filename"` + SourceIP string `json:"sourceIP"` + RocksMap map[int]*TplusRocksDBIncrBack `json:"rocksMap"` //多个rocksdb 拉取增备 + Err error `json:"-"` +} + +// NewTplusIncrBackPull 新建tendisplus拉取任务 +func NewTplusIncrBackPull(filename, sourceIP string) *TplusIncrBackPull { + return &TplusIncrBackPull{ + FileName: filename, + SourceIP: sourceIP, + RocksMap: make(map[int]*TplusRocksDBIncrBack), + } +} + +// NewRocksDBIncrBack 新增rocksdb增备拉取任务 +func (incr *TplusIncrBackPull) NewRocksDBIncrBack(rocksdbIdx int, startPos uint64, + startTime, endTime, saveHost, saveNodeDir, saveMyDir string) { + mylog.Logger.Info("NewRocksDBIncrBack start ...") + + task01 := NewTplusRocksDBIncrBack(incr.FileName, incr.SourceIP, rocksdbIdx, + startPos, startTime, endTime, + saveHost, saveNodeDir, saveMyDir) + if task01.Err != nil { + incr.Err = task01.Err + return + } + // fmt.Printf("rocksdbIdx====>%d task01==>%+v\n", rocksdbIdx, task01) + incr.RocksMap[rocksdbIdx] = task01 + return +} + +// GetAllIncrBacksInfo 获取所有rocksdb的binlog信息 +func (incr *TplusIncrBackPull) GetAllIncrBacksInfo(binlogFileList []FileDetail) { + mylog.Logger.Info("GetAllIncrBacksInfo start ...") + if len(incr.RocksMap) == 0 { + incr.Err = fmt.Errorf("filename:%s 请先添加rocksdb信息再获取备份信息", incr.FileName) + mylog.Logger.Error(incr.Err.Error()) + return + } + //所有rocksdb并发执行 + mylog.Logger.Info("GetAllIncrBacksInfo 并发查询所有kvstore的信息 ...") + wg := sync.WaitGroup{} + for _, rock01 := range incr.RocksMap { + rockItem := rock01 + wg.Add(1) + go func(rock001 *TplusRocksDBIncrBack) { + defer wg.Done() + rock001.GetTplusIncrbacksSpecRocks(binlogFileList) + }(rockItem) + } + wg.Wait() + + //检测是否有失败 + for _, rock01 := range incr.RocksMap { + rockItem := rock01 + if rockItem.Err != nil { + incr.Err = rockItem.Err + return + } + } + return +} + +// TotalSize 所有binlog所需磁盘空间大小 +func (incr *TplusRocksDBIncrBack) TotalSize() int64 { + var ret int64 = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + ret = ret + bkItem.BackupSize + } + return ret +} + +// TotalSize 获取tendisplus所有binlog所需的总size +func (incr *TplusIncrBackPull) TotalSize() int64 { + var ret int64 = 0 + for _, rock01 := range incr.RocksMap { + rockItem := rock01 + ret = ret + rockItem.TotalSize() + } + return ret +} + +// GetBackupFileExt 获取备份文件后缀(如果后缀无法解压,及时报错) +func (incr *TplusRocksDBIncrBack) GetBackupFileExt( + item *TplusRocksDBIncrBackItem) (bkFileExt string) { + bkFileExt = filepath.Ext(item.BackupFile) + + okExt := map[string]bool{ + ".tar": true, + ".tgz": true, + ".gz": true, + ".zip": true, + ".lzo": true, + ".zst": true, + } + + if strings.HasSuffix(item.BackupFile, ".tar.gz") { + bkFileExt = ".tar.gz" + return + } else if _, ok := okExt[bkFileExt]; ok == true { + return bkFileExt + } else { + incr.Err = fmt.Errorf("无法解压的binlog文件:%s", item.BackupFile) + mylog.Logger.Error(incr.Err.Error()) + return + } +} + +// getDecompressedFile 获取解压文件,已经解压文件完整路径 +func (incr *TplusRocksDBIncrBack) getDecompressedFile( + item *TplusRocksDBIncrBackItem) (decpFile, decpFileFullPath string) { + var bkFileExt string = incr.GetBackupFileExt(item) + if incr.Err != nil { + return + } + item.DecompressedFile = strings.TrimSuffix(item.BackupFile, bkFileExt) + decpFile = item.DecompressedFile + decpFileFullPath = filepath.Join(incr.SaveMyDir, decpFile) + return +} + +// CheckLocalBackupfilesIsOk 检查本地增备文件是否全部ok +// 返回值: +// totalCnt: 所需的全部增备文件个数 +// existsCnt: 本地存在的增备文件个数, existsList: 本地存在的增备文件详情 +// sizeOKCnt: 本地存在的增备文件 大小ok 的个数 +func (incr *TplusRocksDBIncrBack) CheckLocalBackupfilesIsOk() ( + totalCnt, existsCnt, sizeOKCnt int, existsList []*TplusRocksDBIncrBackItem, +) { + totalCnt = 0 + existsCnt = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + incrBkFile := filepath.Join(incr.SaveMyDir, bkItem.BackupFile) + incrBkInfo, err := os.Stat(incrBkFile) + if os.IsNotExist(err) == true { + continue + } + existsCnt++ + existsList = append(existsList, bkItem) + if incrBkInfo.Size() == bkItem.BackupSize { + sizeOKCnt++ + } + } + return +} + +// CheckLocalDecompressedFilesIsOk 检查本地 增备解压文件 是否ok +// 返回值: +// totalCnt: 全部增备(解压)文件个数 +// existsCnt: 本地存在的增备(解压)文件个数, existsList: 本地存在的增备(解压)文件详情 +func (incr *TplusRocksDBIncrBack) CheckLocalDecompressedFilesIsOk() ( + totalCnt, existsCnt int, existsList []*TplusRocksDBIncrBackItem, +) { + mylog.Logger.Info("CheckLocalDecompressedFilesIsOk start ...") + totalCnt = 0 + existsCnt = 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + _, decpFileFullPath := incr.getDecompressedFile(bkItem) + if incr.Err != nil { + return + } + _, err := os.Stat(decpFileFullPath) + if os.IsNotExist(err) == true { + continue + } + existsCnt++ + existsList = append(existsList, bkItem) + } + return +} + +// rmLocalBackupFiles 删除一些本地 增备文件 +func (incr *TplusRocksDBIncrBack) rmLocalBackupFiles(bkList []*TplusRocksDBIncrBackItem) { + rmCnt := 0 + for _, bk01 := range bkList { + bkItem := bk01 + bkFileFullPath := filepath.Join(incr.SaveMyDir, bkItem.BackupFile) + if _, err := os.Stat(bkFileFullPath); os.IsNotExist(err) { + continue + } + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, bkItem.BackupFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + rmCnt++ + } + msg := fmt.Sprintf("共删除%d个本地binlog(未解压)文件", rmCnt) + mylog.Logger.Info(msg) + return +} + +// rmLocalDecompressedFiles 删除一些本地 增备(已解压)文件 +func (incr *TplusRocksDBIncrBack) rmLocalDecompressedFiles(bkList []*TplusRocksDBIncrBackItem) { + mylog.Logger.Info("rmLocalDecompressedFiles start ... ") + rmCnt := 0 + for _, bk01 := range bkList { + bkItem := bk01 + if bkItem.DecompressedFile == "" { + continue + } + decpFileFullPath := filepath.Join(incr.SaveMyDir, bkItem.DecompressedFile) + if _, err := os.Stat(decpFileFullPath); os.IsNotExist(err) { + continue + } + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, bkItem.DecompressedFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + rmCnt++ + } + msg := fmt.Sprintf("共删除%d个本地binlog(已解压)文件", rmCnt) + mylog.Logger.Info(msg) + return +} + +// PullFilesFromBS 从备份系统拉取文件到对应位置(saveHost,saveRemoteDir) +func (incr *TplusRocksDBIncrBack) PullFilesFromBS() { + mylog.Logger.Info("PullFilesFromBS .. ") + if len(incr.ResultSortBinlog) == 0 { + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d binlog信息为空(len:%d),没有传入binlog文件信息,请先传入binlog信息再检验", + incr.FileName, incr.RocksDBIndex, len(incr.ResultSortBinlog)) + mylog.Logger.Error(incr.Err.Error()) + return + } + + //检查拉取的文件是否ok,前置函数已有这个功能 + // incr.CheckAllPulledFilesOK() + +} + +// checkPulledFileOK 检查文件下载是否成功 +func (incr *TplusRocksDBIncrBack) checkPulledFileOK(item *TplusRocksDBIncrBackItem) (err error) { + + if incr.SaveMyDir != "" { + incrBkFile := filepath.Join(incr.SaveMyDir, item.BackupFile) + bkFileInfo, err := os.Stat(incrBkFile) + if err != nil { + err = fmt.Errorf("pod:%s 本地binlog文件:%s 信息获取失败,err:%v", + incr.FileName, incrBkFile, err) + mylog.Logger.Error(err.Error()) + return err + } + bkFileSize := bkFileInfo.Size() + if item.BackupSize != bkFileSize { + err = fmt.Errorf("rocksdbIdx:%d 本地binlog文件:%s 大小(%d) 不等于 redis备份记录大小:%d", + incr.RocksDBIndex, incrBkFile, bkFileSize, item.BackupSize) + mylog.Logger.Error(err.Error()) + return err + } + msg := fmt.Sprintf("rocksdbIdx:%d 本地binlog文件:%s 确认ok", incr.RocksDBIndex, incrBkFile) + mylog.Logger.Info(msg) + } + return nil +} + +// CheckAllPulledFilesOK 是否所有本地binlog都拉取ok +func (incr *TplusRocksDBIncrBack) CheckAllPulledFilesOK() { + mylog.Logger.Info("CheckAllPulledFilesOK start ... ") + errList := []string{} + successCnt := 0 + failCnt := 0 + totalCnt := 0 + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + err := incr.checkPulledFileOK(bkItem) + if err != nil { + errList = append(errList, err.Error()) + } else { + successCnt++ + } + } + failCnt = len(errList) + if failCnt > 0 { + list01 := []string{} + //只打印前5条信息 + if failCnt > 5 { + list01 = errList[:5] + } else { + list01 = errList + } + incr.Err = fmt.Errorf( + "rocksdbIdx:%d 检查本地binlog文件失败,成功%d个,失败%d个,共%d个,失败示例:%s", + incr.RocksDBIndex, successCnt, failCnt, totalCnt, strings.Join(list01, "\n"), + ) + mylog.Logger.Error(incr.Err.Error()) + return + } + msg := fmt.Sprintf( + "rocksdbIdx:%d 检查本地binlog文件全部成功,成功%d个,失败%d个,共%d个", + incr.RocksDBIndex, successCnt, failCnt, totalCnt) + mylog.Logger.Info(msg) + + return +} + +// CheckFilesIfNotExists .. +// - 如果所有 增备(已解压)文件 全部存在,则直接return; +// - 如果所有 增备(未解压)文件 全部存在,且大小校验ok,则直接 return; +// - 否则删除 本地存在的增备(已解压)文件、增备(未解压)文件; +// - 继续拉取文件; +func (incr *TplusRocksDBIncrBack) CheckFilesIfNotExists() { + mylog.Logger.Info("CheckFilesIfNotExists start ... ") + var msg string + decpTotalCnt, decpExistsCnt, decpExistsList := incr.CheckLocalDecompressedFilesIsOk() + if incr.Err != nil { + return + } + if decpTotalCnt == decpExistsCnt { + msg = fmt.Sprintf("rollbackPod:%s rocksdbIdx:%d 本地已存在%d个 增备(已解压文件),无需重新拉取增备文件...", + incr.FileName, incr.RocksDBIndex, decpTotalCnt) + mylog.Logger.Info(msg) + return + } + incr.rmLocalDecompressedFiles(decpExistsList) + if incr.Err != nil { + return + } + + localTotalCnt, localExistsCnt, sizeOkCnt, localExistsList := incr.CheckLocalBackupfilesIsOk() + if incr.Err != nil { + return + } + if localTotalCnt == localExistsCnt && localTotalCnt == sizeOkCnt { + msg = fmt.Sprintf("rollbackPod:%s rocksdbIdx:%d 本地已存在%d个 增备(未解压文件),无需重新拉取增备文件...", + incr.FileName, incr.RocksDBIndex, localTotalCnt) + mylog.Logger.Info(msg) + return + } + incr.rmLocalBackupFiles(localExistsList) + if incr.Err != nil { + return + } + // 这里没必要单独检验? + // incr.PullFilesFromBS() +} + +// CheckAllBinlogFiles 检查所有rocksb增备文件是否存在 +func (pull *TplusIncrBackPull) CheckAllBinlogFiles() { + mylog.Logger.Info("CheckAllBinlogFiles start ... ") + if len(pull.RocksMap) == 0 { + pull.Err = fmt.Errorf(" filename:%s rocksdb信息为空,无法拉取binlog文件", pull.FileName) + mylog.Logger.Error(pull.Err.Error()) + return + } + //所有rocksdb并发执行 + wg := sync.WaitGroup{} + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + wg.Add(1) + go func(rock001 *TplusRocksDBIncrBack) { + defer wg.Done() + rock001.CheckFilesIfNotExists() + if rock001.Err != nil { + //拉取备份失败 + return + } + }(rockItem) + } + wg.Wait() + + //检测是否有失败 + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + if rockItem.Err != nil { + pull.Err = rockItem.Err + return + } + } + return +} + +// DecompressedOne 解压一个binlog文件 +func (incr *TplusRocksDBIncrBack) DecompressedOne(item *TplusRocksDBIncrBackItem) { + var cmd string + var bkFileExt string = incr.GetBackupFileExt(item) + if incr.Err != nil { + return + } + if bkFileExt == ".tar" { + cmd = fmt.Sprintf("cd %s && tar -xf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".tar.gz" { + cmd = fmt.Sprintf("cd %s && tar -zxf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".tgz" { + cmd = fmt.Sprintf("cd %s && tar -zxf %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".gz" { + cmd = fmt.Sprintf("cd %s && gunzip %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".zip" { + cmd = fmt.Sprintf("cd %s && unzip %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".lzo" { + cmd = fmt.Sprintf("cd %s && lzop -d %s", + incr.SaveMyDir, item.BackupFile) + } else if bkFileExt == ".zst" { + cmd = fmt.Sprintf("cd %s && %s -d %s", + incr.SaveMyDir, consts.ZstdBin, item.BackupFile) + } + if cmd != "" { + var decpFileFullPath string + item.DecompressedFile, decpFileFullPath = incr.getDecompressedFile(item) + msg := fmt.Sprintf("binlog解压命令:%s", cmd) + mylog.Logger.Info(msg) + + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", cmd}, "", nil, 600*time.Second) + if incr.Err != nil { + return + } + _, err := os.Stat(decpFileFullPath) + if err != nil { + incr.Err = fmt.Errorf("解压binlog:%s => %s 失败,err:%v", + item.BackupFile, decpFileFullPath, err) + mylog.Logger.Error(incr.Err.Error()) + + return + } + msg = fmt.Sprintf("解压binlog:%s成功", item.BackupFile) + mylog.Logger.Info(msg) + + //rm 源文件 + rmCmd := fmt.Sprintf("cd %s && rm -f %s 2>/dev/null", incr.SaveMyDir, item.BackupFile) + _, incr.Err = util.RunLocalCmd("bash", []string{"-c", rmCmd}, "", nil, 30*time.Minute) + if incr.Err != nil { + return + } + msg = fmt.Sprintf("删除binlog源文件:%s完成", item.BackupFile) + mylog.Logger.Info(msg) + } +} + +// DecompressedAll 解压全部binlog文件 +func (incr *TplusRocksDBIncrBack) DecompressedAll() { + mylog.Logger.Info("DecompressedAll start ...") + if len(incr.ResultSortBinlog) == 0 { + incr.Err = fmt.Errorf( + "filename:%s rocksdbIdx:%d binlog信息为空(len:%d),无法解压,请先获取binlog信息", + incr.FileName, incr.RocksDBIndex, len(incr.ResultSortBinlog)) + mylog.Logger.Error(incr.Err.Error()) + return + } + errList := []string{} + successCnt := 0 + failCnt := 0 + totalCnt := 0 + + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + totalCnt++ + incr.DecompressedOne(bkItem) + if incr.Err != nil { + errList = append(errList, incr.Err.Error()) + } else { + successCnt++ + } + } + failCnt = len(errList) + if failCnt > 0 { + list01 := []string{} + //只打印前5条信息 + if failCnt > 5 { + list01 = errList[:5] + } else { + list01 = errList + } + incr.Err = fmt.Errorf( + "解压pod:%s rocksdbIdx:%d binlog文件失败,成功%d个,失败%d个,共%d个,失败示例:%s", + incr.FileName, incr.RocksDBIndex, successCnt, failCnt, totalCnt, strings.Join(list01, "\n"), + ) + mylog.Logger.Error(incr.Err.Error()) + return + } + msg := fmt.Sprintf("解压pod:%s rocksdbIdx:%d binlog文件全部成功,成功%d个,失败%d个,共%d个", + incr.FileName, incr.RocksDBIndex, successCnt, failCnt, totalCnt) + mylog.Logger.Info(msg) + return +} + +// Decompressed 解压binlog +func (pull *TplusIncrBackPull) Decompressed() { + mylog.Logger.Info("Decompressed start ... ") + if len(pull.RocksMap) == 0 { + pull.Err = fmt.Errorf("filename:%s rocksdb信息为空,无法解压本地binlog", pull.FileName) + mylog.Logger.Error(pull.Err.Error()) + return + } + //所有rocksdb并发解压 + wg := sync.WaitGroup{} + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + wg.Add(1) + go func(rock001 *TplusRocksDBIncrBack) { + defer wg.Done() + rock001.DecompressedAllIfNotExists() + }(rockItem) + } + wg.Wait() + + //检测是否有失败 + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + if rockItem.Err != nil { + pull.Err = rockItem.Err + return + } + } + return +} + +// DecompressedAllIfNotExists .. +// 如果所有 增备(已解压)文件 全部存在,则直接return; +// 否则删除 本地存在的增备(已解压)文件; +// 继续执行解压; +func (incr *TplusRocksDBIncrBack) DecompressedAllIfNotExists() { + mylog.Logger.Info("DecompressedAllIfNotExists start .. ") + var msg string + decpTotalCnt, decpExistsCnt, decpExistsList := incr.CheckLocalDecompressedFilesIsOk() + if incr.Err != nil { + return + } + if decpTotalCnt == decpExistsCnt { + msg = fmt.Sprintf("rollbackPod:%s rocksdbIdx:%d 本地已存在%d个 增备(已解压文件),无需执行解压...", + incr.FileName, incr.RocksDBIndex, decpTotalCnt) + mylog.Logger.Info(msg) + return + } + incr.rmLocalDecompressedFiles(decpExistsList) + if incr.Err != nil { + return + } + incr.DecompressedAll() +} + +// ImportOneBinlogToTplus 导入一个binlog文件到tendisplus中 +func (incr *TplusRocksDBIncrBack) ImportOneBinlogToTplus(tplusIP string, tplusPort int, + tplusPasswd string, bkItem *TplusRocksDBIncrBackItem) { + mylog.Logger.Info("ImportOneBinlogToTplus start ... ") + incrBackFile := filepath.Join(incr.SaveMyDir, bkItem.DecompressedFile) + importCmd := fmt.Sprintf( + "binlog_tool --logfile=%s --mode=base64 --start-position=%d --end-datetime=%d|redis-cli -h %s -p %d -a %s", + incrBackFile, incr.StartPos, incr.EndTime.Unix()*1000, tplusIP, tplusPort, tplusPasswd) + logCmd := fmt.Sprintf( + "binlog_tool --logfile=%s --mode=base64 --start-position=%d --end-datetime=%d|redis-cli -h %s -p %d -a xxxx", + incrBackFile, incr.StartPos, incr.EndTime.Unix()*1000, tplusIP, tplusPort) + + mylog.Logger.Info("导入binlog,命令:%v", logCmd) + ret01, err := util.RunLocalCmd("bash", []string{"-c", importCmd}, "", nil, 1*time.Hour) + if err != nil { + mylog.Logger.Error(fmt.Sprintf("导入binlog失败,详情:%v", err)) + incr.Err = err + return + } + ret01 = strings.TrimSpace(ret01) + if strings.Contains(ret01, "ERR:") == true { + mylog.Logger.Error(fmt.Sprintf("导入binlog失败,cmd:%s,err:%s", logCmd, ret01)) + incr.Err = fmt.Errorf("导入binlog失败") + return + } + mylog.Logger.Info("binlog:%s 导入 %s:%d成功", bkItem.BackupFile, tplusIP, tplusPort) + return +} + +// ImportAllBinlogToTplus 导入全部binlog +func (incr *TplusRocksDBIncrBack) ImportAllBinlogToTplus(tplusIP string, tplusPort int, tplusPasswd string) { + for _, bk01 := range incr.ResultSortBinlog { + bkItem := bk01 + incr.ImportOneBinlogToTplus(tplusIP, tplusPort, tplusPasswd, bkItem) + if incr.Err != nil { + return + } + } + msg := fmt.Sprintf("filename:%s rocksdbIdx:%d 共成功导入%d个binlog", + incr.FileName, incr.RocksDBIndex, len(incr.ResultSortBinlog)) + mylog.Logger.Info(msg) + return +} + +// ImportBinlogsToTplus 将binlog导入到tendisplus +func (pull *TplusIncrBackPull) ImportBinlogsToTplus( + tplusIP string, tplusPort int, tplusPasswd string) { + if len(pull.RocksMap) == 0 { + pull.Err = fmt.Errorf("filename:%s rocksdb信息为空,无法导入binlog", pull.FileName) + mylog.Logger.Error(pull.Err.Error()) + return + } + //所有rocksdb并发导入binlog,单个rocksdb串行导入 + wg := sync.WaitGroup{} + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + wg.Add(1) + go func(rock001 *TplusRocksDBIncrBack) { + defer wg.Done() + rock001.ImportAllBinlogToTplus(tplusIP, tplusPort, tplusPasswd) + }(rockItem) + } + wg.Wait() + + //检测是否有失败 + for _, rock01 := range pull.RocksMap { + rockItem := rock01 + if rockItem.Err != nil { + pull.Err = rockItem.Err + return + } + } + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/jobmanager/jobmanager.go b/dbm-services/redis/db-tools/dbactuator/pkg/jobmanager/jobmanager.go index 1cea54b8fe..98e7baf1be 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/jobmanager/jobmanager.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/jobmanager/jobmanager.go @@ -196,9 +196,13 @@ func (m *JobGenericManager) atomjobsMapperLoading() { m.atomJobMapper[atomredis.NewRedisDtsDataRepair().Name()] = atomredis.NewRedisDtsDataRepair m.atomJobMapper[atomredis.NewRedisAddDtsServer().Name()] = atomredis.NewRedisAddDtsServer m.atomJobMapper[atomredis.NewRedisRemoveDtsServer().Name()] = atomredis.NewRedisRemoveDtsServer - m.atomJobMapper[atomredis.NewRedisDataRecover().Name()] = atomredis.NewRedisDataRecover + // 老备份系统 + // m.atomJobMapper[atomredis.NewRedisDataRecover().Name()] = atomredis.NewRedisDataRecover + m.atomJobMapper[atomredis.NewRedisDataStructure().Name()] = atomredis.NewRedisDataStructure m.atomJobMapper[atomredis.NewClusterMeetCheckFinish().Name()] = atomredis.NewClusterMeetCheckFinish m.atomJobMapper[atomredis.NewRedisDtsOnlineSwitch().Name()] = atomredis.NewRedisDtsOnlineSwitch + m.atomJobMapper[atomredis.NewRedisVersionUpdate().Name()] = atomredis.NewRedisVersionUpdate + m.atomJobMapper[atomredis.NewRedisClusterFailover().Name()] = atomredis.NewRedisClusterFailover // scene needs. m.atomJobMapper[atomproxy.NewTwemproxySceneCheckBackends().Name()] = atomproxy.NewTwemproxySceneCheckBackends m.atomJobMapper[atomredis.NewRedisSceneSyncCheck().Name()] = atomredis.NewRedisSceneSyncCheck diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/util/redisutil.go b/dbm-services/redis/db-tools/dbactuator/pkg/util/redisutil.go index f7fdb7c4ed..288867d6a0 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/util/redisutil.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/util/redisutil.go @@ -101,3 +101,15 @@ func StartBkDbmon() (err error) { return } + +// GetRedisDbTypeByPkgName 根据包名推断 dbtype +func GetRedisDbTypeByPkgName(pkgName string) (dbType string) { + if strings.Contains(pkgName, "tendisplus") { + dbType = consts.TendisTypeTendisplusInsance + } else if strings.Contains(pkgName, "2.8.17") && strings.Contains(pkgName, "-rocksdb-") { + dbType = consts.TendisTypeTendisSSDInsance + } else { + dbType = consts.TendisTypeRedisInstance + } + return +} diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/util/util.go b/dbm-services/redis/db-tools/dbactuator/pkg/util/util.go index 0c9f9e52b9..6a70603bb4 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/util/util.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/util/util.go @@ -2,6 +2,7 @@ package util import ( + "encoding/json" "errors" "fmt" "net" @@ -280,3 +281,25 @@ func IsDbmSysKeys(key string) bool { func NewNotFoundErr() error { return errors.New(NotFound) } + +// AddrToIpPort 将ip:port转换为ip,port +func AddrToIpPort(addr string) (ip string, port int, err error) { + ipPort := strings.Split(addr, ":") + if len(ipPort) != 2 { + err = fmt.Errorf("invalid addr:%s", addr) + return + } + ip = ipPort[0] + port, err = strconv.Atoi(ipPort[1]) + if err != nil { + err = fmt.Errorf("invalid addr:%s,err:%v", addr, err) + return + } + return +} + +// ToString string +func ToString(param interface{}) string { + ret, _ := json.Marshal(param) + return string(ret) +} diff --git a/dbm-services/redis/db-tools/dbactuator/tests/clustertest/twemproxy_swtich.go b/dbm-services/redis/db-tools/dbactuator/tests/clustertest/twemproxy_swtich.go index d7ba7bb1da..b56ad50769 100644 --- a/dbm-services/redis/db-tools/dbactuator/tests/clustertest/twemproxy_swtich.go +++ b/dbm-services/redis/db-tools/dbactuator/tests/clustertest/twemproxy_swtich.go @@ -68,8 +68,10 @@ func TwemproxyCacheSwitch(serverIP, SetBkDbmonPkg(bkdbmonPkgName, bkdbmonPkgMd5). SetDbtoolsPkg(dbtoolsPkgName, dbtoolsPkgMd5). SetBackupConf(). - AppendMasterServer(serverIP, consts.TestRedisMasterStartPort, consts.TestRedisInstanceNum). - AppendMasterServer(serverIP, consts.TestSyncRedisMasterStartPort, consts.TestRedisInstanceNum) + AppendMasterServer(serverIP, consts.TestRedisMasterStartPort, consts.TestRedisInstanceNum, + consts.TendisTypeTwemproxyRedisInstance). + AppendMasterServer(serverIP, consts.TestSyncRedisMasterStartPort, consts.TestRedisInstanceNum, + consts.TendisTypeTwemproxyRedisInstance) if installTest.Err != nil { return installTest.Err } @@ -172,8 +174,10 @@ func TwemproxyCacheSwitchRestoreEnv(serverIP, SetBkDbmonPkg(bkdbmonPkgName, bkdbmonPkgMd5). SetDbtoolsPkg(dbtoolsPkgName, dbtoolsPkgMd5). SetBackupConf(). - AppendMasterServer(serverIP, consts.TestRedisMasterStartPort, consts.TestRedisInstanceNum). - AppendMasterServer(serverIP, consts.TestSyncRedisMasterStartPort, consts.TestRedisInstanceNum) + AppendMasterServer(serverIP, consts.TestRedisMasterStartPort, consts.TestRedisInstanceNum, + consts.TendisTypeTwemproxyRedisInstance). + AppendMasterServer(serverIP, consts.TestSyncRedisMasterStartPort, consts.TestRedisInstanceNum, + consts.TendisTypeTwemproxyRedisInstance) if installTest.Err != nil { return installTest.Err } diff --git a/dbm-services/redis/db-tools/dbactuator/tests/redistest/bkdbmon_install.go b/dbm-services/redis/db-tools/dbactuator/tests/redistest/bkdbmon_install.go index 9cea01261d..c87cf4c73c 100644 --- a/dbm-services/redis/db-tools/dbactuator/tests/redistest/bkdbmon_install.go +++ b/dbm-services/redis/db-tools/dbactuator/tests/redistest/bkdbmon_install.go @@ -94,8 +94,35 @@ func (test *BkDBmonInstallTest) SetBackupConf() *BkDBmonInstallTest { return test } +func getRedisClusterServerShargs(ip string, startPort, instNum int, dbType string) (shards map[string]string) { + if !consts.IsTwemproxyClusterType(dbType) { + return + } + if startPort == 0 { + startPort = consts.TestRedisMasterStartPort + } + if instNum == 0 { + instNum = 4 + } + var port int + var instStr string + var segStart int + var segEnd int + shards = make(map[string]string) + segStep := (consts.TwemproxyMaxSegment + 1) / instNum + for i := 0; i < instNum; i++ { + segStart = i * segStep + segEnd = (i+1)*segStep - 1 + port = startPort + i + instStr = fmt.Sprintf("%s:%d", ip, port) + shards[instStr] = fmt.Sprintf("%d-%d", segStart, segEnd) + } + return +} + // AppendMasterServer append master server -func (test *BkDBmonInstallTest) AppendMasterServer(masterIP string, startPort, instNum int) *BkDBmonInstallTest { +func (test *BkDBmonInstallTest) AppendMasterServer(masterIP string, startPort, instNum int, + dbType string) *BkDBmonInstallTest { if test.Err != nil { return test } @@ -112,10 +139,15 @@ func (test *BkDBmonInstallTest) AppendMasterServer(masterIP string, startPort, i svrItem := atomredis.ConfServerItem{ BkBizID: "200500194", BkCloudID: 246, + App: "testapp", + AppName: "测试app", ClusterDomain: "tendisx.aaaa.testapp.db", + ClusterName: "aaaa", + ClusterType: dbType, MetaRole: consts.MetaRoleRedisMaster, ServerIP: masterIP, ServerPorts: ports, + ServerShards: getRedisClusterServerShargs(masterIP, startPort, instNum, dbType), } test.Servers = append(test.Servers, svrItem) return test @@ -139,7 +171,8 @@ func (test *BkDBmonInstallTest) OnlyAEmptyServer(ip string) *BkDBmonInstallTest } // AppendSlaveServer append slave server -func (test *BkDBmonInstallTest) AppendSlaveServer(slaveIP string, startPort, instNum int) *BkDBmonInstallTest { +func (test *BkDBmonInstallTest) AppendSlaveServer(slaveIP string, startPort, instNum int, + dbType string) *BkDBmonInstallTest { if test.Err != nil { return test } @@ -160,10 +193,11 @@ func (test *BkDBmonInstallTest) AppendSlaveServer(slaveIP string, startPort, ins AppName: "测试app", ClusterDomain: "tendisx.aaaa.testapp.db", ClusterName: "aaaa", - ClusterType: consts.TendisTypePredixyTendisplusCluster, + ClusterType: dbType, MetaRole: consts.MetaRoleRedisSlave, ServerIP: slaveIP, ServerPorts: ports, + ServerShards: getRedisClusterServerShargs(slaveIP, startPort, instNum, dbType), } test.Servers = append(test.Servers, svrItem) return test @@ -236,8 +270,8 @@ func BkDbmonInstall(serverIP, dbtoolsPkgName, dbtoolsPkgMd5, bkdbmonPkgName, bkd SetBkDbmonPkg(bkdbmonPkgName, bkdbmonPkgMd5). SetDbtoolsPkg(dbtoolsPkgName, dbtoolsPkgMd5). SetBackupConf(). - AppendMasterServer(serverIP, masterStartPort, consts.TestRedisInstanceNum). - AppendSlaveServer(serverIP, slaveStartPort, consts.TestRedisInstanceNum) + AppendMasterServer(serverIP, masterStartPort, consts.TestRedisInstanceNum, dbType). + AppendSlaveServer(serverIP, slaveStartPort, consts.TestRedisInstanceNum, dbType) if bkdbmonTest.Err != nil { return } diff --git a/dbm-services/redis/db-tools/dbactuator/tests/redistest/redis_install.go b/dbm-services/redis/db-tools/dbactuator/tests/redistest/redis_install.go index b155f1118e..411efbdb33 100644 --- a/dbm-services/redis/db-tools/dbactuator/tests/redistest/redis_install.go +++ b/dbm-services/redis/db-tools/dbactuator/tests/redistest/redis_install.go @@ -404,9 +404,6 @@ func (test *RedisInstallTest) SetTendisplusRedisConf() { "scanCntIndexMgr": "10000", "truncateBinlogIntervalMs": "100", "minbinlogkeepsec": "1800", - "binlogdelrange": "500000", - "migrate-gc-enabled": "false", - "deletefilesinrange-for-binlog": "1", "incrpushthreadnum": "10", "rename-command": `config confxx rename-command flushdb cleandb diff --git a/dbm-services/redis/db-tools/dbactuator/tests/test.sh b/dbm-services/redis/db-tools/dbactuator/tests/test.sh index 21ca002225..437b87b5e3 100644 --- a/dbm-services/redis/db-tools/dbactuator/tests/test.sh +++ b/dbm-services/redis/db-tools/dbactuator/tests/test.sh @@ -3,8 +3,8 @@ repoUser="" repoPassword="" -tendisplusPkgName="tendisplus-2.5.0-rocksdb-v6.23.3.tgz" -tendisplusPkgMd5="573fac8917f3cb6d73d4913471a6eacc" +tendisplusPkgName="tendisplus-2.6.0-rocksdb-v6.23.3.tgz" +tendisplusPkgMd5="eaf90d7072740fd232b157d9cb32a425" redisPkgName="redis-6.2.7.tar.gz" redisPkgMd5="1fc9e5c3a044ce523844a6f2717e5ac3" @@ -17,14 +17,14 @@ tendisssdPkgMd5="7bfe87efbe017c689c3f4a11bb2a8be9" predixyPkgName="predixy-1.4.0.tar.gz" predixyPkgMd5="24aba4a96dcf7f8581d2fde89d062455" -twemproxyPkgName="twemproxy-0.4.1-v23.tar.gz" -twemproxyPkgMd5="41850e44bebfce84ebd4d0cf4cce6833" +twemproxyPkgName="twemproxy-0.4.1-v27.tar.gz" +twemproxyPkgMd5="b7fcec49a43da9fdb5acde0a42287d43" dbtoolsPkgName="dbtools.tar.gz" dbtoolsPkgMd5="ced0fa280c63cb31536fefc1845f3ff0" -bkdbmonPkgName="bk-dbmon-v0.9.tar.gz" -bkdbmonPkgMd5="a579e2ffd74259f3dd66d23a10a170ba" +bkdbmonPkgName="bk-dbmon-v0.12.tar.gz" +bkdbmonPkgMd5="2a3a51c3b4a7dce4300e894e19f2f0ea" repoUrl="" @@ -144,7 +144,7 @@ if [[ -e $localBkDbmonPkgName ]]; then localBkDbmonPkgMd5=$(md5sum $localBkDbmonPkgName | awk '{print $1}') fi -wgetCmd="wget --user=$repoUser --password=$repoPassword $repoUrl/tendisplus/Tendisplus-2.5/$tendisplusPkgName -O $localTendisplusPkgName" +wgetCmd="wget --user=$repoUser --password=$repoPassword $repoUrl/tendisplus/Tendisplus-2.6/$tendisplusPkgName -O $localTendisplusPkgName" if [[ ! -e $localTendisplusPkgName ]]; then echo $wgetCmd $wgetCmd diff --git a/dbm-services/redis/db-tools/dbmon/cmd/root.go b/dbm-services/redis/db-tools/dbmon/cmd/root.go index ff4854fba5..c7b84a524f 100644 --- a/dbm-services/redis/db-tools/dbmon/cmd/root.go +++ b/dbm-services/redis/db-tools/dbmon/cmd/root.go @@ -78,6 +78,8 @@ var rootCmd = &cobra.Command{ log.Panicf("reportHistoryClear addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobHistoryClearJob success,entryID:%d", entryID)) + if config.GlobalConf.RedisFullBackup.Cron != "" { entryID, err = c.AddJob(config.GlobalConf.RedisFullBackup.Cron, cron.NewChain(cron.SkipIfStillRunning(mylog.AdapterLog)).Then(redisfullbackup.GlobRedisFullBackupJob)) @@ -85,6 +87,7 @@ var rootCmd = &cobra.Command{ log.Panicf("fullbackup addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisFullBackupJob success,entryID:%d", entryID)) } if config.GlobalConf.RedisBinlogBackup.Cron != "" { entryID, err = c.AddJob(config.GlobalConf.RedisBinlogBackup.Cron, @@ -93,12 +96,15 @@ var rootCmd = &cobra.Command{ log.Panicf("binlogbackup addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisBinlogBakJob success,entryID:%d", entryID)) + entryID, err = c.AddJob(config.GlobalConf.RedisBinlogBackup.Cron, cron.NewChain(cron.SkipIfStillRunning(mylog.AdapterLog)).Then(redisfullbackup.GlobRedisFullCheckJob)) if err != nil { log.Panicf("fullcheck addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisFullCheckJob success,entryID:%d", entryID)) } if config.GlobalConf.RedisHeartbeat.Cron != "" { entryID, err = c.AddJob(config.GlobalConf.RedisHeartbeat.Cron, @@ -107,6 +113,7 @@ var rootCmd = &cobra.Command{ fmt.Printf("heartbeat addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisHeartbeatJob success,entryID:%d", entryID)) } if config.GlobalConf.RedisMonitor.Cron != "" { entryID, err = c.AddJob(config.GlobalConf.RedisMonitor.Cron, @@ -115,6 +122,7 @@ var rootCmd = &cobra.Command{ fmt.Printf("monitor addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisMonitorJob success,entryID:%d", entryID)) } if config.GlobalConf.KeyLifeCycle.Cron != "" { entryID, err = c.AddJob(config.GlobalConf.KeyLifeCycle.Cron, @@ -123,6 +131,7 @@ var rootCmd = &cobra.Command{ fmt.Printf("keylifecycle addjob fail,entryID:%d,err:%v\n", entryID, err) return } + mylog.Logger.Info(fmt.Sprintf("create cron GlobRedisKeyLifeCycleJob success,entryID:%d", entryID)) } } else if hasMongo { diff --git a/dbm-services/redis/db-tools/dbmon/config/config.go b/dbm-services/redis/db-tools/dbmon/config/config.go index ba9853b52c..e1db01243d 100644 --- a/dbm-services/redis/db-tools/dbmon/config/config.go +++ b/dbm-services/redis/db-tools/dbmon/config/config.go @@ -12,17 +12,19 @@ import ( // ConfServerItem servers配置项 type ConfServerItem struct { - BkBizID string `json:"bk_biz_id" mapstructure:"bk_biz_id"` - BkCloudID int64 `json:"bk_cloud_id" mapstructure:"bk_cloud_id"` - App string `json:"app" mapstructure:"app"` - AppName string `json:"app_name" mapstructure:"app_name"` - ClusterDomain string `json:"cluster_domain" mapstructure:"cluster_domain"` - ClusterName string `json:"cluster_name" mapstructure:"cluster_name"` - ClusterType string `json:"cluster_type" mapstructure:"cluster_type"` - MetaRole string `json:"meta_role" mapstructure:"meta_role"` - ServerIP string `json:"server_ip" mapstructure:"server_ip"` - ServerPorts []int `json:"server_ports" mapstructure:"server_ports"` - Shard string `json:"shard" mapstructure:"shard"` + BkBizID string `json:"bk_biz_id" mapstructure:"bk_biz_id"` + BkCloudID int64 `json:"bk_cloud_id" mapstructure:"bk_cloud_id"` + App string `json:"app" mapstructure:"app"` + AppName string `json:"app_name" mapstructure:"app_name"` + ClusterDomain string `json:"cluster_domain" mapstructure:"cluster_domain"` + ClusterName string `json:"cluster_name" mapstructure:"cluster_name"` + ClusterType string `json:"cluster_type" mapstructure:"cluster_type"` + MetaRole string `json:"meta_role" mapstructure:"meta_role"` + ServerIP string `json:"server_ip" mapstructure:"server_ip"` + ServerPorts []int `json:"server_ports" mapstructure:"server_ports"` + ServerShards map[string]string `json:"server_shards" mapstructure:"server_shards"` + CacheBackupMode string `json:"cache_backup_mode" mapstructure:"cache_backup_mode"` // aof or rdb + Shard string `json:"shard" mapstructure:"shard"` } // ConfRedisFullBackup 全备配置 @@ -69,6 +71,7 @@ type Configuration struct { ReportSaveDir string `json:"report_save_dir" mapstructure:"report_save_dir"` ReportLeftDay int `json:"report_left_day" mapstructure:"report_left_day"` HttpAddress string `json:"http_address" mapstructure:"http_address"` + AgentAddress string `json:"agent_address" mapstructure:"agent_address"` GsePath string `json:"gsepath" mapstructure:"gsepath"` RedisFullBackup ConfRedisFullBackup `json:"redis_fullbackup" mapstructure:"redis_fullbackup"` RedisBinlogBackup ConfRedisBinlogBackup `json:"redis_binlogbackup" mapstructure:"redis_binlogbackup"` diff --git a/dbm-services/redis/db-tools/dbmon/models/myredis/client.go b/dbm-services/redis/db-tools/dbmon/models/myredis/client.go index 583d367416..adcac28b14 100644 --- a/dbm-services/redis/db-tools/dbmon/models/myredis/client.go +++ b/dbm-services/redis/db-tools/dbmon/models/myredis/client.go @@ -1328,6 +1328,36 @@ func (db *RedisClient) IsTendisSSDReplicaStatusOk(masterIP, masterPort string) ( return } +// RedisClusterGetMasterNode 获取master节点信息(如果 addr是master则返回它的node信息,否则找到它的masterID,进而找到master的node信息) +func (db *RedisClient) RedisClusterGetMasterNode(addr string) (masterNode *ClusterNodeData, err error) { + addrToNodes, err := db.GetAddrMapToNodes() + if err != nil { + return + } + myNode, ok := addrToNodes[addr] + if !ok { + err = fmt.Errorf("addr:%s not found in cluster nodes", addr) + mylog.Logger.Error(err.Error()) + return + } + if myNode.GetRole() == consts.RedisMasterRole { + masterNode = myNode + return + } + masterNodeID := myNode.MasterID + idToNode, err := db.GetNodeIDMapToNodes() + if err != nil { + return + } + masterNode, ok = idToNode[masterNodeID] + if !ok { + err = fmt.Errorf("masterNodeID:%s not found in cluster nodes", masterNodeID) + mylog.Logger.Error(err.Error()) + return + } + return +} + // MaxMemory 'confxx get maxmemory' func (db *RedisClient) MaxMemory() (maxmemory uint64, err error) { var confRet map[string]string diff --git a/dbm-services/redis/db-tools/dbmon/pkg/consts/consts.go b/dbm-services/redis/db-tools/dbmon/pkg/consts/consts.go index afddb1b24a..da0f85ce9f 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/consts/consts.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/consts/consts.go @@ -3,7 +3,7 @@ package consts // version const ( - BkDbmonVersion = "v0.12" + BkDbmonVersion = "v0.13" ) const ( @@ -162,6 +162,9 @@ const ( BackupStatusToBakSysSuccess = "to_backup_system_success" BackupStatusFailed = "failed" BackupStatusLocalSuccess = "local_success" + + CacheBackupModeAof = "aof" + CacheBackupModeRdb = "rdb" ) const ( diff --git a/dbm-services/redis/db-tools/dbmon/pkg/keylifecycle/task.go b/dbm-services/redis/db-tools/dbmon/pkg/keylifecycle/task.go index 22a6b4823c..a6460b71ac 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/keylifecycle/task.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/keylifecycle/task.go @@ -183,7 +183,7 @@ func (t *Task) bigKeySmartStat(server Instance) (string, string, int64, int64, e if strings.Contains(server.Version, "TRedis") { dbsize, step, err = t.bigAndMode4TendisSSD(server, bkfile, kmfile) - } else if strings.Contains(server.Version, "tendisplus") { + } else if strings.Contains(server.Version, "-rocksdb-") { dbsize, step, err = t.bigAndMode4TendisPlus(server, bkfile, kmfile) } else { if !util.FileExists(fmt.Sprintf("%s/redis/%d/data/appendonly.aof", t.basicDir, server.Port)) && @@ -271,8 +271,8 @@ func (t *Task) bigAndMode4TendisPlus(server Instance, bkfile, kmfile string) (in rockkeys := fmt.Sprintf("v.%d.keys", server.Port) for db := 0; db < kvstore; db++ { - rocksdir := fmt.Sprintf("%s/%d/data/rocksdb/%d/", t.basicDir, server.Port, db) - cmdScan := fmt.Sprintf("%s --db=%s scan >> %s 2>&1", consts.LdbTendisplusBin, rocksdir, rockkeys) + rocksdir := fmt.Sprintf("%s/%d/data/db/%d/", t.basicDir, server.Port, db) + cmdScan := fmt.Sprintf("%s --db=%s tscan >> %s 2>&1", consts.LdbTendisplusBin, rocksdir, rockkeys) mylog.Logger.Info(fmt.Sprintf("do scan sst keys %s :%d: %s", server.Addr, db, cmdScan)) if _, err := util.RunBashCmd(cmdScan, "", nil, time.Hour); err != nil { mylog.Logger.Warn(fmt.Sprintf("exec cmd: %s failed: %+v", cmdScan, err)) diff --git a/dbm-services/redis/db-tools/dbmon/pkg/mongojob/msg.go b/dbm-services/redis/db-tools/dbmon/pkg/mongojob/msg.go index 5f5573146c..de837aec4f 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/mongojob/msg.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/mongojob/msg.go @@ -16,6 +16,7 @@ func SendEvent(conf *config.Configuration, serverConf *config.ConfServerItem, conf.RedisMonitor.BkMonitorEventDataID, conf.RedisMonitor.BkMonitorEventToken, conf.GsePath, + conf.AgentAddress, ) if msgH != nil && err == nil { diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/job.go b/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/job.go index ba9ed7d044..ac070daefa 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/job.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/job.go @@ -59,21 +59,10 @@ func (job *Job) Run() { } defer job.Reporter.Close() - job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisBinlogTAG) - // job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) - // if job.Err != nil { - // return - // } - - // 检查历史备份任务状态 并 删除过旧的本地文件 - for _, svrItem := range job.Conf.Servers { - if !consts.IsRedisMetaRole(svrItem.MetaRole) { - continue - } - for _, port := range svrItem.ServerPorts { - job.CheckOldBinlogBackupStatus(port) - job.DeleteTooOldBinlogbackup(port) - } + // job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisBinlogTAG) + job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) + if job.Err != nil { + return } job.createTasks() if job.Err != nil { @@ -88,6 +77,17 @@ func (job *Job) Run() { continue } } + + // 检查历史备份任务状态 并 删除过旧的本地文件 + for _, svrItem := range job.Conf.Servers { + if !consts.IsRedisMetaRole(svrItem.MetaRole) { + continue + } + for _, port := range svrItem.ServerPorts { + job.CheckOldBinlogBackupStatus(port) + job.DeleteTooOldBinlogbackup(port) + } + } } // GetRealBackupDir 获取本地binlog保存路径 @@ -110,6 +110,7 @@ func (job *Job) createTasks() { var task *Task var password string var taskBackupDir string + var instStr string job.Tasks = []*Task{} for _, svrItem := range job.Conf.Servers { @@ -121,13 +122,18 @@ func (job *Job) createTasks() { if job.Err != nil { return } + instStr = fmt.Sprintf("%s:%d", svrItem.ServerIP, port) taskBackupDir = filepath.Join(job.RealBackupDir, "binlog", strconv.Itoa(port)) util.MkDirsIfNotExists([]string{taskBackupDir}) util.LocalDirChownMysql(taskBackupDir) - task = NewBinlogBackupTask(svrItem.BkBizID, svrItem.BkCloudID, + task, job.Err = NewBinlogBackupTask(svrItem.BkBizID, svrItem.BkCloudID, svrItem.ClusterDomain, svrItem.ServerIP, port, password, job.Conf.RedisBinlogBackup.ToBackupSystem, - taskBackupDir, job.Conf.RedisBinlogBackup.OldFileLeftDay, job.Reporter) + taskBackupDir, svrItem.ServerShards[instStr], + job.Conf.RedisBinlogBackup.OldFileLeftDay, job.Reporter) + if job.Err != nil { + return + } job.Tasks = append(job.Tasks, task) } } diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/task.go b/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/task.go index 99bb586f67..596621e1fb 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/task.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redisbinlogbackup/task.go @@ -50,8 +50,9 @@ type Task struct { StartTime customtime.CustomTime `json:"start_time"` // binlog文件生成时间(非压缩) EndTime customtime.CustomTime `json:"end_time"` // binlog文件最后修改时间(非压缩) BackupTaskID string `json:"backup_taskid"` - BackupMD5 string `json:"backup_md5"` // 目前为空 - BackupTag string `json:"backup_tag"` // REDIS_BINLOG + BackupMD5 string `json:"backup_md5"` // 目前为空 + BackupTag string `json:"backup_tag"` // REDIS_BINLOG + ShardValue string `json:"shard_value"` // shard值 Status string `json:"status"` Message string `json:"message"` Cli *myredis.RedisClient `json:"-"` @@ -63,10 +64,10 @@ type Task struct { // NewBinlogBackupTask new binlog backup task func NewBinlogBackupTask(bkBizID string, bkCloudID int64, domain, ip string, port int, - password, toBackupSys, backupDir string, oldFileLeftDay int, - reporter report.Reporter) *Task { + password, toBackupSys, backupDir, shardValue string, oldFileLeftDay int, + reporter report.Reporter) (ret *Task, err error) { - ret := &Task{ + ret = &Task{ ReportType: consts.RedisBinlogBackupReportType, BkBizID: bkBizID, BkCloudID: bkCloudID, @@ -79,10 +80,11 @@ func NewBinlogBackupTask(bkBizID string, bkCloudID int64, domain, ip string, por BackupDir: backupDir, BackupTag: consts.RedisBinlogTAG, reporter: reporter, + ShardValue: shardValue, } - ret.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisBinlogTAG) - // ret.backupClient, ret.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) - return ret + // ret.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisBinlogTAG) + ret.backupClient, err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) + return ret, err } // Addr string @@ -112,6 +114,11 @@ func (task *Task) BackupLocalBinlogs() { return } + task.reGetShardValWhenClusterEnabled() + if task.Err != nil { + return + } + // 获取文件锁 lockFile := fmt.Sprintf("lock.%s.%d", task.ServerIP, task.ServerPort) lockFile = filepath.Join(task.BackupDir, lockFile) @@ -191,6 +198,23 @@ func (task *Task) newConnect() { return } +func (task *Task) reGetShardValWhenClusterEnabled() { + var enabled bool + var masterNode *myredis.ClusterNodeData + enabled, task.Err = task.Cli.IsClusterEnabled() + if task.Err != nil { + return + } + if !enabled { + return + } + masterNode, task.Err = task.Cli.RedisClusterGetMasterNode(task.Addr()) + if task.Err != nil { + return + } + task.ShardValue = masterNode.SlotSrcStr +} + type tendisBinlogItem struct { File string `json:"file"` // full path KvStoreIdx int `json:"kvstoreidx"` @@ -366,14 +390,14 @@ func (task *Task) compressAndUpload() { // TransferToBackupSystem 备份文件上传到备份系统 func (task *Task) TransferToBackupSystem() { var msg string - cliFileInfo, err := os.Stat(consts.IBSBackupClient) + cliFileInfo, err := os.Stat(consts.COSBackupClient) if err != nil { - err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.IBSBackupClient, err) + err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.COSBackupClient, err) mylog.Logger.Error(err.Error()) return } if !util.IsExecOther(cliFileInfo.Mode().Perm()) { - err = fmt.Errorf("%s is unable to execute by other", consts.IBSBackupClient) + err = fmt.Errorf("%s is unable to execute by other", consts.COSBackupClient) mylog.Logger.Error(err.Error()) return } diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/backupjob.go b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/backupjob.go index 5f931ee3c0..6419189480 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/backupjob.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/backupjob.go @@ -61,21 +61,10 @@ func (job *Job) Run() { } defer job.Reporter.Close() - job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) - // job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) - // if job.Err != nil { - // return - // } - - // 检查历史备份任务状态 并 删除过旧的本地文件 - for _, svrItem := range job.Conf.Servers { - if !consts.IsRedisMetaRole(svrItem.MetaRole) { - continue - } - for _, port := range svrItem.ServerPorts { - job.CheckOldFullbackupStatus(port) - job.DeleteTooOldFullbackup(port) - } + // job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) + job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisFullBackupTAG) + if job.Err != nil { + return } job.createTasks() if job.Err != nil { @@ -90,6 +79,17 @@ func (job *Job) Run() { continue } } + + // 检查历史备份任务状态 并 删除过旧的本地文件 + for _, svrItem := range job.Conf.Servers { + if !consts.IsRedisMetaRole(svrItem.MetaRole) { + continue + } + for _, port := range svrItem.ServerPorts { + job.CheckOldFullbackupStatus(port) + job.DeleteTooOldFullbackup(port) + } + } } // GetRealBackupDir 获取本地全备保存路径 @@ -115,9 +115,11 @@ func (job *Job) GetReporter() { func (job *Job) createTasks() { var task *BackupTask var password string + var instStr string mylog.Logger.Info(fmt.Sprintf("start create fullback tasks,Servers:%s", util.ToString(job.Conf.Servers))) job.Tasks = []*BackupTask{} + for _, svrItem := range job.Conf.Servers { if !consts.IsRedisMetaRole(svrItem.MetaRole) { continue @@ -127,11 +129,16 @@ func (job *Job) createTasks() { if job.Err != nil { return } - task = NewFullBackupTask(svrItem.BkBizID, svrItem.BkCloudID, + instStr = fmt.Sprintf("%s:%d", svrItem.ServerIP, port) + task, job.Err = NewFullBackupTask(svrItem.BkBizID, svrItem.BkCloudID, svrItem.ClusterDomain, svrItem.ServerIP, port, password, - job.Conf.RedisFullBackup.ToBackupSystem, consts.NormalBackupType, job.RealBackupDir, + job.Conf.RedisFullBackup.ToBackupSystem, + consts.NormalBackupType, svrItem.CacheBackupMode, job.RealBackupDir, job.Conf.RedisFullBackup.TarSplit, job.Conf.RedisFullBackup.TarSplitPartSize, - job.Reporter) + svrItem.ServerShards[instStr], job.Reporter) + if job.Err != nil { + return + } job.Tasks = append(job.Tasks, task) } } diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/checkjob.go b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/checkjob.go index 82dc8c1608..d3ae8f2c2a 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/checkjob.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/checkjob.go @@ -52,11 +52,11 @@ func (job *CheckJob) Run() { } defer job.Reporter.Close() - job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) - // job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) - // if job.Err != nil { - // return - // } + // job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) + job.backupClient, job.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisFullBackupTAG) + if job.Err != nil { + return + } // 检查历史备份任务状态 并 删除过旧的本地文件 for _, svrItem := range job.Conf.Servers { diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/task.go b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/task.go index 1c03ff2fc7..815b4b78e8 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/task.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redisfullbackup/task.go @@ -39,6 +39,7 @@ type BackupTask struct { ToBackupSystem string `json:"-"` DbType string `json:"db_type"` // RedisInstance or TendisplusInstance or TendisSSDInstance BackupType string `json:"-"` // 常规备份、下线备份 + CacheBackupMode string `json:"-"` // aof or rdb RealRole string `json:"role"` DataSize uint64 `json:"-"` // redis实例数据大小 DataDir string `json:"-"` @@ -48,10 +49,11 @@ type BackupTask struct { BackupFile string `json:"backup_file"` // 备份的目标文件,如果文件过大会切割成多个 BackupFileSize int64 `json:"backup_file_size"` // 备份文件大小(已切割 or 已压缩 or 已打包) BackupTaskID string `json:"backup_taskid"` - BackupMD5 string `json:"backup_md5"` // 目前为空 - BackupTag string `json:"backup_tag"` // REDIS_FULL or REDIS_BINLOG - StartTime customtime.CustomTime `json:"start_time"` // 生成全备的起始时间 - EndTime customtime.CustomTime `json:"end_time"` // //生成全备的结束时间 + BackupMD5 string `json:"backup_md5"` // 目前为空 + BackupTag string `json:"backup_tag"` // REDIS_FULL + ShardValue string `json:"shard_value"` // shard值 + StartTime customtime.CustomTime `json:"start_time"` // 生成全备的起始时间 + EndTime customtime.CustomTime `json:"end_time"` // //生成全备的结束时间 Status string `json:"status"` Message string `json:"message"` Cli *myredis.RedisClient `json:"-"` @@ -63,9 +65,9 @@ type BackupTask struct { // NewFullBackupTask new backup task func NewFullBackupTask(bkBizID string, bkCloudID int64, domain, ip string, port int, password, - toBackupSys, backupType, backupDir string, tarSplit bool, tarSplitSize string, - reporter report.Reporter) *BackupTask { - ret := &BackupTask{ + toBackupSys, backupType, cacheBackupMode, backupDir string, tarSplit bool, tarSplitSize, shardValue string, + reporter report.Reporter) (ret *BackupTask, err error) { + ret = &BackupTask{ ReportType: consts.RedisFullBackupReportType, BkBizID: bkBizID, BkCloudID: bkCloudID, @@ -75,20 +77,19 @@ func NewFullBackupTask(bkBizID string, bkCloudID int64, domain, ip string, port Password: password, ToBackupSystem: toBackupSys, BackupType: backupType, + CacheBackupMode: cacheBackupMode, BackupDir: backupDir, TarSplit: tarSplit, TarSplitPartSize: tarSplitSize, BackupTaskID: "", BackupMD5: "", BackupTag: consts.RedisFullBackupTAG, + ShardValue: shardValue, reporter: reporter, } - ret.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) - // ret.backupClient, ret.Err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisBinlogTAG) - // if ret.Err != nil { - // return ret - // } - return ret + // ret.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, consts.RedisFullBackupTAG) + ret.backupClient, err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", consts.RedisFullBackupTAG) + return } // Addr string @@ -104,7 +105,6 @@ func (task *BackupTask) ToString() string { // BakcupToLocal 执行备份task,备份到本地 func (task *BackupTask) BakcupToLocal() { - var infoRet map[string]string var connSlaves int var locked bool task.newConnect() @@ -113,13 +113,14 @@ func (task *BackupTask) BakcupToLocal() { } defer task.Cli.Close() - infoRet, task.Err = task.Cli.Info("replication") - if task.Err != nil { - return - } - connSlaves, _ = strconv.Atoi(infoRet["connectedSlaves"]) + connSlaves, task.Err = task.Cli.ConnectedSlaves() // 如果是redis_master且对应的slave大于0,则跳过备份 if task.RealRole == consts.RedisMasterRole && connSlaves > 0 { + mylog.Logger.Info(fmt.Sprintf("redis(%s) is master and has slaves,skip backup", task.Addr())) + return + } + task.reGetShardValWhenClusterEnabled() + if task.Err != nil { return } @@ -271,6 +272,23 @@ func (task *BackupTask) PrecheckDisk() { task.Addr(), task.DataSize/1024/1024, task.BackupDir, bakDiskUsg.AvailSize/1024/1024)) } +func (task *BackupTask) reGetShardValWhenClusterEnabled() { + var enabled bool + var masterNode *myredis.ClusterNodeData + enabled, task.Err = task.Cli.IsClusterEnabled() + if task.Err != nil { + return + } + if !enabled { + return + } + masterNode, task.Err = task.Cli.RedisClusterGetMasterNode(task.Addr()) + if task.Err != nil { + return + } + task.ShardValue = masterNode.SlotSrcStr +} + // RedisInstanceBackup redis(cache)实例备份 func (task *BackupTask) RedisInstanceBackup() { var srcFile string @@ -279,7 +297,8 @@ func (task *BackupTask) RedisInstanceBackup() { var fileSize int64 nowtime := time.Now().Local().Format(consts.FilenameTimeLayout) task.StartTime.Time = time.Now().Local() - if task.RealRole == consts.RedisMasterRole { + if task.RealRole == consts.RedisMasterRole || + task.CacheBackupMode == consts.CacheBackupModeRdb { // redis master backup rdb confMap, task.Err = task.Cli.ConfigGet("dbfilename") if task.Err != nil { @@ -426,7 +445,7 @@ func (task *BackupTask) TendisSSDInstanceBackup() { mylog.Logger.Error(task.Err.Error()) return } - task.BackupFile = filepath.Join(task.BackupDir, tarFile) + task.BackupFile = tarFile task.GetBakFilesSize() if task.Err != nil { return @@ -467,14 +486,14 @@ func (task *BackupTask) TendisSSDSetLougCount() { // TransferToBackupSystem 备份文件上传到备份系统 func (task *BackupTask) TransferToBackupSystem() { var msg string - cliFileInfo, err := os.Stat(consts.IBSBackupClient) + cliFileInfo, err := os.Stat(consts.COSBackupClient) if err != nil { - err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.IBSBackupClient, err) + err = fmt.Errorf("os.stat(%s) failed,err:%v", consts.COSBackupClient, err) mylog.Logger.Error(err.Error()) return } if !util.IsExecOther(cliFileInfo.Mode().Perm()) { - err = fmt.Errorf("%s is unable to execute by other", consts.IBSBackupClient) + err = fmt.Errorf("%s is unable to execute by other", consts.COSBackupClient) mylog.Logger.Error(err.Error()) return } diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/base_task.go b/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/base_task.go index 1a53ed4412..578b563fb6 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/base_task.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/base_task.go @@ -22,6 +22,7 @@ func newBaseTask(conf *config.Configuration, serverConf config.ConfServerItem, p conf.RedisMonitor.BkMonitorEventDataID, conf.RedisMonitor.BkMonitorEventToken, conf.GsePath, + conf.AgentAddress, ) if err != nil { return diff --git a/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/redis_task.go b/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/redis_task.go index 821de3bff8..7fbb600dee 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/redis_task.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/redismonitor/redis_task.go @@ -304,6 +304,17 @@ func (task *RedisMonitorTask) CheckPersist() { continue } appendonly, _ = confmap["appendonly"] + if task.ServerConf.CacheBackupMode == consts.CacheBackupModeRdb { + if strings.ToLower(appendonly) == "yes" { + // 如果集群是rdb备份,但是aof开启,则关闭aof + _, task.Err = cliItem.ConfigSet("appendonly", "yes") + if task.Err != nil { + continue + } + cliItem.ConfigRewrite() + } + return + } if strings.ToLower(appendonly) == "no" { msg = fmt.Sprintf("redis_slave(%s) appendonly==%s", cliItem.Addr, appendonly) mylog.Logger.Warn(msg) diff --git a/dbm-services/redis/db-tools/dbmon/pkg/sendwarning/bkmonitorbeat.go b/dbm-services/redis/db-tools/dbmon/pkg/sendwarning/bkmonitorbeat.go index da83c34997..050b548d37 100644 --- a/dbm-services/redis/db-tools/dbmon/pkg/sendwarning/bkmonitorbeat.go +++ b/dbm-services/redis/db-tools/dbmon/pkg/sendwarning/bkmonitorbeat.go @@ -33,7 +33,7 @@ type BkMonitorEventSender struct { } // NewBkMonitorEventSender new -func NewBkMonitorEventSender(dataID int64, token, gsePath string) (ret *BkMonitorEventSender, err error) { +func NewBkMonitorEventSender(dataID int64, token, gsePath, agentAddress string) (ret *BkMonitorEventSender, err error) { if !util.FileExists(gsePath) { err = fmt.Errorf("GSE_PATH:%s not exists", gsePath) mylog.Logger.Error(err.Error()) @@ -50,16 +50,20 @@ func NewBkMonitorEventSender(dataID int64, token, gsePath string) (ret *BkMonito mylog.Logger.Error(err.Error()) return } - beatConf := filepath.Join(gsePath, "plugins/etc/bkmonitorbeat.conf") - if !util.FileExists(beatConf) { - err = fmt.Errorf("%s not exists", beatConf) - mylog.Logger.Error(err.Error()) - return - } - grepCmd := fmt.Sprintf(`grep ipc %s|awk '{print $2}'`, beatConf) - ret.AgentAddress, err = util.RunBashCmd(grepCmd, "", nil, 10*time.Second) - if err != nil { - return + if agentAddress != "" { + ret.AgentAddress = agentAddress + } else { + beatConf := filepath.Join(gsePath, "plugins/etc/bkmonitorbeat.conf") + if !util.FileExists(beatConf) { + err = fmt.Errorf("%s not exists", beatConf) + mylog.Logger.Error(err.Error()) + return + } + grepCmd := fmt.Sprintf(`grep ipc %s|awk '{print $2}'`, beatConf) + ret.AgentAddress, err = util.RunBashCmd(grepCmd, "", nil, 10*time.Second) + if err != nil { + return + } } ret.Data = append(ret.Data, eventBodyItem{}) return diff --git a/dbm-services/redis/redis-dts/bin/config-template.yaml b/dbm-services/redis/redis-dts/bin/config-template.yaml index 12366e9695..11dcd80696 100644 --- a/dbm-services/redis/redis-dts/bin/config-template.yaml +++ b/dbm-services/redis/redis-dts/bin/config-template.yaml @@ -16,24 +16,24 @@ tredisdumpOutputRespFileSize: 1MiB #tredisdump输出格式为RESP格式时,每 tredisdumpOutputCmdFileSize: 1GiB #tredisdump输出格式为普通set/hset命令时,每个文件目标 1GB respFileImportParallelLimit: 4 # RESP格式文件导入时,并发度为4 cmdFileImportParallelLimit: 40 # 普通命令文件导入时,并发度为40(也就是每个task同一时间最大导入40个普通命令格式文件) -respFileImportTimeout: 120 # RESP格式文件导入时,超时时间120s +respFileImportTimeout: 120 # RESP格式文件导入时,超时时间120s cmdFileImportTimeout: 604800 # 普通命令文件导入时,超时时间7天 importMaxRetryTimes: 5 #非list类型的key,导入可重试,最大重试次数 tredisdumpTheadCnt: 10 #tredisdump --thread 参数 tendisplusMakeSyncParallelLimit: 5 memSizePerTendisplusKvStoreSync: 500MiB # 每个tendisplus kvstore启动一个redis-sync,默认其占用500MiB内存 bkDbm: - rootUrl: {{bk_dbm_nginx_url}} - bk_cloud_id: {{bk_dbm_cloud_id}} - db_cloud_token: {{bk_dbm_cloud_token}} + rootUrl: VAR_bk_dbm_nginx_url + bk_cloud_id: VAR_bk_dbm_cloud_id + db_cloud_token: VAR_bk_dbm_cloud_token serviceName: bkDbm -zoneName: {{city_name}} -ABSUSER: {{system_user}} -ABSPASSWORD: {{system_password}} +zoneName: VAR_city_name +ABSUSER: VAR_system_user +ABSPASSWORD: VAR_system_password ABSPORT: 36000 ABSTIMEOUT: 14400 RsyncPullBwLimit: 400000 # rsync bandwidth limit, kbit/s RsyncPullTimeout: 36000 # rsync timeout,10 hour -WarnMessageNotifier: {{warning_msg_notifiers}} #告警通知人 +WarnMessageNotifier: VAR_warning_msg_notifiers #告警通知人 DtsServerDiskMaxUsgRatio: 85 #dtsserver磁盘最大使用90%,超过则发送告警 -DtsServerMemMaxUsgRatio: 80 #dtsserver内存最大使用90%,超过则发送告警 \ No newline at end of file +DtsServerMemMaxUsgRatio: 80 #dtsserver内存最大使用90%,超过则发送告警 diff --git a/dbm-services/redis/redis-dts/bin/tendisssd-sync-template.conf b/dbm-services/redis/redis-dts/bin/tendisssd-sync-template.conf index 648ec75a0b..f93a9034d8 100755 --- a/dbm-services/redis/redis-dts/bin/tendisssd-sync-template.conf +++ b/dbm-services/redis/redis-dts/bin/tendisssd-sync-template.conf @@ -5,6 +5,7 @@ skip-ha=no threads=20 port={{SYNC_PORT}} test-mode=no +proxy-enable={{PROXY_ENABLE}} loglevel={{LOG_LEVEL}} logfile={{SYNC_LOG_FILE}} key-white-regex={{KEY_WHITE_REGEX}} diff --git a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisplus/makeSync.go b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisplus/makeSync.go index 3bd1c28a64..f3eaca361c 100644 --- a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisplus/makeSync.go +++ b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisplus/makeSync.go @@ -141,9 +141,9 @@ func (task *MakeSyncTask) MkSyncDirIfNotExists() { return } -// GetMyRedisSyncTool 本地获取redis-sync-tendisplus +// GetMyRedisSyncTool 本地获取redis-sync func (task *MakeSyncTask) GetMyRedisSyncTool() { - task.RedisSyncTool, task.Err = util.IsToolExecutableInCurrDir("redis-sync-tendisplus") + task.RedisSyncTool, task.Err = util.IsToolExecutableInCurrDir("redis-sync") return } diff --git a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/backupFileFetch.go b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/backupFileFetch.go index 829eee37a0..d5633a03b1 100644 --- a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/backupFileFetch.go +++ b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/backupFileFetch.go @@ -3,10 +3,11 @@ package tendisssd import ( "path/filepath" + "dbm-services/redis/db-tools/dbactuator/pkg/util" "dbm-services/redis/redis-dts/models/mysql/tendisdb" "dbm-services/redis/redis-dts/pkg/constvar" "dbm-services/redis/redis-dts/pkg/dtsTask" - "dbm-services/redis/redis-dts/pkg/remoteOperation" + "dbm-services/redis/redis-dts/pkg/scrdbclient" ) // BakcupFileFetchTask 备份拉取task @@ -65,18 +66,49 @@ func (task *BakcupFileFetchTask) Execute() { } // 从srcIP上拉取备份文件 - var absCli remoteOperation.RemoteOperation - absCli, task.Err = remoteOperation.NewIAbsClientByEnvVars(task.RowData.SrcIP, task.Logger) + // var absCli remoteOperation.RemoteOperation + // absCli, task.Err = remoteOperation.NewIAbsClientByEnvVars(task.RowData.SrcIP, task.Logger) + // if task.Err != nil { + // return + // } + // task.Err = absCli.RemoteDownload( + // filepath.Dir(task.RowData.TendisbackupFile), + // task.TaskDir, + // filepath.Base(task.RowData.TendisbackupFile), + // constvar.GetABSPullBwLimit(), + // ) + // if task.Err != nil { + // return + // } + var localIP string + localIP, task.Err = util.GetLocalIP() if task.Err != nil { return } - task.Err = absCli.RemoteDownload( - filepath.Dir(task.RowData.TendisbackupFile), - task.TaskDir, - filepath.Base(task.RowData.TendisbackupFile), - constvar.GetABSPullBwLimit(), - ) - if task.Err != nil { + cli, err := scrdbclient.NewClient(constvar.BkDbm, task.Logger) + if err != nil { + task.Err = err + return + } + param := scrdbclient.TransferFileReq{} + param.SourceList = append(param.SourceList, scrdbclient.TransferFileSourceItem{ + BkCloudID: int(task.RowData.BkCloudID), + IP: task.RowData.SrcIP, + Account: "mysql", + FileList: []string{ + task.RowData.TendisbackupFile + string(filepath.Separator), + }, + }) + param.TargetAccount = "mysql" + param.TargetDir = task.TaskDir + param.TargetIPList = append(param.TargetIPList, scrdbclient.IPItem{ + BkCloudID: int(task.RowData.BkCloudID), + IP: localIP, + }) + param.Timeout = 2 * 86400 + err = cli.SendNew(param, 5) + if err != nil { + task.Err = err return } diff --git a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/makeSync.go b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/makeSync.go index ed4f791c98..21e53e0faf 100644 --- a/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/makeSync.go +++ b/dbm-services/redis/redis-dts/pkg/dtsTask/tendisssd/makeSync.go @@ -697,6 +697,12 @@ func (task *MakeSyncTask) createSyncConfigFile() { tempData = strings.ReplaceAll(tempData, "{{DST_PASSWORD}}", task.DstPassword) tempData = strings.ReplaceAll(tempData, "{{LOG_LEVEL}}", loglevel) + // 如果目标集群是域名,则redis-sync需要先解析域名中的 proxy ips,而后连接;该行为通过 proxy-enable 参数控制 + proxyEnable := "no" + if util.IsDbDNS(task.GetDstRedisAddr()) { + proxyEnable = "yes" + } + tempData = strings.ReplaceAll(tempData, "{{PROXY_ENABLE}}", proxyEnable) err = ioutil.WriteFile(task.SyncConfFile, []byte(tempData), 0755) if err != nil { task.Logger.Error("Save redis-sync conf fail", zap.Error(err), zap.String("syncConfig", task.SyncConfFile)) diff --git a/dbm-services/redis/redis-dts/util/util.go b/dbm-services/redis/redis-dts/util/util.go index e62aa75f9e..fb4c4f7afa 100644 --- a/dbm-services/redis/redis-dts/util/util.go +++ b/dbm-services/redis/redis-dts/util/util.go @@ -194,7 +194,7 @@ func GetPidThatUsePort(port int, logger *zap.Logger) (pid string, err error) { // gamedb.test.spider.db.#20000 func IsDbDNS(domainName string) bool { domainName = strings.TrimSpace(domainName) - var pattern = `^((\w|-)+)\.((\w|-)+)\.((\w|-)+)\.db\.*#(\d+)|((\w|-)+)\.((\w|-)+)\.((\w|-)+)\.db\.*$` + var pattern = `^((\w|-)+)\.((\w|-)+)\.((\w|-)+)\.db\.*#(\d+)|((\w|-)+)\.((\w|-)+)\.((\w|-)+)\.db:(\d+)|((\w|-)+)\.((\w|-)+)\.((\w|-)+)\.db\.*$` reg01 := regexp.MustCompile(pattern) idDNS := reg01.MatchString(domainName) if idDNS { diff --git a/dbm-services/riak/db-tools/dbactuator/go.mod b/dbm-services/riak/db-tools/dbactuator/go.mod index 52557c5a11..d0057aa1b1 100644 --- a/dbm-services/riak/db-tools/dbactuator/go.mod +++ b/dbm-services/riak/db-tools/dbactuator/go.mod @@ -13,6 +13,7 @@ require ( github.com/spf13/cobra v1.7.0 golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 gopkg.in/ini.v1 v1.67.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/dbm-services/riak/db-tools/dbactuator/go.sum b/dbm-services/riak/db-tools/dbactuator/go.sum index 5da0d8b751..b072bde61d 100644 --- a/dbm-services/riak/db-tools/dbactuator/go.sum +++ b/dbm-services/riak/db-tools/dbactuator/go.sum @@ -42,5 +42,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/cmd.go b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/cmd.go index 38fb0b890f..7bcfebed51 100644 --- a/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/cmd.go +++ b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/cmd.go @@ -33,6 +33,9 @@ func NewRiakCommand() *cobra.Command { NewUninstallCommand(), NewStopCommand(), NewStartCommand(), + NewDeployMonitorCommand(), + NewStartMonitorCommand(), + NewStopMonitorCommand(), }, }, } diff --git a/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/deploy_monitor.go b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/deploy_monitor.go new file mode 100644 index 0000000000..123e139801 --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/deploy_monitor.go @@ -0,0 +1,91 @@ +package riakcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/riak/db-tools/dbactuator/internal/subcmd" + "dbm-services/riak/db-tools/dbactuator/pkg/components/riak" + "dbm-services/riak/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// DeployMonitorAct 部署riak监控dbactor参数 +type DeployMonitorAct struct { + *subcmd.BaseOptions + Payload riak.DeployMonitorComp +} + +// NewDeployMonitorCommand riak搬迁数据进度 +func NewDeployMonitorCommand() *cobra.Command { + act := DeployMonitorAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "deploy-monitor", + Short: "部署监控", + Example: fmt.Sprintf("dbactuator riak deploy-monitor %s", subcmd.CmdBaseExampleStr), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validator()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validator TODO +func (d *DeployMonitorAct) Validator() error { + return d.BaseOptions.Validate() +} + +// Init 反序列化并检查 +func (d *DeployMonitorAct) Init() error { + if err := d.DeserializeAndValidate(&d.Payload); err != nil { + logger.Error("DeserializeAndValidate err %s", err.Error()) + return err + } + return nil +} + +// Run 运行 +func (d *DeployMonitorAct) Run() error { + steps := subcmd.Steps{ + { + FunName: "解压crond和monitor介质", + Func: d.Payload.DeployBinary, + }, + // riak使用mysql-crond实现定时功能 + // 生成mysql-crond与riak-monitor的配置文件,部分根据template生成 + // 部分直接生成yaml + { + FunName: "生成crond的runtime.yaml文件", + Func: d.Payload.GenerateCrondConfigYaml, + }, + { + FunName: "生成monitor的runtime.yaml文件", + Func: d.Payload.GenerateMonitorConfigYaml, + }, + { + FunName: "生成crond的jobs-config.yaml文件", + Func: d.Payload.GenerateJobsConfigYaml, + }, + { + FunName: "生成monitor的items-config.yaml文件", + Func: d.Payload.GenerateItemsConfigYaml, + }, + // 前台预执行便于发现执行报错,然后后台正式执行 + { + FunName: "部署监控", + Func: d.Payload.DeployMonitor, + }, + } + // 部署失败 + if err := steps.Run(); err != nil { + return err + } + // 部署成功 + logger.Info("deploy monitor success") + return nil +} diff --git a/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/start_monitor.go b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/start_monitor.go new file mode 100644 index 0000000000..f6b17b97ec --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/start_monitor.go @@ -0,0 +1,65 @@ +package riakcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/riak/db-tools/dbactuator/internal/subcmd" + "dbm-services/riak/db-tools/dbactuator/pkg/components/riak" + "dbm-services/riak/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// StartMonitorAct 启动监控riak dbactor参数 +type StartMonitorAct struct { + *subcmd.BaseOptions + Payload riak.StartMonitorComp +} + +// NewStartMonitorCommand riak搬迁数据进度 +func NewStartMonitorCommand() *cobra.Command { + act := StartMonitorAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "start-monitor", + Short: "启动监控", + Example: fmt.Sprintf("dbactuator riak start-monitor %s", subcmd.CmdBaseExampleStr), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validator()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validator TODO +func (d *StartMonitorAct) Validator() error { + return d.BaseOptions.Validate() +} + +// Init 反序列化并检查 +func (d *StartMonitorAct) Init() error { + if err := d.DeserializeAndValidate(&d.Payload); err != nil { + logger.Error("DeserializeAndValidate err %s", err.Error()) + return err + } + return nil +} + +// Run 运行 +func (d *StartMonitorAct) Run() error { + steps := subcmd.Steps{ + { + FunName: "启动监控", + Func: d.Payload.StartMonitor, + }, + } + if err := steps.Run(); err != nil { + return err + } + logger.Info("start monitor success") + return nil +} diff --git a/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/stop_monitor.go b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/stop_monitor.go new file mode 100644 index 0000000000..c8e7bc63ae --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/internal/subcmd/riakcmd/stop_monitor.go @@ -0,0 +1,65 @@ +package riakcmd + +import ( + "fmt" + + "dbm-services/common/go-pubpkg/logger" + "dbm-services/riak/db-tools/dbactuator/internal/subcmd" + "dbm-services/riak/db-tools/dbactuator/pkg/components/riak" + "dbm-services/riak/db-tools/dbactuator/pkg/util" + + "github.com/spf13/cobra" +) + +// StopMonitorAct 关闭监控riak dbactor参数 +type StopMonitorAct struct { + *subcmd.BaseOptions + Payload riak.StopMonitorComp +} + +// NewStopMonitorCommand riak关闭监控 +func NewStopMonitorCommand() *cobra.Command { + act := StopMonitorAct{ + BaseOptions: subcmd.GBaseOptions, + } + cmd := &cobra.Command{ + Use: "stop-monitor", + Short: "关闭监控", + Example: fmt.Sprintf("dbactuator riak stop-monitor %s", subcmd.CmdBaseExampleStr), + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(act.Validator()) + util.CheckErr(act.Init()) + util.CheckErr(act.Run()) + }, + } + return cmd +} + +// Validator TODO +func (d *StopMonitorAct) Validator() error { + return d.BaseOptions.Validate() +} + +// Init 反序列化并检查 +func (d *StopMonitorAct) Init() error { + if err := d.DeserializeAndValidate(&d.Payload); err != nil { + logger.Error("DeserializeAndValidate err %s", err.Error()) + return err + } + return nil +} + +// Run 运行 +func (d *StopMonitorAct) Run() error { + steps := subcmd.Steps{ + { + FunName: "关闭监控", + Func: d.Payload.StopMonitor, + }, + } + if err := steps.Run(); err != nil { + return err + } + logger.Info("stop monitor success") + return nil +} diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/deploy_monitor.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/deploy_monitor.go new file mode 100644 index 0000000000..dc5184f09e --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/deploy_monitor.go @@ -0,0 +1,342 @@ +// Package riak TODO +/* + * @Description: 安装 Riak + */ +package riak + +import ( + "bytes" + "dbm-services/common/go-pubpkg/logger" + "dbm-services/riak/db-tools/dbactuator/pkg/components" + "dbm-services/riak/db-tools/dbactuator/pkg/core/cst" + "dbm-services/riak/db-tools/dbactuator/pkg/util/osutil" + "fmt" + "io/ioutil" + "net/http" + "os" + "os/exec" + "path" + "text/template" + "time" + + "github.com/pkg/errors" + "gopkg.in/yaml.v2" +) + +// DeployMonitorComp TODO +type DeployMonitorComp struct { + Params *DeployMonitorParam `json:"extend"` + DeployMonitorRunTimeCtx `json:"-"` +} + +// DeployMonitorParam TODO +type DeployMonitorParam struct { + CrondPkg components.Medium `json:"crond_pkg" validate:"required"` + MonitorPkg components.Medium `json:"monitor_pkg" validate:"required"` + CrondConfig CrondConfigYaml `json:"crond_config" validate:"required"` + MonitorConfig MonitorConfigYaml `json:"monitor_config" validate:"required"` + MonitorItems []MonitorItem `json:"monitor_items" validate:"required"` + JobsConfig JobsConfig `json:"jobs_config" validate:"required"` +} + +type JobsConfig struct { + Jobs []Job `json:"jobs" yaml:"jobs"` + BkBizId int `json:"bk_biz_id" yaml:"bk_biz_id" validate:"required"` +} + +type Job struct { + Name string `json:"name" yaml:"name"` + Enable bool `json:"enable" yaml:"enable"` + Command string `json:"command" yaml:"command"` + Args []string `json:"args" yaml:"args"` + Schedule string `json:"schedule" yaml:"schedule"` + Creator string `json:"creator" yaml:"creator"` + WorkDir string `json:"work_dir" yaml:"work_dir"` +} + +// DeployMonitorRunTimeCtx 运行时上下文 +type DeployMonitorRunTimeCtx struct { + LocalIp string +} + +type CrondConfigYaml struct { + IP string `json:"ip" validate:"required,ipv4"` + BkCloudId *int `json:"bk_cloud_id" validate:"required,gte=0"` + EventDataId int `json:"event_data_id" validate:"required"` + EventDataToken string `json:"event_data_token" validate:"required"` + MetricsDataId int `json:"metrics_data_id" validate:"required"` + MetricsDataToken string `json:"metrics_data_token" validate:"required"` + LogPath string `json:"log_file_dir"` + PidPath string `json:"pid_path"` + InstallPath string `json:"install_path"` + BeatPath string `json:"beat_path" validate:"required"` + AgentAddress string `json:"agent_address" validate:"required"` +} + +type MonitorConfigYaml struct { + BkBizId int `json:"bk_biz_id" validate:"required"` + IP string `json:"ip" validate:"required,ipv4"` + Port int `json:"port" validate:"required,gt=1024,lte=65535"` + BkInstanceId int `json:"bk_instance_id" validate:"required,gt=0"` + ImmuteDomain string `json:"immute_domain" validate:"required"` + MachineType string `json:"machine_type" validate:"required"` + BkCloudId *int `json:"bk_cloud_id" validate:"required,gte=0"` + LogPath string `json:"log_path"` + ItemsConfigPath string `json:"items_config_file" validate:"required"` + InteractTimeout time.Duration `json:"interact_timeout" validate:"required"` +} + +type MonitorItem struct { + Name string `json:"name" yaml:"name"` + Enable *bool `json:"enable" yaml:"enable"` + Schedule *string `json:"schedule" yaml:"schedule"` + MachineType []string `json:"machine_type" yaml:"machine_type"` +} + +// DeployMonitor 启动监控 +func (i *DeployMonitorComp) DeployMonitor() error { + // riak-monitor启动指令存储到jobs-config.yaml,jobs-config.yaml作为mysql-crond的runtime.yaml中的jobs_config + // 启动mysql-crond时,会完成riak-monitor监控项注册。mysql-crond定时执行riak-monitor的指令,实现监控。 + + // 前台执行mysql-crond,方便获取报错 + errChan := make(chan error) + var dryRunErr error + go func() { + dryRunCmd := fmt.Sprintf("%s -c %s", path.Join(cst.CrondPath, "mysql-crond"), + path.Join(cst.CrondPath, "runtime.yaml")) + cmd := exec.Command("bash", "-c", dryRunCmd) + var stderr bytes.Buffer + cmd.Stderr = &stderr + err := cmd.Run() + if err != nil { + errChan <- errors.Wrap(err, stderr.String()) + return + } + errChan <- nil + return + }() + select { + case dryRunErr = <-errChan: + if dryRunErr != nil { + dryRunErr = fmt.Errorf("crond dry-run error: %s", dryRunErr.Error()) + logger.Error(dryRunErr.Error()) + return dryRunErr + } + case <-time.After(time.Second * 10): + // crond运行正常不会自动退出,10秒后没有报错,进一步检查是否启动正常 + logger.Info("crond dry-run running 10s without error") + } + + // 检查crond是否启动 + err := GetCrondEntries() + if err != nil { + logger.Error("crond dry-run check error: %s", err.Error()) + return err + } + + // 退出前台mysql-crond + err = QuitCrond() + if err != nil { + logger.Error("quit crond dry-run error: %s", err.Error()) + return err + } + // 后台执行mysql-crond + nohup := fmt.Sprintf("%s -c %s", path.Join(cst.CrondPath, "start.sh"), + path.Join(cst.CrondPath, "runtime.yaml")) + logger.Info("start crond cmd: %s", nohup) + cmd := exec.Command("bash", "-c", nohup) + err = cmd.Run() + if err != nil { + logger.Error("execute crond failed: %s", err.Error()) + return err + } + time.Sleep(10 * time.Second) + // 检查crond是否启动 + err = GetCrondEntries() + if err != nil { + logger.Error("crond check error: %s", err.Error()) + return err + } + logger.Info("crond started") + return nil +} + +// DeployBinary 部署二进制 +func (i *DeployMonitorComp) DeployBinary() (err error) { + // 解压crond介质 + err = Decompress(i.Params.CrondPkg.GetAbsolutePath(), cst.CrondPath) + if err != nil { + logger.Error("decompress: %s to %s failed: %s", i.Params.CrondPkg.GetAbsolutePath(), + cst.CrondPath, err.Error()) + return err + } + // 解压监控的介质 + err = Decompress(i.Params.MonitorPkg.GetAbsolutePath(), cst.RiakMonitorPath) + if err != nil { + logger.Error("decompress: %s to %s failed: %s", i.Params.MonitorPkg.GetAbsolutePath(), + cst.RiakMonitorPath, err.Error()) + return err + } + return nil +} + +// GenerateCrondConfigYaml 生成crond的runtime.yaml文件 +func (i *DeployMonitorComp) GenerateCrondConfigYaml() (err error) { + i.Params.CrondConfig.LogPath = path.Join(cst.CrondPath, i.Params.CrondConfig.LogPath) + i.Params.CrondConfig.PidPath = cst.CrondPath + i.Params.CrondConfig.InstallPath = cst.CrondPath + err = UseTemplate(cst.CrondPath, "mysql-crond.conf.go.tpl", "runtime.yaml", i.Params.CrondConfig) + if err != nil { + logger.Error("generate crond runtime.yaml error: %s", err.Error()) + return err + } + // todo mysql-crond 模版中jobs_user不是固定值 + cmd := fmt.Sprintf(`sed -i "s/jobs_user: mysql/jobs_user: root/g" %s`, path.Join(cst.CrondPath, "runtime.yaml")) + _, err = osutil.ExecShellCommand(false, cmd) + if err != nil { + logger.Error("execute %s error: %s", cmd, err.Error()) + return err + } + return nil +} + +// GenerateMonitorConfigYaml 生成runtime.yaml文件 +func (i *DeployMonitorComp) GenerateMonitorConfigYaml() (err error) { + i.Params.MonitorConfig.LogPath = path.Join(cst.RiakMonitorPath, i.Params.MonitorConfig.LogPath) + i.Params.MonitorConfig.ItemsConfigPath = path.Join(cst.RiakMonitorPath, i.Params.MonitorConfig.ItemsConfigPath) + err = UseTemplate(cst.RiakMonitorPath, "config.yaml.go.tpl", "runtime.yaml", i.Params.MonitorConfig) + if err != nil { + logger.Error("generate monitor runtime.yaml error: %s", err.Error()) + return err + } + return nil +} + +// GenerateJobsConfigYaml 生成jobs-config.yaml文件 +func (i *DeployMonitorComp) GenerateJobsConfigYaml() (err error) { + err = CreateYaml(cst.CrondPath, "jobs-config.yaml", i.Params.JobsConfig) + if err != nil { + logger.Error("create items-config.yaml file failed: %s", err.Error()) + return err + } + return nil +} + +// GenerateItemsConfigYaml 生成items-config.yaml文件 +func (i *DeployMonitorComp) GenerateItemsConfigYaml() (err error) { + err = CreateYaml(cst.RiakMonitorPath, "items-config.yaml", i.Params.MonitorItems) + if err != nil { + logger.Error("create items-config.yaml file failed: %s", err.Error()) + return err + } + return nil +} + +// Decompress 解压文件到目标路径 +func Decompress(source, target string) error { + err := os.MkdirAll(target, 0755) + if err != nil { + logger.Error("mkdir %s failed: %s", target, err.Error()) + return err + } + decompressCmd := fmt.Sprintf( + `tar zxf %s -C %s`, + source, target, + ) + _, err = osutil.ExecShellCommand(false, decompressCmd) + if err != nil { + logger.Error("decompress mysql-crond pkg failed: %s", err.Error()) + return err + } + return nil +} + +// UseTemplate 使用模版生成yaml文件 +func UseTemplate(vpath, tpl, target string, data interface{}) error { + t, err := template.ParseFiles(path.Join(vpath, tpl)) + if err != nil { + logger.Error("read config template failed: %s", err.Error()) + return err + } + + f, err := os.OpenFile( + path.Join(vpath, target), + os.O_CREATE|os.O_TRUNC|os.O_WRONLY, + 0644, + ) + if err != nil { + logger.Error("create yaml failed: %s", err.Error()) + return err + } + + err = t.Execute(f, data) + if err != nil { + logger.Error("execute template failed: %s", err.Error()) + return err + } + return nil +} + +// CreateYaml 根据结构体生成yaml文件 +func CreateYaml(vpath, target string, data interface{}) error { + content, err := yaml.Marshal(data) + if err != nil { + logger.Error("marshal data failed: %s", err.Error()) + return err + } + f, err := os.OpenFile(path.Join(vpath, target), + os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755) + if err != nil { + logger.Error("create file failed: %s", err.Error()) + return err + } + _, err = f.Write(append(content, []byte("\n")...)) + if err != nil { + logger.Error("write file failed: %s", err.Error()) + return err + } + return nil +} + +func GetCrondEntries() error { + url := fmt.Sprintf("http://127.0.0.1:%d/entries", cst.CrondListenPort) + resp, err := http.Get(url) + defer resp.Body.Close() + if err != nil { + err = fmt.Errorf("connect crond failed: %s", err.Error()) + logger.Error(err.Error()) + return err + } + if resp.StatusCode != 200 { + err = fmt.Errorf("connect crond response status code is: %d not 200 ", resp.StatusCode) + logger.Error(err.Error()) + return err + } + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + err = fmt.Errorf("get crond response failed: %s", err.Error()) + logger.Info(err.Error()) + return err + } + logger.Info("monitor entries register in crond:\n%s", string(body)) + return nil +} + +func QuitCrond() error { + // 关闭启动的 mysql-crond + url := fmt.Sprintf("http://127.0.0.1:%d/quit", cst.CrondListenPort) + resp, err := http.Get(url) + defer resp.Body.Close() + if err != nil { + logger.Error("call quit failed: %s", err.Error()) + return err + } + if resp.StatusCode != 200 { + err = fmt.Errorf("quit crond response status code is: %d not 200 ", resp.StatusCode) + logger.Error(err.Error()) + return err + } + time.Sleep(15 * time.Second) + logger.Info("quit crond success") + return nil +} diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start.go index ed5f8febd5..c1b518f027 100644 --- a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start.go +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start.go @@ -18,7 +18,7 @@ type StartParam struct { type StartRunTimeCtx struct { } -// Start 下架 +// Start 启动 func (i *StartComp) Start() error { return Start() } diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start_monitor.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start_monitor.go new file mode 100644 index 0000000000..c3edb64c93 --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/start_monitor.go @@ -0,0 +1,25 @@ +// Package riak TODO +/* + * @Description: 安装 Riak + */ +package riak + +// StartMonitorComp TODO +type StartMonitorComp struct { + Params *StartMonitorParam `json:"extend"` + StartMonitorRunTimeCtx `json:"-"` +} + +// StartMonitorParam TODO +type StartMonitorParam struct { +} + +// StartMonitorRunTimeCtx 运行时上下文 +type StartMonitorRunTimeCtx struct { +} + +// StartMonitor 启动监控 +func (i *StartMonitorComp) StartMonitor() error { + var deploy *DeployMonitorComp + return deploy.DeployMonitor() +} diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop.go index 95b479b77e..5b3d25f873 100644 --- a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop.go +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop.go @@ -25,7 +25,7 @@ type StopParam struct { type StopRunTimeCtx struct { } -// Stop 下架 +// Stop 关闭 func (i *StopComp) Stop() error { // 关闭实例 cmd := "riak stop" diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop_monitor.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop_monitor.go new file mode 100644 index 0000000000..f8414640db --- /dev/null +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/stop_monitor.go @@ -0,0 +1,33 @@ +// Package riak TODO +/* + * @Description: 安装 Riak + */ +package riak + +import "dbm-services/common/go-pubpkg/logger" + +// StopMonitorComp TODO +type StopMonitorComp struct { + Params *StopMonitorParam `json:"extend"` + StopMonitorRunTimeCtx `json:"-"` +} + +// StopMonitorParam TODO +type StopMonitorParam struct { +} + +// StopMonitorRunTimeCtx 运行时上下文 +type StopMonitorRunTimeCtx struct { +} + +// StopMonitor 关闭监控 +func (i *StopMonitorComp) StopMonitor() error { + // 退出mysql-crond + err := QuitCrond() + if err != nil { + logger.Error("quit crond error: %s", err.Error()) + return err + } + logger.Info("quit crond success") + return nil +} diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/uninstall.go b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/uninstall.go index 33f5d0a1fa..2e44ddc8cb 100644 --- a/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/uninstall.go +++ b/dbm-services/riak/db-tools/dbactuator/pkg/components/riak/uninstall.go @@ -79,13 +79,11 @@ func (i *UninstallComp) Uninstall() error { // 关闭守护进程 killDaemon := `ps -ef | grep 'epmd -daemon' | grep riak | grep -v grep | awk '{print "kill -9 "$2";"}' | sh` vtime := time.Now().Local().Format(cst.TimeLayoutDir) - // 清理crontab - cronBak := fmt.Sprintf("crontab -u riak -l > /data/crontab.bak.%s 2>&1", vtime) - cronDel := "crontab -u riak -r" // 清理riak数据以及日志文件 - fileBak := fmt.Sprintf("mv %s/riak /data/riak.bak.%s", cst.DefaultDataRootPath, vtime) - fileBak2 := fmt.Sprintf("mv %s/riak /data1/riak.bak.%s", cst.AlterNativeDataRootPath, vtime) - cmds := []string{killDaemon, cronBak, cronDel, fileBak, fileBak2} + fileBak := fmt.Sprintf("mv %s/riak %s/riak.bak.%s", cst.DefaultDataRootPath, cst.DefaultDataRootPath, vtime) + fileBak2 := fmt.Sprintf("mv %s/riak %s/riak.bak.%s", cst.AlterNativeDataRootPath, cst.AlterNativeDataRootPath, vtime) + fileBak3 := fmt.Sprintf("mv %s %s.bak.%s", cst.MonitorPath, cst.MonitorPath, vtime) + cmds := []string{killDaemon, fileBak, fileBak2, fileBak3} for _, cmd := range cmds { res, err := osutil.ExecShellCommand(false, cmd) diff --git a/dbm-services/riak/db-tools/dbactuator/pkg/core/cst/riak.go b/dbm-services/riak/db-tools/dbactuator/pkg/core/cst/riak.go index 95eeb2b141..d651272880 100644 --- a/dbm-services/riak/db-tools/dbactuator/pkg/core/cst/riak.go +++ b/dbm-services/riak/db-tools/dbactuator/pkg/core/cst/riak.go @@ -11,7 +11,11 @@ const ( // DefaultHttpPort riak http监听接口 DefaultHttpPort = 8098 // LogPath 日志路径 - LogPath = "/data/riak/log" + LogPath = "/data/riak/log" + MonitorPath = "/data/monitor" + RiakMonitorPath = "/data/monitor/riak-monitor" + CrondPath = "/data/monitor/riak-crond" + CrondListenPort = 9999 // DataDir data目录 DataDir = "/riak/data" // ConfigPath 配置文件路径 diff --git a/dbm-services/riak/db-tools/riak-monitor/.gitignore b/dbm-services/riak/db-tools/riak-monitor/.gitignore new file mode 100644 index 0000000000..12520a1502 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/.gitignore @@ -0,0 +1,32 @@ +build +.idea +logs +.DS_Store +cmd/generator +!.gitkeep +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +# Test binary, built with `go test -c` +*.test +# Output of the go coverage tool, specifically when used with LiteIDE +*.out +# Dependency directories (remove the comment below to include it) +vendor/ +# Go workspace file +go.work +configs/* +log/ +build/ +conf/ +*exe +*.log +.idea/ +sync_test.sh +.vscode/ +scripts/upload_media.sh +scripts/upload.sh +.ci \ No newline at end of file diff --git a/dbm-services/riak/db-tools/riak-monitor/Makefile b/dbm-services/riak/db-tools/riak-monitor/Makefile new file mode 100644 index 0000000000..19af8d1544 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/Makefile @@ -0,0 +1,26 @@ +PROJ="riak-monitor" +MODULE="dbm-services/riak/db-tools/riak-monitor" +VERSION = $(error please set VERSION flag) +PKG = ${PROJ}.tar.gz +OUTPUT_DIR = build +RELEASE_BUILD_FLAG = "-X ${MODULE}/cmd.version=${VERSION} -X ${MODULE}/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X ${MODULE}/cmd.gitHash=`git rev-parse HEAD` " +DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X ${MODULE}/cmd.gitHash="" " + + +.PHONY: release-bin +release-bin: + @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @cp config.yaml.go.tpl ${OUTPUT_DIR}/config.yaml.go.tpl + @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} riak-monitor config.yaml.go.tpl + +.PHONY: dev-bin +dev-bin: + @go build -ldflags ${DEV_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} + @cp config.yaml.go.tpl ${OUTPUT_DIR}/config.yaml.go.tpl + @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} riak-monitor config.yaml.go.tpl + +.PHONY: clean +clean: + @rm -rf $(OUTPUT_DIR) + + diff --git a/dbm-services/riak/db-tools/riak-monitor/README.md b/dbm-services/riak/db-tools/riak-monitor/README.md new file mode 100644 index 0000000000..bca9954908 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/README.md @@ -0,0 +1,194 @@ +# 使用 +* riak-monitor被mysql-crond调起 +* 必须先部署 `mysql-crond` +* 配置文件分为 _runtime_ 配置 和 监控项配置 +* _runtime_ 配置需要作为命令行参数传入, 如 `mysql-crond -c runtime.yaml` +* 监控项配置在 _runtime_ 配置中指定,相关配置文件示例见”示例文件“ +* 前台启动 + * 示例: + * /data/monitor/riak-crond/mysql-crond -c /data/monitor/riak-crond/runtime.yaml +* 后台执行 + * 示例: + * /data/monitor/riak-crond/start.sh -c /data/monitor/riak-crond/runtime.yaml + * cat start.sh + * SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + cd $SCRIPT_DIR && nohup ./mysql-crond ${@:1} & + +* 查看定时任务: + * curl http://xxx:xxx/entries +* 关闭定时任务: + * curl http://xxx:xxx/quit + +## 硬编码项 +目前有两个硬编码项 +1. 执行心跳 +2. 连接 _DB_ 失败 +* 如果监控项配置中缺少这两项, 会被自动添加 +* 以 `hardcode-run` 子命令运行 + + +# 监控项配置 +```go +type MonitorItem struct { + Name string `yaml:"name" validate:"required"` + Enable *bool `yaml:"enable" validate:"required"` + Schedule *string `yaml:"schedule"` + MachineType string `yaml:"machine_type"` +} +``` + +* `name`: 监控项名称, 对应蓝鲸监控平台的事件 +* `enable`: 是否启用 +* `schedule`: 可选, 在 _runtime_ 配置中有默认值, 不建议修改 +* `machine_type`: 基于机器类型的过滤 + +## 分组 +在注册 `mysql-crond entry` 时, 会按照 _schedule_ 把所有监控项分组注册 + +# 开发 +1. 在 `items_collect` 中添加监控项目录, 如 _some_new_item_ +2. 在 _some_new_item_ 中实现 `monitor_item_interface.MonitorItemInterface` +3. 同时还要提供 + * `func New(cc *monitor_item_interface.ConnectionCollect) monitor_item_interface.MonitorItemInterface` + * `func Register() (string, monitor_item_interface.MonitorItemConstructorFuncType)` +4. 在 `items_collect.init` 中注册新增的监控项 +5. 把新增监控项的相关配置已经添加到 _items-config.yaml_ 中 + + +# 监控项 + +| 监控项 |调度计划| 机器类型 | 实例角色 |级别| 说明 |自定义| +|--------------------------|-----|----------------|-----------------|-----|-----------------------------|-----| +| riak-err-notice |@every 1m| riak | | 预警 | 预警错误日志 |schedule, enable +| riak-db-up |@every 10s| backend, proxy | | 致命 | db 连通性. 硬编码, 不可配置, 无需录入配置系统 |enable +| riak_monitor_heart_beat |@every 10s| riak | | 致命 | 监控心跳. 硬编码, 不可配置, 无需录入配置系统 |enable +| riak-load-health |@every 1m| riak | | 致命 | 检查负载与响应情况 |enable +| riak-ring-status |@every 10s| riak | | 致命 | 检查ring status, 发现集群中所有的故障节点 |enable + + +## 示例文件: +请在Editor模式下查看 +1. mysql-crond的runtime.yaml示例: +ip: xxx +port: xxx +bk_cloud_id: 0 +bk_monitor_beat: +custom_event: +bk_data_id: xxx +access_token: xxx +report_type: agent +message_kind: event +custom_metrics: +bk_data_id: xxx +access_token: xxx +report_type: agent +message_kind: timeseries +beat_path: xxx +agent_address: xxx +log: +console: false +log_file_dir: /data/monitor/riak-crond +debug: false +source: true +json: true +pid_path: /data/monitor/riak-crond +jobs_user: root +jobs_config: /data/monitor/riak-crond/jobs-config.yaml + + +2. mysql-crond的jobs-config.yaml示例: +- name: riak-err-notice@every 1m + enable: true + command: /data/monitor/riak-monitor/riak-monitor + args: + - run + - --items + - riak-err-notice + - -c + - /data/monitor/riak-monitor/runtime.yaml + schedule: '@every 1m' + creator: admin + work_dir: "" +- name: riak-load-health@every 1m + enable: true + command: /data/monitor/riak-monitor/riak-monitor + args: + - run + - --items + - riak-load-health + - -c + - /data/monitor/riak-monitor/runtime.yaml + schedule: '@every 1m' + creator: admin + work_dir: "" +- name: riak-ring-status@every 10s + enable: true + command: /data/monitor/riak-monitor/riak-monitor + args: + - run + - --items + - riak-ring-status + - -c + - /data/monitor/riak-monitor/runtime.yaml + schedule: '@every 10s' + creator: admin + work_dir: "" +- name: riak-monitor-hardcode@every 10s + enable: true + command: /data/monitor/riak-monitor/riak-monitor + args: + - hardcode-run + - --items + - riak-db-up,riak_monitor_heart_beat + - -c + - /data/monitor/riak-monitor/runtime.yaml + schedule: '@every 10s' + creator: admin + work_dir: "" + bk_biz_id: xxx + +3. riak-monitor的runtime.yaml示例: +bk_biz_id: xxx +ip: xxx +port: xxx +bk_instance_id: xxx +immute_domain: xxx +machine_type: riak +bk_cloud_id: 0 +log: +console: true +log_file_dir: /data/monitor/riak-monitor/logs +debug: true +source: true +json: false +api_url: xxx +items_config_file: /data/monitor/riak-monitor/items-config.yaml +interact_timeout: 2s +default_schedule: '@every 1m' + +4. riak-monitor的items-config.yaml示例: +- name: riak-err-notice + enable: true + schedule: '@every 1m' + machine_type: + - riak +- name: riak-load-health + enable: true + schedule: '@every 1m' + machine_type: + - riak +- name: riak-ring-status + enable: true + schedule: '@every 10s' + machine_type: + - riak +- name: riak-db-up + enable: true + schedule: '@every 10s' + machine_type: + - riak +- name: riak_monitor_heart_beat + enable: true + schedule: '@every 10s' + machine_type: + - riak diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/cmd.go b/dbm-services/riak/db-tools/riak-monitor/cmd/cmd.go new file mode 100644 index 0000000000..5b729f1814 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/cmd.go @@ -0,0 +1,2 @@ +// Package cmd TODO +package cmd diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/init.go b/dbm-services/riak/db-tools/riak-monitor/cmd/init.go new file mode 100644 index 0000000000..e1055154ef --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/init.go @@ -0,0 +1,79 @@ +package cmd + +import ( + "fmt" + "io" + "os" + "path/filepath" + + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + + "github.com/natefinch/lumberjack" + "golang.org/x/exp/slog" +) + +var executable string +var executableName string +var executableDir string + +func init() { + executable, _ = os.Executable() + // 获取可执行文件的名称 + executableName = filepath.Base(executable) + // 获取可执行文件的路径 + executableDir = filepath.Dir(executable) +} + +// initLogger 初始化日志格式 +func initLogger(cfg *config.LogConfig) { + var ioWriters []io.Writer + + // console打印日志 + if cfg.Console { + ioWriters = append(ioWriters, os.Stdout) + } + + // 日志文件记录日志 + if cfg.LogFileDir != nil { + if !filepath.IsAbs(*cfg.LogFileDir) { + *cfg.LogFileDir = filepath.Join(executableDir, *cfg.LogFileDir) + } + + err := os.MkdirAll(*cfg.LogFileDir, 0755) + if err != nil { + panic(err) + } + + logFile := filepath.Join(*cfg.LogFileDir, fmt.Sprintf("%s.log", executableName)) + _, err = os.Stat(logFile) + if err != nil { + // 目录不存在创建目录 + if os.IsNotExist(err) { + _, err := os.Create(logFile) + if err != nil { + panic(err) + } + } else { + panic(err) + } + } + ioWriters = append(ioWriters, &lumberjack.Logger{Filename: logFile}) + } + // 日志中添加源头信息,方便定位 + handleOpt := slog.HandlerOptions{AddSource: cfg.Source} + if cfg.Debug { + handleOpt.Level = slog.LevelDebug + } else { + handleOpt.Level = slog.LevelInfo + } + + var logger *slog.Logger + // 设置日志格式 + if cfg.Json { + logger = slog.New(slog.NewJSONHandler(io.MultiWriter(ioWriters...), &handleOpt)) + } else { + logger = slog.New(slog.NewTextHandler(io.MultiWriter(ioWriters...), &handleOpt)) + } + + slog.SetDefault(logger) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/root.go b/dbm-services/riak/db-tools/riak-monitor/cmd/root.go new file mode 100644 index 0000000000..b8912b4643 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/root.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "os" + + "github.com/spf13/cobra" + "golang.org/x/exp/slog" +) + +var rootCmd = &cobra.Command{ + Use: "riak-monitor", + Short: "riak-monitor", +} + +func init() { + // rootCmd.PersistentFlags().StringP("config", "c", "", "config file") + // _ = viper.BindPFlag("config", rootCmd.PersistentFlags().Lookup("config")) +} + +// Execute TODO +func Execute() { + err := rootCmd.Execute() + if err != nil { + slog.Error("start", err) + os.Exit(1) + } +} diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_clean.go b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_clean.go new file mode 100644 index 0000000000..9ea91c7bd9 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_clean.go @@ -0,0 +1,63 @@ +package cmd + +import ( + "strings" + + ma "dbm-services/mysql/db-tools/mysql-crond/api" + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + "golang.org/x/exp/slog" +) + +// 清理mysql-crond中riak监控entry,但不包括硬编码。如果要退出监控,可访问mysql-crond的quit接口 +var subCmdClean = &cobra.Command{ + Use: "clean", + Short: "clean all mysql-crond entry", + Long: "clean all mysql-crond entry", + RunE: func(cmd *cobra.Command, args []string) error { + err := config.InitConfig(viper.GetString("clean-config")) + if err != nil { + return err + } + initLogger(config.MonitorConfig.Log) + // 通过mysql-crond的接口删除entry + manager := ma.NewManager(config.MonitorConfig.ApiUrl) + // 获取mysql-crond注册的所有entry + entries, err := manager.Entries() + if err != nil { + slog.Error("clean list entries", err) + return err + } + for _, entry := range entries { + // riak监控的entry,排除硬编码的entry,注意此接口会持久化到crond的配置文件jobs-config.yaml + if strings.HasPrefix(entry.Job.Name, "riak-") && + !strings.Contains(entry.Job.Name, "hardcode") { + eid, err := manager.Delete(entry.Job.Name, true) + if err != nil { + slog.Error( + "delete entry", err, + slog.String("name", entry.Job.Name), + ) + return err + } + slog.Info( + "delete entry", + slog.String("name", entry.Job.Name), + slog.Int("ID", eid), + ) + } + } + return nil + }, +} + +func init() { + subCmdClean.PersistentFlags().StringP("config", "c", "", "config file") + _ = subCmdClean.MarkPersistentFlagRequired("config") + _ = viper.BindPFlag("clean-config", subCmdClean.PersistentFlags().Lookup("config")) + + rootCmd.AddCommand(subCmdClean) + +} diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_hardcode_run.go b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_hardcode_run.go new file mode 100644 index 0000000000..b11bbbf210 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_hardcode_run.go @@ -0,0 +1,49 @@ +package cmd + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + "dbm-services/riak/db-tools/riak-monitor/pkg/mainloop" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + "golang.org/x/exp/slog" +) + +// 硬编码,监控启动后基础的定时任务,包括数据库是否启动、心跳上报 +var subCmdHardCodeRun = &cobra.Command{ + Use: "hardcode-run", + Short: "run hardcode monitor items", + Long: "run hardcode monitor items", + RunE: func(cmd *cobra.Command, args []string) error { + err := config.InitConfig(viper.GetString("hard-run-config")) + if err != nil { + return err + } + initLogger(config.MonitorConfig.Log) + // 加载监控items-config.yaml配置文件 + err = config.LoadMonitorItemsConfig() + if err != nil { + slog.Error("run hardcode monitor load items", err) + return err + } + // 执行监控项对应的函数 + err = mainloop.Run(true) + if err != nil { + slog.Error("run monitor hardcode items", err) + return err + } + return nil + }, +} + +func init() { + subCmdHardCodeRun.PersistentFlags().StringP("config", "c", "", "config file") + _ = subCmdHardCodeRun.MarkPersistentFlagRequired("config") + _ = viper.BindPFlag("hard-run-config", subCmdHardCodeRun.PersistentFlags().Lookup("config")) + + subCmdHardCodeRun.PersistentFlags().StringSliceP("items", "", nil, "run items") + _ = subCmdHardCodeRun.MarkPersistentFlagRequired("items") + _ = viper.BindPFlag("hardcode-items", subCmdHardCodeRun.PersistentFlags().Lookup("items")) + + rootCmd.AddCommand(subCmdHardCodeRun) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_run.go b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_run.go new file mode 100644 index 0000000000..7b6f7c581a --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_run.go @@ -0,0 +1,52 @@ +package cmd + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + "dbm-services/riak/db-tools/riak-monitor/pkg/mainloop" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + "golang.org/x/exp/slog" +) + +// 根据配置文件以及指定的item,运行监控 +var subCmdRun = &cobra.Command{ + Use: "run", + Short: "run monitor items", + Long: "run monitor items", + RunE: func(cmd *cobra.Command, args []string) error { + // 配置初始化 + err := config.InitConfig(viper.GetString("run-config")) + if err != nil { + return err + } + // 初始化日志配置 + initLogger(config.MonitorConfig.Log) + // 加载监控items-config.yaml配置文件 + err = config.LoadMonitorItemsConfig() + if err != nil { + slog.Error("run monitor load items", err) + return err + } + // 执行监控项 + err = mainloop.Run(false) + if err != nil { + slog.Error("msg", "run monitor items", err) + return err + } + return nil + }, +} + +func init() { + // 配置文件 + subCmdRun.PersistentFlags().StringP("config", "c", "", "config file") + _ = subCmdRun.MarkPersistentFlagRequired("config") + _ = viper.BindPFlag("run-config", subCmdRun.PersistentFlags().Lookup("config")) + // 指定items + subCmdRun.PersistentFlags().StringSliceP("items", "", nil, "run items") + _ = subCmdRun.MarkPersistentFlagRequired("items") + _ = viper.BindPFlag("run-items", subCmdRun.PersistentFlags().Lookup("items")) + + rootCmd.AddCommand(subCmdRun) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_version.go b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_version.go new file mode 100644 index 0000000000..eeb516b6df --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/cmd/subcmd_version.go @@ -0,0 +1,42 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +// versionCmd represents the version command +var subCmdVersion = &cobra.Command{ + Use: "version", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + printVersion() + }, +} +var version = "" +var buildStamp = "" +var gitHash = "" + +func init() { + rootCmd.AddCommand(subCmdVersion) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // versionCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // versionCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} +func printVersion() { + fmt.Printf("Version: %s, GitHash: %s, BuildAt: %s\n", version, gitHash, buildStamp) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/config.yaml b/dbm-services/riak/db-tools/riak-monitor/config.yaml new file mode 100644 index 0000000000..5347f41f93 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/config.yaml @@ -0,0 +1,17 @@ +bk_biz_id: xxx +ip: xxx +port: xxx +bk_instance_id: xxx +immute_domain: xxx +machine_type: riak +bk_cloud_id: xxx +log: + console: true + log_file_dir: /data/monitor/riak-monitor/logs + debug: true + source: true + json: false +api_url: http://127.0.0.1:9999 +items_config_file: /data/monitor/riak-monitor/items-config.yaml +interact_timeout: 2s +default_schedule: '@every 1m' diff --git a/dbm-services/riak/db-tools/riak-monitor/config.yaml.go.tpl b/dbm-services/riak/db-tools/riak-monitor/config.yaml.go.tpl new file mode 100644 index 0000000000..b0488e6e7f --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/config.yaml.go.tpl @@ -0,0 +1,17 @@ +bk_biz_id: {{ .BkBizId }} +ip: {{ .IP }} +port: {{ .Port }} +bk_instance_id: {{ .BkInstanceId }} +immute_domain: {{ .ImmuteDomain }} +machine_type: {{ .MachineType }} +bk_cloud_id: {{ .BkCloudId }} +log: + console: true + log_file_dir: {{ .LogPath }} + debug: true + source: true + json: false +api_url: http://127.0.0.1:9999 +items_config_file: {{ .ItemsConfigPath }} +interact_timeout: 2s +default_schedule: '@every 1m' diff --git a/dbm-services/riak/db-tools/riak-monitor/go.mod b/dbm-services/riak/db-tools/riak-monitor/go.mod new file mode 100644 index 0000000000..ed8b8eb031 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/go.mod @@ -0,0 +1,38 @@ +module dbm-services/riak/db-tools/riak-monitor + +go 1.19 + +require ( + github.com/dlclark/regexp2 v1.10.0 + github.com/go-playground/validator v9.31.0+incompatible + github.com/go-sql-driver/mysql v1.7.1 + github.com/natefinch/lumberjack v2.0.0+incompatible + github.com/pkg/errors v0.9.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/viper v1.16.0 + golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 + gopkg.in/yaml.v2 v2.4.0 +) + +require ( + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/dbm-services/riak/db-tools/riak-monitor/go.sum b/dbm-services/riak/db-tools/riak-monitor/go.sum new file mode 100644 index 0000000000..cd57c03fda --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/go.sum @@ -0,0 +1,512 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= +github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator v9.31.0+incompatible h1:UA72EPEogEnq76ehGdEDp4Mit+3FDh548oRqwVgNsHA= +github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= +github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= +golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/dbm-services/riak/db-tools/riak-monitor/items-config.yaml b/dbm-services/riak/db-tools/riak-monitor/items-config.yaml new file mode 100644 index 0000000000..742964af28 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/items-config.yaml @@ -0,0 +1,25 @@ +- name: riak-err-notice + enable: true + schedule: '@every 1m' + machine_type: + - riak +- name: riak-load-health + enable: true + schedule: '@every 1m' + machine_type: + - riak +- name: riak-ring-status + enable: true + schedule: '@every 10s' + machine_type: + - riak +- name: riak-db-up + enable: true + schedule: '@every 10s' + machine_type: + - riak +- name: riak_monitor_heart_beat + enable: true + schedule: '@every 10s' + machine_type: + - riak diff --git a/dbm-services/riak/db-tools/riak-monitor/main.go b/dbm-services/riak/db-tools/riak-monitor/main.go new file mode 100644 index 0000000000..17178c7c87 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/main.go @@ -0,0 +1,8 @@ +package main + +import "dbm-services/riak/db-tools/riak-monitor/cmd" + +func main() { + // 执行命令行指令 + cmd.Execute() +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/config/config.go b/dbm-services/riak/db-tools/riak-monitor/pkg/config/config.go new file mode 100644 index 0000000000..f0e566976e --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/config/config.go @@ -0,0 +1,2 @@ +// Package config 配置 +package config diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/config/init.go b/dbm-services/riak/db-tools/riak-monitor/pkg/config/init.go new file mode 100644 index 0000000000..40c5c65667 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/config/init.go @@ -0,0 +1,142 @@ +package config + +import ( + "os" + "path/filepath" + + "github.com/go-playground/validator" + "golang.org/x/exp/slog" + "gopkg.in/yaml.v2" +) + +var HeartBeatName = "riak_monitor_heart_beat" +var MonitorConfig *monitorConfig +var ItemsConfig []*MonitorItem +var HardCodeSchedule = "@every 10s" + +// InitConfig 配置初始化 +func InitConfig(configPath string) error { + slog.Info("msg", "config path", configPath) + if !filepath.IsAbs(configPath) { + cwd, err := os.Getwd() + if err != nil { + slog.Error("init config", err) + return err + } + + configPath = filepath.Join(cwd, configPath) + } + slog.Info("msg", "absolute config path", configPath) + + content, err := os.ReadFile(configPath) + if err != nil { + slog.Error("init config", err) + return err + } + + slog.Info("msg", "content", string(content)) + MonitorConfig = &monitorConfig{} + slog.Info("msg", "MonitorConfig", MonitorConfig) + err = yaml.UnmarshalStrict(content, MonitorConfig) + if err != nil { + slog.Error("config file content", string(content)) + slog.Error("init config", err) + return err + } + validate := validator.New() + err = validate.Struct(MonitorConfig) + if err != nil { + slog.Error("validate monitor config", err) + return err + } + + return nil +} + +// LoadMonitorItemsConfig 加载监控项配置 +func LoadMonitorItemsConfig() error { + ItemsConfig = make([]*MonitorItem, 0) + + content, err := os.ReadFile(MonitorConfig.ItemsConfigFile) + if err != nil { + slog.Error("load monitor items config", err) + return err + } + + err = yaml.UnmarshalStrict(content, &ItemsConfig) + if err != nil { + slog.Error("unmarshal monitor items config", err) + return err + } + + validate := validator.New() + for _, ele := range ItemsConfig { + err := validate.Struct(ele) + if err != nil { + slog.Error("validate monitor items config", err) + return err + } + } + + return nil +} + +// InjectHardCodeItem 注入硬编码的心跳和riak-db-up监控 +func InjectHardCodeItem() { + enable := true + dbUpItem := &MonitorItem{ + Name: "riak-db-up", + Enable: &enable, + Schedule: &HardCodeSchedule, //&MonitorConfig.DefaultSchedule, + MachineType: []string{MonitorConfig.MachineType}, + } + heartBeatItem := &MonitorItem{ + Name: HeartBeatName, + Enable: &enable, + Schedule: &HardCodeSchedule, //&MonitorConfig.DefaultSchedule, + MachineType: []string{MonitorConfig.MachineType}, + } + slog.Debug("load monitor item", slog.Any("items", ItemsConfig)) + + ItemsConfig = injectItem(dbUpItem, ItemsConfig) + slog.Debug("inject hardcode", slog.Any("items", ItemsConfig)) + + ItemsConfig = injectItem(heartBeatItem, ItemsConfig) + slog.Debug("inject hardcode", slog.Any("items", ItemsConfig)) +} + +func injectItem(item *MonitorItem, collect []*MonitorItem) (res []*MonitorItem) { + for i, ele := range collect { + if ele.Name == item.Name { + // 如果已经在配置文件, 保留 enable 配置, 其他覆盖为默认配置 + res = append(collect[:i], collect[i+1:]...) + item.Enable = ele.Enable + return append(res, item) + } + } + + return append(collect, item) +} + +// WriteMonitorItemsBack 回写监控项到文件 +func WriteMonitorItemsBack() error { + // 注入硬编码监控项后回写items文件 + content, err := yaml.Marshal(ItemsConfig) + if err != nil { + slog.Error("marshal items config", err) + return err + } + + f, err := os.OpenFile(MonitorConfig.ItemsConfigFile, os.O_TRUNC|os.O_WRONLY, 0755) + if err != nil { + slog.Error("open items config file", err) + return err + } + + _, err = f.Write(content) + if err != nil { + slog.Error("write items config file", err) + return err + } + return nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/config/items_config.go b/dbm-services/riak/db-tools/riak-monitor/pkg/config/items_config.go new file mode 100644 index 0000000000..98db2ccccc --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/config/items_config.go @@ -0,0 +1,21 @@ +package config + +import "golang.org/x/exp/slices" + +// MonitorItem 监控项 +type MonitorItem struct { + Name string `yaml:"name" validate:"required"` + Enable *bool `yaml:"enable" validate:"required"` + Schedule *string `yaml:"schedule"` + MachineType []string `yaml:"machine_type"` +} + +// IsEnable 监控项启用 +func (c *MonitorItem) IsEnable() bool { + return c.Enable != nil && *c.Enable +} + +// IsMatchMachineType 机器类型匹配 +func (c *MonitorItem) IsMatchMachineType() bool { + return slices.Index(c.MachineType, MonitorConfig.MachineType) >= 0 +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/config/log_config.go b/dbm-services/riak/db-tools/riak-monitor/pkg/config/log_config.go new file mode 100644 index 0000000000..f5ca53f03d --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/config/log_config.go @@ -0,0 +1,13 @@ +package config + +// LogConfig 日志配置 +type LogConfig struct { + // 是否console输出 + Console bool `yaml:"console"` + // 位置 + LogFileDir *string `yaml:"log_file_dir"` + Debug bool `yaml:"debug"` + // 是否打印日志源头信息 + Source bool `yaml:"source"` + Json bool `yaml:"json"` +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/config/monitor_config.go b/dbm-services/riak/db-tools/riak-monitor/pkg/config/monitor_config.go new file mode 100644 index 0000000000..dec2af5b20 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/config/monitor_config.go @@ -0,0 +1,25 @@ +package config + +import ( + "time" +) + +type monitorConfig struct { + BkBizId int `yaml:"bk_biz_id"` + Ip string `yaml:"ip" validate:"required,ipv4"` + Port int `yaml:"port" validate:"required,gt=1024,lte=65535"` + BkInstanceId int64 `yaml:"bk_instance_id" validate:"required,gt=0"` + ImmuteDomain string `yaml:"immute_domain"` + MachineType string `yaml:"machine_type"` + BkCloudID *int `yaml:"bk_cloud_id" validate:"required,gte=0"` + // 日志配置项 + Log *LogConfig `yaml:"log"` + // items-config.yaml 路径 + ItemsConfigFile string `yaml:"items_config_file" validate:"required"` + // crond的访问url + ApiUrl string `yaml:"api_url" validate:"required"` + // 超时时间 + InteractTimeout time.Duration `yaml:"interact_timeout" validate:"required"` + // 调度频率 + DefaultSchedule string `yaml:"default_schedule" validate:"required"` +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/const.go b/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/const.go new file mode 100644 index 0000000000..67c05d39c1 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/const.go @@ -0,0 +1,10 @@ +package cst + +const ( + // RiakMachineType 机器类型 + RiakMachineType = "riak" + // RiakHttpPort http端口 + RiakHttpPort = 8098 + // RiakAdminPath 管理指令 + RiakAdminPath = "/usr/sbin/riak-admin" +) diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/cst.go b/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/cst.go new file mode 100644 index 0000000000..f558488b06 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst/cst.go @@ -0,0 +1,2 @@ +// Package cst TODO +package cst diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/check_load.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/check_load.go new file mode 100644 index 0000000000..0d7f278adc --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/check_load.go @@ -0,0 +1,57 @@ +package checkload + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst" + "dbm-services/riak/db-tools/riak-monitor/pkg/utils" + "encoding/json" + "fmt" + "strings" + + "golang.org/x/exp/slog" +) + +func CheckResponseTime() (string, error) { + item := `^node_put_fsm_time_mean|^node_get_fsm_time_mean|^node_put_fsm_rejected|^node_get_fsm_rejected` + format := `awk '{print "\""$1"\" "$3}' | awk '{printf("%s: %s,",$1,$2)}' | sed "{s/,$/\}/g}" | sed "{s/^/{/g}"` + cmd := fmt.Sprintf(`%s status | grep -E '%s' | grep -E -v '_60s|_total' | %s`, cst.RiakAdminPath, item, format) + resp, err := utils.ExecShellCommand(false, cmd) + if err != nil { + // 这个检查项是在此riak节点运行时,执行集群ring检查,发现其他异常节点;如果此节点异常,检查联通性时可探测到 + if strings.Contains(err.Error(), "Node did not respond to ping!") { + slog.Warn(fmt.Sprintf("check load. execute [ %s ] error: %s.", cmd, err.Error())) + return "", nil + } else { + errInfo := fmt.Sprintf("check load. execute [ %s ] error: %s", cmd, err.Error()) + return "", fmt.Errorf(errInfo) + } + } + type CheckItems struct { + GetTime int `json:"node_get_fsm_time_mean"` // 客户端发起GET请求到收到响应时间间隔的均值,微妙 + PutTime int `json:"node_put_fsm_time_mean"` // 客户端发起PUT请求到收到响应时间间隔的均值,微妙 + GetRejectedNum int `json:"node_get_fsm_rejected"` // 被过载保护主动拒绝的GET FSM数量 + PutRejectedNum int `json:"node_put_fsm_rejected"` // 被过载保护主动拒绝的PUT FSM数量 + } + var items CheckItems + if err = json.Unmarshal([]byte(resp), &items); err != nil { + err = fmt.Errorf("unmarshall %s to %+v get an error:%s", resp, items, err.Error()) + slog.Error(err.Error()) + return "", err + } + var errList []string + if items.GetTime > 300000 { + errList = append(errList, fmt.Sprintf("get response time over than 0.3s")) + } + if items.PutTime > 500000 { + errList = append(errList, fmt.Sprintf("put response time over than 0.5s")) + } + if items.GetRejectedNum > 0 { + errList = append(errList, fmt.Sprintf("overload protection, get was rejected")) + } + if items.PutRejectedNum > 0 { + errList = append(errList, fmt.Sprintf("overload protection, put was rejected")) + } + if len(errList) > 0 { + return strings.Join(errList, "\n"), nil + } + return "", nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/init.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/init.go new file mode 100644 index 0000000000..c3326c51f5 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload/init.go @@ -0,0 +1,45 @@ +package checkload + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface" + "fmt" + + "github.com/pkg/errors" +) + +var NameCheckLoadHealth = "riak-load-health" + +func init() {} + +// Checker TODO +type Checker struct { + name string + f func() (string, error) +} + +// Run TODO +func (c *Checker) Run() (msg string, err error) { + msg, err = c.f() + if err != nil { + return "", errors.Wrap(err, fmt.Sprintf("run %s", c.name)) + } + return msg, nil +} + +// Name TODO +func (c *Checker) Name() string { + return c.name +} + +// NewCheckLoadHealth TODO +func NewCheckLoadHealth(cc *monitoriteminterface.ConnectionCollect) monitoriteminterface.MonitorItemInterface { + return &Checker{ + name: NameCheckLoadHealth, + f: CheckResponseTime, + } +} + +// RegisterCheckLoadHealth TODO +func RegisterCheckLoadHealth() (string, monitoriteminterface.MonitorItemConstructorFuncType) { + return NameCheckLoadHealth, NewCheckLoadHealth +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/init.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/init.go new file mode 100644 index 0000000000..d2f3e45974 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/init.go @@ -0,0 +1,45 @@ +package checkringstatus + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface" + "fmt" + + "github.com/pkg/errors" +) + +var NameCheckRingStatus = "riak-ring-status" + +func init() {} + +// Checker TODO +type Checker struct { + name string + f func() (string, error) +} + +// Run TODO +func (c *Checker) Run() (msg string, err error) { + msg, err = c.f() + if err != nil { + return "", errors.Wrap(err, fmt.Sprintf("run %s", c.name)) + } + return msg, nil +} + +// Name TODO +func (c *Checker) Name() string { + return c.name +} + +// NewCheckRingStatus TODO +func NewCheckRingStatus(cc *monitoriteminterface.ConnectionCollect) monitoriteminterface.MonitorItemInterface { + return &Checker{ + name: NameCheckRingStatus, + f: CheckRingStatus, + } +} + +// RegisterCheckRingStatus TODO +func RegisterCheckRingStatus() (string, monitoriteminterface.MonitorItemConstructorFuncType) { + return NameCheckRingStatus, NewCheckRingStatus +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/riak_ring_status.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/riak_ring_status.go new file mode 100644 index 0000000000..9bad2ba2a7 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus/riak_ring_status.go @@ -0,0 +1,39 @@ +package checkringstatus + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst" + "dbm-services/riak/db-tools/riak-monitor/pkg/utils" + "fmt" + "regexp" + "strings" + + "golang.org/x/exp/slog" +) + +func CheckRingStatus() (string, error) { + cmd := fmt.Sprintf("%s ringready", cst.RiakAdminPath) + resp, err := utils.ExecShellCommand(false, cmd) + if err != nil { + // 这个检查项是在此riak节点运行时,执行集群ring检查,发现其他异常节点;如果此节点异常,检查联通性时可探测到 + if strings.Contains(err.Error(), "Node did not respond to ping!") { + slog.Warn(fmt.Sprintf("execute [ %s ] error: %s.", cmd, err.Error())) + } else if strings.Contains(resp, "FALSE") { + // FALSE ['riak@xxx','riak@xxx'] down. All nodes need to be up to check. + slog.Error(resp) + // 如果指令无法执行返回error,告警monitor-internal-error; + // 如果指令执行正常,集群异常,返回message,riak-ring-status事件告警 + re := regexp.MustCompile(`\[[^[]*\] down`) + matchArr := re.FindStringSubmatch(resp) + if len(matchArr) == 1 { + return matchArr[0], nil + } else { + return resp, nil + } + } else { + errInfo := fmt.Sprintf("execute [ %s ] error: %s", cmd, err.Error()) + slog.Error(errInfo) + return "", fmt.Errorf(errInfo) + } + } + return "", nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/items_collect.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/items_collect.go new file mode 100644 index 0000000000..d7f7b69f8a --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/items_collect.go @@ -0,0 +1,50 @@ +// TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +// Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://opensource.org/licenses/MIT +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// Package itemscollect 监控项 +package itemscollect + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkload" + "dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/checkringstatus" + "dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog" + "fmt" + + mi "dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface" + + "golang.org/x/exp/slog" +) + +var registeredItemConstructor map[string]func(*mi.ConnectionCollect) mi.MonitorItemInterface + +func registerItemConstructor( + name string, f func(*mi.ConnectionCollect) mi.MonitorItemInterface, +) error { + if _, ok := registeredItemConstructor[name]; ok { + err := fmt.Errorf("%s already registered", name) + slog.Error("register item creator", err) + return err + } + registeredItemConstructor[name] = f + return nil +} + +// RegisteredItemConstructor 返回注册列表 +func RegisteredItemConstructor() map[string]func(*mi.ConnectionCollect) mi.MonitorItemInterface { + return registeredItemConstructor +} + +func init() { + registeredItemConstructor = make(map[string]func(*mi.ConnectionCollect) mi.MonitorItemInterface) + /* + 注册监控项 + */ + _ = registerItemConstructor(riakconsolelog.RegisterRiakErrNotice()) + _ = registerItemConstructor(checkringstatus.RegisterCheckRingStatus()) + _ = registerItemConstructor(checkload.RegisterCheckLoadHealth()) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/init.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/init.go new file mode 100644 index 0000000000..5d3564b9a3 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/init.go @@ -0,0 +1,44 @@ +// TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +// Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://opensource.org/licenses/MIT +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +package riakconsolelog + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface" +) + +var nameRiakErrNotice = "riak-err-notice" + +// Checker TODO +type Checker struct { + name string + f func() (string, error) +} + +// Run TODO +func (c *Checker) Run() (msg string, err error) { + return c.f() +} + +// Name TODO +func (c *Checker) Name() string { + return c.name +} + +// NewRiakErrNotice TODO +func NewRiakErrNotice(cc *monitoriteminterface.ConnectionCollect) monitoriteminterface.MonitorItemInterface { + return &Checker{ + name: nameRiakErrNotice, + f: riakNotice, + } +} + +// RegisterRiakErrNotice TODO +func RegisterRiakErrNotice() (string, monitoriteminterface.MonitorItemConstructorFuncType) { + return nameRiakErrNotice, NewRiakErrNotice +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/riak_notice.go b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/riak_notice.go new file mode 100644 index 0000000000..62bd373133 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect/riakconsolelog/riak_notice.go @@ -0,0 +1,200 @@ +// TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +// Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://opensource.org/licenses/MIT +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +package riakconsolelog + +import ( + "bufio" + "dbm-services/riak/db-tools/riak-monitor/pkg/utils" + "fmt" + "os" + "path" + "path/filepath" + "strconv" + "strings" + "time" + + "golang.org/x/exp/slog" + + "github.com/dlclark/regexp2" +) + +var executable string +var offsetRegFile string +var rowStartPattern *regexp2.Regexp +var riakNoticePattern *regexp2.Regexp +var riakNoticeIgnorePattern *regexp2.Regexp + +func riakNotice() (string, error) { + return ScanLog() +} + +func init() { + executable, _ = os.Executable() + offsetRegFile = filepath.Join(filepath.Dir(executable), "console_log_offset.reg") + now := time.Now() + rowStartPattern = regexp2.MustCompile( + fmt.Sprintf( + `^(?=(?:(%s|%s|%s)))`, + now.Format("2006-01-02"), + now.Format("060102"), + now.Format("20060102"), + ), + regexp2.None, + ) + riakNoticePattern = regexp2.MustCompile( + fmt.Sprintf( + `(?=(?:(%s)))`, + strings.Join( + []string{"error", "fatal"}, + "|", + ), + ), + regexp2.IgnoreCase, + ) + riakNoticeIgnorePattern = regexp2.MustCompile( + fmt.Sprintf( + `(?=(?:(%s)))`, + strings.Join( + []string{"Unrecognized message", + "no function clause matching webmachine_request", + "too many siblings for object"}, + "|", + ), + ), + regexp2.IgnoreCase, + ) +} + +// ScanLog 扫描日志 +func ScanLog() (string, error) { + consoleLogPath, err := findConsoleLogFile() + if err != nil { + return "", err + } + file, offset, err := newScanner(consoleLogPath) + scanner := bufio.NewScanner(file) + var lines, infos []string + // 逐行扫描日志文件 + for scanner.Scan() { + content := scanner.Bytes() + line := scanner.Text() + lines = append(lines, line) + offset += int64(len(content)) + 1 + } + file.Close() + for _, line := range lines { + match, err := rowStartPattern.MatchString(line) + if err != nil { + slog.Error( + "apply row pattern", err, slog.String("pattern", rowStartPattern.String()), + ) + continue + } + // 非完整一行的读取不做判断 + if !match { + continue + } + // 匹配报错信息 + match, err = riakNoticePattern.MatchString(line) + if err != nil { + slog.Error( + "apply pattern", err, slog.String("pattern", riakNoticePattern.String()), + ) + } + if match { + // 应该忽略的报错信息 + matchignore, err := riakNoticeIgnorePattern.MatchString(line) + if err != nil { + slog.Error( + "apply ignore pattern", err, slog.String("ignore pattern", riakNoticeIgnorePattern.String()), + ) + } + if !matchignore { + infos = append(infos, line) + } + } + } + // 更新offsetRegFile文件中,下次读取开始的位置 + f, err := os.OpenFile(offsetRegFile, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755) + if err != nil { + slog.Error("open offset reg", err) + return "", err + } + _, err = f.WriteString(strconv.FormatInt(offset, 10)) + if err != nil { + slog.Error("update offset reg", err) + return "", err + } + if len(infos) > 0 { + return strings.Join(infos, "\n"), nil + } + return "", nil +} + +func findConsoleLogFile() (string, error) { + cmd := `/usr/sbin/riak config effective | grep '^platform_log_dir' | cut -d '=' -f2 | awk '{print $1}'` + LogPath, err := utils.ExecShellCommand(false, cmd) + if err != nil { + slog.Error("get riak log error", err) + return LogPath, err + } + LogPath = strings.ReplaceAll(LogPath, "\n", "") + return path.Join(LogPath, "console.log"), nil +} + +func newScanner(logPath string) (*os.File, int64, error) { + f, err := os.Open(logPath) + if err != nil { + slog.Error("open console log", err) + return nil, 0, err + } + + st, err := f.Stat() + if err != nil { + slog.Error("stat of console log", err) + return nil, 0, err + } + consoleLogSize := st.Size() + + lastOffset, err := lastRoundOffset() + if err != nil { + return nil, 0, err + } + + // errlog 应该是被 rotate 了 + if consoleLogSize < lastOffset { + lastOffset = 0 + } + + // 从lastOffset开始读取文件 + offset, err := f.Seek(lastOffset, 0) + if err != nil { + slog.Error("seek err log", err) + return nil, 0, err + } + return f, offset, nil +} + +func lastRoundOffset() (int64, error) { + content, err := os.ReadFile(offsetRegFile) + if err != nil { + if os.IsNotExist(err) { + return 0, nil + } + slog.Error("read offset reg", err, slog.String("file", offsetRegFile)) + return 0, err + } + + r, err := strconv.ParseInt(string(content), 10, 64) + if err != nil { + slog.Error("parse last offset", err) + return 0, err + } + return r, nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/mainloop/main_loop.go b/dbm-services/riak/db-tools/riak-monitor/pkg/mainloop/main_loop.go new file mode 100644 index 0000000000..c01c13eae8 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/mainloop/main_loop.go @@ -0,0 +1,87 @@ +// TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +// Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://opensource.org/licenses/MIT +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// Package mainloop 主循环 +package mainloop + +import ( + "fmt" + "strings" + + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + "dbm-services/riak/db-tools/riak-monitor/pkg/itemscollect" + "dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface" + "dbm-services/riak/db-tools/riak-monitor/pkg/utils" + + _ "github.com/go-sql-driver/mysql" // mysql TODO + "github.com/pkg/errors" + "github.com/spf13/viper" + "golang.org/x/exp/slices" + "golang.org/x/exp/slog" +) + +// Run TODO +func Run(hardcode bool) error { + var iNames []string + if hardcode { + iNames = viper.GetStringSlice("hardcode-items") + } else { + iNames = viper.GetStringSlice("run-items") + } + slog.Info("main loop", slog.String("items", strings.Join(iNames, ","))) + slog.Info("main loop", slog.Bool("hardcode", hardcode)) + + if hardcode && slices.Index(iNames, config.HeartBeatName) >= 0 { + utils.SendMonitorMetrics(config.HeartBeatName, 1, nil) + } + + cc, err := monitoriteminterface.NewConnectionCollect() + if err != nil { + if hardcode && slices.Index(iNames, "riak-db-up") >= 0 { + utils.SendMonitorEvent("riak-db-up", err.Error()) + } + return nil + } + + if hardcode { + return nil + } + + for _, iName := range iNames { + + if constructor, ok := itemscollect.RegisteredItemConstructor()[iName]; ok { + msg, err := constructor(cc).Run() + if err != nil { + slog.Error("run monitor item", err, slog.String("name", iName)) + utils.SendMonitorEvent( + "monitor-internal-error", + fmt.Sprintf("run monitor item %s failed: %s", iName, err.Error()), + ) + continue + } + + if msg != "" { + slog.Info( + "run monitor items", + slog.String("name", iName), + slog.String("msg", msg), + ) + utils.SendMonitorEvent(iName, msg) + continue + } + + slog.Info("run monitor item pass", slog.String("name", iName)) + + } else { + err := errors.Errorf("%s not registered", iName) + slog.Error("run monitor item", err) + continue + } + } + return nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/connection_collect.go b/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/connection_collect.go new file mode 100644 index 0000000000..c88e2fe36c --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/connection_collect.go @@ -0,0 +1,95 @@ +// TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +// Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://opensource.org/licenses/MIT +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +package monitoriteminterface + +import ( + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + "dbm-services/riak/db-tools/riak-monitor/pkg/internal/cst" + "dbm-services/riak/db-tools/riak-monitor/pkg/utils" + "fmt" + "strings" + "time" + + "golang.org/x/exp/slog" +) + +// ConnectionCollect DB连接对象 +type ConnectionCollect struct { +} + +// NewConnectionCollect 新建连接 +func NewConnectionCollect() (*ConnectionCollect, error) { + if config.MonitorConfig.MachineType == cst.RiakMachineType { + err := ConnectDB( + config.MonitorConfig.Ip, + ) + if err != nil { + slog.Error( + fmt.Sprintf("connect error: %s", config.MonitorConfig.MachineType), err, + slog.String("ip", config.MonitorConfig.Ip), + slog.Int("port", config.MonitorConfig.Port), + ) + return nil, err + } + } + return nil, nil +} + +func ConnectDB(ip string) error { + recheck := 1 + var riakErr error + for i := 0; i <= recheck; i++ { + // 设置缓冲为1防止没有接收者导致阻塞,即Detection已经超时返回 + errChan := make(chan error, 2) + // 这里存在资源泄露的可能,因为不能主动kill掉协程,所以如果这个协程依然阻塞在连接riak,但是 + // 这个函数已经超时返回了,那么这个协程因为被阻塞一直没被释放,直到Riak连接超时,如果阻塞的时间 + // 大于下次探测该实例的时间间隔,则创建协程频率大于释放协程频率,可能会导致oom。可以考虑在Riak + // 客户端连接设置超时时间来防止。 + go CheckRiak(ip, int(config.MonitorConfig.InteractTimeout.Seconds()), errChan) + select { + case riakErr = <-errChan: + if riakErr != nil { + slog.Error(fmt.Sprintf("The Node is out of service:%s.", riakErr.Error())) + } else { + return nil + } + case <-time.After(config.MonitorConfig.InteractTimeout): + slog.Error(fmt.Sprintf("Connect Riak timeout recheck:%d", recheck)) + riakErr = fmt.Errorf(`['riak@%s'] down`, ip) + } + } + return riakErr +} + +// CheckRiak check whether riak alive +func CheckRiak(ip string, timeout int, errChan chan error) { + foundNothing := "riak down, query heartbeat nothing return" + down := fmt.Errorf(`['riak@%s'] down`, ip) + query := fmt.Sprintf(`curl -s --connect-timeout %d -m %d http://%s:%d/types/default/buckets/test/keys/1000`, + timeout, timeout, ip, cst.RiakHttpPort) + insert := fmt.Sprintf( + `%s -X PUT -H 'Content-Type: application/json' -d '{name: "DBATeam", members: 31}'`, query) + _, err := utils.ExecShellCommand(false, insert) + if err != nil { + slog.Warn(fmt.Sprintf("Execute [ %s ] error: %s.", insert, err.Error())) + errChan <- down + return + } + stdout, err := utils.ExecShellCommand(false, query) + if err != nil { + slog.Warn(fmt.Sprintf(" Execute [ %s ] error: %s", query, err.Error())) + errChan <- down + return + } else if strings.Contains(stdout, "not found") { + slog.Warn(fmt.Sprintf("%s. Execute [ %s ]", foundNothing, query)) + errChan <- down + return + } + errChan <- nil +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/monitor_item_interface.go b/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/monitor_item_interface.go new file mode 100644 index 0000000000..d96fe3d03b --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/monitoriteminterface/monitor_item_interface.go @@ -0,0 +1,11 @@ +// Package monitoriteminterface 监控项接口 +package monitoriteminterface + +// MonitorItemInterface TODO +type MonitorItemInterface interface { + Run() (msg string, err error) + Name() string +} + +// MonitorItemConstructorFuncType TODO +type MonitorItemConstructorFuncType func(cc *ConnectionCollect) MonitorItemInterface diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_event.go b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_event.go new file mode 100644 index 0000000000..db059a6a8f --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_event.go @@ -0,0 +1,43 @@ +package utils + +import ( + "strconv" + + ma "dbm-services/mysql/db-tools/mysql-crond/api" + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + + "golang.org/x/exp/slog" +) + +// SendMonitorEvent 向蓝鲸监控发送监控事件 +func SendMonitorEvent(name string, msg string) { + // 借助crond发送监控的信息 + crondManager := ma.NewManager(config.MonitorConfig.ApiUrl) + + // 事件的维度信息 + additionDimension := map[string]interface{}{ + "cluster_domain": config.MonitorConfig.ImmuteDomain, + "machine_type": config.MonitorConfig.MachineType, + "bk_cloud_id": *config.MonitorConfig.BkCloudID, + "port": config.MonitorConfig.Port, + // 实例id + "bk_target_service_instance_id": strconv.FormatInt(config.MonitorConfig.BkInstanceId, 10), + } + + err := crondManager.SendEvent( + name, + msg, + additionDimension, + ) + if err != nil { + slog.Error( + "send event", err, + slog.String("name", name), slog.String("msg", msg), + ) + } + + slog.Info( + "send event", + slog.String("name", name), slog.String("msg", msg), + ) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_metrics.go b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_metrics.go new file mode 100644 index 0000000000..7bc25c39a7 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/send_monitor_metrics.go @@ -0,0 +1,46 @@ +package utils + +import ( + "strconv" + + ma "dbm-services/mysql/db-tools/mysql-crond/api" + "dbm-services/riak/db-tools/riak-monitor/pkg/config" + + "golang.org/x/exp/maps" + "golang.org/x/exp/slog" +) + +// SendMonitorMetrics 向蓝鲸监控发送监控指标,用于发送心跳 +func SendMonitorMetrics(name string, value int64, customDimension map[string]interface{}) { + // 借助crond发送监控的信息 + crondManager := ma.NewManager(config.MonitorConfig.ApiUrl) + // 指标的维度信息 + additionDimension := map[string]interface{}{ + "cluster_domain": config.MonitorConfig.ImmuteDomain, + "machine_type": config.MonitorConfig.MachineType, + "bk_cloud_id": strconv.Itoa(*config.MonitorConfig.BkCloudID), + "port": strconv.Itoa(config.MonitorConfig.Port), + "bk_target_service_instance_id": strconv.FormatInt(config.MonitorConfig.BkInstanceId, 10), + } + + if customDimension != nil { + maps.Copy(additionDimension, customDimension) + } + + err := crondManager.SendMetrics( + name, + value, + additionDimension, + ) + if err != nil { + slog.Error( + "send metrics", err, + slog.String("name", name), slog.Int64("value", value), + ) + } + + slog.Info( + "send metrics", + slog.String("name", name), slog.Int64("msg", value), + ) +} diff --git a/dbm-services/riak/db-tools/riak-monitor/pkg/utils/utils.go b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/utils.go new file mode 100644 index 0000000000..f76e345e74 --- /dev/null +++ b/dbm-services/riak/db-tools/riak-monitor/pkg/utils/utils.go @@ -0,0 +1,38 @@ +// Package utils TODO +package utils + +import ( + "bytes" + "fmt" + "os/exec" + + "github.com/pkg/errors" +) + +// ExecShellCommand 执行 shell 命令 +// 如果有 err, 返回 stderr; 如果没有 err 返回的是 stdout +// 后续尽量不要用这个方法,因为通过标准错误来判断有点不靠谱 +func ExecShellCommand(isSudo bool, param string) (stdoutStr string, err error) { + if isSudo { + param = "sudo " + param + } + cmd := exec.Command("bash", "-c", param) + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + err = cmd.Run() + if err != nil { + if len(stderr.String()) > 0 { + return stderr.String(), errors.WithMessage(err, stderr.String()) + } else { + return stdout.String(), errors.WithMessage(err, stderr.String()) + } + } + + if len(stderr.String()) > 0 { + err = fmt.Errorf("execute shell command(%s) error:%s", param, stderr.String()) + return stderr.String(), err + } + + return stdout.String(), nil +} diff --git a/dbm-ui/Dockerfile b/dbm-ui/Dockerfile index 3cfd11776b..58702e6dd5 100644 --- a/dbm-ui/Dockerfile +++ b/dbm-ui/Dockerfile @@ -1,19 +1,23 @@ -FROM node:16.20.1-slim AS static-builder +FROM node:16.20.1-slim AS frontend-installer ENV NPM_VERSION 8.19.4 -RUN npm config set registry https://mirrors.tencent.com/npm/ +RUN npm config set registry https://mirrors.tencent.com/npm/ && yarn config set registry https://mirrors.tencent.com/npm/ WORKDIR /frontend -COPY frontend ./ +COPY frontend/package.json ./ RUN yarn install -# fix heap out of memory -ENV NODE_OPTIONS="--max_old_space_size=8192" + +FROM frontend-installer AS frontend-builder + +WORKDIR /frontend +COPY frontend ./ + RUN yarn build FROM python:3.6.12-slim-buster AS base -ENV LC_ALL=C.UTF-8 \ - LANG=C.UTF-8 +WORKDIR / +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 ## PYTHON # Seems to speed things up @@ -35,7 +39,7 @@ RUN set -ex && \ RUN set -ex && mkdir ~/.pip && printf '[global]\nindex-url = https://mirrors.tencent.com/pypi/simple/' > ~/.pip/pip.conf -FROM base AS builder +FROM base AS backend-builder WORKDIR / @@ -54,29 +58,30 @@ COPY ./pyproject.toml ./poetry.lock / # 创建 Python 虚拟环境并安装依赖 RUN set -ex && python -m venv /venv && . /venv/bin/activate && pip install --upgrade pip && pip install poetry && poetry install +FROM base AS copy-backend-file +WORKDIR /app +COPY ./ ./ +RUN rm -rf frontend + FROM base AS base-app # 安装运行时依赖 RUN set -ex && \ apt-get update && \ apt-get install -y --no-install-recommends \ - gettext curl vim default-libmysqlclient-dev && \ + gettext curl iputils-ping procps vim default-libmysqlclient-dev && \ rm -rf /var/lib/apt/lists/* WORKDIR /app USER root -ADD ./ ./ - # 拷贝构件 - -COPY --from=builder /venv /venv -COPY --from=static-builder /frontend/dist /app/static/ - -ENV APP_ID=bk-dbm -ENV APP_TOKEN=xxxx +COPY --from=copy-backend-file /app /app +COPY --from=backend-builder /venv /venv +COPY --from=frontend-builder /frontend/dist /app/static/ # 收集静态文件 +ENV APP_ID=bk-dbm APP_TOKEN=xxxx RUN python manage.py collectstatic --settings=config.prod --noinput ENTRYPOINT ["/app"] diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/hdfs.json b/dbm-ui/backend/bk_dataview/dashboards/json/hdfs.json index cd62bfeb5a..4f23907c64 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/hdfs.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/hdfs.json @@ -6,7 +6,7 @@ "description": "", "type": "datasource", "pluginId": "bkmonitor-timeseries-datasource", - "pluginName": "Blueing Monitor TimeSeries" + "pluginName": "BlueKing Monitor TimeSeries" } ], "__elements": {}, @@ -14,9 +14,15 @@ { "type": "datasource", "id": "bkmonitor-timeseries-datasource", - "name": "Blueing Monitor TimeSeries", + "name": "BlueKing Monitor TimeSeries", "version": "3.6.0" }, + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, { "type": "grafana", "id": "grafana", @@ -98,59 +104,15 @@ }, { "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 0, - "y": 1 - }, - "id": 4, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.1.0", - "title": "NameNode数量", - "type": "stat" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "value": 0 + }, { - "color": "green", - "value": null + "color": "yellow", + "value": 1 }, { - "color": "red", - "value": 80 + "color": "green", + "value": 2 } ] } @@ -159,11 +121,11 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 3, + "w": 4, + "x": 0, "y": 1 }, - "id": 18, + "id": 4, "options": { "colorMode": "value", "graphMode": "area", @@ -179,59 +141,70 @@ "textMode": "auto" }, "pluginVersion": "9.1.0", - "title": "ZooKeeper数量", - "type": "stat" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 6, - "y": 1 - }, - "id": 9, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "count_without_time", + "metric_field": "usage", + "refId": "a", + "result_table_id": "dbm_system.cpu_summary", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "hdfs_namenode" + ] + } + ] + } ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.1.0", - "title": "JournalNode数量", + "refId": "A", + "source": "count(bkmonitor:dbm_system:cpu_summary:usage{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", + "step": "", + "type": "range" + } + ], + "title": "NameNode数量", "type": "stat" }, { @@ -263,8 +236,8 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 9, + "w": 4, + "x": 4, "y": 1 }, "id": 10, @@ -275,7 +248,7 @@ "orientation": "auto", "reduceOptions": { "calcs": [ - "lastNotNull" + "last" ], "fields": "", "values": false @@ -283,6 +256,26 @@ "textMode": "auto" }, "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "", + "query_configs": [], + "refId": "A", + "source": "count(bkmonitor:dbm_system:cpu_summary:usage{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" + } + ], "title": "DataNode数量", "type": "stat" }, @@ -309,14 +302,15 @@ "value": 80 } ] - } + }, + "unit": "short" }, "overrides": [] }, "gridPos": { "h": 3, - "w": 3, - "x": 12, + "w": 4, + "x": 8, "y": 1 }, "id": 11, @@ -327,7 +321,7 @@ "orientation": "auto", "reduceOptions": { "calcs": [ - "lastNotNull" + "last" ], "fields": "", "values": false @@ -345,21 +339,21 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "FilesTotal", "query_configs": [ { - "alias": "", + "alias": "FilesTotal", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], "group_by": [], "interval": 60, "interval_unit": "s", - "method": "avg_without_time", + "method": "AVG", "metric_field": "hadoop_namenode_files_total", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -385,7 +379,7 @@ } ], "refId": "A", - "source": "sum(count_over_time(bkmonitor:exporter_es_exporter:group11:elasticsearch_indices_docs_primary{app=\"$app\",cluster_domain=\"$cluster_domain\"}[1m]))", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_namenode_files_total{app=\"$app\",cluster_domain=\"$cluster_domain\"}[1m]))", "step": "", "type": "range" } @@ -412,14 +406,15 @@ "value": null } ] - } + }, + "unit": "short" }, "overrides": [] }, "gridPos": { "h": 3, - "w": 3, - "x": 15, + "w": 4, + "x": 12, "y": 1 }, "id": 12, @@ -522,8 +517,8 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 18, + "w": 4, + "x": 16, "y": 1 }, "id": 13, @@ -626,8 +621,8 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 21, + "w": 4, + "x": 20, "y": 1 }, "id": 16, @@ -733,7 +728,7 @@ }, "gridPos": { "h": 3, - "w": 3, + "w": 4, "x": 0, "y": 4 }, @@ -777,7 +772,7 @@ "group_by": [], "interval": 60, "interval_unit": "s", - "method": "count_without_time", + "method": "COUNT", "metric_field": "hadoop_namenode_State", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -822,6 +817,7 @@ "mode": "thresholds" }, "mappings": [], + "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ @@ -840,11 +836,11 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 3, + "w": 4, + "x": 4, "y": 4 }, - "id": 17, + "id": 20, "options": { "colorMode": "value", "graphMode": "area", @@ -852,7 +848,7 @@ "orientation": "auto", "reduceOptions": { "calcs": [ - "lastNotNull" + "last" ], "fields": "", "values": false @@ -870,17 +866,52 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "code", + "mode": "ui", "module": [], "promqlAlias": "", - "query_configs": [], + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "COUNT", + "metric_field": "hadoop_datanode_call_queue_length", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], "refId": "A", - "source": "sum(count_over_time(bkmonitor:exporter_es_exporter:group6:elasticsearch_jvm_uptime_seconds{app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\"}[1m]))", + "source": "sum(count_over_time(bkmonitor:exporter_es_exporter:group6:elasticsearch_jvm_uptime_seconds{app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"false\",es_master_node=\"false\"}[1m]))", "step": "", "type": "range" } ], - "title": "上报ZooKeeper数量", + "title": "上报DataNode数量", "type": "stat" }, { @@ -894,7 +925,6 @@ "mode": "thresholds" }, "mappings": [], - "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ @@ -913,11 +943,11 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 6, + "w": 4, + "x": 8, "y": 4 }, - "id": 19, + "id": 24, "options": { "colorMode": "value", "graphMode": "area", @@ -943,187 +973,7 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "code", - "module": [], - "promqlAlias": "", - "query_configs": [], - "refId": "A", - "source": "sum(count_over_time(bkmonitor:exporter_es_exporter:group6:elasticsearch_jvm_uptime_seconds{app=\"$app\", cluster_domain=\"$cluster_domain\", name=~\"(cold|warm)-.*\"}[1m]))\n", - "step": "", - "type": "range" - } - ], - "title": "上报JournalNode数量", - "type": "stat" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 9, - "y": 4 - }, - "id": 20, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.1.0", - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [], - "interval": "auto", - "interval_unit": "s", - "method": "count_without_time", - "metric_field": "hadoop_datanode_call_queue_length", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] - } - ], - "refId": "A", - "source": "sum(count_over_time(bkmonitor:exporter_es_exporter:group6:elasticsearch_jvm_uptime_seconds{app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"false\",es_master_node=\"false\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "上报DataNode数量", - "type": "stat" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 12, - "y": 4 - }, - "id": 24, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.1.0", - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", + "mode": "ui", "module": [], "promqlAlias": "", "query_configs": [ @@ -1200,8 +1050,8 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 15, + "w": 4, + "x": 12, "y": 4 }, "id": 29, @@ -1296,6 +1146,10 @@ "color": "green", "value": null }, + { + "color": "#EAB839", + "value": 50 + }, { "color": "red", "value": 80 @@ -1308,15 +1162,12 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 18, + "w": 4, + "x": 16, "y": 4 }, "id": 26, "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ @@ -1325,7 +1176,8 @@ "fields": "", "values": false }, - "textMode": "auto" + "showThresholdLabels": false, + "showThresholdMarkers": false }, "pluginVersion": "9.1.0", "targets": [ @@ -1381,14 +1233,6 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] }, @@ -1423,14 +1267,6 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] } @@ -1442,7 +1278,7 @@ } ], "title": "DFS Used%", - "type": "stat" + "type": "gauge" }, { "datasource": { @@ -1454,7 +1290,28 @@ "color": { "mode": "thresholds" }, - "mappings": [], + "mappings": [ + { + "options": { + "1": { + "color": "green", + "index": 0, + "text": "Green" + }, + "2": { + "color": "super-light-yellow", + "index": 1, + "text": "Yellow" + }, + "3": { + "color": "red", + "index": 2, + "text": "Red" + } + }, + "type": "value" + } + ], "thresholds": { "mode": "absolute", "steps": [ @@ -1465,6 +1322,14 @@ { "color": "green", "value": 1 + }, + { + "color": "#EAB839", + "value": 2 + }, + { + "color": "red", + "value": 3 } ] } @@ -1473,8 +1338,8 @@ }, "gridPos": { "h": 3, - "w": 3, - "x": 21, + "w": 4, + "x": 20, "y": 4 }, "id": 25, @@ -1517,12 +1382,12 @@ "group_by": [], "interval": "auto", "interval_unit": "s", - "method": "sum_without_time", + "method": "max_without_time", "metric_field": "hadoop_namenode_State", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", - "time_field": "", + "time_field": "time", "where": [ { "key": "app", @@ -1604,7 +1469,8 @@ "value": 80 } ] - } + }, + "unit": "bytes" }, "overrides": [] }, @@ -1617,9 +1483,12 @@ "id": 36, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -1634,7 +1503,20 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "CapacityTotal", + "expression": "a/c", + "functions": [] + }, + { + "active": true, + "alias": "CapacityUsed", + "expression": "b/c", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -1642,13 +1524,15 @@ "promqlAlias": "", "query_configs": [ { - "alias": "CapacityTotal", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -1659,30 +1543,32 @@ "time_field": "", "where": [ { - "key": "cluster_domain", + "key": "app", "method": "eq", "value": [ - "$cluster_domain" + "$app" ] }, { "condition": "and", - "key": "instance_host", + "key": "cluster_domain", "method": "eq", "value": [ - "$namenode_ip" + "$cluster_domain" ] } ] }, { - "alias": "CapacityUsed", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -1693,10 +1579,54 @@ "time_field": "", "where": [ { - "key": "cluster_domain", + "key": "app", "method": "eq", "value": [ - "$cluster_domain" + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "c", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" ] } ] @@ -1764,34 +1694,10 @@ "value": 80 } ] - } + }, + "unit": "short" }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "BlocksTotal" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 8, @@ -1822,7 +1728,20 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "BlocksTotal", + "expression": "a/b", + "functions": [] + }, + { + "active": true, + "alias": "FilesTotal", + "expression": "c/b", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -1830,13 +1749,15 @@ "promqlAlias": "", "query_configs": [ { - "alias": "BlocksTotal", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -1860,50 +1781,60 @@ "value": [ "$cluster_domain" ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] }, { "condition": "and", - "key": "instance_host", + "key": "cluster_domain", "method": "eq", "value": [ - "$namenode_ip" + "$cluster_domain" ] } ] - } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ + }, { - "alias": "FilesTotal", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", "metric_field": "hadoop_namenode_files_total", - "refId": "a", + "refId": "c", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", @@ -1922,19 +1853,11 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] } ], - "refId": "B", + "refId": "A", "source": "", "step": "", "type": "range" @@ -2029,7 +1952,14 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "TotalLoad", + "expression": "a/b", + "functions": [] + } + ], "format": "time_series", "hide": false, "host": [], @@ -2038,21 +1968,24 @@ "promqlAlias": "TotalLoad", "query_configs": [ { - "alias": "TotalLoad", + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": 60, "interval_unit": "s", - "method": "AVG", + "method": "avg_without_time", "metric_field": "hadoop_namenode_total_load", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", - "time_field": "", + "time_field": "time", "where": [ { "key": "app", @@ -2068,20 +2001,49 @@ "value": [ "$cluster_domain" ] + } + ] + }, + { + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] }, { "condition": "and", - "key": "instance_host", + "key": "cluster_domain", "method": "eq", "value": [ - "$namenode_ip" + "$cluster_domain" ] } ] } ], "refId": "A", - "source": "avg(avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_namenode_total_load[1m]))", + "source": "avg(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_namenode_total_load{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_host=\"$namenode_ip\"})", "step": "", "type": "range" } @@ -2148,12 +2110,15 @@ "x": 12, "y": 15 }, - "id": 28, + "id": 142, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -2173,21 +2138,21 @@ "host": [], "mode": "ui", "module": [], - "promqlAlias": "状态", + "promqlAlias": "safemode-$tag_bk_target_ip", "query_configs": [ { - "alias": "状态", + "alias": "safemode-$tag_instance_host", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], "group_by": [ - "bk_target_service_instance_id" + "instance_host" ], "interval": 60, "interval_unit": "s", - "method": "MAX", + "method": "avg_without_time", "metric_field": "hadoop_namenode_f_s_state", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -2210,10 +2175,46 @@ ] } ] + }, + { + "alias": "hastate-$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_State", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] } ], "refId": "A", - "source": "avg by(instance_host) (bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_namenode_f_s_state{app=\"$app\",cluster_domain=\"$cluster_domain\"})", + "source": "avg(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_namenode_f_s_state{app=\"$app\",cluster_domain=\"$cluster_domain\"})", "step": "", "type": "range" } @@ -2266,7 +2267,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2275,7 +2277,32 @@ ] } }, - "overrides": [] + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "RpcQueueTimeAvgTime" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] }, "gridPos": { "h": 8, @@ -2283,7 +2310,7 @@ "x": 0, "y": 23 }, - "id": 130, + "id": 131, "options": { "legend": { "calcs": [ @@ -2306,7 +2333,20 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "RpcQueueTimeAvgTime", + "expression": "a * b > 0", + "functions": [] + }, + { + "active": true, + "alias": "RpcProcessingTimeAvgTime", + "expression": "a * c > 0", + "functions": [] + } + ], "format": "time_series", "hide": false, "host": [], @@ -2315,17 +2355,19 @@ "promqlAlias": "", "query_configs": [ { - "alias": "CallQueueLength", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", - "metric_field": "hadoop_namenode_call_queue_length", + "metric_field": "hadoop_namenode_State", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", @@ -2345,13 +2387,77 @@ "value": [ "$cluster_domain" ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_rpc_queue_time_avg_time", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_rpc_processing_time_avg_time", + "refId": "c", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] }, { "condition": "and", - "key": "instance_host", + "key": "cluster_domain", "method": "eq", "value": [ - "$namenode_ip" + "$cluster_domain" ] } ] @@ -2363,7 +2469,7 @@ "type": "range" } ], - "title": "请求队列长度", + "title": "Queue & Processing Time", "type": "timeseries" }, { @@ -2411,7 +2517,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2428,7 +2535,7 @@ "x": 12, "y": 23 }, - "id": 131, + "id": 130, "options": { "legend": { "calcs": [ @@ -2451,7 +2558,14 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "CallQueueLength", + "expression": "a/b", + "functions": [] + } + ], "format": "time_series", "hide": false, "host": [], @@ -2460,17 +2574,19 @@ "promqlAlias": "", "query_configs": [ { - "alias": "RpcQueueTimeAvgTime", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", - "metric_field": "hadoop_namenode_rpc_queue_time_avg_time", + "metric_field": "hadoop_namenode_call_queue_length", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", @@ -2490,34 +2606,44 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] }, { - "alias": "RpcProcessingTimeAvgTime", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", - "metric_field": "hadoop_namenode_rpc_processing_time_avg_time", + "metric_field": "hadoop_namenode_State", "refId": "b", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] } ], "refId": "A", @@ -2526,7 +2652,7 @@ "type": "range" } ], - "title": "Queue & Processing Time", + "title": "请求队列长度", "type": "timeseries" }, { @@ -2574,7 +2700,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2583,32 +2710,7 @@ ] } }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "ScheduledReplicationBlocks" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 8, @@ -2639,7 +2741,32 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "PendingReplicationBlocks", + "expression": "a/e", + "functions": [] + }, + { + "active": true, + "alias": "UnderReplicatedBlocks", + "expression": "b/e", + "functions": [] + }, + { + "active": true, + "alias": "PendingDeletionBlocks", + "expression": "c/e", + "functions": [] + }, + { + "active": true, + "alias": "ScheduledReplicationBlocks", + "expression": "d/e", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -2647,16 +2774,18 @@ "promqlAlias": "", "query_configs": [ { - "alias": "PendingReplicationBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", - "method": "sum_without_time", + "method": "AVG", "metric_field": "hadoop_namenode_pending_replication_blocks", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -2677,25 +2806,19 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] }, { - "alias": "UnderReplicatedBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -2704,16 +2827,34 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] - }, + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, { - "alias": "PendingDeletionBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -2722,16 +2863,34 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] }, { - "alias": "ScheduledReplicationBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -2740,7 +2899,59 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_State", + "refId": "e", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] } ], "refId": "A", @@ -2797,7 +3008,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2837,7 +3049,26 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "CorruptBlocks", + "expression": "a/d", + "functions": [] + }, + { + "active": true, + "alias": "MissingBlocks", + "expression": "b/d", + "functions": [] + }, + { + "active": true, + "alias": "ExcessBlocks", + "expression": "c/d", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -2845,16 +3076,18 @@ "promqlAlias": "", "query_configs": [ { - "alias": "CorruptBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", - "method": "count_without_time", + "method": "AVG", "metric_field": "hadoop_namenode_corrupt_blocks", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -2879,13 +3112,15 @@ ] }, { - "alias": "MissingBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -2894,16 +3129,34 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] }, { - "alias": "ExcessBlocks", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -2912,7 +3165,59 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_State", + "refId": "d", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] } ], "refId": "A", @@ -2969,7 +3274,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -3116,7 +3422,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -3263,7 +3570,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -3272,32 +3580,7 @@ ] } }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "GetFileInfoNumOps" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 8, @@ -3328,7 +3611,32 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "CreateFileOps", + "expression": "a/e", + "functions": [] + }, + { + "active": true, + "alias": "DeleteFileOps", + "expression": "b/e", + "functions": [] + }, + { + "active": true, + "alias": "FilesAppended", + "expression": "c/e", + "functions": [] + }, + { + "active": true, + "alias": "GetFileInfoNumOps", + "expression": "d/e", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -3336,10 +3644,10 @@ "promqlAlias": "", "query_configs": [ { - "alias": "CreateFileOps", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [ { @@ -3352,7 +3660,9 @@ ] } ], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -3376,22 +3686,14 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] }, { - "alias": "DeleteFileOps", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [ { @@ -3404,7 +3706,9 @@ ] } ], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -3413,13 +3717,29 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] }, { - "alias": "FilesAppended", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [ { @@ -3432,7 +3752,9 @@ ] } ], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -3441,13 +3763,29 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] }, { - "alias": "GetFileInfoNumOps", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [ { @@ -3460,7 +3798,9 @@ ] } ], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": "auto", "interval_unit": "s", "method": "AVG", @@ -3469,7 +3809,59 @@ "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", - "where": [] + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "e", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] } ], "refId": "A", @@ -3478,7 +3870,7 @@ "type": "range" } ], - "title": "文件操作", + "title": "File Operations", "type": "timeseries" }, { @@ -3526,7 +3918,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -3567,7 +3960,20 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "LastWrittenTransactionId", + "expression": "a/c", + "functions": [] + }, + { + "active": true, + "alias": "TransactionsSinceLastCheckpoint", + "expression": "b/c", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -3575,10 +3981,10 @@ "promqlAlias": "", "query_configs": [ { - "alias": "LastWrittenTransactionId", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [ { @@ -3591,7 +3997,9 @@ ] } ], - "group_by": [], + "group_by": [ + "instance_host" + ], "interval": 60, "interval_unit": "s", "method": "avg_without_time", @@ -3615,13 +4023,77 @@ "value": [ "$cluster_domain" ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_namenode_transactions_since_last_checkpoint", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "c", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] }, { "condition": "and", - "key": "instance_host", + "key": "cluster_domain", "method": "eq", "value": [ - "$namenode_ip" + "$cluster_domain" ] } ] @@ -3636,19 +4108,6 @@ "title": "Number of Transactions that unCheckpointed", "type": "timeseries" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 55 - }, - "id": 48, - "panels": [], - "title": "NameNode", - "type": "row" - }, { "datasource": { "type": "bkmonitor-timeseries-datasource", @@ -3694,7 +4153,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -3702,7 +4162,7 @@ } ] }, - "unit": "percentunit" + "unit": "short" }, "overrides": [] }, @@ -3710,9 +4170,9 @@ "h": 8, "w": 12, "x": 0, - "y": 56 + "y": 55 }, - "id": 50, + "id": 143, "options": { "legend": { "calcs": [ @@ -3738,8 +4198,8 @@ "expressionList": [ { "active": true, - "alias": "mem_used%", - "expression": "a / b", + "alias": "BlockReportNumOps", + "expression": "a/c", "functions": [] } ], @@ -3751,22 +4211,33 @@ "query_configs": [ { "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": false, "filter_dict": {}, - "functions": [], - "group_by": [ - "__name" + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" ], "interval": 60, "interval_unit": "s", - "method": "max_without_time", - "metric_field": "hadoop_namenode_mem_heap_used_m", + "method": "avg_without_time", + "metric_field": "hadoop_namenode_block_report_num_ops", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", - "time_field": "", + "time_field": "time", "where": [ { "key": "app", @@ -3782,32 +4253,25 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] }, { "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": false, "filter_dict": {}, "functions": [], "group_by": [ - "__name" + "instance_host" ], - "interval": 60, + "interval": "auto", "interval_unit": "s", - "method": "max_without_time", - "metric_field": "hadoop_namenode_mem_heap_max_m", - "refId": "b", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "c", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", @@ -3826,25 +4290,17 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] } ], "refId": "A", - "source": "max(bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_used_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"}) / max by(__name) (bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_max_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"})", + "source": "sum(sum_over_time(bkmonitor:exporter_es_exporter:group2:elasticsearch_indices_store_size_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\"}[1m]))", "step": "", "type": "range" } ], - "title": "jvm heap使用率", + "title": "BlockReportNumOps /s", "type": "timeseries" }, { @@ -3892,14 +4348,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, @@ -3907,9 +4365,9 @@ "h": 8, "w": 12, "x": 12, - "y": 56 + "y": 55 }, - "id": 54, + "id": 144, "options": { "legend": { "calcs": [ @@ -3935,8 +4393,8 @@ "expressionList": [ { "active": true, - "alias": "", - "expression": "a * 60", + "alias": "BlockReportAvgTime", + "expression": "a/c", "functions": [] } ], @@ -3944,36 +4402,27 @@ "host": [], "mode": "ui", "module": [], - "promqlAlias": "young-$tag___name", + "promqlAlias": "", "query_configs": [ { - "alias": "young", + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], + "functions": [], "group_by": [ - "__name" + "instance_host" ], - "interval": 60, + "interval": "auto", "interval_unit": "s", "method": "AVG", - "metric_field": "hadoop_namenode_gc_count", + "metric_field": "hadoop_namenode_block_report_avg_time", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", - "time_field": "", + "time_field": "time", "where": [ { "key": "app", @@ -3989,69 +4438,26 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] - } - ], - "refId": "A", - "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\",gc=\"young\"}[2m])) * 60", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [ - { - "active": true, - "alias": "old-$tag___name", - "expression": "a * 60", - "functions": [] - } - ], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "old-$tag___name", - "query_configs": [ + }, { - "alias": "old-$tag___name", + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", + "display": false, "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], + "functions": [], "group_by": [ - "__name" + "instance_host" ], - "interval": 60, + "interval": "auto", "interval_unit": "s", - "method": "AVG", - "metric_field": "elasticsearch_jvm_gc_collection_seconds_count", - "refId": "a", - "result_table_id": "exporter_es_exporter.group7", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "c", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", "time_field": "", "where": [ @@ -4069,33 +4475,17 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "es_master_node", - "method": "eq", - "value": [ - "true" - ] - }, - { - "condition": "and", - "key": "gc", - "method": "eq", - "value": [ - "old" - ] } ] } ], - "refId": "B", - "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\",gc=\"old\"}[2m])) * 60", + "refId": "A", + "source": "sum(sum_over_time(bkmonitor:exporter_es_exporter:group2:elasticsearch_indices_store_size_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\"}[1m]))", "step": "", "type": "range" } ], - "title": "jvm gc次数(1m)", + "title": "BlockReportAvgTime", "type": "timeseries" }, { @@ -4143,14 +4533,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - } + }, + "unit": "s" }, "overrides": [] }, @@ -4158,14 +4550,17 @@ "h": 8, "w": 12, "x": 0, - "y": 64 + "y": 63 }, "id": 55, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -4180,26 +4575,37 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "$tag_datanode", + "expression": "a/b", + "functions": [] + } + ], "format": "time_series", "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "$tag_datanode", "query_configs": [ { - "alias": "$tag_datanode", + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], "group_by": [ - "datanode" + "datanode", + "instance_host", + "app", + "cluster_domain" ], "interval": 60, "interval_unit": "s", - "method": "SUM", + "method": "AVG", "metric_field": "hadoop_namenode_live_nodes_last_contact", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group3", @@ -4220,20 +4626,35 @@ "value": [ "$app" ] - }, - { - "condition": "and", - "key": "instance_host", - "method": "eq", - "value": [ - "$namenode_ip" - ] } ] + }, + { + "alias": "", + "data_label": "exporter_dbm_hdfs_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "app", + "cluster_domain", + "instance_host" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MIN", + "metric_field": "hadoop_namenode_State", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "time", + "where": [] } ], "refId": "A", - "source": "", + "source": "avg by (datanode, instance_host, app, cluster_domain) (avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_live_nodes_last_contact{app=\"$app\",cluster_domain=\"$cluster_domain\"}[1m])) / ignoring(datanode) group_left min by (app, cluster_domain, instance_host) (min_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_State[1m]) > 0 ) ", "step": "", "type": "range" } @@ -4241,6 +4662,19 @@ "title": "DataNode lastContact Top10", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 71 + }, + "id": 48, + "panels": [], + "title": "NameNode", + "type": "row" + }, { "datasource": { "type": "bkmonitor-timeseries-datasource", @@ -4286,29 +4720,34 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - } + }, + "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 64 + "x": 0, + "y": 72 }, - "id": 52, + "id": 50, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -4323,7 +4762,14 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "$tag_instance_host", + "expression": "a / b", + "functions": [] + } + ], "format": "time_series", "host": [], "mode": "ui", @@ -4334,19 +4780,19 @@ "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", - "display": true, + "display": false, "filter_dict": {}, "functions": [], "group_by": [ - "bk_target_ip" + "instance_host" ], "interval": 60, "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "usage", + "method": "max_without_time", + "metric_field": "hadoop_namenode_mem_heap_used_m", "refId": "a", - "result_table_id": "dbm_system.cpu_summary", - "result_table_label": "os", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", "time_field": "", "where": [ { @@ -4363,26 +4809,54 @@ "value": [ "$cluster_domain" ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] } ] - } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" - } - ], - "title": "CPU使用率", - "type": "timeseries" + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "hadoop_namenode_mem_heap_max_m", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "max(bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_used_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"}) / max by(__name) (bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_max_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"})", + "step": "", + "type": "range" + } + ], + "title": "jvm heap使用率", + "type": "timeseries" }, { "datasource": { @@ -4429,29 +4903,34 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - } + }, + "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, - "x": 0, + "x": 12, "y": 72 }, - "id": 142, + "id": 52, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -4472,59 +4951,14 @@ "mode": "code", "module": [], "promqlAlias": "$tag_bk_target_ip", - "query_configs": [ - { - "alias": "$tag_bk_target_ip", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "speed_sent", - "refId": "a", - "result_table_id": "dbm_system.net", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - } - ], + "query_configs": [], "refId": "A", - "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:net:speed_resv{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", + "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:cpu_summary:usage{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", "step": "", "type": "range" } ], - "title": "入流量", + "title": "CPU使用率", "type": "timeseries" }, { @@ -4572,7 +5006,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4586,15 +5021,18 @@ "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 72 + "x": 0, + "y": 80 }, - "id": 59, + "id": 60, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -4612,62 +5050,17 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "$tag_bk_target_ip", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "speed_sent", - "refId": "a", - "result_table_id": "dbm_system.net", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - } - ], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], "refId": "A", - "source": "avg by(bk_target_ip) (bkmonitor:dbm_system:net:speed_sent{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", + "source": "max by (bk_target_ip) (bkmonitor:dbm_system:netstat:cur_tcp_estab{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", "step": "", "type": "range" } ], - "title": "出流量", + "title": "连接数", "type": "timeseries" }, { @@ -4675,7 +5068,6 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "description": "", "fieldConfig": { "defaults": { "color": { @@ -4716,38 +5108,40 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - }, - "unit": "binBps" + } }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, - "x": 0, + "x": 12, "y": 80 }, - "id": 144, + "id": 62, "options": { "legend": { - "calcs": [], + "calcs": [ + "max", + "last" + ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { - "mode": "multi", + "mode": "single", "sort": "none" } }, - "pluginVersion": "9.1.0", "targets": [ { "cluster": [], @@ -4757,251 +5151,43 @@ }, "expressionList": [], "format": "time_series", - "hide": false, "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "ioutil", - "query_configs": [ - { - "alias": "$tag_bk_target_ip, timewait", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "cur_tcp_timewait", - "refId": "a", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - }, - { - "alias": "$tag_bk_target_ip, closewait", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "cur_tcp_closewait", - "refId": "b", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - }, - { - "alias": "$tag_bk_target_ip, estab", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "cur_tcp_estab", - "refId": "c", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - } - ], - "refId": "C", - "source": "max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "TCP Connection", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 80 - }, - "id": 63, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "", - "query_configs": [], - "refId": "A", - "source": "avg by (bk_target_ip, mount_point) (avg_over_time(bkmonitor:dbm_system:disk:in_use{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\",mount_point!=\"/\",mount_point!=\"/usr/local\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "分区使用率", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], + "refId": "A", + "source": "avg by (bk_target_ip) (irate(bkmonitor:dbm_system:netstat:cur_tcp_estab{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "新建连接数", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, @@ -5024,7 +5210,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5044,9 +5231,12 @@ "id": 64, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -5066,10 +5256,10 @@ "host": [], "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "$tag_bk_target_ip", "query_configs": [], "refId": "A", - "source": "avg by (device_name, bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:rkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"}[1m]))", + "source": "avg by (bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:rkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"}[1m]))", "step": "", "type": "range" } @@ -5122,7 +5312,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5142,9 +5333,12 @@ "id": 65, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -5164,10 +5358,10 @@ "host": [], "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "$tag_bk_target_ip", "query_configs": [], "refId": "A", - "source": "avg by (bk_target_ip, device_name) (avg_over_time(bkmonitor:dbm_system:io:wkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"}[1m]))", + "source": "avg by (bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:wkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"}[1m]))", "step": "", "type": "range" } @@ -5175,19 +5369,6 @@ "title": "磁盘写入", "type": "timeseries" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 96 - }, - "id": 67, - "panels": [], - "title": "DataNode", - "type": "row" - }, { "datasource": { "type": "bkmonitor-timeseries-datasource", @@ -5233,7 +5414,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5248,9 +5430,9 @@ "h": 8, "w": 12, "x": 0, - "y": 97 + "y": 96 }, - "id": 69, + "id": 54, "options": { "legend": { "calcs": [ @@ -5259,9 +5441,7 @@ ], "displayMode": "table", "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "showLegend": true }, "tooltip": { "mode": "single", @@ -5280,10 +5460,10 @@ "host": [], "mode": "ui", "module": [], - "promqlAlias": "$tag___name", + "promqlAlias": "young-$tag___name", "query_configs": [ { - "alias": "$tag_instance_host", + "alias": "LogError-$tag_instance_host", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, @@ -5304,8 +5484,8 @@ ], "interval": 60, "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_blocks_read", + "method": "AVG", + "metric_field": "hadoop_namenode_log_error", "refId": "a", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "result_table_label": "component", @@ -5330,2685 +5510,3090 @@ } ], "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\",gc=\"young\"}[2m])) * 60", "step": "", "type": "range" } ], - "title": "BlocksRead/s", + "title": "Log统计", "type": "timeseries" }, { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 104 }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "id": 67, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "thresholdsStyle": { - "mode": "off" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 89 + }, + "id": 69, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 97 - }, - "id": 132, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_blocks_read", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "title": "BlocksRead/s", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 89 + }, + "id": 132, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ { - "id": "window", - "value": "2m" + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_blocks_written", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] } ] } ], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_blocks_written", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "BlocksWritten/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 97 + }, + "id": 135, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_bytes_written", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] } - ] + ], + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", - "step": "", - "type": "range" - } - ], - "title": "BlocksWritten/s", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "BytesWritten/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 97 + }, + "id": 136, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 105 - }, - "id": 133, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_bytes_read", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "title": "BytesRead/s", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 105 + }, + "id": 133, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ { - "id": "window", - "value": "2m" + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_blocks_removed", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] } ] } ], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_blocks_removed", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "BlocksRemoved/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 105 + }, + "id": 134, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "hadoop_datanode_blocks_replicated", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] } - ] + ], + "refId": "A", + "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", - "step": "", - "type": "range" - } - ], - "title": "BlocksRemoved/s", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "BlocksRepilcated/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 113 + }, + "id": 96, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 105 - }, - "id": 134, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "avg_without_time", + "metric_field": "hadoop_datanode_call_queue_length", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "title": "CallQueueLength", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 113 + }, + "id": 138, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "avg_without_time", + "metric_field": "hadoop_datanode_xceiver_count", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ { - "id": "window", - "value": "2m" + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] } ] } ], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_blocks_replicated", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] + "refId": "A", + "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", - "step": "", - "type": "range" - } - ], - "title": "BlocksRepilcated/s", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "XceiverCount 连接数", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 121 + }, + "id": 139, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 113 - }, - "id": 135, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "avg_without_time", + "metric_field": "hadoop_datanode_rpc_queue_time_avg_time", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "title": "Rpc Queue Time 队列等待耗时", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 121 + }, + "id": 140, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "avg_without_time", + "metric_field": "hadoop_datanode_rpc_processing_time_avg_time", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ { - "id": "window", - "value": "2m" + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] } ] } ], - "group_by": [ - "instance_host" + "refId": "A", + "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", + "step": "", + "type": "range" + } + ], + "title": "Rpc Processing 处理耗时", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 129 + }, + "id": 141, + "options": { + "legend": { + "calcs": [ + "max", + "last" ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_bytes_written", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ { - "key": "app", - "method": "eq", - "value": [ - "$app" + "active": true, + "alias": "$tag_instance_host", + "expression": "a / b", + "functions": [] + } + ], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "hadoop_datanode_mem_heap_used_m", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] }, { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "hadoop_datanode_mem_heap_max_m", + "refId": "b", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] } - ] + ], + "refId": "A", + "source": "max(bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_used_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"}) / max by(__name) (bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_max_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"})", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", - "step": "", - "type": "range" - } - ], - "title": "BytesWritten/s", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "jvm heap使用率", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 129 + }, + "id": 91, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 113 - }, - "id": 136, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag___name", + "query_configs": [ + { + "alias": "$tag_instance_host", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance_host" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "hadoop_datanode_gc_count", + "refId": "a", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{__name=~\"dn-*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",gc=\"young\"}[2m])) * 60", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "old-$tag___name", + "expression": "a * 60", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag___name", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "__name" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "elasticsearch_jvm_gc_collection_seconds_count", + "refId": "a", + "result_table_id": "exporter_es_exporter.group7", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "es_data_node", + "method": "eq", + "value": [ + "true" + ] + }, + { + "condition": "and", + "key": "gc", + "method": "eq", + "value": [ + "old" + ] + }, + { + "condition": "and", + "key": "__name", + "method": "reg", + "value": [ + "dn-*" + ] + } + ] + } + ], + "refId": "B", + "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",gc=\"old\"}[2m])) * 60", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last", - "sortDesc": true + "title": "jvm gc次数(1m)", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 1, + "mappings": [], + "noValue": "Max", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 137 + }, + "id": 88, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [ + { + "alias": "$tag_bk_target_ip", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "avg_without_time", + "metric_field": "usage", + "refId": "a", + "result_table_id": "dbm_system.cpu_summary", + "result_table_label": "os", + "time_field": "", + "where": [ { - "id": "window", - "value": "2m" + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "hdfs_datanode" + ] } ] } ], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "hadoop_datanode_bytes_read", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] + "refId": "A", + "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:cpu_summary:usage{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (irate(bkmonitor:exporter_dbm_hdfs_exporter:group1:hadoop_datanode_blocks_read{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\"}[2m]))", - "step": "", - "type": "range" - } - ], - "title": "BytesRead/s", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "CPU使用率", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 137 + }, + "id": 87, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 121 - }, - "id": 96, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], + "refId": "A", + "source": "avg by(bk_target_ip) (bkmonitor:dbm_system:load:load1{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "title": "系统负载(1m)", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ - { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "hadoop_datanode_call_queue_length", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ] - } - ], - "refId": "A", - "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", - "step": "", - "type": "range" - } - ], - "title": "CallQueueLength", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 145 + }, + "id": 84, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 121 - }, - "id": 138, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], + "refId": "A", + "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:net:speed_recv{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "title": "入流量", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ - { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "hadoop_datanode_xceiver_count", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ] + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 145 + }, + "id": 83, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], + "refId": "A", + "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:net:speed_sent{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", - "step": "", - "type": "range" - } - ], - "title": "XceiverCount 连接数", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "title": "出流量", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "KBs" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 153 + }, + "id": 76, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 129 - }, - "id": 139, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "rkb_s", + "refId": "a", + "result_table_id": "dbm_system.io", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "hdfs_datanode" + ] + } + ] + } + ], + "refId": "A", + "source": "avg by (bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:rkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"}[1m]))", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "title": "磁盘读取", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 153 + }, + "id": 75, + "options": { + "legend": { + "calcs": [ + "max", + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "hadoop_datanode_rpc_queue_time_avg_time", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "rkb_s", + "refId": "a", + "result_table_id": "dbm_system.io", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "hdfs_datanode" + ] + } ] } - ] - } - ], - "refId": "A", - "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", - "step": "", - "type": "range" - } - ], - "title": "Rpc Queue Time 队列等待耗时", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + ], + "refId": "A", + "source": "avg by (bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:wkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"}[1m]))", + "step": "", + "type": "range" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 129 - }, - "id": 140, - "options": { - "legend": { - "calcs": [ - "max", - "last" ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "title": "磁盘写入", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ - { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "hadoop_datanode_rpc_processing_time_avg_time", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ] - } - ], - "refId": "A", - "source": "max by(__name) (bkmonitor:exporter_es_exporter:group6:elasticsearch_thread_pool_queue_count{__name=~\"dn-.*|DN-.*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",type=\"write\"})", - "step": "", - "type": "range" - } - ], - "title": "Rpc Processing 处理耗时", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "thresholdsStyle": { - "mode": "off" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 161 + }, + "id": 82, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 137 - }, - "id": 141, - "options": { - "legend": { - "calcs": [ - "max", - "last" + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [], + "refId": "A", + "source": "max by (bk_target_ip) (bkmonitor:dbm_system:netstat:cur_tcp_estab{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", + "step": "", + "type": "range" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "title": "连接数", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [ - { - "active": true, - "alias": "$tag_instance_host", - "expression": "a / b", - "functions": [] - } - ], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": false, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "max_without_time", - "metric_field": "hadoop_datanode_mem_heap_used_m", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] - }, - { - "alias": "", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": false, - "filter_dict": {}, - "functions": [], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "max_without_time", - "metric_field": "hadoop_datanode_mem_heap_max_m", - "refId": "b", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] - } - ], - "refId": "A", - "source": "max(bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_used_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"}) / max by(__name) (bkmonitor:exporter_es_exporter:group8:elasticsearch_jvm_memory_max_bytes{app=\"$app\",cluster_domain=\"$cluster_domain\",es_master_node=\"true\"})", - "step": "", - "type": "range" - } - ], - "title": "jvm heap使用率", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 137 - }, - "id": 91, - "options": { - "legend": { - "calcs": [ - "max", - "last" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "$tag___name", - "query_configs": [ - { - "alias": "$tag_instance_host", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], - "group_by": [ - "instance_host" - ], - "interval": 60, - "interval_unit": "s", - "method": "AVG", - "metric_field": "hadoop_datanode_gc_count", - "refId": "a", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - } - ] - } - ], - "refId": "A", - "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{__name=~\"dn-*\",app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",gc=\"young\"}[2m])) * 60", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [ - { - "active": true, - "alias": "old-$tag___name", - "expression": "a * 60", - "functions": [] - } - ], - "format": "time_series", - "hide": false, - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "$tag___name", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": false, - "filter_dict": {}, - "functions": [ - { - "id": "irate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], - "group_by": [ - "__name" - ], - "interval": 60, - "interval_unit": "s", - "method": "AVG", - "metric_field": "elasticsearch_jvm_gc_collection_seconds_count", - "refId": "a", - "result_table_id": "exporter_es_exporter.group7", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "es_data_node", - "method": "eq", - "value": [ - "true" - ] - }, - { - "condition": "and", - "key": "gc", - "method": "eq", - "value": [ - "old" - ] - }, - { - "condition": "and", - "key": "__name", - "method": "reg", - "value": [ - "dn-*" - ] - } - ] - } - ], - "refId": "B", - "source": "avg by(__name) (irate(bkmonitor:exporter_es_exporter:group7:elasticsearch_jvm_gc_collection_seconds_count{app=\"$app\",cluster_domain=\"$cluster_domain\",es_data_node=\"true\",gc=\"old\"}[2m])) * 60", - "step": "", - "type": "range" - } - ], - "title": "jvm gc次数(1m)", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 145 - }, - "id": 146, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "$tag_bk_target_ip", - "query_configs": [ - { - "alias": "$tag_bk_target_ip", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "speed_sent", - "refId": "a", - "result_table_id": "dbm_system.net", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_namenode" - ] - } - ] - } - ], - "refId": "A", - "source": "avg by (bk_target_ip) (bkmonitor:dbm_system:net:speed_resv{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"})", - "step": "", - "type": "range" - } - ], - "title": "入流量", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 145 - }, - "id": 147, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "$tag_bk_target_ip", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "speed_sent", - "refId": "a", - "result_table_id": "dbm_system.net", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_datanode" - ] - } - ] - } - ], - "refId": "A", - "source": "avg by(bk_target_ip) (bkmonitor:dbm_system:net:speed_sent{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_namenode\"})", - "step": "", - "type": "range" - } - ], - "title": "出流量", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 153 - }, - "id": 148, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "9.1.0", - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "ioutil", - "query_configs": [ - { - "alias": "$tag_bk_target_ip, timewait", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "cur_tcp_timewait", - "refId": "a", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_datanode" - ] - } - ] - }, - { - "alias": "$tag_bk_target_ip, closewait", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "MAX", - "metric_field": "cur_tcp_closewait", - "refId": "b", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_datanode" - ] - } - ] - }, - { - "alias": "$tag_bk_target_ip, estab", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "cur_tcp_estab", - "refId": "c", - "result_table_id": "dbm_system.netstat", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_datanode" - ] - } - ] - } - ], - "refId": "C", - "source": "max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "TCP Connection", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 153 - }, - "id": 149, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "", - "query_configs": [], - "refId": "A", - "source": "avg by (bk_target_ip, mount_point) (avg_over_time(bkmonitor:dbm_system:disk:in_use{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\",mount_point!=\"/\",mount_point!=\"/usr/local\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "分区使用率", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 161 - }, - "id": 150, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "", - "query_configs": [], - "refId": "A", - "source": "avg by (device_name, bk_target_ip) (avg_over_time(bkmonitor:dbm_system:io:rkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "磁盘读取", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "thresholdsStyle": { - "mode": "off" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 161 + }, + "id": 81, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 161 - }, - "id": 151, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_bk_target_ip", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "filter_dict": {}, + "functions": [ + { + "id": "irate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "cur_tcp_estab", + "refId": "a", + "result_table_id": "dbm_system.netstat", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "hdfs_datanode" + ] + } + ] + } + ], + "refId": "A", + "source": "avg by (bk_target_ip) (irate(bkmonitor:dbm_system:netstat:cur_tcp_estab{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "新建连接数", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "", - "query_configs": [], - "refId": "A", - "source": "avg by (bk_target_ip, device_name) (avg_over_time(bkmonitor:dbm_system:io:wkb_s{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\"}[1m]))", - "step": "", - "type": "range" - } - ], - "title": "磁盘写入", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "thresholdsStyle": { - "mode": "off" + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 169 + }, + "id": 80, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 169 - }, - "id": 145, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "title": "打开fd数", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "bk_target_ip" - ], - "interval": 60, - "interval_unit": "s", - "method": "avg_without_time", - "metric_field": "usage", - "refId": "a", - "result_table_id": "dbm_system.cpu_summary", - "result_table_label": "os", - "time_field": "", - "where": [ - { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "condition": "and", - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "hdfs_datanode" - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ] + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 169 + }, + "id": 79, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "", + "query_configs": [], + "refId": "A", + "source": "sum(bkmonitor:dbm_system:disk:used{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\",mount_point!=\"/\",mount_point!=\"/usr/local\"}) / sum(bkmonitor:dbm_system:disk:total{app=\"$app\",cluster_domain=\"$cluster_domain\",instance_role=\"hdfs_datanode\",mount_point!=\"/\",mount_point!=\"/usr/local\"})", + "step": "", + "type": "range" } ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + "title": "总磁盘使用率", + "type": "timeseries" } ], - "title": "CPU使用率", - "type": "timeseries" + "title": "DataNode", + "type": "row" } ], "refresh": false, "schemaVersion": 37, "style": "dark", - "tags": [ - "hdfs" - ], + "tags": ["hdfs"], "templating": { "list": [ { @@ -8029,51 +8614,11 @@ "data_source_label": "bk_monitor", "data_type_label": "time_series", "group_by": "app", - "metric_field": "hadoop_namenode_rpc_queue_time_num_ops", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", - "where": [] - }, - "queryType": "dimension", - "variables": "" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "definition": "- Blueking Monitor - 维度", - "hide": 0, - "includeAll": false, - "label": "cluster_domain", - "multi": false, - "name": "cluster_domain", - "options": [], - "query": { - "metricConfig": { - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "group_by": "cluster_domain", "metric_field": "usage", "result_table_id": "dbm_system.cpu_summary", "result_table_label": "os", "where": [ { - "key": "app", - "method": "eq", - "value": [ - "$app" - ] - }, - { - "condition": "and", "key": "instance_role", "method": "eq", "value": [ @@ -8083,7 +8628,7 @@ ] }, "queryType": "dimension", - "variables": "$app" + "variables": "" }, "refresh": 1, "regex": "", @@ -8100,18 +8645,18 @@ "definition": "- Blueking Monitor - 维度", "hide": 0, "includeAll": false, - "label": "namenode_ip", + "label": "cluster_domain", "multi": false, - "name": "namenode_ip", + "name": "cluster_domain", "options": [], "query": { "metricConfig": { "data_source_label": "bk_monitor", "data_type_label": "time_series", - "group_by": "instance_host", - "metric_field": "hadoop_namenode_f_s_state", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "result_table_label": "component", + "group_by": "cluster_domain", + "metric_field": "usage", + "result_table_id": "dbm_system.cpu_summary", + "result_table_label": "os", "where": [ { "key": "app", @@ -8122,16 +8667,16 @@ }, { "condition": "and", - "key": "cluster_domain", + "key": "instance_role", "method": "eq", "value": [ - "$cluster_domain" + "hdfs_namenode" ] } ] }, "queryType": "dimension", - "variables": "$app $cluster_domain" + "variables": "$app" }, "refresh": 1, "regex": "", @@ -8142,13 +8687,13 @@ ] }, "time": { - "from": "now-5m", + "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "default", "title": "HDFS", "uid": "m8Demr1Vk", - "version": 37, + "version": 72, "weekStart": "" } \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json new file mode 100644 index 0000000000..f20b873e96 --- /dev/null +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json @@ -0,0 +1,6225 @@ +{ + "__inputs": [ + { + "name": "DS_蓝鲸监控_- 指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "BlueKing Monitor TimeSeries" + }, + { + "name": "DS_日志平台", + "label": "日志平台", + "description": "", + "type": "datasource", + "pluginId": "bk_log_datasource", + "pluginName": "BlueKing Log TimeSeries" + }, + { + "name": "VAR_SPIDER_MASTER", + "type": "constant", + "label": "spider_master", + "value": "spider_master", + "description": "" + }, + { + "name": "VAR_REMOTE_MASTER", + "type": "constant", + "label": "remote_master", + "value": "remote_master", + "description": "" + }, + { + "name": "VAR_REMOTE_SLAVE", + "type": "constant", + "label": "remote_slave", + "value": "remote_slave", + "description": "" + }, + { + "name": "VAR_SPIDER_SLAVE", + "type": "constant", + "label": "spider_slave", + "value": "spider_slave", + "description": "" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "datasource", + "id": "bk_log_datasource", + "name": "BlueKing Log TimeSeries", + "version": "1.0.0" + }, + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "BlueKing Monitor TimeSeries", + "version": "3.6.0" + }, + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.1.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 22, + "panels": [], + "title": "Summary", + "type": "row" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 0, + "y": 1 + }, + "id": 10, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "name" + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_version", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "version" + ], + "interval": "auto", + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "mysql_version_info", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.version", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "instant" + } + ], + "title": "MySQL Version", + "type": "stat" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 5, + "x": 3, + "y": 1 + }, + "id": 14, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "limit": 2, + "values": true + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "table", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MAX", + "metric_field": "mysql_datadir_df_usage", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "instance_role", + "method": "eq", + "value": [ + "$remote_master" + ] + }, + { + "condition": "and", + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "instant" + } + ], + "title": "Capacity Used Pct", + "type": "gauge" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "select|insert|update|delete|replace|commit", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 1 + }, + "id": 33, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_command", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "command" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_commands_total", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + }, + { + "condition": "and", + "key": "command", + "method": "reg", + "value": [ + "select|insert|update|delete" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit\",instance_role=\"$spider_master\"}[2m])) >0", + "step": "", + "type": "range" + } + ], + "title": "QPS (spider total)", + "transformations": [ + { + "id": "calculateField", + "options": { + "mode": "reduceRow", + "reduce": { + "include": [ + "commit", + "delete", + "delete_multi", + "insert", + "insert_select", + "replace", + "replace_select", + "select", + "update", + "update_multi", + "xa_commit" + ], + "reducer": "sum" + } + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 1 + }, + "id": 55, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "cpu_used total", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "usage", + "refId": "a", + "result_table_id": "system.cpu_summary", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "bk_target_ip", + "method": "eq", + "value": [ + "$host" + ] + } + ] + } + ], + "refId": "C", + "source": "", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": true, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "Load 1m", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "MAX", + "metric_field": "load1", + "refId": "a", + "result_table_id": "system.load", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "bk_target_ip", + "method": "eq", + "value": [ + "$host" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "MAX", + "metric_field": "load1", + "refId": "a", + "result_table_id": "dbm_system.load", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$spider_master" + ] + } + ] + } + ], + "refId": "B", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "CPU Usage / Load (spider max)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 0, + "y": 3 + }, + "id": 15, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "mysql_global_status_uptime", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "instant" + } + ], + "title": "Uptime", + "type": "stat" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 5 + }, + "id": 56, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "Time", + "expression": "(a / b) * 1000", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag_command", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_info_schema_query_response_time_seconds_sum", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.resptime", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_info_schema_query_response_time_seconds_count", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.resptime", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_created_tmp_tables{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "Average Query Response Time", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 5 + }, + "id": 32, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Com_$tag_command", + "query_configs": [ + { + "alias": "slow_queries", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_global_status_slow_queries", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$spider_master" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", + "step": "", + "type": "range" + } + ], + "title": "Slow Queries", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 5 + }, + "id": 83, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "slave=$tag_instance, sid=$tag_master_server_id", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance", + "channel_name", + "master_server_id" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_slave_status_seconds_behind_master", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$remote_slave" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Seconds Behind Master", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 10 + }, + "id": 26, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_handler", + "query_configs": [ + { + "alias": "$tag_handler", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "handler" + ], + "interval": 60, + "interval_unit": "s", + "method": "sum_without_time", + "metric_field": "mysql_global_status_handlers_total", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(handler) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_handlers_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\",handler!~\"commit|rollback|savepoint.*|prepare\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "MySQL Handlers($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 10 + }, + "id": 25, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Com_$tag_command", + "query_configs": [ + { + "alias": "Com_$tag_command", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "command" + ], + "interval": 60, + "interval_unit": "s", + "method": "sum_without_time", + "metric_field": "mysql_global_status_commands_total", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", + "step": "", + "type": "range" + } + ], + "title": "Top Command Counters ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 10 + }, + "id": 73, + "options": { + "legend": { + "calcs": [ + "last", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_command, $tag_state", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "command", + "state" + ], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_info_schema_processlist_threads", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.plist", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Processlist State ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 10 + }, + "id": 31, + "options": { + "legend": { + "calcs": [ + "last", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "Hits", + "expression": "avg(a / ( b + c)) * 100", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Com_$tag_command", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_table_open_cache_hits", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_table_open_cache_hits", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": false, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_table_open_cache_misses", + "refId": "c", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "avg((avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_innodb_buffer_pool_read_requests{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m])) - avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_innodb_buffer_pool_reads{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))) / avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_innodb_buffer_pool_read_requests{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))) * 100", + "step": "", + "type": "range" + } + ], + "title": "Table Cache Hits($dbrole)", + "type": "timeseries" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 92, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "Click link to get details for this instance", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster_name" + }, + "properties": [ + { + "id": "custom.width", + "value": 144 + }, + { + "id": "custom.inspect", + "value": false + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "custom.width", + "value": 188 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "Show details", + "url": "http://127.0.0.1/grafana/d/Gq771PmIk/mysql-instance?orgName=3&orgId=4&var-app=$app&var-cluster_domain=$cluster_domain&var-instance=${__value.raw}" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-text" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance_role" + }, + "properties": [ + { + "id": "custom.width", + "value": 186 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 13, + "links": [], + "options": { + "footer": { + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 0, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "table", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance_role", + "instance", + "cluster_name", + "version" + ], + "interval": "auto", + "interval_unit": "s", + "method": "MAX", + "metric_field": "mysql_version_info", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.version", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "B", + "source": "", + "step": "", + "type": "instant" + } + ], + "title": "Instance List", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "cluster_name", + "instance", + "instance_role", + "version" + ] + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 94, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_bk_target_ip", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "usage", + "refId": "a", + "result_table_id": "dbm_system.cpu_summary", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "max(max_over_time(bkmonitor:dbm_system:cpu_summary:usage{cluster_domain=\"$cluster_domain\",instance_role=\"$spider_master\"}[1m])) by (instance)", + "step": "", + "type": "range" + } + ], + "title": "CPU Usage ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 97, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "ioutil", + "query_configs": [ + { + "alias": "$tag_bk_target_ip: writes", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "w_s", + "refId": "a", + "result_table_id": "dbm_system.io", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "$tag_bk_target_ip: reads", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "r_s", + "refId": "b", + "result_table_id": "dbm_system.io", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "C", + "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "Disk IOs per Device($dbrole)", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "The number of statements executed by the server. This includes\nonly statements sent to the server by clients and not statements executed\nwithin stored programs, unlike the Queries variable. This variable does\nnot count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or\nCOM_STMT_RESET commands", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 29 + }, + "id": 95, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Questions", + "query_configs": [ + { + "alias": "$tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_questions", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_questions{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "Questions ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "The number of statements executed by the server. This variable\nincludes statements executed within stored programs, unlike the Questions\nvariable. It does not count COM_PING or COM_STATISTICS commands", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 29 + }, + "id": 98, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Questions", + "query_configs": [ + { + "alias": "$tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_queries", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_questions{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))", + "step": "", + "type": "range" + } + ], + "title": "Queries ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "select|insert|update|delete|replace|commit", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 29 + }, + "id": 89, + "options": { + "legend": { + "calcs": [ + "last" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "$tag_instance", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "command" + ], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_commands_total", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + }, + { + "condition": "and", + "key": "command", + "method": "reg", + "value": [ + "select|insert|update|delete" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(instance) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit|prepare.*\",instance_role=\"$dbrole\"}[2m])) >0", + "step": "", + "type": "range" + } + ], + "title": "QPS ($dbrole)", + "transformations": [ + { + "id": "calculateField", + "options": { + "mode": "reduceRow", + "reduce": { + "include": [ + "commit", + "delete", + "delete_multi", + "insert", + "insert_select", + "replace", + "replace_select", + "select", + "update", + "update_multi", + "xa_commit" + ], + "reducer": "sum" + } + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 34 + }, + "id": 101, + "options": { + "legend": { + "calcs": [ + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag_command", + "query_configs": [ + { + "alias": "$tag_instance, Open Tables", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_global_status_open_tables", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit\",instance_role=\"$dbrole\"}[2m])) >0", + "step": "", + "type": "range" + } + ], + "title": "Open Tables ($dbrole)", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 6, + "y": 34 + }, + "id": 99, + "options": { + "legend": { + "calcs": [ + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "$tag_command", + "query_configs": [ + { + "alias": "$tag_instance, Openings files", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_global_status_opened_files", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit\",instance_role=\"$dbrole\"}[2m])) >0", + "step": "", + "type": "range" + } + ], + "title": "File Openings($dbrole)", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 34 + }, + "id": 93, + "interval": "5m", + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_instance, $tag_mount_point", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point", + "instance", + "path" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_df_usage", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "datadir usage ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 96, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": true, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Connected $tag_instance", + "query_configs": [ + { + "alias": "Peak Threads Connected", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "mysql_global_status_threads_connected", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "A", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m])) by (instance)", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "MaxUsed $tag_instance", + "query_configs": [], + "refId": "B", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_max_used_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m])) by (instance)", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": true, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Max Conn", + "query_configs": [], + "refId": "C", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:gvars:mysql_global_variables_max_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "MySQL Connections ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 104, + "interval": "5m", + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_instance $tag_mount_point", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance", + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_du_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "datadir used size ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 0, + "y": 44 + }, + "id": 105, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Com_$tag_command", + "query_configs": [ + { + "alias": "$tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_global_status_slow_queries", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:gstatus:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", + "step": "", + "type": "range" + } + ], + "title": "Slow Queries ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "磁盘空间使用率", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 44 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Usage $tag_mount_point", + "query_configs": [ + { + "alias": "Usage $tag_mount_point", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": 60, + "interval_unit": "s", + "method": "max_without_time", + "metric_field": "in_use", + "refId": "a", + "result_table_id": "system.disk", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "bk_target_ip", + "method": "eq", + "value": [ + "$host" + ] + }, + { + "condition": "and", + "key": "mount_point", + "method": "reg", + "value": [ + "/data.*|" + ] + } + ] + } + ], + "refId": "A", + "source": "max by(mount_point) (bkmonitor:dbm_system:disk:in_use{bk_target_ip=\"$host\",mount_point=~\"/data.*\"})", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "Total $tag_mount_point", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "total", + "refId": "a", + "result_table_id": "system.disk", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "bk_target_ip", + "method": "eq", + "value": [ + "$host" + ] + } + ] + } + ], + "refId": "B", + "source": "", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_bk_target_ip, $tag_mount_point", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point", + "bk_target_ip" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "used", + "refId": "a", + "result_table_id": "dbm_system.disk", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "C", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Disk Size Used", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 49 + }, + "id": 87, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "slave=$tag_instance, $tag_channel_name, master_uuid=$tag_master_uuid", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance", + "master_uuid", + "channel_name" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_slave_status_seconds_behind_master", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$remote_slave" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Seconds Behind Master (slave)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 6, + "y": 49 + }, + "id": 80, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "delay_sec: $tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_infodba_schema_heartbeat_delay_sec", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + }, + { + "alias": "beat_sec: $tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_infodba_schema_heartbeat_beat_sec", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Master Slave Heartbeat Delay (slave)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 49 + }, + "id": 77, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "ioutil", + "query_configs": [ + { + "alias": "$tag_bk_target_ip, timewait", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip", + "instance_role" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "cur_tcp_timewait", + "refId": "a", + "result_table_id": "dbm_system.netstat", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "$tag_bk_target_ip, closewait", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip", + "instance_role" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "cur_tcp_closewait", + "refId": "b", + "result_table_id": "dbm_system.netstat", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "$tag_bk_target_ip, estab", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "bk_target_ip", + "instance_role" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "cur_tcp_estab", + "refId": "c", + "result_table_id": "dbm_system.netstat", + "result_table_label": "os", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "C", + "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "TCP Connection ($dbrole)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 49 + }, + "id": 53, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "ioutil", + "query_configs": [ + { + "alias": "In: $tag_bk_target_ip $tag_device_name", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "device_name", + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "speed_recv", + "refId": "a", + "result_table_id": "dbm_system.net", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "device_name", + "method": "reg", + "value": [ + "eth.*" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + }, + { + "alias": "Out: $tag_bk_target_ip $tag_device_name", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "device_name", + "bk_target_ip" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "speed_sent", + "refId": "b", + "result_table_id": "dbm_system.net", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "device_name", + "method": "reg", + "value": [ + "eth.*" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "C", + "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "MySQL Network Traffic ($dbrole)", + "type": "timeseries" + } + ], + "title": "Instance Detail ($dbrole)", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 70, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 0, + "y": 20 + }, + "id": 65, + "interval": "5m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "path" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_du_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "DataSize by datadir", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 7, + "x": 9, + "y": 20 + }, + "id": 66, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_schema", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "schema" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_info_schema_total_size", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.tablesize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "DataSize by schema", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 16, + "y": 20 + }, + "id": 106, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "{$tag_schema}.$tag_table", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "topk", + "params": [ + { + "id": "k", + "value": "20" + } + ] + } + ], + "group_by": [ + "schema", + "table" + ], + "interval": 60, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_info_schema_table_rows", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.tablesize", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$remote_master" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "TableRows by table", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 0, + "y": 25 + }, + "id": 84, + "interval": "5m", + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_df_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + }, + { + "alias": "", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_df_total_mb", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "datadir disk space", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 102, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_database_name", + "data_label": "dbm_report_channel", + "data_source_label": "custom", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "database_name" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_database_size", + "refId": "a", + "result_table_id": "bkmonitor_time_series_1572876.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "immute_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "ibd database size", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 103, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "{$tag_database_name}.$tag_table_name", + "data_label": "dbm_report_channel", + "data_source_label": "custom", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "topk", + "params": [ + { + "id": "k", + "value": "50" + } + ] + } + ], + "group_by": [ + "database_name", + "table_name" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_table_size", + "refId": "a", + "result_table_id": "bkmonitor_time_series_1572876.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "immute_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "ibd table size", + "type": "timeseries" + } + ], + "title": "Table Capacity", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 110, + "panels": [ + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 108, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "data": { + "alias": "", + "conditions": [], + "dimensions": [], + "index": { + "id": [ + "host_process", + 38 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] + }, + "method": "logs", + "metric": "bk_host_id", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "datasourceId": "bk_log_datasource", + "name": "BlueKing Log TimeSeries", + "refId": "A" + } + ], + "title": "Panel Title", + "type": "table" + } + ], + "title": "Slow Logs", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 37, + "style": "dark", + "tags": [ + "tendbcluster" + ], + "templating": { + "list": [ + { + "hide": 2, + "name": "spider_master", + "query": "${VAR_SPIDER_MASTER}", + "skipUrlSync": false, + "type": "constant", + "current": { + "value": "${VAR_SPIDER_MASTER}", + "text": "${VAR_SPIDER_MASTER}", + "selected": false + }, + "options": [ + { + "value": "${VAR_SPIDER_MASTER}", + "text": "${VAR_SPIDER_MASTER}", + "selected": false + } + ] + }, + { + "hide": 2, + "name": "remote_master", + "query": "${VAR_REMOTE_MASTER}", + "skipUrlSync": false, + "type": "constant", + "current": { + "value": "${VAR_REMOTE_MASTER}", + "text": "${VAR_REMOTE_MASTER}", + "selected": false + }, + "options": [ + { + "value": "${VAR_REMOTE_MASTER}", + "text": "${VAR_REMOTE_MASTER}", + "selected": false + } + ] + }, + { + "hide": 2, + "name": "remote_slave", + "query": "${VAR_REMOTE_SLAVE}", + "skipUrlSync": false, + "type": "constant", + "current": { + "value": "${VAR_REMOTE_SLAVE}", + "text": "${VAR_REMOTE_SLAVE}", + "selected": false + }, + "options": [ + { + "value": "${VAR_REMOTE_SLAVE}", + "text": "${VAR_REMOTE_SLAVE}", + "selected": false + } + ] + }, + { + "hide": 2, + "name": "spider_slave", + "query": "${VAR_SPIDER_SLAVE}", + "skipUrlSync": false, + "type": "constant", + "current": { + "value": "${VAR_SPIDER_SLAVE}", + "text": "${VAR_SPIDER_SLAVE}", + "selected": false + }, + "options": [ + { + "value": "${VAR_SPIDER_SLAVE}", + "text": "${VAR_SPIDER_SLAVE}", + "selected": false + } + ] + }, + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "definition": "- Blueking Monitor - 维度", + "hide": 0, + "includeAll": false, + "label": "app", + "multi": false, + "name": "app", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "app", + "metric_field": "mysql_up", + "result_table_id": "exporter_dbm_mysqld_exporter.group_default", + "result_table_label": "component", + "where": [] + }, + "queryType": "dimension", + "variables": "" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "definition": "- Blueking Monitor - 维度", + "hide": 0, + "includeAll": false, + "label": "cluster_domain", + "multi": false, + "name": "cluster_domain", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "cluster_domain", + "metric_field": "mysql_up", + "result_table_id": "exporter_dbm_mysqld_exporter.mysqlup", + "result_table_label": "component", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_type", + "method": "eq", + "value": [ + "tendbcluster" + ] + } + ] + }, + "queryType": "dimension", + "variables": "$app" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "spider_master", + "value": "spider_master" + }, + "hide": 0, + "includeAll": false, + "label": "dbrole", + "multi": false, + "name": "dbrole", + "options": [ + { + "selected": true, + "text": "spider_master", + "value": "spider_master" + }, + { + "selected": false, + "text": "spider_slave", + "value": "spider_slave" + }, + { + "selected": false, + "text": "remote_master", + "value": "remote_master" + }, + { + "selected": false, + "text": "remote_slave", + "value": "remote_slave" + } + ], + "query": "spider_master,spider_slave,remote_master,remote_slave", + "queryValue": "", + "refresh": 1, + "skipUrlSync": false, + "type": "custom" + }, + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "definition": "- Blueking Monitor - 维度", + "hide": 2, + "includeAll": false, + "label": "db_name", + "multi": false, + "name": "db_name", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "schema", + "metric_field": "mysql_info_schema_total_size", + "result_table_id": "exporter_dbm_mysqld_exporter.tablesize", + "result_table_label": "component", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$remote_master" + ] + } + ] + }, + "queryType": "dimension", + "variables": "$cluster_domain $remote_master" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "definition": "- Blueking Monitor - 维度", + "description": "instance master", + "hide": 0, + "includeAll": false, + "label": "spider_instance", + "multi": false, + "name": "spider_instance", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "instance", + "metric_field": "mysql_up", + "result_table_id": "exporter_dbm_mysqld_exporter.mysqlup", + "result_table_label": "component", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "spider_master" + ] + } + ] + }, + "queryType": "dimension", + "variables": "$cluster_domain" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "default", + "title": "TenDBCluster", + "uid": "8303483841", + "version": 27, + "weekStart": "" +} \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json index a9a1e8cd9b..084b212256 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json @@ -606,7 +606,7 @@ "method":"AVG", "metric_field":"usage", "refId":"a", - "result_table_id":"system.cpu_summary", + "result_table_id":"dbm_system.cpu_summary", "result_table_label":"os", "time_field":"", "where":[ @@ -666,7 +666,7 @@ "method":"AVG", "metric_field":"load1", "refId":"a", - "result_table_id":"system.load", + "result_table_id":"dbm_system.load", "result_table_label":"os", "time_field":"", "where":[ @@ -2507,7 +2507,7 @@ "method":"AVG", "metric_field":"usage", "refId":"a", - "result_table_id":"system.cpu_summary", + "result_table_id":"dbm_system.cpu_summary", "result_table_label":"os", "time_field":"", "where":[ @@ -2567,7 +2567,7 @@ "method":"AVG", "metric_field":"load1", "refId":"a", - "result_table_id":"system.load", + "result_table_id":"dbm_system.load", "result_table_label":"os", "time_field":"", "where":[ @@ -8028,7 +8028,7 @@ "method":"MAX", "metric_field":"w_s", "refId":"a", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -8060,7 +8060,7 @@ "method":"MAX", "metric_field":"r_s", "refId":"b", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -8075,7 +8075,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } @@ -8210,7 +8210,7 @@ "method":"MAX", "metric_field":"pct_used", "refId":"a", - "result_table_id":"system.mem", + "result_table_id":"dbm_system.mem", "result_table_label":"os", "time_field":"", "where":[ @@ -8242,7 +8242,7 @@ "method":"MAX", "metric_field":"total", "refId":"b", - "result_table_id":"system.mem", + "result_table_id":"dbm_system.mem", "result_table_label":"os", "time_field":"", "where":[ @@ -8257,7 +8257,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" }, @@ -8302,7 +8302,7 @@ "method":"AVG", "metric_field":"used", "refId":"a", - "result_table_id":"system.swap", + "result_table_id":"dbm_system.swap", "result_table_label":"os", "time_field":"", "where":[ @@ -8451,7 +8451,7 @@ "method":"MAX", "metric_field":"util", "refId":"a", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -8600,7 +8600,7 @@ "method":"max_without_time", "metric_field":"in_use", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -8623,7 +8623,7 @@ } ], "refId":"A", - "source":"max by(mount_point) (bkmonitor:system:disk:in_use{bk_target_ip=\"$host\",mount_point=~\"/data.*\"})", + "source":"max by(mount_point) (bkmonitor:dbm_system:disk:in_use{bk_target_ip=\"$host\",mount_point=~\"/data.*\"})", "step":"", "type":"range" }, @@ -8668,7 +8668,7 @@ "method":"AVG", "metric_field":"total", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -8728,7 +8728,7 @@ "method":"AVG", "metric_field":"used", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -8878,7 +8878,7 @@ "method":"MAX", "metric_field":"speed_recv", "refId":"a", - "result_table_id":"system.net", + "result_table_id":"dbm_system.net", "result_table_label":"os", "time_field":"", "where":[ @@ -8910,7 +8910,7 @@ "method":"MAX", "metric_field":"speed_sent", "refId":"b", - "result_table_id":"system.net", + "result_table_id":"dbm_system.net", "result_table_label":"os", "time_field":"", "where":[ @@ -8925,7 +8925,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } @@ -9142,7 +9142,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbsingle.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbsingle.json index aaa607301d..f88b19a74c 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbsingle.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbsingle.json @@ -606,7 +606,7 @@ "method":"AVG", "metric_field":"usage", "refId":"a", - "result_table_id":"system.cpu_summary", + "result_table_id":"dbm_system.cpu_summary", "result_table_label":"os", "time_field":"", "where":[ @@ -666,7 +666,7 @@ "method":"AVG", "metric_field":"load1", "refId":"a", - "result_table_id":"system.load", + "result_table_id":"dbm_system.load", "result_table_label":"os", "time_field":"", "where":[ @@ -5787,7 +5787,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -5843,7 +5843,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -6014,7 +6014,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -6170,7 +6170,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -6350,7 +6350,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -6393,7 +6393,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -6695,7 +6695,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -7074,7 +7074,7 @@ "method":"MAX", "metric_field":"w_s", "refId":"a", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -7106,7 +7106,7 @@ "method":"MAX", "metric_field":"r_s", "refId":"b", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -7121,7 +7121,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } @@ -7255,7 +7255,7 @@ "method":"MAX", "metric_field":"pct_used", "refId":"a", - "result_table_id":"system.mem", + "result_table_id":"dbm_system.mem", "result_table_label":"os", "time_field":"", "where":[ @@ -7287,7 +7287,7 @@ "method":"MAX", "metric_field":"total", "refId":"b", - "result_table_id":"system.mem", + "result_table_id":"dbm_system.mem", "result_table_label":"os", "time_field":"", "where":[ @@ -7302,7 +7302,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" }, @@ -7347,7 +7347,7 @@ "method":"AVG", "metric_field":"used", "refId":"a", - "result_table_id":"system.swap", + "result_table_id":"dbm_system.swap", "result_table_label":"os", "time_field":"", "where":[ @@ -7495,7 +7495,7 @@ "method":"MAX", "metric_field":"util", "refId":"a", - "result_table_id":"system.io", + "result_table_id":"dbm_system.io", "result_table_label":"os", "time_field":"", "where":[ @@ -7643,7 +7643,7 @@ "method":"max_without_time", "metric_field":"in_use", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -7666,7 +7666,7 @@ } ], "refId":"A", - "source":"max by(mount_point) (bkmonitor:system:disk:in_use{bk_target_ip=\"$host\",mount_point=~\"/data.*\"})", + "source":"max by(mount_point) (bkmonitor:dbm_system:disk:in_use{bk_target_ip=\"$host\",mount_point=~\"/data.*\"})", "step":"", "type":"range" }, @@ -7711,7 +7711,7 @@ "method":"AVG", "metric_field":"total", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -7771,7 +7771,7 @@ "method":"AVG", "metric_field":"used", "refId":"a", - "result_table_id":"system.disk", + "result_table_id":"dbm_system.disk", "result_table_label":"os", "time_field":"", "where":[ @@ -7920,7 +7920,7 @@ "method":"MAX", "metric_field":"speed_recv", "refId":"a", - "result_table_id":"system.net", + "result_table_id":"dbm_system.net", "result_table_label":"os", "time_field":"", "where":[ @@ -7952,7 +7952,7 @@ "method":"MAX", "metric_field":"speed_sent", "refId":"b", - "result_table_id":"system.net", + "result_table_id":"dbm_system.net", "result_table_label":"os", "time_field":"", "where":[ @@ -7967,7 +7967,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } @@ -8183,7 +8183,7 @@ } ], "refId":"C", - "source":"max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source":"max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step":"", "type":"range" } @@ -8332,7 +8332,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -8385,7 +8385,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -8437,7 +8437,7 @@ "key":"instance_role", "method":"eq", "value":[ - "backend_master" + "orphan" ] } ] @@ -8463,7 +8463,7 @@ "options":[ ], - "query":"backend_master", + "query":"orphan", "skipUrlSync":false, "type":"custom", "refresh":1 diff --git a/dbm-ui/backend/bk_dataview/dashboards/readme.md b/dbm-ui/backend/bk_dataview/dashboards/readme.md index 8aea112767..6d9b813475 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/readme.md +++ b/dbm-ui/backend/bk_dataview/dashboards/readme.md @@ -8,7 +8,7 @@ ___________________________________ "tags": ["pulsar"], "tags": ["tendbha"], "tags": ["tendbsingle"], -"tags": ["tendbha"], +"tags": ["tendbcluster"], "tags": ["influxdb"], "tags": ["TwemproxyRedisInstance"], "tags": ["PredixyTendisplusCluster"], @@ -17,7 +17,12 @@ ___________________________________ # 刷新监控数据源ID:bkmonitor_timeseries cd backend/bk_dataview/dashboards/json find . -type f -name "*.json" -exec sed -i '' -e 's#${DS_蓝鲸监控_-_指标数据}#bkmonitor_timeseries#g' {} \; +find . -type f -name "*.json" -exec sed -i '' -e 's#${DS_蓝鲸监控_- 指标数据}#bkmonitor_timeseries#g' {} \; find . -type f -name "*.json" -exec sed -i '' -e 's#"editable": true#"editable": false#g' {} \; +find . -type f -name "*.json" -exec sed -i '' -e 's#bkmonitor:system:#bkmonitor:dbm_system:#g' {} \; +# 批量替换基础指标来源:system -> dbm_system +find . -type f -name "*.json" -exec sed -i '' -e 's#bkmonitor:system:#bkmonitor:dbm_system:#g' {} \; +find . -type f -name "*.json" -exec sed -i '' -e 's#"result_table_id":"system.#"result_table_id":"dbm_system.#g' {} \; # 导入监控的方法,还原模板后导入 find . -type f -name "*.json" -exec sed -i '' -e 's#bkmonitor_timeseries#${DS_蓝鲸监控_-_指标数据}#g' {} \; diff --git a/dbm-ui/backend/bk_web/swagger.py b/dbm-ui/backend/bk_web/swagger.py index d43f560271..1a139931fc 100644 --- a/dbm-ui/backend/bk_web/swagger.py +++ b/dbm-ui/backend/bk_web/swagger.py @@ -11,10 +11,18 @@ from collections import OrderedDict from drf_yasg import openapi +from drf_yasg.generators import OpenAPISchemaGenerator from drf_yasg.inspectors import SwaggerAutoSchema from drf_yasg.utils import swagger_auto_schema +class BothHttpAndHttpsSchemaGenerator(OpenAPISchemaGenerator): + def get_schema(self, request=None, public=False): + schema = super().get_schema(request, public) + schema.schemes = ["http", "https"] + return schema + + class ResponseSwaggerAutoSchema(SwaggerAutoSchema): """普通接口的Swagger响应格式""" diff --git a/dbm-ui/backend/bk_web/viewsets.py b/dbm-ui/backend/bk_web/viewsets.py index dc5dda1405..636b89c3ba 100644 --- a/dbm-ui/backend/bk_web/viewsets.py +++ b/dbm-ui/backend/bk_web/viewsets.py @@ -13,7 +13,8 @@ from blueapps.account.decorators import login_exempt from django.utils.decorators import classonlymethod -from rest_framework import viewsets +from rest_framework import serializers, status, viewsets +from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet @@ -117,6 +118,8 @@ def as_view(cls, actions=None, **initkwargs): class SystemViewSet(GenericMixin, viewsets.ViewSet, viewsets.GenericViewSet): """SaaS app 使用的 API ViewSet""" + serializer_class = serializers.Serializer + class AuditedModelViewSet(GenericMixin, ModelViewSet): """记录数据插入信息的ModelViewSet类""" @@ -133,6 +136,11 @@ def perform_update(self, serializer): username = self.request.user.username return serializer.save(updater=username) + def destroy(self, request, *args, **kwargs): + """修改 destroy 的返回码为 200""" + super(AuditedModelViewSet, self).destroy(request, *args, **kwargs) + return Response(status=status.HTTP_200_OK) + class ReadOnlyAuditedModelViewSet(ReadOnlyModelViewSet, GenericMixin): pass diff --git a/dbm-ui/backend/components/base.py b/dbm-ui/backend/components/base.py index de3795ea4a..825fbf7f78 100644 --- a/dbm-ui/backend/components/base.py +++ b/dbm-ui/backend/components/base.py @@ -464,7 +464,8 @@ def _fetch_client_crt(self): client_crt, client_key = f"{CLIENT_CRT_PATH}/{SSLEnum.CLIENT_CRT}", f"{CLIENT_CRT_PATH}/{SSLEnum.CLIENT_KEY}" # 如何证书已存在,则直接返回即可 ssl = SystemSettings.get_setting_value(key=SSL_KEY, default={}) - if ssl and ssl.get("local"): + # 这里需要判断是否本地化以及文件夹是否存在,有可能pod重启导致秘钥文件丢失 + if ssl and ssl.get("local") and os.path.exists(CLIENT_CRT_PATH): return client_crt, client_key # 本地写入crt和key文件,防止每次都需要write IO diff --git a/dbm-ui/backend/components/bkmonitorv3/client.py b/dbm-ui/backend/components/bkmonitorv3/client.py index 701db672ec..8ea95ce1ae 100644 --- a/dbm-ui/backend/components/bkmonitorv3/client.py +++ b/dbm-ui/backend/components/bkmonitorv3/client.py @@ -86,6 +86,27 @@ def __init__(self): module=self.MODULE, description=_("保存告警策略"), ) + self.switch_alarm_strategy = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="switch_alarm_strategy/", + module=self.MODULE, + description=_("启停告警策略"), + ) + self.update_partial_strategy_v3 = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="update_partial_strategy_v3/", + module=self.MODULE, + description=_("批量更新策略局部配置"), + ) + self.delete_alarm_strategy_v3 = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="delete_alarm_strategy_v3/", + module=self.MODULE, + description=_("删除告警策略"), + ) self.search_alarm_strategy_v3 = DataAPI( method="POST", base=BKMONITORV3_APIGW_DOMAIN, @@ -121,6 +142,87 @@ def __init__(self): module=self.MODULE, description=_("查询采集策略详情"), ) + self.search_user_groups = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="search_user_groups/", + module=self.MODULE, + description=_("查询用户组列表"), + ) + self.search_user_group_detail = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="search_user_group_detail/", + module=self.MODULE, + description=_("查询用户组详情"), + ) + self.delete_user_groups = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="delete_user_groups/", + module=self.MODULE, + description=_("删除用户组"), + ) + self.save_user_group = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="save_user_group/", + module=self.MODULE, + description=_("保存用户组"), + ) + self.save_duty_rule = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="save_duty_rule/", + module=self.MODULE, + description=_("保存轮值规则"), + ) + self.delete_duty_rules = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="delete_duty_rules/", + module=self.MODULE, + description=_("删除轮值规则"), + ) + self.save_rule_group = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="assign/save_rule_group/", + module=self.MODULE, + description=_("保存分派组"), + ) + + self.search_rule_groups = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="assign/search_rule_groups/", + module=self.MODULE, + description=_("查询分派组"), + ) + + self.delete_rule_group = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="assign/delete_rule_group/", + module=self.MODULE, + description=_("删除分派组"), + ) + + self.search_event = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="search_event/", + module=self.MODULE, + description=_("查询事件"), + ) + + self.unify_query = DataAPI( + method="POST", + base=BKMONITORV3_APIGW_DOMAIN, + url="time_series_unify_query/", + module=self.MODULE, + description=_("统一查询时序数据"), + ) BKMonitorV3Api = _BKMonitorV3Api() diff --git a/dbm-ui/backend/components/cc/client.py b/dbm-ui/backend/components/cc/client.py index 4bebd183d5..d0c038fe8f 100644 --- a/dbm-ui/backend/components/cc/client.py +++ b/dbm-ui/backend/components/cc/client.py @@ -261,5 +261,13 @@ def __init__(self): description=_("查询主机业务关系信息"), ) + self.search_object_attribute = DataAPI( + method="POST", + base=CC_APIGW_DOMAIN, + url="search_object_attribute/", + module=self.MODULE, + description=_("查询对象属性"), + ) + CCApi = _CCApi() diff --git a/dbm-ui/backend/components/cmsi/client.py b/dbm-ui/backend/components/cmsi/client.py index 04fa55a32e..416c8be57a 100644 --- a/dbm-ui/backend/components/cmsi/client.py +++ b/dbm-ui/backend/components/cmsi/client.py @@ -26,6 +26,13 @@ def __init__(self): module=self.MODULE, description=_("通用消息发送"), ) + self.get_msg_type = DataAPI( + method="GET", + base=CMSI_APIGW_DOMAIN, + url="get_msg_type/", + module=self.MODULE, + description=_("查询通知类型"), + ) CmsiApi = _CmsiApi() diff --git a/dbm-ui/backend/components/db_name_service/client.py b/dbm-ui/backend/components/db_name_service/client.py index 2659efcf9e..7b64a944e4 100644 --- a/dbm-ui/backend/components/db_name_service/client.py +++ b/dbm-ui/backend/components/db_name_service/client.py @@ -22,77 +22,77 @@ def __init__(self): self.clb_create_lb_and_register_target = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/create_lb_and_register_target", + url="/api/nameservice/clb/create_lb_and_register_target", module=self.MODULE, description=_("创建clb并绑定后端主机"), ) self.clb_deregister_part_target = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/deregister_part_target", + url="/api/nameservice/clb/deregister_part_target", module=self.MODULE, description=_("clb解绑部分后端主机"), ) self.clb_register_part_target = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/register_part_target", + url="/api/nameservice/clb/register_part_target", module=self.MODULE, description=_("clb新增绑定部分后端主机"), ) self.clb_get_target_private_ips = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/get_target_private_ips", + url="/api/nameservice/clb/get_target_private_ips", module=self.MODULE, description=_("获取已绑定clb的后端主机私网IP"), ) self.clb_check_clb_register_target_by_ip = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/check_clb_register_target_by_ip", + url="/api/nameservice/clb/check_clb_register_target_by_ip", module=self.MODULE, description=_("通过IP查询该IP是否已经被clb绑定了"), ) self.clb_deregister_target_and_del_lb = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/clb/deregister_target_and_del_lb", + url="/api/nameservice/clb/deregister_target_and_del_lb", module=self.MODULE, description=_("解绑后端主机并删除clb"), ) self.polaris_create_service_alias_and_bind_targets = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/polaris/create_service_alias_and_bind_targets", + url="/api/nameservice/polaris/create_service_alias_and_bind_targets", module=self.MODULE, description=_("创建北极星服务和别名并绑定后端主机"), ) self.polaris_unbind_part_targets = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/polaris/unbind_part_targets", + url="/api/nameservice/polaris/unbind_part_targets", module=self.MODULE, description=_("北极星解绑部分后端主机"), ) self.polaris_bind_part_targets = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/polaris/bind_part_targets", + url="/api/nameservice/polaris/bind_part_targets", module=self.MODULE, description=_("北极星新增绑定部分后端主机"), ) self.polaris_describe_targets = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/polaris/describe_targets", + url="/api/nameservice/polaris/describe_targets", module=self.MODULE, description=_("获取北极星已绑定的后端主机信息"), ) self.polaris_unbind_targets_and_delete_alias_service = DataAPI( method="POST", base=NAMESERVICE_APIGW_DOMAIN, - url="/polaris/unbind_targets_and_delete_alias_service", + url="/api/nameservice/polaris/unbind_targets_and_delete_alias_service", module=self.MODULE, description=_("解绑后端主机并删除别名和北极星服务"), ) diff --git a/dbm-ui/backend/components/mysql_backup/client.py b/dbm-ui/backend/components/mysql_backup/client.py index f518f58e03..eeed35a8ca 100644 --- a/dbm-ui/backend/components/mysql_backup/client.py +++ b/dbm-ui/backend/components/mysql_backup/client.py @@ -52,3 +52,4 @@ def __init__(self): MysqlBackupApi = _BackupApi() +RedisBackupApi = _BackupApi() diff --git a/dbm-ui/backend/configuration/constants.py b/dbm-ui/backend/configuration/constants.py index eef1ae2c54..a6ed080cb2 100644 --- a/dbm-ui/backend/configuration/constants.py +++ b/dbm-ui/backend/configuration/constants.py @@ -47,6 +47,14 @@ class SystemSettingsEnum(str, StructuredEnum): # 主机默认统一转移到 DBM 业务下托管,若业务 ID 属于这个列表,则转移到对应的业务下 INDEPENDENT_HOSTING_BIZS = EnumField("INDEPENDENT_HOSTING_BIZS", _("独立托管机器的业务列表")) SPEC_OFFSET = EnumField("SPEC_OFFSET", _("默认的规格参数偏移量")) + DEVICE_CLASSES = EnumField("DEVICE_CLASSES", _("机型列表")) + BKM_DUTY_NOTICE = EnumField("BKM_DUTY_NOTICE", _("轮值通知设置")) + + +class BizSettingsEnum(str, StructuredEnum): + """配置的枚举项,建议将业务配置都录入到这里方便统一管理""" + + OPEN_AREA_VARS = EnumField("OPEN_AREA_VARS", _("开区模板的渲染变量")) DEFAULT_DB_ADMINISTRATORS = ["admin"] @@ -90,6 +98,26 @@ class SystemSettingsEnum(str, StructuredEnum): # 默认的规格参数偏移量,磁盘为0,内存偏移1G SPEC_OFFSET_VALUE = {"mem": 1024, "disk": 0} +# 磁盘类型,目前固定写死 +DISK_CLASSES = ["SSD", "HDD", "ALL"] + +# 默认轮值通知配置 +BKM_DUTY_NOTICE_VALUE = { + "schedule_table": { + "enable": False, + "send_at": {"freq": "w", "freq_values": [], "time": ""}, + "send_day": 7, + "qywx_id": 0, + }, + "person_duty": { + "enable": False, + "send_at": { + "unit": "h", + "num": 0, + }, + }, +} + DEFAULT_SETTINGS = [ # [key, 类型,初始值, 描述] [SystemSettingsEnum.BKM_DBM_TOKEN.value, "str", "", _("监控数据源token")], @@ -97,6 +125,7 @@ class SystemSettingsEnum(str, StructuredEnum): [SystemSettingsEnum.FREE_BK_MODULE_ID.value, "str", "0", _("业务空闲模块ID")], [SystemSettingsEnum.INDEPENDENT_HOSTING_BIZS.value, "list", [], _("独立托管机器的业务列表")], [SystemSettingsEnum.SPEC_OFFSET.value, "dict", SPEC_OFFSET_VALUE, _("默认的规格参数偏移量")], + [SystemSettingsEnum.BKM_DUTY_NOTICE.value, "dict", BKM_DUTY_NOTICE_VALUE, _("默认通知配置")], ] # 环境配置项 是否支持DNS解析 pulsar flow used diff --git a/dbm-ui/backend/configuration/migrations/0005_auto_20230907_2050.py b/dbm-ui/backend/configuration/migrations/0005_auto_20230907_2050.py new file mode 100644 index 0000000000..43d1fe8830 --- /dev/null +++ b/dbm-ui/backend/configuration/migrations/0005_auto_20230907_2050.py @@ -0,0 +1,37 @@ +# Generated by Django 3.2.19 on 2023-09-07 12:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("configuration", "0004_remove_ipwhitelist_db_type"), + ] + + operations = [ + migrations.CreateModel( + name="BizSettings", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("creator", models.CharField(max_length=64, verbose_name="创建人")), + ("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), + ("updater", models.CharField(max_length=64, verbose_name="修改人")), + ("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), + ("type", models.CharField(max_length=64, verbose_name="类型")), + ("key", models.CharField(max_length=64, unique=True, verbose_name="关键字唯一标识")), + ("value", models.JSONField(verbose_name="系统设置值")), + ("desc", models.CharField(max_length=255, verbose_name="描述")), + ("bk_biz_id", models.IntegerField(help_text="业务ID")), + ], + options={ + "verbose_name": "业务配置", + "verbose_name_plural": "业务配置", + "ordering": ("id",), + }, + ), + migrations.AddIndex( + model_name="bizsettings", + index=models.Index(fields=["bk_biz_id"], name="configurati_bk_biz__6102bd_idx"), + ), + ] diff --git a/dbm-ui/backend/configuration/mock_data.py b/dbm-ui/backend/configuration/mock_data.py index 4851257d4a..fcbbfd94f7 100644 --- a/dbm-ui/backend/configuration/mock_data.py +++ b/dbm-ui/backend/configuration/mock_data.py @@ -63,3 +63,10 @@ "update_time": "2023-09-19 13:02:38", } ] +BIZ_SETTINGS_DATA = { + "key1": "value1", + "key2": "value2", + "...": "....", + # 开区变量表 + "OPEN_AREA_VARS": [{"desc": "test1", "name": "test1"}, {"desc": "test2", "name": "test2"}], +} diff --git a/dbm-ui/backend/configuration/models/__init__.py b/dbm-ui/backend/configuration/models/__init__.py index 68a0fe8466..688393439c 100644 --- a/dbm-ui/backend/configuration/models/__init__.py +++ b/dbm-ui/backend/configuration/models/__init__.py @@ -12,4 +12,4 @@ from .function_controller import FunctionController from .password_policy import PasswordPolicy from .profile import Profile -from .system import SystemSettings +from .system import BizSettings, SystemSettings diff --git a/dbm-ui/backend/configuration/models/dba.py b/dbm-ui/backend/configuration/models/dba.py index 389c04c821..d25fa90f9c 100644 --- a/dbm-ui/backend/configuration/models/dba.py +++ b/dbm-ui/backend/configuration/models/dba.py @@ -51,8 +51,22 @@ def list_biz_admins(cls, bk_biz_id: int) -> List[Dict[str, Union[str, List[str]] @classmethod def upsert_biz_admins(cls, bk_biz_id: int, db_admins: List[Dict[str, Union[str, List[str]]]]): + # 平台管理员 + db_type_platform_dba = {dba.db_type: dba.users for dba in cls.objects.filter(bk_biz_id=0)} + + # 业务管理员 + db_type_biz_dba = {dba.db_type: dba.users for dba in cls.objects.filter(bk_biz_id=bk_biz_id)} + + # 更新或创建业务管理员 for dba in db_admins: - cls.objects.update_or_create(bk_biz_id=bk_biz_id, db_type=dba["db_type"], defaults={"users": dba["users"]}) + db_type = dba["db_type"] + new_dba = dba["users"] + platform_dba = db_type_platform_dba.get(db_type, []) + biz_dba = db_type_biz_dba.get(db_type, []) + if set(new_dba) == set(platform_dba) and not biz_dba: + # 业务新设置的与平台人员一致,则无需新建 + continue + cls.objects.update_or_create(bk_biz_id=bk_biz_id, db_type=db_type, defaults={"users": new_dba}) @classmethod def get_biz_db_type_admins(cls, bk_biz_id: int, db_type: str) -> List[str]: diff --git a/dbm-ui/backend/configuration/models/function_controller.py b/dbm-ui/backend/configuration/models/function_controller.py index a038b1b74c..e8a33d5590 100644 --- a/dbm-ui/backend/configuration/models/function_controller.py +++ b/dbm-ui/backend/configuration/models/function_controller.py @@ -21,6 +21,7 @@ class CustomFuncNameEnum(str, StructuredEnum): ToolBox = EnumField("toolbox", _("工具箱")) TenDBClusterToolBox = EnumField("tendbcluster_toolbox", _("TenDBCluster 工具箱")) AddOnServicePlugin = EnumField("addons", _("插件服务")) + Monitor = EnumField("monitor", _("监控告警")) # 用于初始化功能开关,注意调整 key 后需跟前端对齐 @@ -59,7 +60,15 @@ class CustomFuncNameEnum(str, StructuredEnum): CustomFuncNameEnum.AddOnServicePlugin.value: { "is_enabled": False, "children": { - "redis_nameservice": {"is_enabled": True}, + "redis_nameservice": {"is_enabled": False}, + }, + }, + CustomFuncNameEnum.Monitor.value: { + "is_enabled": False, + "children": { + "monitor_policy": {"is_enabled": False}, + "duty_rule": {"is_enabled": False}, + "notice_group": {"is_enabled": False}, }, }, } diff --git a/dbm-ui/backend/configuration/models/ip_whitelist.py b/dbm-ui/backend/configuration/models/ip_whitelist.py index c845901fed..25aae5a0b3 100644 --- a/dbm-ui/backend/configuration/models/ip_whitelist.py +++ b/dbm-ui/backend/configuration/models/ip_whitelist.py @@ -52,6 +52,7 @@ def list_ip_whitelist( # IPWhitelist.objects.raw(select_sts) iplist = cls.objects.filter(ips_filters) count = iplist.count() + limit = count if limit == -1 else limit ip_whitelist = [ # model_to_dict没有带上create_at和update_at { diff --git a/dbm-ui/backend/configuration/models/system.py b/dbm-ui/backend/configuration/models/system.py index 52d50ccb97..c70664ac7d 100644 --- a/dbm-ui/backend/configuration/models/system.py +++ b/dbm-ui/backend/configuration/models/system.py @@ -19,16 +19,53 @@ from backend.bk_web.constants import LEN_LONG, LEN_NORMAL from backend.bk_web.models import AuditedModel from backend.configuration import constants +from backend.configuration.constants import BizSettingsEnum, SystemSettingsEnum logger = logging.getLogger("root") -class SystemSettings(AuditedModel): +class AbstractSettings(AuditedModel): + """定义配置表的基本字段""" + type = models.CharField(_("类型"), max_length=LEN_NORMAL) key = models.CharField(_("关键字唯一标识"), max_length=LEN_NORMAL, unique=True) value = models.JSONField(_("系统设置值")) desc = models.CharField(_("描述"), max_length=LEN_LONG) + @classmethod + def get_setting_value(cls, key: dict, default: Optional[Any] = None) -> Union[str, Dict]: + """插入一条配置记录""" + try: + setting_value = cls.objects.get(**key).value + except cls.DoesNotExist: + if default is None: + setting_value = "" + else: + setting_value = default + return setting_value + + @classmethod + def insert_setting_value( + cls, key: dict, value: Any, desc: str = "", value_type: str = "str", user: str = "admin" + ) -> None: + """插入一条配置记录""" + cls.objects.update_or_create( + defaults={ + "type": value_type, + "value": value, + "desc": desc, + "updater": user, + }, + **key, + ) + + class Meta: + abstract = True + + +class SystemSettings(AbstractSettings): + """系统配置表""" + class Meta: verbose_name = _("系统设置") verbose_name_plural = _("系统设置") @@ -68,26 +105,16 @@ def register_system_settings(cls): @classmethod def get_setting_value(cls, key: str, default: Optional[Any] = None) -> Union[str, Dict]: - try: - setting_value = cls.objects.get(key=key).value - except cls.DoesNotExist: - if default is None: - setting_value = "" - else: - setting_value = default - return setting_value + return super().get_setting_value(key={"key": key}, default=default) @classmethod def insert_setting_value(cls, key: str, value: Any, value_type: str = "str", user: str = "admin") -> None: - """插入一条系统配置记录""" - cls.objects.update_or_create( - defaults={ - "type": value_type, - "value": value, - "desc": constants.SystemSettingsEnum.get_choice_label(key), - "updater": user, - }, - key=key, + return super().insert_setting_value( + key={"key": key}, + value=value, + value_type=value_type, + user=user, + desc=constants.SystemSettingsEnum.get_choice_label(key), ) @classmethod @@ -102,3 +129,31 @@ def get_exact_hosting_biz(cls, bk_biz_id: int) -> int: if bk_biz_id in cls.get_setting_value(constants.SystemSettingsEnum.INDEPENDENT_HOSTING_BIZS.value, default=[]): return bk_biz_id return env.DBA_APP_BK_BIZ_ID + + +class BizSettings(AbstractSettings): + """业务配置表""" + + bk_biz_id = models.IntegerField(help_text=_("业务ID")) + + class Meta: + indexes = [ + models.Index(fields=["bk_biz_id"]), + ] + verbose_name = _("业务配置") + verbose_name_plural = _("业务配置") + ordering = ("id",) + + @classmethod + def get_setting_value(cls, bk_biz_id: int, key: str, default: Optional[Any] = None) -> Union[str, Dict]: + return super().get_setting_value(key={"key": key, "bk_biz_id": bk_biz_id}, default=default) + + @classmethod + def insert_setting_value(cls, bk_biz_id: int, key: str, value: Any, value_type: str = "str", user: str = "admin"): + return super().insert_setting_value( + key={"key": key, "bk_biz_id": bk_biz_id}, + value=value, + value_type=value_type, + user=user, + desc=constants.BizSettingsEnum.get_choice_label(key), + ) diff --git a/dbm-ui/backend/configuration/serializers.py b/dbm-ui/backend/configuration/serializers.py index 06e4f1fd54..2b046d7c07 100644 --- a/dbm-ui/backend/configuration/serializers.py +++ b/dbm-ui/backend/configuration/serializers.py @@ -16,12 +16,11 @@ from backend.bk_web.constants import LEN_NORMAL, LEN_SHORT from backend.bk_web.serializers import AuditedSerializer from backend.configuration import mock_data -from backend.configuration.constants import DBType -from backend.configuration.mock_data import PASSWORD_POLICY, VERIFY_PASSWORD_DATA +from backend.configuration.constants import DEFAULT_SETTINGS, DBType +from backend.configuration.mock_data import BIZ_SETTINGS_DATA, PASSWORD_POLICY from backend.configuration.models.function_controller import FunctionController from backend.configuration.models.ip_whitelist import IPWhitelist -from backend.configuration.models.system import SystemSettings -from backend.db_meta.enums import ClusterType +from backend.configuration.models.system import BizSettings, SystemSettings from backend.db_services.mysql.permission.constants import AccountType @@ -36,6 +35,29 @@ class Meta: fields = ("id", "type", "key", "value") +class BizSettingsSerializer(serializers.ModelSerializer): + class Meta: + model = BizSettings + fields = ("id", "bk_biz_id", "type", "key", "value") + + +class ListBizSettingsSerializer(serializers.Serializer): + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + key = serializers.CharField(help_text=_("查询key"), required=False) + + +class ListBizSettingsResponseSerializer(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": BIZ_SETTINGS_DATA} + + +class UpdateBizSettingsSerializer(serializers.Serializer): + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + key = serializers.CharField(help_text=_("更新key")) + value = serializers.JSONField(help_text=_("更新value")) + value_type = serializers.CharField(help_text=_("value类型"), default="dict", required=False) + + class ProfileSerializer(serializers.Serializer): label = serializers.CharField(required=True, max_length=LEN_SHORT) values = serializers.JSONField() @@ -175,6 +197,11 @@ class ListIPWhitelistSerializer(serializers.Serializer): offset = serializers.IntegerField(help_text=_("分页起始"), default=0, required=False) +class UpdateDutyNoticeSerializer(serializers.Serializer): + schedule_table = serializers.JSONField(help_text=_("排期表通知")) + person_duty = serializers.JSONField(help_text=_("个人轮值通知")) + + class FunctionControllerSerializer(serializers.Serializer): class Meta: model = FunctionController diff --git a/dbm-ui/backend/configuration/urls.py b/dbm-ui/backend/configuration/urls.py index 8e44d00bbf..1841c186ff 100644 --- a/dbm-ui/backend/configuration/urls.py +++ b/dbm-ui/backend/configuration/urls.py @@ -16,11 +16,12 @@ from backend.configuration.views.ip_whitelist import IPWhitelistViewSet from backend.configuration.views.password_policy import PasswordPolicyViewSet from backend.configuration.views.profile import ProfileViewSet -from backend.configuration.views.system import SystemSettingsViewSet +from backend.configuration.views.system import BizSettingsViewSet, SystemSettingsViewSet routers = DefaultRouter(trailing_slash=True) routers.register(r"system_settings", SystemSettingsViewSet, basename="system_settings") +routers.register(r"biz_settings", BizSettingsViewSet, basename="biz_settings") routers.register(r"db_admin", DBAdminViewSet, basename="dba_settings") routers.register(r"profile", ProfileViewSet, basename="profile") routers.register(r"password_policy", PasswordPolicyViewSet, basename="password_policy") diff --git a/dbm-ui/backend/configuration/views/dba.py b/dbm-ui/backend/configuration/views/dba.py index 1e553bb4cf..874065b081 100644 --- a/dbm-ui/backend/configuration/views/dba.py +++ b/dbm-ui/backend/configuration/views/dba.py @@ -27,7 +27,7 @@ def _get_custom_permissions(self): return [] bk_biz_id = self.request.query_params.get("bk_biz_id", 0) or self.request.data.get("bk_biz_id", 0) - if bk_biz_id: + if int(bk_biz_id): return [DBManageIAMPermission()] return [GlobalManageIAMPermission()] diff --git a/dbm-ui/backend/configuration/views/ip_whitelist.py b/dbm-ui/backend/configuration/views/ip_whitelist.py index 2bcdb9d2cb..d6ab19b6eb 100644 --- a/dbm-ui/backend/configuration/views/ip_whitelist.py +++ b/dbm-ui/backend/configuration/views/ip_whitelist.py @@ -42,7 +42,7 @@ class IPWhitelistViewSet(viewsets.AuditedModelViewSet): def _get_custom_permissions(self): bk_biz_id = self.request.query_params.get("bk_biz_id") or self.request.data.get("bk_biz_id") - if bk_biz_id: + if int(bk_biz_id): return [DBManageIAMPermission()] return [GlobalManageIAMPermission()] diff --git a/dbm-ui/backend/configuration/views/system.py b/dbm-ui/backend/configuration/views/system.py index aa98cdea41..c4778ff10e 100644 --- a/dbm-ui/backend/configuration/views/system.py +++ b/dbm-ui/backend/configuration/views/system.py @@ -9,7 +9,6 @@ specific language governing permissions and limitations under the License. """ from django.utils.translation import ugettext_lazy as _ -from drf_yasg.openapi import Response as yasg_response from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response @@ -17,55 +16,72 @@ from backend import env from backend.bk_web import viewsets from backend.bk_web.swagger import common_swagger_auto_schema -from backend.configuration.constants import DEFAULT_SETTINGS -from backend.configuration.models.system import SystemSettings -from backend.configuration.serializers import SystemSettingsSerializer +from backend.components import domains +from backend.configuration.constants import DISK_CLASSES, SystemSettingsEnum +from backend.configuration.models.system import BizSettings, SystemSettings +from backend.configuration.serializers import ( + BizSettingsSerializer, + ListBizSettingsResponseSerializer, + ListBizSettingsSerializer, + UpdateBizSettingsSerializer, + UpdateDutyNoticeSerializer, +) +from backend.db_services.ipchooser.constants import IDLE_HOST_MODULE +from backend.flow.utils.cc_manage import CcManage +from backend.iam_app.handlers.drf_perm import DBManageIAMPermission, RejectPermission tags = [_("系统设置")] -class SystemSettingsViewSet(viewsets.AuditedModelViewSet): +class SystemSettingsViewSet(viewsets.SystemViewSet): """系统设置视图""" - serializer_class = SystemSettingsSerializer - queryset = SystemSettings.objects.all() - # permission_classes 管理员 - filter_fields = { - "key": ["exact"], - "type": ["exact"], - "id": ["exact"], - } - def _get_custom_permissions(self): + # 非超级用户拒绝访问敏感信息 + if self.action == self.sensitive_environ.__name__ and not self.request.user.is_superuser: + return [RejectPermission()] + return [] @common_swagger_auto_schema( - operation_summary=_("系统设置列表"), - responses={status.HTTP_200_OK: SystemSettingsSerializer(_("系统设置"), many=True)}, + operation_summary=_("查询磁盘类型"), tags=tags, ) - def list(self, request, *args, **kwargs): - return super().list(request, *args, **kwargs) + @action(methods=["GET"], detail=False) + def disk_classes(self, request, *args, **kwargs): + return Response(DISK_CLASSES) @common_swagger_auto_schema( - operation_summary=_("系统设置键值映射表"), - responses={ - status.HTTP_200_OK: yasg_response( - _("系统设置"), examples={setting[0]: setting[2] for setting in DEFAULT_SETTINGS} - ) - }, + operation_summary=_("查询机型类型"), tags=tags, ) - @action(detail=False, methods=["get"]) - def simple(self, request, *args, **kwargs): - """获取系统配置表 -> {"key": "value"}""" + @action(methods=["GET"], detail=False) + def device_classes(self, request, *args, **kwargs): + return Response(SystemSettings.get_setting_value(SystemSettingsEnum.DEVICE_CLASSES.value, default=[])) + + @common_swagger_auto_schema( + operation_summary=_("查询轮值通知配置"), + tags=tags, + ) + @action(methods=["GET"], detail=False, pagination_class=None) + def duty_notice_config(self, request, *args, **kwargs): + return Response(SystemSettings.get_setting_value(SystemSettingsEnum.BKM_DUTY_NOTICE.value, default={})) - return Response({q.key: q.value for q in self.queryset}) + @common_swagger_auto_schema( + operation_summary=_("更新轮值通知配置"), + tags=tags, + request_body=UpdateDutyNoticeSerializer(), + ) + @action(methods=["POST"], detail=False, pagination_class=None, serializer_class=UpdateDutyNoticeSerializer) + def update_duty_notice_config(self, request, *args, **kwargs): + """""" + SystemSettings.insert_setting_value(SystemSettingsEnum.BKM_DUTY_NOTICE.value, self.validated_data, "dict") + return Response(SystemSettings.get_setting_value(SystemSettingsEnum.BKM_DUTY_NOTICE.value, default={})) @common_swagger_auto_schema(operation_summary=_("查询环境变量"), tags=tags) @action(detail=False, methods=["get"]) def environ(self, request): - """按需提供环境变量""" + """按需提供非敏感环境变量""" return Response( { "BK_DOMAIN": env.BK_DOMAIN, @@ -73,5 +89,66 @@ def environ(self, request): "BK_CMDB_URL": env.BK_CMDB_URL, "BK_NODEMAN_URL": env.BK_NODEMAN_URL, "BK_SCR_URL": env.BK_SCR_URL, + "BK_HELPER_URL": env.BK_HELPER_URL, + "BK_DBM_URL": env.BK_SAAS_HOST, + "CC_IDLE_MODULE_ID": CcManage(env.DBA_APP_BK_BIZ_ID).get_biz_internal_module(env.DBA_APP_BK_BIZ_ID)[ + IDLE_HOST_MODULE + ]["bk_module_id"], + "CC_MANAGE_TOPO": SystemSettings.get_setting_value(key=SystemSettingsEnum.MANAGE_TOPO.value), + } + ) + + @common_swagger_auto_schema(operation_summary=_("查询环境变量"), tags=tags) + @action(detail=False, methods=["get"]) + def sensitive_environ(self, request): + """按需提供敏感环境变量""" + dbm_report = SystemSettings.get_setting_value(key=SystemSettingsEnum.BKM_DBM_REPORT.value) + return Response( + { + "MONITOR_METRIC_DATA_ID": dbm_report["metric"]["data_id"], + "MONITOR_EVENT_DATA_ID": dbm_report["event"]["data_id"], + "MONITOR_METRIC_ACCESS_TOKEN": dbm_report["metric"]["token"], + "MONITOR_EVENT_ACCESS_TOKEN": dbm_report["event"]["token"], + "MONITOR_SERVICE": dbm_report["proxy"], } ) + + +class BizSettingsViewSet(viewsets.AuditedModelViewSet): + """业务设置视图""" + + serializer_class = BizSettingsSerializer + queryset = BizSettings.objects.all() + + def _get_custom_permissions(self): + return [DBManageIAMPermission()] + + @common_swagger_auto_schema( + operation_summary=_("业务设置列表"), + responses={status.HTTP_200_OK: BizSettingsSerializer(_("业务设置"), many=True)}, + tags=tags, + ) + def list(self, request, *args, **kwargs): + return super().list(request, *args, **kwargs) + + @common_swagger_auto_schema( + operation_summary=_("业务设置列表键值映射表"), + query_serializer=ListBizSettingsSerializer(), + responses={status.HTTP_200_OK: ListBizSettingsResponseSerializer()}, + tags=tags, + ) + @action(detail=False, methods=["GET"], serializer_class=ListBizSettingsSerializer) + def simple(self, request, *args, **kwargs): + filter_field = self.params_validate(self.get_serializer_class()) + return Response({q.key: q.value for q in self.queryset.filter(**filter_field)}) + + @common_swagger_auto_schema( + operation_summary=_("更新业务设置列表键值"), + request_body=UpdateBizSettingsSerializer(), + tags=tags, + ) + @action(detail=False, methods=["POST"], serializer_class=UpdateBizSettingsSerializer) + def update_settings(self, request, *args, **kwargs): + setting_data = self.params_validate(self.get_serializer_class()) + BizSettings.insert_setting_value(**setting_data, user=request.user.username) + return Response() diff --git a/dbm-ui/backend/constants.py b/dbm-ui/backend/constants.py index 2506898671..8920aa0f40 100644 --- a/dbm-ui/backend/constants.py +++ b/dbm-ui/backend/constants.py @@ -52,6 +52,7 @@ class CommonInstanceLabels: instance_role: str instance_host: str instance_port: str + db_module: str # 定义添加host的公共固定标签结构 @@ -62,3 +63,7 @@ class CommonHostDBMeta: cluster_domain: str cluster_type: str instance_role: str + + +# 集群状态数据缓存key +CACHE_CLUSTER_STATS = "cluster_stats" diff --git a/dbm-ui/backend/core/storages/apps.py b/dbm-ui/backend/core/storages/apps.py index 37551e8c03..41cfb499a3 100644 --- a/dbm-ui/backend/core/storages/apps.py +++ b/dbm-ui/backend/core/storages/apps.py @@ -14,4 +14,5 @@ class CoreFilesConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" name = "backend.core.storages" diff --git a/dbm-ui/backend/core/storages/handlers.py b/dbm-ui/backend/core/storages/handlers.py index db25b52107..b2f5da5beb 100644 --- a/dbm-ui/backend/core/storages/handlers.py +++ b/dbm-ui/backend/core/storages/handlers.py @@ -56,13 +56,12 @@ def batch_fetch_file_content(self, file_path_list: List[str]) -> List[Dict[str, file_stream = io.BytesIO(zip_content) unzip_files = zipfile.ZipFile(file=file_stream) for index, unzip_file_name in enumerate(unzip_files.namelist()): - # 注意,这里解压缩的文件名和原路径会有差异(好像会少一个层级) - file_path = file_path_list[index] + # 注意,这里解压缩的文件名和原路径会有差异(好像少一个层级) file_content_list.append( { - "path": file_path, + "path": unzip_file_name, "content": unzip_files.read(unzip_file_name).decode("utf-8"), - "url": self.storage.url(file_path), + "url": self.storage.url(unzip_file_name), } ) diff --git a/dbm-ui/backend/core/translation/constants.py b/dbm-ui/backend/core/translation/constants.py index a0369872d6..74a378be2f 100644 --- a/dbm-ui/backend/core/translation/constants.py +++ b/dbm-ui/backend/core/translation/constants.py @@ -33,6 +33,7 @@ "backend/db_monitor/management", "backend/db_event/management", "backend/flow/utils/cloud/script_template", + "dbm-ui/backend/db_services/report/mock_data", ] # 寻找未翻译语言时,忽略的文件路径 EXCLUDE_FILE_PATHS = [ diff --git a/dbm-ui/backend/core/translation/language_finder.py b/dbm-ui/backend/core/translation/language_finder.py index 527be281c5..3b8d9f585b 100644 --- a/dbm-ui/backend/core/translation/language_finder.py +++ b/dbm-ui/backend/core/translation/language_finder.py @@ -274,6 +274,8 @@ def __init__( "translate", "conf", "config", + "mock.py", + "mock_data.py", } if exclude_dir_or_file_list: _exclude_dir_or_file_list.update(set(exclude_dir_or_file_list)) diff --git a/dbm-ui/backend/db_dirty/handlers.py b/dbm-ui/backend/db_dirty/handlers.py index 424d732006..4969107623 100644 --- a/dbm-ui/backend/db_dirty/handlers.py +++ b/dbm-ui/backend/db_dirty/handlers.py @@ -18,6 +18,8 @@ from backend.configuration.models import SystemSettings from backend.db_dirty.models import DirtyMachine from backend.db_meta.models import Machine +from backend.db_services.ipchooser.constants import IDLE_HOST_MODULE +from backend.db_services.ipchooser.handlers.topo_handler import TopoHandler from backend.flow.utils.cc_manage import CcManage from backend.ticket.models import Flow, Ticket @@ -55,14 +57,10 @@ def insert_dirty_machines(cls, bk_biz_id: int, bk_host_ids: List[Dict[str, Any]] @param ticket: 关联的单据 @param flow: 关联的flow任务 """ - # 排除已经录入到Machine表的机器(因为是成功消费不算污点机器) - db_machines = list(Machine.objects.filter(bk_host_id__in=bk_host_ids).values_list("bk_host_id", flat=True)) - dirty_host_ids = list(set(bk_host_ids) - set(db_machines)) - # 查询污点机器信息 host_property_filter = { "condition": "AND", - "rules": [{"field": "bk_host_id", "operator": "in", "value": dirty_host_ids}], + "rules": [{"field": "bk_host_id", "operator": "in", "value": bk_host_ids}], } dirty_host_infos = CCApi.list_biz_hosts( { @@ -74,15 +72,26 @@ def insert_dirty_machines(cls, bk_biz_id: int, bk_host_ids: List[Dict[str, Any]] } )["info"] - # 将污点机器信息转移至污点池模块 - dirty_module = SystemSettings.get_setting_value(key=SystemSettingsEnum.MANAGE_TOPO.value)["dirty_module_id"] - CcManage(bk_biz_id=env.DBA_APP_BK_BIZ_ID).transfer_host_module( - bk_host_ids=dirty_host_ids, target_module_ids=[dirty_module] - ) + # 获取空闲机模块,资源池模块和污点池模块 + system_manage_topo = SystemSettings.get_setting_value(key=SystemSettingsEnum.MANAGE_TOPO.value) + idle_module = CcManage(bk_biz_id).get_biz_internal_module(bk_biz_id)[IDLE_HOST_MODULE]["bk_module_id"] + resource_module, dirty_module = system_manage_topo["resource_module_id"], system_manage_topo["dirty_module_id"] + # 获取主机的拓扑信息 + host_topo_infos = TopoHandler.query_host_set_module(bk_biz_id=3, bk_host_ids=bk_host_ids)["hosts_topo_info"] + # 将污点机器信息转移至污点池模(如果污点机器不在空闲机/资源池,则放弃转移,认为已到正确拓扑) + transfer_host_ids = [ + info["bk_host_id"] + for info in host_topo_infos + if not set(info["bk_module_ids"]) - {resource_module, idle_module} + ] + if transfer_host_ids: + CcManage(bk_biz_id=env.DBA_APP_BK_BIZ_ID).transfer_host_module( + bk_host_ids=transfer_host_ids, target_module_ids=[dirty_module] + ) # 录入污点池表中 exist_dirty_machine_ids = list( - DirtyMachine.objects.filter(bk_host_id__in=dirty_host_ids).values_list("bk_host_id", flat=True) + DirtyMachine.objects.filter(bk_host_id__in=bk_host_ids).values_list("bk_host_id", flat=True) ) DirtyMachine.objects.bulk_create( [ diff --git a/dbm-ui/backend/db_meta/api/cluster/base/graph.py b/dbm-ui/backend/db_meta/api/cluster/base/graph.py index 0fd9a7f0c5..3d3c6e4fdd 100644 --- a/dbm-ui/backend/db_meta/api/cluster/base/graph.py +++ b/dbm-ui/backend/db_meta/api/cluster/base/graph.py @@ -19,7 +19,7 @@ from django.utils.translation import gettext_lazy as _ from backend import env -from backend.db_meta.enums import ClusterEntryType, InstanceRole, MachineType, TenDBClusterSpiderRole +from backend.db_meta.enums import ClusterEntryType, ClusterType, InstanceRole, MachineType, TenDBClusterSpiderRole from backend.db_meta.models import Cluster, ClusterEntry, ProxyInstance, StorageInstance @@ -50,8 +50,18 @@ def generate_node_type(ins: Union[StorageInstance, ProxyInstance, ClusterEntry]) @staticmethod def generate_url(ins: Union[StorageInstance, ProxyInstance, ClusterEntry]) -> str: if isinstance(ins, (StorageInstance, ProxyInstance)): + if ins.cluster_type == ClusterType.TenDBCluster: + url_tpl = ( + "/database/{bk_biz_id}/spider-manage/list-instance?" + "instance_address={ip}:{port}&cluster_id={cluster_id}" + ) + else: + url_tpl = ( + "/database/{bk_biz_id}/{cluster_type}-instance?" + "instance_address={ip}:{port}&cluster_id={cluster_id}" + ) # url 跳转到实例详情 - return "/database/{bk_biz_id}/{cluster_type}-instance/{cluster_id}/{ip}:{port}/details".format( + return url_tpl.format( bk_biz_id=ins.bk_biz_id, cluster_type=ins.cluster_type, cluster_id=ins.cluster.first().id, diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py index d26fc205c8..7b2e1505c2 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py @@ -14,6 +14,7 @@ from backend.db_meta.exceptions import DBMetaException from backend.db_meta.models import Cluster, ClusterEntry, StorageInstanceTuple +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig from backend.flow.utils.cc_manage import CcManage logger = logging.getLogger("root") @@ -59,6 +60,8 @@ def decommission(cluster: Cluster): # todo 目前cc没有封装移除主机模块接口,先保留写法 # delete_cluster_modules(db_type=DBType.MySQL.value, del_cluster_id=cluster.id) cluster.delete(keep_parents=True) + # 删除集群相关的配置模板 + TendbOpenAreaConfig.objects.filter(source_cluster_id=cluster.id).delete() @transaction.atomic diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py index 1dbfb8b3b0..b6c5c1c816 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py @@ -294,13 +294,13 @@ def remote_switch(cls, cluster_id: int, switch_tuples: list): # 切换新master服务实例角色标签 cc_manage.add_label_for_service_instance( bk_instance_ids=[obj.bk_instance_id for obj in slave_objs], - labels_dict={"instance_role": InstanceRole.BACKEND_MASTER.value}, + labels_dict={"instance_role": InstanceRole.REMOTE_MASTER.value}, ) # 切换新slave服务实例角色标签 cc_manage.add_label_for_service_instance( bk_instance_ids=[obj.bk_instance_id for obj in master_objs], - labels_dict={"instance_role": InstanceRole.BACKEND_SLAVE.value}, + labels_dict={"instance_role": InstanceRole.REMOTE_SLAVE.value}, ) def get_remote_address(self, role=TenDBBackUpLocation.REMOTE) -> str: diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/remotedb_node_migrate.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/remotedb_node_migrate.py index d1282ecc7a..65819ac217 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/remotedb_node_migrate.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/remotedb_node_migrate.py @@ -164,5 +164,4 @@ def uninstall_storage(cls, cluster_id: int, ip: str): StorageInstanceTuple.objects.filter(ejector=one.id).delete() StorageInstanceTuple.objects.filter(receiver=one.id).delete() StorageInstance.objects.filter(machine__ip=ip, machine__bk_cloud_id=bk_cloud_id).delete() - api.machine.trans_module(bk_cloud_id=bk_cloud_id, cluster_ids=[cluster_id], machines=[ip], idle=True) - api.machine.delete(bk_cloud_id=bk_cloud_id, machines=[ip]) + api.machine.delete(machines=["ip"], bk_cloud_id=cluster.bk_cloud_id) diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/add_proxy.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/add_proxy.py index c70d1879e3..267160ea61 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/add_proxy.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/add_proxy.py @@ -46,7 +46,12 @@ def add_proxy(cluster_ids: list, proxy_ip: str, bk_cloud_id: int): # proxy实例的时区信息同步cluster的,这里其实list只有一个实例 for proxy in proxy_objs: + m = proxy.machine + m.db_module_id = cluster.db_module_id + m.save() + proxy.time_zone = cluster.time_zone + proxy.db_module_id = cluster.db_module_id proxy.save() new_proxy_objs.append(proxy) diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py index acd667939b..ab344256b5 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py @@ -17,6 +17,7 @@ from backend.db_meta.exceptions import DBMetaException from backend.db_meta.models import Cluster, ClusterEntry, StorageInstanceTuple from backend.flow.consts import MySQLPrivComponent, UserName +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig from backend.flow.utils.cc_manage import CcManage logger = logging.getLogger("root") @@ -64,6 +65,8 @@ def decommission(cluster: Cluster): # TODO CC 目前没有把主机移出当前模块的接口,主机还在模块下,无法删除 # cc_manage.delete_cluster_modules(db_type=DBType.MySQL.value, cluster=cluster) cluster.delete(keep_parents=True) + # 删除集群相关的配置模板 + TendbOpenAreaConfig.objects.filter(source_cluster_id=cluster.id).delete() @transaction.atomic diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_proxy.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_proxy.py index db40e2bc23..cba2d8e81c 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_proxy.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_proxy.py @@ -46,7 +46,12 @@ def switch_proxy(cluster_ids: list, target_proxy_ip: str, origin_proxy_ip: str, # proxy实例的时区信息同步cluster的,这里其实list只有一个实例 for proxy in proxy_objs: + m = proxy.machine + m.db_module_id = cluster.db_module_id + m.save() + proxy.time_zone = cluster.time_zone + proxy.db_module_id = cluster.db_module_id proxy.save() new_proxy_objs.append(proxy) diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_storage.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_storage.py index 57b536e971..c70bfc2caf 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_storage.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/switch_storage.py @@ -38,10 +38,10 @@ def switch_storage(cluster_id: int, target_storage_ip: str, origin_storage_ip: s target_storage.instance_inner_role = InstanceRoleInstanceInnerRoleMap[role].value # target实例需要继承source实例的is_standby特性 - target_storage.is_stand_by = target_storage.is_stand_by - - # 保存 + target_storage.is_stand_by = origin_storage.is_stand_by target_storage.save() + origin_storage.is_stand_by = False + origin_storage.save() def change_proxy_storage_entry(cluster_id: int, master_ip: str, new_master_ip: str): diff --git a/dbm-ui/backend/db_meta/enums/cluster_phase.py b/dbm-ui/backend/db_meta/enums/cluster_phase.py index 61d90f2e91..d18abed7c0 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_phase.py +++ b/dbm-ui/backend/db_meta/enums/cluster_phase.py @@ -20,6 +20,9 @@ class ClusterPhase(str, StructuredEnum): # 仅用作单据校验,不实际写入,销毁集群时,请直接删除Cluster DESTROY = EnumField("destroy", _("destroy")) + # scr, gcs 迁移的中间阶段 + TRANS_STAGE = EnumField("trans_stage", _("trans_stage")) + @classmethod def cluster_status_transfer_valid(cls, source_phase, target_phase) -> bool: """ diff --git a/dbm-ui/backend/db_meta/enums/cluster_status.py b/dbm-ui/backend/db_meta/enums/cluster_status.py index 99938bf7e3..bce35f62f1 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_status.py +++ b/dbm-ui/backend/db_meta/enums/cluster_status.py @@ -28,6 +28,10 @@ def flag_text(self) -> List[str]: return flag_str.split("|") +class ClusterDBSingleStatusFlags(ClusterStatusFlags): + SingleUnavailable = auto() + + class ClusterDBHAStatusFlags(ClusterStatusFlags): ProxyUnavailable = auto() BackendMasterUnavailable = auto() diff --git a/dbm-ui/backend/db_meta/enums/cluster_type.py b/dbm-ui/backend/db_meta/enums/cluster_type.py index 0e1a6fd1a6..d89e4fc31b 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_type.py +++ b/dbm-ui/backend/db_meta/enums/cluster_type.py @@ -11,6 +11,8 @@ from blue_krill.data_types.enum import EnumField, StructuredEnum from django.utils.translation import gettext_lazy as _ +from backend.configuration.constants import DBType + class ClusterType(str, StructuredEnum): TenDBSingle = EnumField("tendbsingle", _("tendbsingle")) @@ -18,7 +20,7 @@ class ClusterType(str, StructuredEnum): TenDBCluster = EnumField("tendbcluster", _("tendbcluster")) RedisCluster = EnumField("redis", _("Redis集群")) - TendisPredixyRedisCluster = EnumField("PredixyRedisCluster", _("Redis集群")) + TendisPredixyRedisCluster = EnumField("PredixyRedisCluster", _("Tendisplus集群")) TendisPredixyTendisplusCluster = EnumField("PredixyTendisplusCluster", _("Tendisplus存储版集群")) TendisTwemproxyRedisInstance = EnumField("TwemproxyRedisInstance", _("TendisCache集群")) TwemproxyTendisSSDInstance = EnumField("TwemproxyTendisSSDInstance", _("TendisSSD集群")) @@ -44,3 +46,48 @@ class ClusterType(str, StructuredEnum): MongoShardedCluster = EnumField("MongoShardedCluster", _("Mongo分片集群")) Riak = EnumField("riak", _("Riak集群")) + + @classmethod + def db_type_to_cluster_type(cls, db_type): + return { + DBType.InfluxDB: [], + DBType.MySQL: [cls.TenDBSingle, cls.TenDBHA], + DBType.TenDBCluster: [cls.TenDBCluster], + DBType.Redis: [ + cls.RedisCluster, + cls.TendisPredixyRedisCluster, + cls.TendisPredixyTendisplusCluster, + cls.TendisTwemproxyRedisInstance, + cls.TwemproxyTendisSSDInstance, + cls.TendisTwemproxyTendisplusIns, + cls.TendisRedisInstance, + cls.TendisTendisSSDInstance, + cls.TendisTendisplusInsance, + cls.TendisRedisCluster, + cls.TendisTendisplusCluster, + ], + DBType.Es: [cls.Es], + DBType.Kafka: [cls.Kafka], + DBType.Hdfs: [cls.Hdfs], + DBType.Pulsar: [cls.Pulsar], + DBType.MongoDB: [cls.MongoShardedCluster, cls.MongoReplicaSet], + DBType.Riak: [cls.Riak], + }.get(db_type) + + @classmethod + def cluster_type_to_db_type(cls, cluster_type): + if cluster_type in [ClusterType.TenDBSingle, ClusterType.TenDBHA]: + db_type = DBType.MySQL.value + elif cluster_type in [ + ClusterType.Es, + ClusterType.Kafka, + ClusterType.Hdfs, + ClusterType.Pulsar, + ClusterType.Influxdb, + ClusterType.TenDBCluster, + ]: + db_type = cluster_type.lower() + else: + db_type = DBType.Redis.value + + return db_type diff --git a/dbm-ui/backend/db_meta/enums/comm.py b/dbm-ui/backend/db_meta/enums/comm.py index f8e697b556..6618d250ed 100644 --- a/dbm-ui/backend/db_meta/enums/comm.py +++ b/dbm-ui/backend/db_meta/enums/comm.py @@ -22,3 +22,14 @@ class SyncType(str, StructuredEnum): class DBCCModule(str, StructuredEnum): REDIS = EnumField("redis", _("redis")) MONGODB = EnumField("mongodb", _("mongodb")) + + +class TagType(str, StructuredEnum): + CUSTOM = EnumField("custom", _("custom")) + SYSTEM = EnumField("system", _("system")) + + +class SystemTagEnum(str, StructuredEnum): + """系统内置的tag名称""" + + TEMPORARY = EnumField("temporary", _("temporary")) diff --git a/dbm-ui/backend/db_meta/enums/instance_phase.py b/dbm-ui/backend/db_meta/enums/instance_phase.py index 37d3283b81..76d0399f24 100644 --- a/dbm-ui/backend/db_meta/enums/instance_phase.py +++ b/dbm-ui/backend/db_meta/enums/instance_phase.py @@ -20,6 +20,8 @@ class InstancePhase(str, StructuredEnum): # 仅用作单据校验,不实际写入,销毁集群时,请直接删除Instance DESTROY = EnumField("destroy", _("destroy")) + TRANS_STAGE = EnumField("trans_stage", _("trans_stage")) + @classmethod def instance_status_transfer_valid(cls, source_phase, target_phase) -> bool: """ diff --git a/dbm-ui/backend/db_meta/flatten/proxy_instance.py b/dbm-ui/backend/db_meta/flatten/proxy_instance.py index 30553d2e11..86f7e23590 100644 --- a/dbm-ui/backend/db_meta/flatten/proxy_instance.py +++ b/dbm-ui/backend/db_meta/flatten/proxy_instance.py @@ -69,6 +69,30 @@ def proxy_instance(proxies: QuerySet) -> List[Dict]: "bind_port": be.proxyinstance_set.first().port, } ) + elif be.cluster_entry_type == ClusterEntryType.CLB: + dt = be.clbentrydetail_set.get() + bind_entry[be.cluster_entry_type].append( + { + "clb_ip": dt.clb_ip, + "clb_id": dt.clb_id, + "listener_id": dt.listener_id, + "clb_region": dt.clb_region, + "bind_ips": list(set([ele.machine.ip for ele in list(be.proxyinstance_set.all())])), + "bind_port": be.proxyinstance_set.first().port, + } + ) + elif be.cluster_entry_type == ClusterEntryType.POLARIS: + dt = be.polarisentrydetail_set.get() + bind_entry[be.cluster_entry_type].append( + { + "polaris_name": dt.polaris_name, + "polaris_l5": dt.polaris_l5, + "polaris_token": dt.polaris_token, + "alias_token": dt.alias_token, + "bind_ips": list(set([ele.machine.ip for ele in list(be.proxyinstance_set.all())])), + "bind_port": be.proxyinstance_set.first().port, + } + ) else: bind_entry[be.cluster_entry_type].append(be.entry) diff --git a/dbm-ui/backend/db_meta/flatten/storage_instance.py b/dbm-ui/backend/db_meta/flatten/storage_instance.py index 45c377cbde..e6a21c4ab9 100644 --- a/dbm-ui/backend/db_meta/flatten/storage_instance.py +++ b/dbm-ui/backend/db_meta/flatten/storage_instance.py @@ -86,6 +86,30 @@ def storage_instance(storages: QuerySet) -> List[Dict]: "bind_port": be.storageinstance_set.first().port, } ) + elif be.cluster_entry_type == ClusterEntryType.CLB: + dt = be.clbentrydetail_set.get() + bind_entry[be.cluster_entry_type].append( + { + "clb_ip": dt.clb_ip, + "clb_id": dt.clb_id, + "listener_id": dt.listener_id, + "clb_region": dt.clb_region, + "bind_ips": list(set([ele.machine.ip for ele in list(be.storageinstance_set.all())])), + "bind_port": be.storageinstance_set.first().port, + } + ) + elif be.cluster_entry_type == ClusterEntryType.POLARIS: + dt = be.polarisentrydetail_set.get() + bind_entry[be.cluster_entry_type].append( + { + "polaris_name": dt.polaris_name, + "polaris_l5": dt.polaris_l5, + "polaris_token": dt.polaris_token, + "alias_token": dt.alias_token, + "bind_ips": list(set([ele.machine.ip for ele in list(be.storageinstance_set.all())])), + "bind_port": be.storageinstance_set.first().port, + } + ) else: bind_entry[be.cluster_entry_type].append(be.entry) diff --git a/dbm-ui/backend/db_meta/management/commands/remove_cluster_ips.py b/dbm-ui/backend/db_meta/management/commands/remove_cluster_ips.py index c6a7e0d790..287c94670a 100644 --- a/dbm-ui/backend/db_meta/management/commands/remove_cluster_ips.py +++ b/dbm-ui/backend/db_meta/management/commands/remove_cluster_ips.py @@ -18,7 +18,9 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("cluster_ips", nargs="+", type=str, help="cluster ips to remove") + parser.add_argument("-i", "--ignore-clean", dest="ignore_clean", action="store_true", help="skip job/cc clean") def handle(self, *args, **options): cluster_ips = options.get("cluster_ips") - remove_cluster_ips(cluster_ips) + ignore_clean = options.get("ignore_clean") + remove_cluster_ips(cluster_ips, ignore_clean, ignore_clean) diff --git a/dbm-ui/backend/db_meta/management/commands/remove_clusters.py b/dbm-ui/backend/db_meta/management/commands/remove_clusters.py index 46d89dd60e..af54938eda 100644 --- a/dbm-ui/backend/db_meta/management/commands/remove_clusters.py +++ b/dbm-ui/backend/db_meta/management/commands/remove_clusters.py @@ -19,8 +19,10 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("cluster_ids", nargs="+", type=int, help="cluster IDs to remove") + parser.add_argument("-i", "--ignore-clean", dest="ignore_clean", action="store_true", help="skip job/cc clean") def handle(self, *args, **options): cluster_ids = options.get("cluster_ids") + ignore_clean = options.get("ignore_clean") for cluster in Cluster.objects.filter(id__in=cluster_ids): - remove_cluster(cluster.id) + remove_cluster(cluster.id, ignore_clean, ignore_clean) diff --git a/dbm-ui/backend/db_meta/migrations/0020_auto_20230913_1041.py b/dbm-ui/backend/db_meta/migrations/0020_auto_20230913_1041.py new file mode 100644 index 0000000000..b662828016 --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0020_auto_20230913_1041.py @@ -0,0 +1,34 @@ +# Generated by Django 3.2.19 on 2023-09-13 02:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0019_auto_20230829_1133"), + ] + + operations = [ + migrations.AddField( + model_name="cluster", + name="tag", + field=models.ManyToManyField(blank=True, help_text="集群标签", to="db_meta.Tag"), + ), + migrations.AddField( + model_name="tag", + name="type", + field=models.CharField( + choices=[("custom", "custom"), ("system", "system")], + default="system", + help_text="tag类型", + max_length=64, + ), + preserve_default=False, + ), + migrations.AlterField( + model_name="tag", + name="name", + field=models.CharField(default="", help_text="tag名称", max_length=64), + ), + ] diff --git a/dbm-ui/backend/db_meta/migrations/0021_auto_20230918_1750.py b/dbm-ui/backend/db_meta/migrations/0021_auto_20230918_1750.py new file mode 100644 index 0000000000..0bb500fba9 --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0021_auto_20230918_1750.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.19 on 2023-09-18 09:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0020_auto_20230913_1041"), + ] + + operations = [ + migrations.RemoveField( + model_name="cluster", + name="tag", + ), + migrations.AddField( + model_name="tag", + name="cluster", + field=models.ManyToManyField(blank=True, help_text="关联集群", to="db_meta.Cluster"), + ), + ] diff --git a/dbm-ui/backend/db_meta/migrations/0021_proxyinstance_phase.py b/dbm-ui/backend/db_meta/migrations/0021_proxyinstance_phase.py new file mode 100644 index 0000000000..78f174f463 --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0021_proxyinstance_phase.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2.19 on 2023-09-21 01:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0020_auto_20230913_1041"), + ] + + operations = [ + migrations.AddField( + model_name="proxyinstance", + name="phase", + field=models.CharField( + choices=[ + ("online", "online"), + ("offline", "offline"), + ("destroy", "destroy"), + ("trans_stage", "trans_stage"), + ], + default="online", + max_length=64, + ), + ), + ] diff --git a/dbm-ui/backend/db_meta/migrations/0022_merge_20230921_1147.py b/dbm-ui/backend/db_meta/migrations/0022_merge_20230921_1147.py new file mode 100644 index 0000000000..0fe6db7d06 --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0022_merge_20230921_1147.py @@ -0,0 +1,13 @@ +# Generated by Django 3.2.19 on 2023-09-21 03:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0021_auto_20230918_1750"), + ("db_meta", "0021_proxyinstance_phase"), + ] + + operations = [] diff --git a/dbm-ui/backend/db_meta/migrations/0023_cluster_disaster_tolerance_level.py b/dbm-ui/backend/db_meta/migrations/0023_cluster_disaster_tolerance_level.py new file mode 100644 index 0000000000..ac2c9ace97 --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0023_cluster_disaster_tolerance_level.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.19 on 2023-09-25 03:33 + +from django.db import migrations, models + +from backend.ticket.constants import AffinityEnum + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0022_merge_20230921_1147"), + ] + + operations = [ + migrations.AddField( + model_name="cluster", + name="disaster_tolerance_level", + field=models.CharField( + choices=AffinityEnum.get_choices(), default="NONE", help_text="容灾要求", max_length=128 + ), + ), + ] diff --git a/dbm-ui/backend/db_meta/models/cluster.py b/dbm-ui/backend/db_meta/models/cluster.py index dd6fb97df4..c4bf8223e8 100644 --- a/dbm-ui/backend/db_meta/models/cluster.py +++ b/dbm-ui/backend/db_meta/models/cluster.py @@ -8,9 +8,11 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import json import logging from typing import Dict, List +from django.core.cache import cache from django.db import models from django.db.models import Count, QuerySet from django.forms import model_to_dict @@ -18,7 +20,7 @@ from backend.bk_web.models import AuditedModel from backend.components.db_remote_service.client import DRSApi -from backend.constants import DEFAULT_BK_CLOUD_ID, DEFAULT_TIME_ZONE, IP_PORT_DIVIDER +from backend.constants import CACHE_CLUSTER_STATS, DEFAULT_BK_CLOUD_ID, DEFAULT_TIME_ZONE, IP_PORT_DIVIDER from backend.db_meta.enums import ( ClusterDBHAStatusFlags, ClusterPhase, @@ -29,9 +31,10 @@ InstanceStatus, TenDBClusterSpiderRole, ) +from backend.db_meta.enums.cluster_status import ClusterDBSingleStatusFlags from backend.db_meta.exceptions import ClusterExclusiveOperateException, DBMetaException from backend.db_services.version.constants import LATEST, PredixyVersion, TwemproxyVersion -from backend.ticket.constants import TicketType +from backend.ticket.constants import AffinityEnum, TicketType from backend.ticket.models import ClusterOperateRecord logger = logging.getLogger("root") @@ -49,10 +52,11 @@ class Cluster(AuditedModel): status = models.CharField(max_length=64, choices=ClusterStatus.get_choices(), default=ClusterStatus.NORMAL.value) bk_cloud_id = models.IntegerField(default=DEFAULT_BK_CLOUD_ID, help_text=_("云区域 ID")) region = models.CharField(max_length=128, default="", help_text=_("地域")) + disaster_tolerance_level = models.CharField( + max_length=128, help_text=_("容灾要求"), choices=AffinityEnum.get_choices(), default=AffinityEnum.NONE.value + ) time_zone = models.CharField(max_length=16, default=DEFAULT_TIME_ZONE, help_text=_("集群所在的时区")) - # tag = models.ManyToManyField(Tag, blank=True) - class Meta: unique_together = ("bk_biz_id", "name", "cluster_type", "db_module_id") @@ -60,7 +64,12 @@ def __str__(self): return self.name def to_dict(self): - return {**model_to_dict(self), "cluster_type_name": str(ClusterType.get_choice_label(self.cluster_type))} + """将集群所有字段转为字段""" + return { + **model_to_dict(self), + "cluster_type_name": str(ClusterType.get_choice_label(self.cluster_type)), + "tag": [t.tag_desc() for t in self.tag_set.all()], + } @property def simple_desc(self): @@ -101,20 +110,19 @@ def get_cluster_id_immute_domain_map(cls, cluster_ids: List[int]) -> Dict[int, s return {cluster.id: cluster.immute_domain for cluster in clusters} @classmethod - def is_exclusive(cls, cluster_id, ticket_type=None): + def is_exclusive(cls, cluster_id, ticket_type=None, **kwargs): if not ticket_type: return None - return ClusterOperateRecord.objects.has_exclusive_operations(ticket_type, cluster_id) + return ClusterOperateRecord.objects.has_exclusive_operations(ticket_type, cluster_id, **kwargs) @classmethod - def handle_exclusive_operations(cls, cluster_ids: List[int], ticket_type: str): + def handle_exclusive_operations(cls, cluster_ids: List[int], ticket_type: str, **kwargs): """ 处理当前的动作是否和集群正在运行的动作存在执行互斥 """ - for cluster_id in cluster_ids: - exclusive_infos = cls.is_exclusive(cluster_id, ticket_type) + exclusive_infos = cls.is_exclusive(cluster_id, ticket_type, **kwargs) if not exclusive_infos: continue @@ -179,6 +187,10 @@ def __status_flag(self): status=InstanceStatus.UNAVAILABLE.value, instance_inner_role=InstanceInnerRole.SLAVE.value ).exists(): flag_obj |= ClusterTenDBClusterStatusFlag.RemoteSlaveUnavailable + elif self.cluster_type == ClusterType.TenDBSingle.value: + flag_obj = ClusterDBSingleStatusFlags(0) + if self.storageinstance_set.filter(status=InstanceStatus.UNAVAILABLE.value).exists(): + flag_obj |= ClusterDBSingleStatusFlags.SingleUnavailable else: raise DBMetaException(message=_("{} 未实现 status flag".format(self.cluster_type))) @@ -256,3 +268,7 @@ def tendbcluster_ctl_primary_address(self) -> str: ) else: return ctl_address + + @classmethod + def get_cluster_stats(cls) -> dict: + return json.loads(cache.get(CACHE_CLUSTER_STATS, "{}")) diff --git a/dbm-ui/backend/db_meta/models/cluster_monitor.py b/dbm-ui/backend/db_meta/models/cluster_monitor.py index 0ff1c2555d..7dfa8a9ca0 100644 --- a/dbm-ui/backend/db_meta/models/cluster_monitor.py +++ b/dbm-ui/backend/db_meta/models/cluster_monitor.py @@ -77,6 +77,16 @@ SET_NAME_TEMPLATE = "db.{db_type}.{monitor_plugin_name}" +SHORT_NAMES = list( + set( + [ + collect_info["name"] + for _, machine_types in INSTANCE_MONITOR_PLUGINS.items() + for _, collect_info in machine_types.items() + ] + ) +) + def get_monitor_plugin(db_type, machine_type): """主机实例 -> 监控插件类型""" diff --git a/dbm-ui/backend/db_meta/models/db_module.py b/dbm-ui/backend/db_meta/models/db_module.py index 2f8259f702..06306675d2 100644 --- a/dbm-ui/backend/db_meta/models/db_module.py +++ b/dbm-ui/backend/db_meta/models/db_module.py @@ -8,11 +8,16 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import logging + from django.db import models +from django.db.models import Q from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterEntryType, MachineType +logger = logging.getLogger("root") + class DBModule(AuditedModel): """ @@ -30,6 +35,36 @@ class Meta: ("db_module_name", "bk_biz_id", "cluster_type"), ] + @classmethod + def get_choices(cls): + try: + db_module_choices = [ + (module.db_module_id, f"[{module.db_module_id}]{module.cluster_type}-{module.db_module_name}") + for module in cls.objects.all() + ] + except Exception: # pylint: disable=broad-except + # 忽略出现的异常,此时可能因为表未初始化 + db_module_choices = [] + return db_module_choices + + @classmethod + def get_choices_with_filter(cls, cluster_type=None): + try: + q = Q() + if cluster_type: + q = Q(cluster_type=cluster_type) + + logger.info("get db module choices with filter: {}".format(q)) + + db_module_choices = [ + (module.db_module_id, f"[{module.db_module_id}]{module.cluster_type}-{module.db_module_name}") + for module in cls.objects.filter(q) + ] + except Exception: # pylint: disable=broad-except + # 忽略出现的异常,此时可能因为表未初始化 + db_module_choices = [] + return db_module_choices + class BKModule(AuditedModel): bk_module_id = models.IntegerField(primary_key=True) diff --git a/dbm-ui/backend/db_meta/models/instance.py b/dbm-ui/backend/db_meta/models/instance.py index c8ddda8e90..be23a1b4eb 100644 --- a/dbm-ui/backend/db_meta/models/instance.py +++ b/dbm-ui/backend/db_meta/models/instance.py @@ -195,6 +195,7 @@ class ProxyInstance(InstanceMixin, AuditedModel): storageinstance = models.ManyToManyField(StorageInstance, blank=True) cluster_type = models.CharField(max_length=64, choices=ClusterType.get_choices(), default="") + phase = models.CharField(max_length=64, choices=InstancePhase.get_choices(), default=InstancePhase.ONLINE.value) status = models.CharField(max_length=64, choices=InstanceStatus.get_choices(), default="") bind_entry = models.ManyToManyField(ClusterEntry, blank=True) name = models.CharField(max_length=255, default="") diff --git a/dbm-ui/backend/db_meta/models/machine.py b/dbm-ui/backend/db_meta/models/machine.py index 88be79453b..32a2306739 100644 --- a/dbm-ui/backend/db_meta/models/machine.py +++ b/dbm-ui/backend/db_meta/models/machine.py @@ -72,6 +72,7 @@ def remove_duplicates(seq): if proxies: for proxy in proxies: for cluster in proxy.cluster.all(): + tendb_cluster_spider_ext = getattr(proxy, "tendbclusterspiderext", None) host_labels.append( asdict( CommonHostDBMeta( @@ -79,13 +80,31 @@ def remove_duplicates(seq): app_id=str(cluster.bk_biz_id), cluster_type=cluster.cluster_type, cluster_domain=cluster.immute_domain, - instance_role="proxy", + # tendbcluster中扩展了proxy的类型,需要特殊处理 + instance_role=tendb_cluster_spider_ext.spider_role + if tendb_cluster_spider_ext + else "proxy", ) ) ) if storages: for storage in storages: + # influxdb需要单独处理 + if storage.cluster_type == ClusterType.Influxdb.value: + host_labels.append( + asdict( + CommonHostDBMeta( + app=AppCache.get_app_attr(storage.bk_biz_id, default=storage.bk_biz_id), + app_id=str(storage.bk_biz_id), + cluster_domain=storage.machine.ip, + cluster_type=storage.cluster_type, + instance_role=storage.instance_role, + ) + ) + ) + continue + for cluster in storage.cluster.all(): host_labels.append( asdict( diff --git a/dbm-ui/backend/db_meta/models/spec.py b/dbm-ui/backend/db_meta/models/spec.py index 2f09904f50..dc09539cdb 100644 --- a/dbm-ui/backend/db_meta/models/spec.py +++ b/dbm-ui/backend/db_meta/models/spec.py @@ -9,10 +9,12 @@ specific language governing permissions and limitations under the License. """ import json +import logging from collections import defaultdict from typing import Dict, List from django.db import models +from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from backend import env @@ -23,6 +25,8 @@ from backend.db_meta.enums import ClusterType, MachineType from backend.ticket.constants import AffinityEnum +logger = logging.getLogger("root") + class Spec(AuditedModel): """ @@ -167,6 +171,39 @@ def init_spec(cls): Spec.objects.bulk_create(to_init_specs) + @classmethod + def get_choices(cls): + try: + spec_choices = [ + (spec.spec_id, f"[{spec.spec_id}]{spec.spec_cluster_type}-{spec.spec_machine_type}-{spec.spec_name}") + for spec in cls.objects.all() + ] + except Exception: # pylint: disable=broad-except + # 忽略出现的异常,此时可能因为表未初始化 + spec_choices = [] + return spec_choices + + @classmethod + def get_choices_with_filter(cls, cluster_type=None, machine_type=None): + try: + qct = Q() + qmt = Q() + if cluster_type: + qct = Q(spec_cluster_type=cluster_type) + if machine_type: + qmt = Q(spec_machine_type=machine_type) + + logger.info("get spec choices with filter: {}".format(qct & qmt)) + + spec_choices = [ + (spec.spec_id, f"[{spec.spec_id}]{spec.spec_cluster_type}-{spec.spec_machine_type}-{spec.spec_name}") + for spec in cls.objects.filter(qct & qmt) + ] + except Exception: # pylint: disable=broad-except + # 忽略出现的异常,此时可能因为表未初始化 + spec_choices = [] + return spec_choices + class SnapshotSpec(AuditedModel): """ diff --git a/dbm-ui/backend/db_meta/models/tag.py b/dbm-ui/backend/db_meta/models/tag.py index 54ac71aa45..05618dd99e 100644 --- a/dbm-ui/backend/db_meta/models/tag.py +++ b/dbm-ui/backend/db_meta/models/tag.py @@ -9,13 +9,22 @@ specific language governing permissions and limitations under the License. """ from django.db import models +from django.utils.translation import ugettext_lazy as _ from backend.bk_web.models import AuditedModel +from backend.db_meta.enums.comm import TagType +from backend.db_meta.models import Cluster class Tag(AuditedModel): bk_biz_id = models.IntegerField(default=0) - name = models.CharField(max_length=64, default="") + name = models.CharField(max_length=64, default="", help_text=_("tag名称")) + type = models.CharField(max_length=64, help_text=_("tag类型"), choices=TagType.get_choices()) + cluster = models.ManyToManyField(Cluster, blank=True, help_text=_("关联集群")) class Meta: unique_together = ["bk_biz_id", "name"] + + def tag_desc(self): + """仅返回tag的信息""" + return {"bk_biz_id": self.bk_biz_id, "name": self.name, "type": self.type} diff --git a/dbm-ui/backend/db_meta/utils.py b/dbm-ui/backend/db_meta/utils.py index b44c98e57b..7b246e7400 100644 --- a/dbm-ui/backend/db_meta/utils.py +++ b/dbm-ui/backend/db_meta/utils.py @@ -35,24 +35,7 @@ logger = logging.getLogger("root") -SNIPPETS_DIR = os.path.join(os.path.dirname(settings.BASE_DIR), "scripts/snippets") - - -def cluster_type_to_db_type(cluster_type): - if cluster_type in [ClusterType.TenDBSingle, ClusterType.TenDBHA, ClusterType.TenDBHA]: - db_type = "mysql" - elif cluster_type in [ - ClusterType.Es, - ClusterType.Kafka, - ClusterType.Hdfs, - ClusterType.Pulsar, - ClusterType.Influxdb, - ]: - db_type = cluster_type.lower() - else: - db_type = "redis" - - return db_type +SNIPPETS_DIR = os.path.join(settings.BASE_DIR, "scripts/snippets") def remove_cluster(cluster_id, job_clean=True, cc_clean=True): @@ -64,7 +47,7 @@ def remove_cluster(cluster_id, job_clean=True, cc_clean=True): cluster.phase = ClusterPhase.OFFLINE cluster.save() - db_type = cluster_type_to_db_type(cluster.cluster_type) + db_type = ClusterType.cluster_type_to_db_type(cluster.cluster_type) cluster_ips = set( list(cluster.storageinstance_set.values_list("machine__ip", flat=True)) @@ -111,6 +94,8 @@ def remove_cluster(cluster_id, job_clean=True, cc_clean=True): cluster.nosqlstoragesetdtl_set.all().delete() cluster.storageinstance_set.all().delete() cluster.proxyinstance_set.all().delete() + + cluster.clusterentry_set.all().update(forward_to=None) cluster.clusterentry_set.all().delete() Machine.objects.filter(ip__in=cluster_ips).delete() cluster.delete() diff --git a/dbm-ui/backend/db_monitor/admin.py b/dbm-ui/backend/db_monitor/admin.py new file mode 100644 index 0000000000..db2fdc075a --- /dev/null +++ b/dbm-ui/backend/db_monitor/admin.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.contrib import admin + +from . import models + + +@admin.register(models.MonitorPolicy) +class MonitorPolicyAdmin(admin.ModelAdmin): + list_display = ( + "parent_id", + "id", + "monitor_policy_id", + "name", + "db_type", + "bk_biz_id", + "target_level", + "target_keyword", + "is_enabled", + # "is_synced", + "sync_at", + "event_count", + # "dispatch_group_id", + ) + list_filter = ("bk_biz_id", "db_type") + search_fields = ("name",) diff --git a/dbm-ui/backend/db_monitor/constants.py b/dbm-ui/backend/db_monitor/constants.py index 3820b518fe..aeed3cadb7 100644 --- a/dbm-ui/backend/db_monitor/constants.py +++ b/dbm-ui/backend/db_monitor/constants.py @@ -18,6 +18,8 @@ TPLS_COLLECT_DIR = os.path.join(DB_MONITOR_TPLS_DIR, "collect") TPLS_ALARM_DIR = os.path.join(DB_MONITOR_TPLS_DIR, "alarm") +SWAGGER_TAG = "db_monitor" + class GroupType(str, StructuredEnum): """告警组类别: 平台级->业务级->集群级->一次性""" @@ -28,30 +30,43 @@ class GroupType(str, StructuredEnum): SINGLE = EnumField("SINGLE", _("single")) +class DutyRuleCategory(str, StructuredEnum): + """轮值规则分类""" + + REGULAR = EnumField("regular", _("固定值班")) + HANDOFF = EnumField("handoff", _("交替轮值")) + + class TargetLevel(str, StructuredEnum): """告警策略类别: 平台级->业务级->模块级->集群级->实例级 ROLE: 角色不确定所处的位置 CUSTOM: 用于表达额外过滤条件 """ - PLATFORM = EnumField("PLATFORM", _("platform")) - APP = EnumField("APP", _("app")) - MODULE = EnumField("MODULE", _("module")) - CLUSTER = EnumField("CLUSTER", _("cluster")) - ROLE = EnumField("ROLE", _("role")) - INSTANCE = EnumField("INSTANCE", _("instance")) - CUSTOM = EnumField("CUSTOM", _("custom")) + PLATFORM = EnumField("platform", _("platform")) + APP = EnumField("app_id", _("app id")) + MODULE = EnumField("db_module", _("db module")) + CLUSTER = EnumField("cluster_domain", _("cluster domain")) + CUSTOM = EnumField("custom", _("custom")) class TargetPriority(int, StructuredEnum): """监控策略优先级: 0-10000""" PLATFORM = EnumField(0, _("platform")) - APP = EnumField(1, _("app")) - MODULE = EnumField(10, _("module")) - CLUSTER = EnumField(100, _("cluster")) - INSTANCE = EnumField(1000, _("instance")) - CUSTOM = EnumField(5000, _("instance")) + APP = EnumField(1, _("app id")) + MODULE = EnumField(10, _("db module")) + CLUSTER = EnumField(100, _("cluster domain")) + CUSTOM = EnumField(5000, _("custom")) + + +TARGET_LEVEL_TO_PRIORITY = { + TargetLevel.PLATFORM.value: TargetPriority.PLATFORM, + TargetLevel.APP.value: TargetPriority.APP, + TargetLevel.MODULE.value: TargetPriority.MODULE, + TargetLevel.CLUSTER.value: TargetPriority.CLUSTER, + TargetLevel.CUSTOM.value: TargetPriority.CUSTOM, +} class PolicyStatus(str, StructuredEnum): @@ -59,3 +74,112 @@ class PolicyStatus(str, StructuredEnum): VALID = EnumField("valid", _("有效")) TARGET_INVALID = EnumField("target_invalid", _("监控目标已失效")) + + +class OperatorEnum(str, StructuredEnum): + """比较操作符""" + + EQ = EnumField("eq", _("等于")) + NEQ = EnumField("neq", _("不等于")) + LT = EnumField("lt", _("小于")) + GT = EnumField("gt", _("大于")) + LTE = EnumField("lte", _("小于等于")) + GTE = EnumField("gte", _("大于等于")) + + +class AlertLevelEnum(int, StructuredEnum): + """告警级别""" + + HIGH = EnumField(1, _("致命")) + MID = EnumField(2, _("预警")) + LOW = EnumField(3, _("提醒")) + + +class AlertSourceEnum(str, StructuredEnum): + """告警数据来源""" + + TIME_SERIES = EnumField("time_series", _("时序数据")) + EVENT = EnumField("event", _("事件数据")) + LOG = EnumField("log", _("日志关键字")) + + +class DetectAlgEnum(str, StructuredEnum): + """检测算法""" + + THRESHOLD = EnumField("Threshold", _("阈值检测")) + + +class NoticeWayEnum(str, StructuredEnum): + """通知方式""" + + BY_RULE = EnumField("by_rule", _("基于分派规则通知")) + ONLY_NOTICE = EnumField("only_notice", _("基于告警组直接通知")) + + +# 非ui方式监控策略模板占位符 +PROMQL_FILTER_TPL = "__COND__" + +# 蓝鲸监控保存用户组模板 +DEFAULT_ALERT_NOTICE = [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + {"notice_ways": [{"name": "mail"}], "level": 3}, + {"notice_ways": [{"name": "mail"}], "level": 2}, + {"notice_ways": [{"name": "mail"}], "level": 1}, + ], + } +] +BK_MONITOR_SAVE_USER_GROUP_TEMPLATE = { + "name": "", + "desc": "", + "need_duty": False, + "duty_arranges": [{"duty_type": "always", "work_time": "always", "users": []}], + "alert_notice": DEFAULT_ALERT_NOTICE, + "action_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + {"phase": 3, "notice_ways": [{"name": "mail"}]}, + {"phase": 2, "notice_ways": [{"name": "mail"}]}, + {"phase": 1, "notice_ways": [{"name": "mail"}]}, + ], + } + ], + "channels": ["user"], + "bk_biz_id": 0, +} + +# 分派优先级定义 +PLAT_PRIORITY = 100 +APP_PRIORITY = 1000 + +# 分派规则模板 +BK_MONITOR_SAVE_DISPATCH_GROUP_TEMPLATE = { + "id": 0, + "bk_biz_id": 0, + "priority": PLAT_PRIORITY, + "name": _("平台级分派给业务"), + "rules": [ + { + "id": 2, + "user_groups": [], + "conditions": [ + {"field": "alert.strategy_id", "value": ["95"], "method": "eq", "condition": "and"}, + {"field": "app_id", "value": ["1", "2", "3"], "method": "eq", "condition": "and"}, + ], + "actions": [ + { + "action_type": "notice", + "is_enabled": True, + "upgrade_config": {"is_enabled": False, "user_groups": [], "upgrade_interval": 0}, + } + ], + "alert_severity": 0, + "additional_tags": [], + "is_enabled": True, + }, + ], +} + +MONITOR_EVENTS_PREFIX = "monitor_events" diff --git a/dbm-ui/backend/db_monitor/exceptions.py b/dbm-ui/backend/db_monitor/exceptions.py new file mode 100644 index 0000000000..e9d8f8db27 --- /dev/null +++ b/dbm-ui/backend/db_monitor/exceptions.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import ugettext as _ + +from backend.exceptions import AppBaseException, ErrorCode + + +class DBMonitorBaseException(AppBaseException): + MODULE_CODE = ErrorCode.DB_MONITOR_CODE + MESSAGE = _("监控异常") + + +class BuiltInNotAllowDeleteException(DBMonitorBaseException): + ERROR_CODE = "001" + MESSAGE = _("内置告警组不允许删除") + + +class BkMonitorSaveAlarmException(DBMonitorBaseException): + ERROR_CODE = "201" + MESSAGE = _("监控策略保存失败") + MESSAGE_TPL = _("监控策略保存失败: {message}") + + +class BkMonitorDeleteAlarmException(DBMonitorBaseException): + ERROR_CODE = "202" + MESSAGE = _("监控策略删除失败") + MESSAGE_TPL = _("监控策略删除失败: {message}") diff --git a/dbm-ui/backend/db_monitor/handlers/__init__.py b/dbm-ui/backend/db_monitor/handlers/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/db_monitor/handlers/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/db_monitor/handlers/notice_group.py b/dbm-ui/backend/db_monitor/handlers/notice_group.py new file mode 100644 index 0000000000..2baf833529 --- /dev/null +++ b/dbm-ui/backend/db_monitor/handlers/notice_group.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + + +class NoticeGroupHandler: + pass diff --git a/dbm-ui/backend/db_monitor/management/commands/export_template.py b/dbm-ui/backend/db_monitor/management/commands/export_template.py index 6267c618ab..228e9b1aee 100644 --- a/dbm-ui/backend/db_monitor/management/commands/export_template.py +++ b/dbm-ui/backend/db_monitor/management/commands/export_template.py @@ -16,6 +16,7 @@ from django.core.management.base import BaseCommand from django.forms import model_to_dict +from backend.configuration.constants import DBType from backend.db_monitor.constants import TPLS_ALARM_DIR, TPLS_COLLECT_DIR from backend.db_monitor.models import CollectTemplate, RuleTemplate @@ -26,6 +27,8 @@ class Command(BaseCommand): help = "策略模板导出到文件" COLLECT_FIELDS = [ + "name", + "short_name", "bk_biz_id", "plugin_id", "db_type", @@ -33,7 +36,6 @@ class Command(BaseCommand): ] ALARM_FIELDS = [ "bk_biz_id", - "monitor_strategy_id", "name", "db_type", "details", @@ -42,27 +44,42 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("-t", "--type", choices=["collect", "alarm", "all"], default="all", help="模板类型") + parser.add_argument( + "-d", + "--dbtype", + choices=DBType.get_values() + ["all"], + default="all", + type=str, + help="db类型", + ) def handle(self, *args, **options): + template_type = options["type"] + db_type = options["dbtype"] + collect_templates = CollectTemplate.objects.filter(bk_biz_id=0) alarm_templates = RuleTemplate.objects.filter(bk_biz_id=0, is_enabled=True) - template_type = options["type"] + if db_type != "all": + collect_templates = collect_templates.filter(db_type=db_type) + alarm_templates = alarm_templates.filter(db_type=db_type) + print(f"start export db: {db_type} 's {template_type}...") if template_type in ["all", "collect"]: for template in collect_templates: # 转base64并写文件 template = model_to_dict(template, fields=self.COLLECT_FIELDS) - template_json = json.dumps(template) - template_json64 = base64.b64encode(template_json.encode()).decode() - template_file_name = "{bk_biz_id}.{db_type}.{plugin_id}.tpl64".format(**template) + template["version"] = template.get("version", 1) + template_json = json.dumps(template, indent=2) + template_file_name = "{db_type}.{name}.{short_name}.json".format(**template) with open(os.path.join(TPLS_COLLECT_DIR, template_file_name), "w") as template_file: - template_file.write(template_json64) + template_file.write(template_json) + print(f"export db: {db_type}'s {template_type}: {template['name']}") if template_type in ["all", "alarm"]: for template in alarm_templates: template = model_to_dict(template, fields=self.ALARM_FIELDS) template_json = json.dumps(template) - template_json64 = base64.b64encode(template_json.encode()).decode() - template_file_name = "{bk_biz_id}.{db_type}.{monitor_strategy_id}.tpl64".format(**template) + template_file_name = "{name}.json".format(**template) with open(os.path.join(TPLS_ALARM_DIR, template_file_name), "w") as template_file: - template_file.write(template_json64) + template_file.write(template_json) + print(f"export db: {db_type}'s {template_type}: {template['name']}") diff --git a/dbm-ui/backend/db_monitor/management/commands/extract_alarm.py b/dbm-ui/backend/db_monitor/management/commands/extract_alarm.py index e297971b94..6336f3d6de 100644 --- a/dbm-ui/backend/db_monitor/management/commands/extract_alarm.py +++ b/dbm-ui/backend/db_monitor/management/commands/extract_alarm.py @@ -16,6 +16,7 @@ from backend import env from backend.components import BKMonitorV3Api +from backend.configuration.constants import DBType from backend.db_meta.models import AppMonitorTopo from backend.db_monitor.models import NoticeGroup, RuleTemplate @@ -26,9 +27,7 @@ class Command(BaseCommand): help = "监控告警模板提取到本地数据库" def add_arguments(self, parser): - parser.add_argument( - "db_type", choices=["mysql", "redis", "es", "hdfs", "kafka", "pulsar", "influxdb"], type=str, help="db类型" - ) + parser.add_argument("db_type", choices=DBType.get_values(), type=str, help="db类型") parser.add_argument("bkmonitor_strategy_list", nargs="+", type=int, help="监控策略ID列表") def to_template(self, db_type: str, instance: dict): @@ -65,47 +64,38 @@ def clear_id(objs: List[dict], id_name="id"): # 更新业务id template["bk_biz_id"] = env.DBA_APP_BK_BIZ_ID # 更新label,追加db_type - template["labels"] = template["labels"] + [f"DBM_{db_type.upper()}", "DBM"] + template["labels"] = list(set(template["labels"] + [f"DBM_{db_type.upper()}", "DBM"])) # 更新通知组 notice = template["notice"] clear_id([notice]) - notice["user_groups"] = NoticeGroup.get_monitor_groups(db_type=db_type) + notice["user_groups"] = [] # 更新监控项和metric_id items = template["items"] clear_id(items) for item in items: # 更新监控目标为db_type对应的cmdb拓扑 - item["target"] = [ - [ - { - "field": "host_topo_node", - "method": "eq", - "value": [ - {"bk_inst_id": obj["bk_set_id"], "bk_obj_id": "set"} - for obj in AppMonitorTopo.get_set_by_dbtype(db_type=db_type) - ], - } - ] - ] + item["target"] = [] # 自定义事件和指标需要调整metric_id和result_table_id # custom.event.100465_bkmonitor_event_542898.redis_sync - custom_event_key = "custom.event" - bkmonitor_event_key = "bkmonitor_event" + # custom_event_key = "custom.event" + # bkmonitor_event_key = "bkmonitor_event" for query_config in item["query_configs"]: metric_id = query_config["metric_id"] - if custom_event_key in metric_id and bkmonitor_event_key in metric_id: + # if custom_event_key in metric_id and bkmonitor_event_key in metric_id: + if query_config["data_type_label"] == "event": metric_ids = metric_id.split(".") - metric_ids[2] = "{bk_biz_id}_bkmonitor_event_{event_data_id}" + metric_ids[2] = "bkmonitor_event_{event_data_id}" query_config["metric_id"] = ".".join(metric_ids) + query_config["result_table_id"] = "bkmonitor_event_{event_data_id}" logger.info(query_config.get("metric_id")) - result_table_id = query_config.get("result_table_id") - if result_table_id and custom_event_key in metric_id and bkmonitor_event_key in result_table_id: - query_config["result_table_id"] = "{bk_biz_id}_bkmonitor_event_{event_data_id}" - logger.info(query_config.get("result_table_id")) + # result_table_id = query_config.get("result_table_id") + # if result_table_id and custom_event_key in metric_id and bkmonitor_event_key in result_table_id: + # query_config["result_table_id"] = "bkmonitor_event_{event_data_id}" + # logger.info(query_config.get("result_table_id")) return instance["id"], template diff --git a/dbm-ui/backend/db_monitor/management/commands/extract_collect.py b/dbm-ui/backend/db_monitor/management/commands/extract_collect.py index 06937561a2..9bf5ea0733 100644 --- a/dbm-ui/backend/db_monitor/management/commands/extract_collect.py +++ b/dbm-ui/backend/db_monitor/management/commands/extract_collect.py @@ -15,6 +15,8 @@ from django.core.management.base import BaseCommand from backend.components import BKMonitorV3Api +from backend.db_meta.enums import MachineType +from backend.db_meta.models.cluster_monitor import SHORT_NAMES from backend.db_monitor.models import CollectTemplate logger = logging.getLogger("root") @@ -27,6 +29,7 @@ def add_arguments(self, parser): parser.add_argument( "db_type", choices=["mysql", "redis", "es", "hdfs", "kafka", "pulsar", "influxdb"], type=str, help="db类型" ) + parser.add_argument("short_name", choices=SHORT_NAMES + ["redis"], help="集群名后缀,比如db.redis.proxy -> proxy") parser.add_argument("collect_list", nargs="+", type=str, help="监控采集策略ID列表") def to_template(self, instance: dict): @@ -79,6 +82,8 @@ def clear_keys(obj: dict, keeped_keys: List): def handle(self, *args, **options): collect_list = options["collect_list"] db_type = options["db_type"] + short_name = options["short_name"] + # 批量获取策略 for collect_id in collect_list: instance = BKMonitorV3Api.query_collect_config_detail({"id": str(collect_id)}) @@ -86,12 +91,14 @@ def handle(self, *args, **options): plugin_id = instance["plugin_info"]["plugin_id"] collect_template = self.to_template(instance) - + print(collect_template) logger.info(f"[{db_type}-{collect_id}] update collect template: {collect_template['name']}") obj, _ = CollectTemplate.objects.update_or_create( defaults={ + "name": collect_template["name"], "details": collect_template, }, db_type=db_type, + short_name=short_name, plugin_id=plugin_id, ) diff --git a/dbm-ui/backend/db_monitor/management/commands/fix_alarm_source.py b/dbm-ui/backend/db_monitor/management/commands/fix_alarm_source.py new file mode 100644 index 0000000000..b938e70d6a --- /dev/null +++ b/dbm-ui/backend/db_monitor/management/commands/fix_alarm_source.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging + +from django.core.management.base import BaseCommand + +from backend.db_monitor.constants import AlertSourceEnum +from backend.db_monitor.models import MonitorPolicy + +logger = logging.getLogger("root") + + +class Command(BaseCommand): + help = "告警数据来源字段补充" + + def handle(self, *args, **options): + event_policies = set() + time_series_policies = set() + + for policy in MonitorPolicy.objects.all(): + for item in policy.details["items"]: + for query_config in item["query_configs"]: + if query_config["data_type_label"] == "event": + event_policies.add(policy.id) + else: + time_series_policies.add(policy.id) + + MonitorPolicy.objects.filter(id__in=event_policies).update(alert_source=AlertSourceEnum.EVENT.value) + MonitorPolicy.objects.filter(id__in=time_series_policies).update( + alert_source=AlertSourceEnum.TIME_SERIES.value + ) diff --git a/dbm-ui/backend/db_monitor/management/commands/fix_template.py b/dbm-ui/backend/db_monitor/management/commands/fix_template.py new file mode 100644 index 0000000000..c05d8e8d4c --- /dev/null +++ b/dbm-ui/backend/db_monitor/management/commands/fix_template.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import glob +import json +import logging +import os + +from django.core.management.base import BaseCommand + +from backend.db_monitor.constants import TPLS_ALARM_DIR, TargetPriority + +logger = logging.getLogger("root") + + +class Command(BaseCommand): + help = "策略模板文件修复" + + def add_arguments(self, parser): + parser.add_argument( + "-d", + "--dbtype", + choices=["mysql", "redis", "es", "hdfs", "kafka", "pulsar", "influxdb", "all"], + default="all", + type=str, + help="db类型", + ) + + def clear_id(self, objs, id_name="id"): + for obj in objs: + obj.pop(id_name, None) + + def update_json_file(self, f, template_dict): + # print(f"update json file: {f.name}") + f.seek(0) + f.write(json.dumps(template_dict, indent=2)) + f.truncate() + + def update_json_file_name(self, json_file, old, new): + if old == new: + return + + print(f"rename json name: {old} -> {new}") + os.rename(json_file, os.path.join(TPLS_ALARM_DIR, f"{new}.json")) + + def handle(self, *args, **options): + # db_type = options["dbtype"] + alarm_jsons = glob.glob(os.path.join(TPLS_ALARM_DIR, "*.json")) + for alarm_json in alarm_jsons: + with open(alarm_json, "r+") as f: + template_dict = json.loads(f.read()) + + old_template_name = template_dict["name"] + template_name = template_dict["name"] + + # 清理实例参数 + details = template_dict["details"] + + # 补充默认值 + if not template_dict.get("monitor_indicator"): + template_dict["monitor_indicator"] = details["items"][0]["name"] + + if not template_dict.get("version"): + template_dict["version"] = 0 + + template_dict.pop("monitor_strategy_id", None) + # details.pop("monitor_indicator", None) + + details["labels"] = sorted(set(details["labels"])) + details["source"] = "dbm" + details["bk_biz_id"] = "" + details["priority"] = TargetPriority.PLATFORM.value + # 平台策略仅开启基于分派通知 + details["notice"]["options"]["assign_mode"] = ["by_rule"] + for item in details["items"]: + # 清空监控目标 + item["target"] = [] + item["origin_sql"] = "" + + # 补充app_id作为维度 + self.clear_id(item["query_configs"]) + self.clear_id(item["algorithms"]) + for query_config in item["query_configs"]: + metric_id = query_config["metric_id"] + + # 标记告警数据来源 + template_dict["alert_source"] = query_config["data_type_label"] + + # 增加版本 + template_dict["version"] = 2 + + if "promql" in query_config: + promql = query_config["promql"] + if metric_id != promql: + query_config["metric_id"] = promql + # print(f"found promql style rule: {template_name}") + else: + # 奇怪,监控新版阉割了name + metric_field = query_config.get("metric_field") + if metric_field and not metric_id.endswith(metric_field): + query_config["metric_id"] = ".".join(metric_id.split(".")[:-1] + [metric_field]) + print(f"found bad metric_id rule: {template_name} -> {query_config['metric_id']}") + + # 根据监控侧长度限制进行截断 + if len(query_config["metric_id"]) > 128: + print(f"found too long promql metric rule: {template_name} -> {query_config['metric_id']}") + + query_config["metric_id"] = query_config["metric_id"][:128] + + if "agg_dimension" in query_config and "app_id" not in query_config["agg_dimension"]: + query_config["agg_dimension"].append("app_id") + + self.clear_id(details["items"]) + + # # [HDFS]-XXXXX -> HDFS XXXXX + # if old_template_name.startswith("[") and "]-" in old_template_name: + # db_type, name = old_template_name.split("-") + # template_name = f"{db_type[1:-1]} {name}" + # template_dict["details"]["name"] = template_dict["name"] = template_name + # + # # redis主机xxx-> Redis 主机xxx + # if old_template_name.startswith("redis主机"): + # db_type = "redis" + # template_name = f"Redis {old_template_name[5:]}" + # template_dict["details"]["name"] = template_dict["name"] = template_name + + self.update_json_file_name(alarm_json, old_template_name, template_name) + self.update_json_file(f, template_dict) diff --git a/dbm-ui/backend/db_monitor/migrations/0005_auto_20230905_1023.py b/dbm-ui/backend/db_monitor/migrations/0005_auto_20230905_1023.py new file mode 100644 index 0000000000..7e00221723 --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0005_auto_20230905_1023.py @@ -0,0 +1,32 @@ +# Generated by Django 3.2.19 on 2023-09-05 02:23 + +from django.db import migrations, models + +from backend.db_monitor.constants import TargetLevel + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0004_auto_20230829_1033"), + ] + + operations = [ + migrations.AddField( + model_name="monitorpolicy", + name="parent_details", + field=models.JSONField(default=dict, verbose_name="父级策略模板详情,可用于还原"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="details", + field=models.JSONField(default=dict, verbose_name="当前策略详情,可用于patch"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="target_level", + field=models.CharField( + choices=TargetLevel.get_choices(), default="app_id", max_length=64, verbose_name="监控目标级别,跟随targets调整" + ), + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0006_monitorpolicy_target_keyword.py b/dbm-ui/backend/db_monitor/migrations/0006_monitorpolicy_target_keyword.py new file mode 100644 index 0000000000..b6c4ac2f1c --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0006_monitorpolicy_target_keyword.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.19 on 2023-09-06 03:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0005_auto_20230905_1023"), + ] + + operations = [ + migrations.AddField( + model_name="monitorpolicy", + name="target_keyword", + field=models.TextField(default="", verbose_name="监控目标检索冗余字段"), + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0007_auto_20230912_1128.py b/dbm-ui/backend/db_monitor/migrations/0007_auto_20230912_1128.py new file mode 100644 index 0000000000..acb123aad0 --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0007_auto_20230912_1128.py @@ -0,0 +1,34 @@ +# Generated by Django 3.2.19 on 2023-09-12 03:28 + +from django.db import migrations, models + +from backend.configuration.constants import DBType + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0006_monitorpolicy_target_keyword"), + ] + + operations = [ + migrations.RemoveField( + model_name="noticegroup", + name="group_type", + ), + migrations.AddField( + model_name="noticegroup", + name="is_built_in", + field=models.BooleanField(default=False, verbose_name="是否内置"), + ), + migrations.AddField( + model_name="noticegroup", + name="name", + field=models.CharField(default="", max_length=255, verbose_name="告警通知组名称"), + ), + migrations.AlterField( + model_name="noticegroup", + name="db_type", + field=models.CharField(choices=DBType.get_choices(), default="", max_length=32, verbose_name="数据库类型"), + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0008_auto_20230914_1444.py b/dbm-ui/backend/db_monitor/migrations/0008_auto_20230914_1444.py new file mode 100644 index 0000000000..3908a49ed0 --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0008_auto_20230914_1444.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.19 on 2023-09-14 06:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0007_auto_20230912_1128"), + ] + + operations = [ + migrations.AddField( + model_name="monitorpolicy", + name="expected_notify_groups", + field=models.JSONField(default=dict, verbose_name="期望的通知组"), + ), + migrations.AddField( + model_name="monitorpolicy", + name="monitor_indicator", + field=models.CharField(default="", max_length=128, verbose_name="监控指标名"), + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0009_remove_monitorpolicy_expected_notify_groups.py b/dbm-ui/backend/db_monitor/migrations/0009_remove_monitorpolicy_expected_notify_groups.py new file mode 100644 index 0000000000..de53b27b2a --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0009_remove_monitorpolicy_expected_notify_groups.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.19 on 2023-09-14 11:29 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0008_auto_20230914_1444"), + ] + + operations = [ + migrations.RemoveField( + model_name="monitorpolicy", + name="expected_notify_groups", + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0010_auto_20230921_2148.py b/dbm-ui/backend/db_monitor/migrations/0010_auto_20230921_2148.py new file mode 100644 index 0000000000..e0bf932b17 --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0010_auto_20230921_2148.py @@ -0,0 +1,52 @@ +# Generated by Django 3.2.19 on 2023-09-21 13:48 + +from django.db import migrations, models + +from backend.configuration.constants import DBType +from backend.db_monitor.constants import DutyRuleCategory + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0009_remove_monitorpolicy_expected_notify_groups"), + ] + + operations = [ + migrations.CreateModel( + name="DutyRule", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("creator", models.CharField(max_length=64, verbose_name="创建人")), + ("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), + ("updater", models.CharField(max_length=64, verbose_name="修改人")), + ("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), + ("name", models.CharField(max_length=255, verbose_name="轮值规则名称")), + ("priority", models.PositiveIntegerField(verbose_name="优先级")), + ("is_enabled", models.BooleanField(default=True, verbose_name="是否启用")), + ("effective_time", models.DateTimeField(verbose_name="生效时间")), + ("end_time", models.DateTimeField(blank=True, null=True, verbose_name="截止时间")), + ( + "category", + models.CharField(choices=DutyRuleCategory.get_choices(), max_length=32, verbose_name="轮值类型"), + ), + ( + "db_type", + models.CharField( + choices=DBType.get_choices(), + max_length=32, + verbose_name="数据库类型", + ), + ), + ("duty_arranges", models.JSONField(verbose_name="轮值人员设置")), + ], + options={ + "verbose_name": "轮值规则", + "verbose_name_plural": "轮值规则", + }, + ), + migrations.AlterModelOptions( + name="noticegroup", + options={"verbose_name": "告警通知组", "verbose_name_plural": "告警通知组"}, + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0011_auto_20231007_1525.py b/dbm-ui/backend/db_monitor/migrations/0011_auto_20231007_1525.py new file mode 100644 index 0000000000..3fa9ff4a37 --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0011_auto_20231007_1525.py @@ -0,0 +1,134 @@ +# Generated by Django 3.2.19 on 2023-10-07 07:25 + +from django.db import migrations, models + +import backend.db_monitor.constants + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0010_auto_20230921_2148"), + ] + + operations = [ + migrations.RemoveField( + model_name="dispatchgroup", + name="is_synced", + ), + migrations.RemoveField( + model_name="dispatchgroup", + name="name", + ), + migrations.RemoveField( + model_name="dispatchgroup", + name="priority", + ), + migrations.RemoveField( + model_name="monitorpolicy", + name="dispatch_group_id", + ), + migrations.RemoveField( + model_name="monitorpolicy", + name="is_synced", + ), + migrations.RemoveField( + model_name="noticegroup", + name="is_synced", + ), + migrations.AddField( + model_name="collectinstance", + name="name", + field=models.CharField(default="", max_length=128, verbose_name="策略名称,全局唯一"), + ), + migrations.AddField( + model_name="collectinstance", + name="short_name", + field=models.CharField(default="", max_length=128), + ), + migrations.AddField( + model_name="collectinstance", + name="sync_at", + field=models.DateTimeField(null=True, verbose_name="最近一次的同步时间"), + ), + migrations.AddField( + model_name="collectinstance", + name="version", + field=models.IntegerField(default=0, verbose_name="版本"), + ), + migrations.AddField( + model_name="collecttemplate", + name="name", + field=models.CharField(default="", max_length=128, verbose_name="策略名称,全局唯一"), + ), + migrations.AddField( + model_name="collecttemplate", + name="short_name", + field=models.CharField(default="", max_length=128), + ), + migrations.AddField( + model_name="collecttemplate", + name="version", + field=models.IntegerField(default=0, verbose_name="版本"), + ), + migrations.AddField( + model_name="dispatchgroup", + name="bk_biz_id", + field=models.IntegerField(default=0, unique=True, verbose_name="业务ID, 0代表全业务"), + ), + migrations.AddField( + model_name="dispatchgroup", + name="rules", + field=models.JSONField(default=list, verbose_name="规则列表"), + ), + migrations.AddField( + model_name="monitorpolicy", + name="alert_source", + field=models.CharField( + choices=[("time_series", "时序数据"), ("event", "事件数据"), ("log", "日志关键字")], + default=backend.db_monitor.constants.AlertSourceEnum["TIME_SERIES"], + max_length=32, + verbose_name="告警数据来源", + ), + ), + migrations.AddField( + model_name="monitorpolicy", + name="version", + field=models.IntegerField(default=0, verbose_name="版本"), + ), + migrations.AlterField( + model_name="collectinstance", + name="plugin_id", + field=models.CharField(max_length=128, verbose_name="插件ID"), + ), + migrations.AlterField( + model_name="collecttemplate", + name="plugin_id", + field=models.CharField(max_length=128, verbose_name="插件ID"), + ), + migrations.AlterField( + model_name="dispatchgroup", + name="details", + field=models.JSONField(default=dict, verbose_name="策略模板详情"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="notify_groups", + field=models.JSONField(default=list, verbose_name="通知组"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="notify_rules", + field=models.JSONField(default=list, verbose_name="通知规则"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="targets", + field=models.JSONField(default=list, verbose_name="监控目标"), + ), + migrations.AlterField( + model_name="monitorpolicy", + name="test_rules", + field=models.JSONField(default=list, verbose_name="检测规则"), + ), + ] diff --git a/dbm-ui/backend/db_monitor/migrations/0012_auto_20231009_1015.py b/dbm-ui/backend/db_monitor/migrations/0012_auto_20231009_1015.py new file mode 100644 index 0000000000..d6939dfdee --- /dev/null +++ b/dbm-ui/backend/db_monitor/migrations/0012_auto_20231009_1015.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.19 on 2023-10-09 02:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_monitor", "0011_auto_20231007_1525"), + ] + + operations = [ + migrations.AddField( + model_name="dutyrule", + name="monitor_duty_rule_id", + field=models.IntegerField(default=0, verbose_name="监控轮值规则 ID"), + ), + migrations.AddField( + model_name="noticegroup", + name="monitor_duty_rule_id", + field=models.IntegerField(default=0, verbose_name="监控轮值规则 ID"), + ), + ] diff --git a/dbm-ui/backend/db_monitor/mock_data.py b/dbm-ui/backend/db_monitor/mock_data.py new file mode 100644 index 0000000000..7032f84ec1 --- /dev/null +++ b/dbm-ui/backend/db_monitor/mock_data.py @@ -0,0 +1,399 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy + +from django.utils.translation import ugettext_lazy as _ + +GET_MESSAGE_TYPE = [ + {"type": "rtx", "label": _("企业微信"), "is_active": True, "icon": "base64xxxxxxx"}, + {"type": "weixin", "label": _("微信"), "is_active": False, "icon": "base64xxxxxxx"}, + {"type": "mail", "label": _("邮件"), "is_active": True, "icon": "base64xxxxxxx"}, + {"type": "sms", "label": _("短信"), "is_active": True, "icon": "base64xxxxxxx"}, + {"type": "voice", "label": _("语音"), "is_active": True, "icon": "base64xxxxxxx"}, + {"type": "wxwork-bot", "label": _("群机器人"), "is_active": True, "icon": "base64xxxxxxx"}, +] + +GET_RECEIVER_GROUP = [ + {"id": "bk_biz_maintainer", "display_name": _("运维人员"), "logo": "", "type": "group", "members": ["admin"]}, + {"id": "bk_biz_productor", "display_name": _("产品人员"), "logo": "", "type": "group", "members": []}, + {"id": "bk_biz_tester", "display_name": _("测试人员"), "logo": "", "type": "group", "members": []}, + {"id": "bk_biz_developer", "display_name": _("开发人员"), "logo": "", "type": "group", "members": []}, + {"id": "operator", "display_name": _("主负责人"), "logo": "", "type": "group", "members": []}, + {"id": "bk_bak_operator", "display_name": _("备份负责人"), "logo": "", "type": "group", "members": []}, +] + +NOTICE_GROUP_DETAIL = { + "alert_notice": [ + { + "time_range": "00:00:00--11:59:00", + "notify_config": [ + { + "notice_ways": [{"name": "weixin"}], + "level": 3, + }, + { + "notice_ways": [{"name": "mail"}], + "level": 2, + }, + { + "notice_ways": [{"name": "rtx"}, {"name": "voice"}], + "level": 1, + }, + ], + }, + { + "time_range": "12:00:00--23:59:00", + "notify_config": [ + { + "notice_ways": [{"name": "weixin"}], + "level": 3, + }, + { + "notice_ways": [{"name": "wxwork-bot", "receivers": ["123"]}], + "level": 2, + }, + { + "notice_ways": [{"name": "rtx"}, {"name": "voice"}], + "level": 1, + }, + ], + }, + ] +} + +LIST_NOTICE_GROUP = { + "count": 2, + "results": [ + { + "id": 1, + "name": "MySQL DBA", + "updater": "admin", + "update_at": "2023-08-29 15:36:53", + "bk_biz_id": 0, + "monitor_group_id": 0, + "related_policy_count": 1, + "group_type": "PLATFORM", + "db_type": "mysql", + "receivers": [{"type": "group", "id": "bk_biz_maintainer"}, {"type": "user", "id": "admin"}], + "details": { + "alert_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + { + "notice_ways": [{"name": "weixin"}], + "level": 3, + }, + { + "notice_ways": [{"name": "mail"}], + "level": 2, + }, + { + "notice_ways": [{"name": "rtx"}, {"name": "voice"}], + "level": 1, + }, + ], + } + ] + }, + "is_built_in": True, + }, + { + "id": 2, + "name": _("自定义告警组名称"), + "updater": "admin", + "update_at": "2023-08-29 15:36:53", + "bk_biz_id": 0, + "monitor_group_id": 0, + "related_policy_count": 2, + "group_type": "PLATFORM", + "db_type": "mysql", + "receivers": [{"type": "user", "id": "admin"}], + "details": copy.deepcopy(NOTICE_GROUP_DETAIL), + "is_built_in": False, + }, + ], +} + +CREATE_NOTICE_GROUP = { + "name": _("新建告警组"), + "bk_biz_id": 0, + "receivers": [{"type": "group", "id": "bk_biz_maintainer"}, {"type": "user", "id": "admin"}], + "details": copy.deepcopy(NOTICE_GROUP_DETAIL), +} + +UPDATE_NOTICE_GROUP = {"id": 1, **CREATE_NOTICE_GROUP, **{"name": _("更新告警组")}} + +GET_RELATED_POLICY = [{"id": 1, "name": _("策略 A")}, {"id": 2, "name": _("策略 B")}] + +CREATE_HANDOFF_DUTY_RULE = { + "name": _("周末轮值"), + "priority": 1, + "db_type": "mysql", + "category": "handoff", + "effective_time": "2023-09-05 00:00:00", + "duty_arranges": [ + { + "duty_number": 2, + "duty_day": 1, + "members": ["admin"], + "work_type": "weekly", + "work_days": [6, 7], + "work_times": ["00:00--11:59", "12:00--23:59"], + } + ], +} + +CREATE_CUSTOM_DUTY_RULE = { + "name": _("固定排班"), + "priority": 2, + "db_type": "redis", + "category": "regular", + "effective_time": "2023-10-01 00:00:00", + "end_time": "2023-10-03 00:00:00", + "duty_arranges": [ + {"date": "2023-10-01", "work_times": ["00:00--11:59", "12:00--23:59"], "members": ["admin"]}, + {"date": "2023-10-02", "work_times": ["08:00--18:00"], "members": ["admin"]}, + {"date": "2023-10-03", "work_times": ["00:00--11:59", "12:00--23:59"], "members": ["admin"]}, + ], +} + +# bk monitor api +BK_MONITOR_CREATE_NOTICE_GROUP_REQUEST = { + "name": "durant0905", + "desc": "", + "need_duty": False, + "duty_arranges": [ + { + "duty_type": "always", + "work_time": "always", + "users": [{"display_name": "admin", "logo": "", "id": "admin", "type": "user"}], + } + ], + "alert_notice": [ + { + "time_range": "00:00:00--17:59:00", + "notify_config": [ + {"level": 3, "notice_ways": [{"name": "rtx"}, {"name": "wxwork-bot", "receivers": ["123"]}]}, + {"level": 2, "notice_ways": [{"name": "rtx"}]}, + {"level": 1, "notice_ways": [{"name": "rtx"}]}, + ], + }, + { + "time_range": "18:00:00--23:59:00", + "notify_config": [ + {"level": 3, "notice_ways": [{"name": "rtx"}]}, + {"level": 2, "notice_ways": [{"name": "rtx"}]}, + {"level": 1, "notice_ways": [{"name": "rtx"}]}, + ], + }, + ], + "action_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + {"level": 3, "notice_ways": [{"name": "rtx"}], "phase": 3}, + {"level": 2, "notice_ways": [{"name": "rtx"}], "phase": 2}, + {"level": 1, "notice_ways": [{"name": "rtx"}], "phase": 1}, + ], + } + ], + "channels": ["user", "wxwork-bot"], + "bk_biz_id": 5005578, +} + +BK_MONITOR_NOTICE_GROUP_DETAIL = { + "id": 29, + "name": _("mysql 周末轮值 告警组"), + "bk_biz_id": 3, + "desc": "", + "update_user": "admin", + "update_time": "2023-08-28 12:02:27+0800", + "create_user": "admin", + "create_time": "2023-08-23 17:53:46+0800", + "duty_arranges": [ + { + "id": 35, + "user_group_id": 29, + "need_rotation": True, + "duty_time": [{"work_type": "weekly", "work_days": [6, 7], "work_time": "00:00--23:59"}], + "effective_time": "2023-08-28t12:02:00+08:00", + "handoff_time": {"date": 1, "time": "00:00", "rotation_type": "daily"}, + "users": [], + "duty_users": [ + [{"id": "durant", "display_name": "durant", "type": "user"}], + [{"id": "edwin", "display_name": "edwin", "type": "user"}], + [{"id": "hongsong", "display_name": "hongsong", "type": "user"}], + [{"id": "kio", "display_name": "kio", "type": "user"}], + ], + "backups": [], + "order": 1, + }, + { + "id": 36, + "user_group_id": 29, + "need_rotation": True, + "duty_time": [{"work_type": "weekly", "work_days": [6, 7], "work_time": "00:00--23:59"}], + "effective_time": "2023-08-28t12:02:00+08:00", + "handoff_time": {"date": 1, "time": "00:00", "rotation_type": "daily"}, + "users": [], + "duty_users": [ + [{"id": "hongsong", "display_name": "hongsong", "type": "user"}], + [{"id": "kio", "display_name": "kio", "type": "user"}], + [{"id": "durant", "display_name": "durant", "type": "user"}], + [{"id": "edwin", "display_name": "edwin", "type": "user"}], + ], + "backups": [], + "order": 2, + }, + ], + "alert_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "level": 3}, + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "level": 2}, + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "level": 1}, + ], + } + ], + "action_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "phase": 3}, + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "phase": 2}, + {"type": [], "notice_ways": [{"name": "weixin", "receivers": []}], "phase": 1}, + ], + } + ], + "need_duty": True, + "path": "", + "channels": ["user"], + "users": [], + "strategy_count": 1, + "delete_allowed": False, + "edit_allowed": True, + "config_source": "ui", + "duty_plans": [ + { + "id": 365, + "user_group_id": 29, + "duty_arrange_id": 35, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-04 00:00:00+0800", + "end_time": "2023-09-05 00:00:00+0800", + "users": [{"id": "kio", "display_name": "kio", "type": "user"}], + "order": 1, + "is_active": False, + }, + { + "id": 390, + "user_group_id": 29, + "duty_arrange_id": 35, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-05 00:00:00+0800", + "end_time": "2023-09-06 00:00:00+0800", + "users": [{"id": "durant", "display_name": "durant", "type": "user"}], + "order": 1, + "is_active": False, + }, + { + "id": 391, + "user_group_id": 29, + "duty_arrange_id": 35, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-06 00:00:00+0800", + "end_time": "2023-09-07 00:00:00+0800", + "users": [{"id": "edwin", "display_name": "edwin", "type": "user"}], + "order": 1, + "is_active": False, + }, + { + "id": 392, + "user_group_id": 29, + "duty_arrange_id": 35, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-07 00:00:00+0800", + "end_time": "2023-09-08 00:00:00+0800", + "users": [{"id": "hongsong", "display_name": "hongsong", "type": "user"}], + "order": 1, + "is_active": False, + }, + { + "id": 393, + "user_group_id": 29, + "duty_arrange_id": 35, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-08 00:00:00+0800", + "end_time": "2023-09-09 00:00:00+0800", + "users": [{"id": "kio", "display_name": "kio", "type": "user"}], + "order": 1, + "is_active": False, + }, + { + "id": 369, + "user_group_id": 29, + "duty_arrange_id": 36, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-04 00:00:00+0800", + "end_time": "2023-09-05 00:00:00+0800", + "users": [{"id": "edwin", "display_name": "edwin", "type": "user"}], + "order": 2, + "is_active": False, + }, + { + "id": 394, + "user_group_id": 29, + "duty_arrange_id": 36, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-05 00:00:00+0800", + "end_time": "2023-09-06 00:00:00+0800", + "users": [{"id": "hongsong", "display_name": "hongsong", "type": "user"}], + "order": 2, + "is_active": False, + }, + { + "id": 395, + "user_group_id": 29, + "duty_arrange_id": 36, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-06 00:00:00+0800", + "end_time": "2023-09-07 00:00:00+0800", + "users": [{"id": "kio", "display_name": "kio", "type": "user"}], + "order": 2, + "is_active": False, + }, + { + "id": 396, + "user_group_id": 29, + "duty_arrange_id": 36, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-07 00:00:00+0800", + "end_time": "2023-09-08 00:00:00+0800", + "users": [{"id": "durant", "display_name": "durant", "type": "user"}], + "order": 2, + "is_active": False, + }, + { + "id": 397, + "user_group_id": 29, + "duty_arrange_id": 36, + "duty_time": [{"work_days": [6, 7], "work_time": "00:00--23:59", "work_type": "weekly"}], + "begin_time": "2023-09-08 00:00:00+0800", + "end_time": "2023-09-09 00:00:00+0800", + "users": [{"id": "edwin", "display_name": "edwin", "type": "user"}], + "order": 2, + "is_active": False, + }, + ], + "rule_count": 1, +} diff --git a/dbm-ui/backend/db_monitor/models/alarm.py b/dbm-ui/backend/db_monitor/models/alarm.py index 0648244cae..30a7a21394 100644 --- a/dbm-ui/backend/db_monitor/models/alarm.py +++ b/dbm-ui/backend/db_monitor/models/alarm.py @@ -8,47 +8,291 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import copy +import datetime +import logging +from collections import defaultdict + from django.db import models from django.utils.translation import gettext_lazy as _ +from backend import env from backend.bk_web.constants import LEN_LONG, LEN_MIDDLE, LEN_NORMAL, LEN_SHORT from backend.bk_web.models import AuditedModel -from backend.configuration.constants import PLAT_BIZ_ID, DBType -from backend.db_monitor.constants import GroupType, PolicyStatus, TargetLevel, TargetPriority +from backend.components import BKMonitorV3Api +from backend.configuration.constants import PLAT_BIZ_ID, DBType, SystemSettingsEnum +from backend.configuration.models import SystemSettings +from backend.db_meta.models import AppMonitorTopo +from backend.db_monitor.constants import ( + APP_PRIORITY, + BK_MONITOR_SAVE_DISPATCH_GROUP_TEMPLATE, + BK_MONITOR_SAVE_USER_GROUP_TEMPLATE, + DEFAULT_ALERT_NOTICE, + PLAT_PRIORITY, + PROMQL_FILTER_TPL, + TARGET_LEVEL_TO_PRIORITY, + AlertSourceEnum, + DutyRuleCategory, + PolicyStatus, + TargetLevel, +) +from backend.db_monitor.exceptions import ( + BkMonitorDeleteAlarmException, + BkMonitorSaveAlarmException, + BuiltInNotAllowDeleteException, +) +from backend.db_monitor.tasks import update_app_policy +from backend.exceptions import ApiError + +__all__ = ["NoticeGroup", "AlertRule", "RuleTemplate", "DispatchGroup", "MonitorPolicy", "DutyRule"] -__all__ = ["NoticeGroup", "AlertRule", "RuleTemplate", "DispatchGroup", "MonitorPolicy"] +logger = logging.getLogger("root") class NoticeGroup(AuditedModel): """告警通知组:一期粒度仅支持到业务级,可开关是否同步DBA人员数据""" bk_biz_id = models.IntegerField(help_text=_("业务ID, 0代表全业务"), default=PLAT_BIZ_ID) + name = models.CharField(_("告警通知组名称"), max_length=LEN_LONG, default="") monitor_group_id = models.BigIntegerField(help_text=_("监控通知组ID"), default=0) - group_type = models.CharField( - _("告警通知组类别"), choices=GroupType.get_choices(), max_length=LEN_NORMAL, default=GroupType.PLATFORM - ) - - db_type = models.CharField(_("数据库类型"), choices=DBType.get_choices(), max_length=LEN_SHORT) - + monitor_duty_rule_id = models.IntegerField(verbose_name=_("监控轮值规则 ID"), default=0) + db_type = models.CharField(_("数据库类型"), choices=DBType.get_choices(), max_length=LEN_SHORT, default="") receivers = models.JSONField(_("告警接收人员/组列表"), default=dict) details = models.JSONField(verbose_name=_("通知方式详情"), default=dict) - - is_synced = models.BooleanField(verbose_name=_("是否已同步到监控"), default=False) + # is_synced = models.BooleanField(verbose_name=_("是否已同步到监控"), default=False) + is_built_in = models.BooleanField(verbose_name=_("是否内置"), default=False) sync_at = models.DateTimeField(_("最近一次的同步时间"), null=True) dba_sync = models.BooleanField(help_text=_("自动同步DBA人员配置"), default=True) class Meta: verbose_name = _("告警通知组") + verbose_name_plural = verbose_name @classmethod - def get_monitor_groups(cls, db_type, group_type=GroupType.PLATFORM): - return list( - cls.objects.filter(group_type=group_type, db_type=db_type).values_list("monitor_group_id", flat=True) + def get_monitor_groups(cls, db_type=None, group_ids=None, **kwargs): + """查询监控告警组id""" + + qs = cls.objects.all() + + if db_type: + qs = qs.filter(db_type=db_type) + + if group_ids is not None: + qs = qs.filter(id__in=group_ids) + + # is_built_in/bk_biz_id等 + if kwargs: + qs = qs.filter(**kwargs) + + return list(qs.values_list("monitor_group_id", flat=True)) + + @classmethod + def get_notify_groups(cls, group_ids, **kwargs): + """查询告警组id""" + + qs = cls.objects.filter(monitor_group_id__in=group_ids) + + # is_built_in/bk_biz_id等 + if kwargs: + qs = qs.filter(**kwargs) + + return list(qs.values_list("id", flat=True)) + + @classmethod + def get_groups(cls, bk_biz_id, id_name="monitor_group_id") -> dict: + """业务内置""" + return dict(cls.objects.filter(bk_biz_id=bk_biz_id, is_built_in=True).values_list("db_type", id_name)) + + def save(self, *args, **kwargs): + """ + 保存告警组 + """ + # 深拷贝保存用户组的模板 + save_monitor_group_params = copy.deepcopy(BK_MONITOR_SAVE_USER_GROUP_TEMPLATE) + # 更新差异字段 + save_monitor_group_params.update( + { + "name": f"{self.name}_{self.bk_biz_id}", + "alert_notice": self.details.get("alert_notice") or DEFAULT_ALERT_NOTICE, + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, + } ) + if self.is_built_in: + # 内置告警组 + # 创建/更新一条轮值规则 + save_duty_rule_params = { + "name": f"{self.name}_{self.bk_biz_id}", + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, + "effective_time": datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + "end_time": "", + "labels": [self.db_type], + "enabled": True, + "category": DutyRuleCategory.REGULAR.value, + "duty_arranges": [ + { + "duty_time": [{"work_type": "daily", "work_time": ["00:00--23:59"]}], + "duty_users": [self.receivers], + } + ], + } + if self.monitor_duty_rule_id: + save_duty_rule_params["id"] = self.monitor_duty_rule_id + try: + resp = BKMonitorV3Api.save_duty_rule(save_duty_rule_params) + self.monitor_duty_rule_id = resp["id"] + except ApiError as err: + logger.error(f"request monitor api error: {err}") + # 把相同 db_type 的轮值应用到此告警组中 + monitor_duty_rule_ids = ( + DutyRule.objects.filter(db_type=self.db_type) + .exclude(monitor_duty_rule_id=0) + .order_by("-priority") + .values_list("monitor_duty_rule_id", flat=True) + ) + save_monitor_group_params["need_duty"] = True + save_monitor_group_params["duty_rules"] = list(monitor_duty_rule_ids) + else: + save_monitor_group_params["duty_arranges"][0]["users"] = self.receivers + + if self.monitor_group_id: + save_monitor_group_params["id"] = self.monitor_group_id + # 调用监控接口写入 + resp = BKMonitorV3Api.save_user_group(save_monitor_group_params) + self.monitor_group_id = resp["id"] + + if self.is_built_in: + # 更新业务策略绑定的告警组 + update_app_policy.delay(self.bk_biz_id, self.id, self.db_type) + super().save(*args, **kwargs) + + def delete(self, using=None, keep_parents=False): + if self.is_built_in: + raise BuiltInNotAllowDeleteException + BKMonitorV3Api.delete_user_groups({"ids": [self.monitor_group_id], "bk_biz_ids": [env.DBA_APP_BK_BIZ_ID]}) + super().delete() + + +class DutyRule(AuditedModel): + """ + 轮值规则,仅为平台设置,启用后默认应用到所有内置告警组 + duty_arranges: + 交替轮值(category=handoff) + [ + { + "duty_number": 2, + "duty_day": 1, + "members": ["admin"], + "work_type": "weekly", + "work_days": [6, 7], + "work_times": ["00:00--11:59", "12:00--23:59"] + } + ] + 常规轮值/自定义(category=regular) + [ + { + "date": "2023-10-01", + "work_times": ["00:00--11:59", "12:00--23:59"], + "members": ["admin"] + }, + { + "date": "2023-10-02", + "work_times": ["08:00--18:00"], + "members": ["admin"] + }, + { + "date": "2023-10-03", + "work_times": ["00:00--11:59", "12:00--23:59"], + "members": ["admin"] + } + ] + """ + + name = models.CharField(verbose_name=_("轮值规则名称"), max_length=LEN_LONG) + monitor_duty_rule_id = models.IntegerField(verbose_name=_("监控轮值规则 ID"), default=0) + priority = models.PositiveIntegerField(verbose_name=_("优先级")) + is_enabled = models.BooleanField(verbose_name=_("是否启用"), default=True) + effective_time = models.DateTimeField(verbose_name=_("生效时间")) + end_time = models.DateTimeField(verbose_name=_("截止时间"), blank=True, null=True) + category = models.CharField(verbose_name=_("轮值类型"), choices=DutyRuleCategory.get_choices(), max_length=LEN_SHORT) + db_type = models.CharField(_("数据库类型"), choices=DBType.get_choices(), max_length=LEN_SHORT) + duty_arranges = models.JSONField(_("轮值人员设置")) + + def save(self, *args, **kwargs): + """ + 保存轮值 + """ + # 1. 新建监控轮值 + params = { + "name": self.name, + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, + "effective_time": self.effective_time.strftime("%Y-%m-%d %H:%M:%S"), + "end_time": self.end_time.strftime("%Y-%m-%d %H:%M:%S") if self.end_time else "", + "labels": [self.db_type], + "enabled": self.is_enabled, + "category": self.category, + } + if self.category == DutyRuleCategory.REGULAR.value: + params["duty_arranges"] = [ + { + "duty_time": [ + { + "work_type": "monthly", + "work_days": [int(arrange["date"].split("-")[-1])], + "work_time": arrange["work_times"], + } + ], + "duty_users": [[{"id": member, "type": "user"} for member in arrange["members"]]], + } + for arrange in self.duty_arranges + ] + else: + params.update( + **{ + "duty_arranges": [ + { + "duty_time": [ + { + "work_type": arrange["work_type"], + "work_days": arrange["work_days"], + "work_time": arrange["work_times"], + "period_settings": { + "window_unit": "day", + "duration": self.duty_arranges[0]["duty_day"], + }, + } + ], + "duty_users": [[{"id": member, "type": "user"} for member in arrange["members"]]], + } + for arrange in self.duty_arranges + ], + "group_type": "auto", + "group_number": self.duty_arranges[0]["duty_number"], + } + ) + # 判断是否存量的轮值规则 + is_old_rule = bool(self.monitor_duty_rule_id) + if is_old_rule: + params["id"] = self.monitor_duty_rule_id + resp = BKMonitorV3Api.save_duty_rule(params) + self.monitor_duty_rule_id = resp["id"] + # 2. 保存本地轮值规则 + super().save(*args, **kwargs) + # 3. 如果是新增的轮值,则还需要把新的轮值规则绑定到内置告警组中 + if not is_old_rule: + for notice_group in NoticeGroup.objects.filter(is_built_in=True, db_type=self.db_type): + notice_group.save() + + def delete(self, using=None, keep_parents=False): + BKMonitorV3Api.delete_duty_rules({"ids": [self.monitor_duty_rule_id], "bk_biz_ids": [env.DBA_APP_BK_BIZ_ID]}) + super().delete() + + class Meta: + verbose_name = _("轮值规则") + verbose_name_plural = verbose_name class RuleTemplate(AuditedModel): - """TODO: 告警策略模板:deprecated""" + """告警策略模板:just for export""" bk_biz_id = models.IntegerField(help_text=_("业务ID, 0代表全业务"), default=PLAT_BIZ_ID) monitor_strategy_id = models.IntegerField(help_text=_("监控策略ID"), default=0) @@ -81,6 +325,19 @@ class AlertRule(AuditedModel): details = models.JSONField(verbose_name=_("实例详情"), default=dict) is_enabled = models.BooleanField(_("是否启用"), default=True) + @classmethod + def clear(cls, ids=None): + """清理所有平台告警策略""" + + ids = list(cls.objects.all().values_list("monitor_policy_id", flat=True)) if not ids else ids.split(",") + params = {"bk_biz_id": env.DBA_APP_BK_BIZ_ID, "ids": ids} + response = BKMonitorV3Api.delete_alarm_strategy_v3(params, use_admin=True, raw=True) + if not response.get("result"): + logger.error("bkm_delete_alarm_strategy failed: params: %s\n response: %s", params, response) + raise BkMonitorDeleteAlarmException(message=response.get("message")) + + cls.objects.all().delete() + class Meta: verbose_name = _("告警策略实例") @@ -88,21 +345,117 @@ class Meta: class DispatchGroup(AuditedModel): """分派策略组""" + bk_biz_id = models.IntegerField(verbose_name=_("业务ID, 0代表全业务"), default=PLAT_BIZ_ID, unique=True) monitor_dispatch_id = models.IntegerField(verbose_name=_("蓝鲸监控分派策略组ID"), default=0) - name = models.CharField(verbose_name=_("策略名称,全局唯一"), max_length=LEN_MIDDLE) - priority = models.PositiveIntegerField(verbose_name=_("监控策略优先级,跟随targets调整")) - details = models.JSONField(verbose_name=_("策略模板详情,可用于还原"), default=dict) - is_synced = models.BooleanField(verbose_name=_("是否已同步到监控"), default=False) + # name = models.CharField(verbose_name=_("策略名称,全局唯一"), max_length=LEN_MIDDLE) + # priority = models.PositiveIntegerField(verbose_name=_("监控策略优先级,跟随targets调整")) + details = models.JSONField(verbose_name=_("策略模板详情"), default=dict) + rules = models.JSONField(verbose_name=_("规则列表"), default=list) + # is_synced = models.BooleanField(verbose_name=_("是否已同步到监控"), default=False) sync_at = models.DateTimeField(_("最近一次的同步时间"), null=True) class Meta: verbose_name = _("分派策略组") + @classmethod + def save_dispatch_group(cls, params): + return BKMonitorV3Api.save_rule_group(params) + + @classmethod + def get_rule_by_dbtype(cls, db_type, bk_biz_id): + """根据db类型生成规则""" + + rule_mixin = { + "actions": [ + { + "action_type": "notice", + "is_enabled": True, + "upgrade_config": {"is_enabled": False, "user_groups": [], "upgrade_interval": 0}, + } + ], + "alert_severity": 0, + "additional_tags": [], + "is_enabled": True, + } + + conditions = [] + # 仅分派平台策略 + policies = MonitorPolicy.get_policies(db_type) + + # 排除无效的db类型,比如cloud + if not policies: + return {} + + conditions.append({"field": "alert.strategy_id", "value": policies, "method": "eq", "condition": "and"}) + user_groups = NoticeGroup.get_groups(bk_biz_id) + + # 业务级分派策略 + if bk_biz_id != PLAT_BIZ_ID: + conditions.append({"field": "app_id", "value": [str(bk_biz_id)], "method": "eq", "condition": "and"}) + + return { + "user_groups": [user_groups.get(db_type)], + "conditions": conditions, + **rule_mixin, + } + + @classmethod + def get_rules(cls, bk_biz_id=PLAT_BIZ_ID): + rules = [] + + notify_groups = NoticeGroup.objects.filter(is_built_in=True, bk_biz_id=bk_biz_id) + for db_type in notify_groups.values_list("db_type", flat=True): + rule = cls.get_rule_by_dbtype(db_type, bk_biz_id) + + if not rule: + continue + + rules.append(rule) + return rules + + def save(self, *args, **kwargs): + """ + 保存分派规则组 + """ + + data = copy.deepcopy(BK_MONITOR_SAVE_DISPATCH_GROUP_TEMPLATE) + data.update( + { + "name": _("DBM平台规则_勿动_{}").format(self.bk_biz_id), + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, + # 请求参数格式错误:(priority) 当前业务下已经存在优先级别为(100)的分派规则组 + # 优先级必能重复,故叠加业务id作为优先级调整 + "priority": PLAT_PRIORITY if self.bk_biz_id == PLAT_BIZ_ID else APP_PRIORITY + self.bk_biz_id, + "rules": self.rules, + } + ) + + if self.monitor_dispatch_id: + # data["id"] = self.monitor_dispatch_id + data["assign_group_id"] = self.monitor_dispatch_id + + # 复用旧的rule_id + for index, rule_id in enumerate(self.details.get("rules", [])[: len(self.rules)]): + data["rules"][index]["id"] = rule_id + + # 调用监控接口写入 + resp = self.save_dispatch_group(data) + self.monitor_dispatch_id = resp.get("assign_group_id", 0) + + self.details = resp + self.sync_at = datetime.datetime.now() + + super().save(*args, **kwargs) + class MonitorPolicy(AuditedModel): """监控策略""" + KEEPED_FIELDS = [*AuditedModel.AUDITED_FIELDS, "id", "is_enabled", "monitor_policy_id", "policy_status"] + parent_id = models.IntegerField(verbose_name=_("父级策略ID,0代表父级"), default=0) + parent_details = models.JSONField(verbose_name=_("父级策略模板详情,可用于还原"), default=dict) + name = models.CharField(verbose_name=_("策略名称,全局唯一"), max_length=LEN_MIDDLE, unique=True) bk_biz_id = models.IntegerField(verbose_name=_("业务ID, 0代表全业务"), default=PLAT_BIZ_ID) @@ -110,10 +463,45 @@ class MonitorPolicy(AuditedModel): _("DB类型"), choices=DBType.get_choices(), max_length=LEN_NORMAL, default=DBType.MySQL.value ) - details = models.JSONField(verbose_name=_("策略模板详情,可用于还原"), default=dict) + details = models.JSONField(verbose_name=_("当前策略详情,可用于patch"), default=dict) + monitor_indicator = models.CharField(verbose_name=_("监控指标名"), max_length=LEN_MIDDLE, default="") # 拆解部分details中的字段到外层 - targets = models.JSONField(verbose_name=_("监控目标"), default=dict) + # TODO: MethodEnum: eq|neq|include|exclude|regex|nregex + # item[*].query_configs[*].agg_condition[*] + # { + # "agg_condition": [ + # { + # "key": "app_id", + # "dimension_name": "dbm_meta app id", + # "value": [ + # "2" + # ], + # "method": "eq", + # "condition": "and" + # }, + # { + # "key": "db_module", + # "dimension_name": "dbm_meta db module", + # "value": [ + # "zookeeper" + # ], + # "method": "eq", + # "condition": "and" + # } + # { + # "key": "cluster_domain", + # "dimension_name": "dbm_meta cluster domain", + # "value": [ + # "spider.spidertest.db" + # ], + # "method": "eq", + # "condition": "and" + # }, + # ] + # } + # [{"level": platform, "rule":{"key": "app_id/db_module/cluster_domain", "value": ["aa", "bb"]}}] + targets = models.JSONField(verbose_name=_("监控目标"), default=list) target_level = models.CharField( verbose_name=_("监控目标级别,跟随targets调整"), choices=TargetLevel.get_choices(), @@ -121,16 +509,36 @@ class MonitorPolicy(AuditedModel): default=TargetLevel.APP.value, ) target_priority = models.PositiveIntegerField(verbose_name=_("监控策略优先级,跟随targets调整")) + target_keyword = models.TextField(verbose_name=_("监控目标检索冗余字段"), default="") - # [{}, {}] - test_rules = models.JSONField(verbose_name=_("检测规则"), default=dict) - # [1,2,3] - notify_rules = models.JSONField(verbose_name=_("通知规则"), default=dict) + # Type 目前仅支持 Threshold + # level: 1(致命)、2(预警)、3(提醒) + # item[*].algorithms[*]: + # { + # "id": 6212, + # "type": "Threshold", + # "level": 1, + # "config": [ + # [ + # { + # "method": "gte", + # "threshold": 90 + # } + # ] + # ], + # "unit_prefix": "%" + # } + # [{"level": 1, "config": [[{"method": "gte", "threshold": 90}]], "unit_prefix": "%"}] + test_rules = models.JSONField(verbose_name=_("检测规则"), default=list) + # NoticeSignalEnum: notice.signal -> ["recovered", "abnormal", "closed", "ack", "no_data"] + # item[*].no_data_config.is_enabled + notify_rules = models.JSONField(verbose_name=_("通知规则"), default=list) # [1,2,3] - notify_groups = models.JSONField(verbose_name=_("通知组"), default=dict) + notify_groups = models.JSONField(verbose_name=_("通知组"), default=list) + # .notice.options.assign_mode = ["by_rule", "only_notice"] + # assign_mode = models.JSONField(verbose_name=_("通知模式-分派|直接通知"), default=list) is_enabled = models.BooleanField(verbose_name=_("是否已启用"), default=True) - is_synced = models.BooleanField(verbose_name=_("是否已同步到监控"), default=False) # 当 is_synced=True时,才有效 sync_at = models.DateTimeField(_("最近一次的同步时间"), null=True) @@ -144,15 +552,517 @@ class MonitorPolicy(AuditedModel): default=PolicyStatus.VALID.value, ) - # 分派策略组ID,目前专供内置策略 - dispatch_group_id = models.BigIntegerField(verbose_name=_("分派策略组ID,0代表没有对应的策略"), default=0) monitor_policy_id = models.BigIntegerField(verbose_name=_("蓝鲸监控策略ID"), default=0) - def calculate_targets(self): - """TODO: 根据目标计算优先级(样例)""" - self.target_level = TargetLevel.APP - self.target_priority = TargetPriority.APP - self.save() + # 支持版本管理 + version = models.IntegerField(verbose_name=_("版本"), default=0) + + alert_source = models.CharField( + verbose_name=_("告警数据来源"), + max_length=LEN_SHORT, + choices=AlertSourceEnum.get_choices(), + default=AlertSourceEnum.TIME_SERIES, + ) class Meta: verbose_name = _("告警策略") + + def calc_from_targets(self): + """根据目标计算优先级""" + + target_levels = list(map(lambda x: x["level"], self.targets)) + + if TargetLevel.CUSTOM.value in target_levels: + target_level = TargetLevel.CUSTOM.value + elif TargetLevel.CLUSTER.value in target_levels: + target_level = TargetLevel.CLUSTER.value + elif TargetLevel.MODULE.value in target_levels: + target_level = TargetLevel.MODULE.value + elif TargetLevel.APP.value in target_levels: + target_level = TargetLevel.APP.value + else: + target_level = TargetLevel.PLATFORM.value + + self.target_level = target_level + self.target_priority = TARGET_LEVEL_TO_PRIORITY.get(target_level).value + + self.target_keyword = ",".join( + [str(value) for target_level in self.targets for value in target_level["rule"]["value"]] + ) + + self.local_save() + + def patch_bk_biz_id(self, details, bk_biz_id=env.DBA_APP_BK_BIZ_ID): + """策略要跟随主机所属的cc业务,默认为dba业务""" + host_biz_id = SystemSettings.get_exact_hosting_biz(bk_biz_id) + details["bk_biz_id"] = host_biz_id + return details + + def patch_target_and_metric_id(self, details): + """监控目标/自定义事件和指标需要渲染 + metric_id: {bk_biz_id}_bkmoinitor_event_{event_data_id} + """ + + bkm_dbm_report = SystemSettings.get_setting_value(key=SystemSettingsEnum.BKM_DBM_REPORT.value) + + items = details["items"] + for item in items: + # 更新监控目标为db_type对应的cmdb拓扑 + item["target"] = [ + [ + { + "field": "host_topo_node", + "method": "eq", + "value": [ + {"bk_inst_id": obj["bk_set_id"], "bk_obj_id": "set"} + for obj in AppMonitorTopo.get_set_by_dbtype(db_type=self.db_type) + ], + } + ] + ] + + for query_config in item["query_configs"]: + # data_type_label: time_series | event(自定义上报,需要填充data_id) + if query_config["data_type_label"] != "event": + continue + + # TODO: 自定义上报类告警策略如何支持非纳管业务? + bkm_dbm_report_event = bkm_dbm_report["event"] + query_config["metric_id"] = query_config["metric_id"].format( + bk_biz_id=env.DBA_APP_BK_BIZ_ID, event_data_id=bkm_dbm_report_event["data_id"] + ) + query_config["result_table_id"] = query_config["result_table_id"].format( + bk_biz_id=env.DBA_APP_BK_BIZ_ID, event_data_id=bkm_dbm_report_event["data_id"] + ) + + return details + + def render_promql_tpl(self, promql): + """渲染promql中的过滤表达式 + TODO: 从实例克隆时,这里的渲染将会失效 + """ + + filter_expr = "" + for target in self.targets: + if target["level"] == TargetLevel.PLATFORM.value: + continue + + target_rule = target["rule"] + key, values = target_rule["key"], target_rule["value"] + + if len(values) == 1: + filter_expr += f'{key}="{values}[0]"' + filter_expr += "," + + # 多个值:a~="(1|2|3)" + join_values = "|".join(map(lambda x: str(x), values)) + filter_expr += f'{key}~="({join_values})"' + filter_expr += "," + + return promql.replace(PROMQL_FILTER_TPL, filter_expr) + + def patch_priority_and_agg_conditions(self, details): + """将监控目标映射为所有查询的where条件""" + + self.calc_from_targets() + + # patch priority + details["priority"] = self.target_priority + + # patch agg conditions + agg_conditions = [] + for target in self.targets: + if target["level"] == TargetLevel.PLATFORM.value: + continue + + target_rule = target["rule"] + agg_conditions.append( + { + "key": target_rule["key"], + "dimension_name": TargetLevel.get_choice_label(target_rule["key"]), + "value": target_rule["value"], + "method": "eq", + "condition": "and", + } + ) + + for item in details["items"]: + for query_config in item["query_configs"]: + if "agg_condition" in query_config: + # remove same type conditions + query_config_agg_condition = list( + filter(lambda cond: cond["key"] not in TargetLevel.get_values(), query_config["agg_condition"]) + ) + query_config_agg_condition.extend(agg_conditions) + # overwrite agg_condition + query_config["agg_condition"] = query_config_agg_condition + else: + query_config["promql"] = self.render_promql_tpl(query_config["promql"]) + logger.info("query_config.promql: %s", query_config["promql"]) + # logger.error(_("{name}: 无法配置目标,暂不支持promql策略填充目标").format(**details)) + + return details + + def patch_algorithms(self, details): + """检测条件""" + + for rule in self.test_rules: + rule["type"] = "Threshold" + rule.pop("id", None) + + for item in details["items"]: + item["algorithms"] = self.test_rules + + return details + + def patch_notice(self, details): + """通知规则和通知对象""" + # notify_rules -> notice.signal + details["notice"]["signal"] = self.notify_rules + + # 克隆出来的策略,固定通知模式为:直接通知 + if self.parent_id: + details["notice"]["options"]["assign_mode"] = ["only_notice"] + + # notice_groups -> notice.user_groups + details["notice"]["user_groups"] = NoticeGroup.get_monitor_groups(group_ids=self.notify_groups) + + return details + + @classmethod + def bkm_save_alarm_strategy(cls, params): + response = BKMonitorV3Api.save_alarm_strategy_v3(params, use_admin=True, raw=True) + if not response.get("result"): + logger.error("bkm_save_alarm_strategy failed: params: %s\n response: %s", params, response) + raise BkMonitorSaveAlarmException(message=response.get("message")) + # logger.info("bkm_save_alarm_strategy success: %s", params["name"]) + return response["data"] + + def bkm_delete_alarm_strategy(self): + params = {"bk_biz_id": self.bk_biz_id or env.DBA_APP_BK_BIZ_ID, "ids": [self.monitor_policy_id]} + response = BKMonitorV3Api.delete_alarm_strategy_v3(params, use_admin=True, raw=True) + if not response.get("result"): + logger.error("bkm_delete_alarm_strategy failed: params: %s\n response: %s", params, response) + raise BkMonitorDeleteAlarmException(message=response.get("message")) + logger.info("bkm_delete_alarm_strategy success: %s", self.name) + return response["data"] + + def local_save(self, *args, **kwargs): + """仅保存到本地,不同步到监控""" + super().save(*args, **kwargs) + + def patch_all(self): + # model.targets -> agg_condition + details = self.patch_priority_and_agg_conditions(self.details) + + # model.test_rules -> algorithms + details = self.patch_algorithms(details) + + # model.notify_xxx -> notice + details = self.patch_notice(details) + + # other + details = self.patch_bk_biz_id(details) + details = self.patch_target_and_metric_id(details) + + return details + + def save(self, force_insert=False, force_update=False, using=None, update_fields=None): + """保存策略对象的同时,同步记录到监控""" + + # step1. sync to model + # 启停操作(["is_enabled"]) -> 跳过重复的patch + details = self.details if update_fields == ["is_enabled"] else self.patch_all() + + # step2. sync to bkm + res = self.bkm_save_alarm_strategy(details) + + # overwrite by bkm strategy details + self.details = res + self.monitor_policy_id = self.details["id"] + self.sync_at = datetime.datetime.now() + + # 平台内置策略支持保存初始版本,用于恢复默认设置 + if self.pk is None and self.bk_biz_id == env.DBA_APP_BK_BIZ_ID: + self.parent_details = self.details + + # step3. save to db + super().save(force_insert, force_update, using, update_fields) + + def delete(self, using=None, keep_parents=False): + if self.bk_biz_id == PLAT_BIZ_ID: + raise BuiltInNotAllowDeleteException + + if self.monitor_policy_id: + self.bkm_delete_alarm_strategy() + + super().delete(using, keep_parents) + + def enable(self) -> bool: + """启用: + is_enabled:true -> save + 监控提供了批量启停的接口,若我们需要批量操作,这里可以切换接口为: + 推荐:update_partial_strategy_v3({ + "bk_biz_id":1, + "ids":[23121], + "edit_data":{ + "is_enabled":true, + "notice_group_list":[4644] + } + }) + switch_alarm_strategy({"ids": [1], "is_enalbed": true/false}) + """ + self.is_enabled = True + self.details.update(is_enabled=self.is_enabled) + self.save(update_fields=["is_enabled"]) + + return self.is_enabled + + def disable(self) -> bool: + """禁用:is_enabled:false -> save""" + self.is_enabled = False + self.details.update(is_enabled=self.is_enabled) + self.save(update_fields=["is_enabled"]) + + return self.is_enabled + + @classmethod + def clone(cls, params, username="system") -> dict: + """克隆:patch -> create""" + + # params -> model + policy = cls(**params) + + # transfer details from parent to self + parent = cls.objects.get(id=policy.parent_id) + + policy.parent_details = copy.deepcopy(parent.details) + policy.db_type = parent.db_type + policy.monitor_indicator = parent.monitor_indicator + + policy.details = copy.deepcopy(parent.details) + policy.details.pop("id", None) + policy.details.update(name=policy.name) + + policy.creator = policy.updater = username + policy.id = None + + policy.save() + + # 重新获取policy + policy.refresh_from_db() + + return {"local_id": policy.id, "bkm_id": policy.monitor_policy_id} + + def update(self, params, username="system") -> dict: + """更新:patch -> update""" + + update_fields = ["targets", "test_rules", "notify_rules", "notify_groups"] + + # param -> model + for key in update_fields: + setattr(self, key, params[key]) + + # update -> overwrite details + self.creator = self.updater = username + self.save() + + return {"local_id": self.id, "bkm_id": self.monitor_policy_id} + + def parse_details(self, details=None): + """从模板反向提取部分参数""" + + details = details or self.details + result = defaultdict(list) + + result["test_rules"] = [ + { + "level": alg["level"], + "config": alg["config"], + "unit_prefix": alg["unit_prefix"], + } + # 这里假设item长度恒为1 + for alg in details["items"][0]["algorithms"] + ] + + first_query_config = details["items"][0]["query_configs"][0] + target_conditions = ( + list(filter(lambda cond: cond["key"] in TargetLevel.get_values(), first_query_config["agg_condition"])) + if "agg_condition" in first_query_config + else [] + ) + + result["targets"] = [ + {"level": condition["key"], "rule": {"key": condition["key"], "value": condition["value"]}} + for condition in target_conditions + ] + + # 默认填充平台级目标 + if not result["targets"]: + result["targets"].append( + {"level": TargetLevel.PLATFORM.value, "rule": {"key": TargetLevel.PLATFORM.value, "value": []}} + ) + + result["notify_rules"] = details["notice"]["signal"] + result["notify_groups"] = list( + NoticeGroup.objects.filter(monitor_group_id__in=details["notice"]["user_groups"]) + .values_list("id", flat=True) + .distinct() + ) + + return result + + def reset(self) -> dict: + """恢复默认:parent_details -> save""" + + # patch by parent details + self.details = self.parent_details + self.details["id"] = self.monitor_policy_id + self.details["name"] = self.name + + # fetch targets/test_rules/notify_rules/notify_groups from parent details + for attr, value in self.parse_details().items(): + setattr(self, attr, value) + + self.save() + + return {"local_id": self.id, "bkm_id": self.monitor_policy_id} + + @classmethod + def get_policies(cls, db_type, bk_biz_id=PLAT_BIZ_ID): + """获取监控策略id列表""" + return list( + cls.objects.filter(db_type=db_type, bk_biz_id=bk_biz_id).values_list("monitor_policy_id", flat=True) + ) + + @staticmethod + def bkm_search_event( + bk_biz_ids: list, + strategy_id: list, + event_status: list = None, + days=7, + level=None, + data_source=None, + time_range=None, + group_count=True, + ): + """事件搜索 + bk_biz_ids:[2] 必填 + + id: 事件ID + strategy_id: 事件关联的策略ID + days: 查询最近几天内的时间,这个参数存在,time_range则失效 + time_range:"2020-02-26 00:00:00 -- 2020-02-28 23:59:59" + conditions: + level - 告警级别 + 1 - 致命 + 2 - 预警 + 3 - 提醒 + event_status - 事件状态 + ABNORMAL - 未恢复 + CLOSED - 已关闭 + RECOVERED - 已恢复 + data_source: ["bk_monitor|time_series"] + 数据类型: + time_series - 时序数据 + event - 事件 + log - 日志关键字 + 返回格式: + { + "status": "ABNORMAL", + "bk_biz_id": 2, + "is_ack": false, + "level": 1, + "origin_alarm": { + "data": { + "record_id": "d751713988987e9331980363e24189ce.1574439900", + "values": { + "count": 10, + "dtEventTimeStamp": 1574439900 + }, + "dimensions": {}, + "value": 10, + "time": 1574439900 + }, + "trigger": { + "level": "1", + "anomaly_ids": [ + "d751713988987e9331980363e24189ce.15744396", + ] + }, + "anomaly": { + "1": { + "anomaly_message": "count >= 1.0, 当前值10.0", + "anomaly_time": "2019-11-22 16:31:06", + "anomaly_id": "d751713988987e9331980363e24189ce.1574439" + } + }, + "dimension_translation": {}, + "strategy_snapshot_key": "bk_bkmonitor.ee.cache.strategy.snapshot.88." + }, + "target_key": "", + "strategy_id": 88, + "id": 1364253, + "is_shielded": false, + "event_id": "d751713988987e9331980363e24189ce.15744396", + "create_time": "2019-11-22 16:31:07", + "end_time": null, + "begin_time": "2019-11-22 16:25:00", + "origin_config": {}, + "p_event_id": "" + } + ] + """ + + # 默认搜索未恢复 + event_status = event_status or ["ABNORMAL"] + condition_kwargs = { + "strategy_id": strategy_id, + "event_status": event_status, + "level": level, + "data_source": data_source, + } + + # TODO: 单次查询上限5000条,若需要突破上限,需要循环查询 + params = { + "bk_biz_ids": bk_biz_ids, + "conditions": [ + {"key": cond_key, "value": cond_value} + for cond_key, cond_value in condition_kwargs.items() + if cond_value + ], + "days": days, + "page": 1, + "page_size": 5000, + } + + # 精确范围查找 + if time_range: + params["time_range"] = time_range + params.pop("days") + + events = BKMonitorV3Api.search_event(params) + + # 需要根据app_id来拆分全局内置策略的告警数量 + if group_count: + tmp = defaultdict(int) + for event in events: + # 监控对外返回json中会将app_id映射为bk_app_code: tapd:1010104091006892981 + bk_app_code = event["origin_alarm"]["data"]["dimensions"].get("bk_app_code") + app_id = event["origin_alarm"]["data"]["dimensions"].get("app_id") or bk_app_code + + # 缺少业app_id维度的策略 + if not app_id: + app_id = 0 + logger.error("find bad bkmonitor event: %s", event) + # continue + + tmp[(event["strategy_id"], app_id)] += 1 + + event_counts = defaultdict(dict) + for (strategy_id, app_id), event_count in tmp.items(): + event_counts[strategy_id][app_id] = event_count + # return dict(Counter(event["strategy_id"] for event in events)) + return event_counts + + return events diff --git a/dbm-ui/backend/db_monitor/models/collect.py b/dbm-ui/backend/db_monitor/models/collect.py index c866701776..56b75aefb6 100644 --- a/dbm-ui/backend/db_monitor/models/collect.py +++ b/dbm-ui/backend/db_monitor/models/collect.py @@ -8,12 +8,20 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import copy +import datetime +import glob +import json +import logging +import os from django.db import models from django.utils.translation import gettext_lazy as _ +from backend import env from backend.bk_web.constants import LEN_LONG, LEN_MIDDLE, LEN_NORMAL, LEN_SHORT from backend.bk_web.models import AuditedModel +from backend.components import BKMonitorV3Api from backend.configuration.constants import PLAT_BIZ_ID, DBType __all__ = [ @@ -21,17 +29,30 @@ "CollectInstance", ] +from backend.db_meta.enums import MachineType +from backend.db_meta.models import AppMonitorTopo +from backend.db_monitor.constants import TPLS_COLLECT_DIR +from backend.dbm_init.services import EXCLUDE_DB_TYPES + +logger = logging.getLogger("root") + class CollectTemplateBase(AuditedModel): """采集策略模板""" bk_biz_id = models.IntegerField(help_text=_("业务ID, 0代表全业务"), default=PLAT_BIZ_ID) - plugin_id = models.CharField(verbose_name=_("插件ID"), max_length=LEN_MIDDLE, unique=True) + plugin_id = models.CharField(verbose_name=_("插件ID"), max_length=LEN_MIDDLE) + name = models.CharField(verbose_name=_("策略名称,全局唯一"), max_length=LEN_MIDDLE, default="") db_type = models.CharField( _("DB类型"), choices=DBType.get_choices(), max_length=LEN_NORMAL, default=DBType.MySQL.value ) + # 与INSTANCE_MONITOR_PLUGINS的name对应 + short_name = models.CharField(max_length=LEN_MIDDLE, default="") details = models.JSONField(verbose_name=_("详情"), default=dict) + # 支持版本管理 + version = models.IntegerField(verbose_name=_("版本"), default=0) + class Meta: abstract = True verbose_name = _("采集策略模板") @@ -48,5 +69,105 @@ class CollectInstance(CollectTemplateBase): template_id = models.IntegerField(help_text=_("监控插件模板ID"), default=0) collect_id = models.IntegerField(help_text=_("监控采集策略ID")) + sync_at = models.DateTimeField(_("最近一次的同步时间"), null=True) + + def save(self, force_insert=False, force_update=False, using=None, update_fields=None): + + # collect_params = copy.deepcopy(self.details) + # + # res = BKMonitorV3Api.save_collect_config(collect_params, use_admin=True) + # + # self.details = res + # self.collect_id = self.details["id"] + # self.sync_at = datetime.datetime.now() + + super().save(force_insert, force_update, using) + + @staticmethod + def init_collect_strategy(bk_biz_id=env.DBA_APP_BK_BIZ_ID): + """初始化监控采集项 + TODO: 新增一个周期任务来做周期刷新,处理非DBM业务中的采集项 + """ + now = datetime.datetime.now() + updated_collectors = 0 + + logger.warning("[init_collect_strategy] start sync bkmonitor collector start: %s", now) + + # 未来考虑将模板放到db管理 + # templates = CollectTemplate.objects.filter(bk_biz_id=0) + # for template in templates: + + collect_tpls = os.path.join(TPLS_COLLECT_DIR, "*.json") + for collect_tpl in glob.glob(collect_tpls): + with open(collect_tpl, "r") as f: + template_dict = json.loads(f.read()) + template = CollectTemplate(**template_dict) + + collect_params = template.details + + # 支持跳过部分db类型的初始化 + if template.db_type in EXCLUDE_DB_TYPES: + continue + + try: + try: + collect_instance = CollectInstance.objects.get( + bk_biz_id=template.bk_biz_id, + db_type=template.db_type, + plugin_id=template.plugin_id, + name=template.name, + short_name=template.short_name, + ) + collect_params["id"] = collect_instance.collect_id + logger.warning("[init_collect_strategy] update bkmonitor collector: %s " % template.name) + except CollectInstance.DoesNotExist: + # 为了能够重复执行,这里考虑下CollectInstance被清空的情况 + res = BKMonitorV3Api.query_collect_config( + {"bk_biz_id": env.DBA_APP_BK_BIZ_ID, "search": {"fuzzy": collect_params["name"]}}, + use_admin=True, + ) + + # 业务下存在该策略 + collect_config_list = res["config_list"] + if res["total"] == 1: + collect_config = collect_config_list[0] + collect_params["id"] = collect_config["id"] + logger.warning("[init_collect_strategy] sync bkmonitor collector: %s " % template.db_type) + else: + logger.warning("[init_collect_strategy] create bkmonitor collector: %s " % template.db_type) + logger.warning("[init_collect_strategy] create bkmonitor collector: %s " % template.db_type) + + # TODO: 非DBA业务支持待验证 + collect_params.update( + bk_biz_id=bk_biz_id, + plugin_id=template.plugin_id, + target_nodes=[ + {"bk_inst_id": bk_set_id, "bk_obj_id": "set", "bk_biz_id": bk_biz_id} + for bk_set_id, bk_biz_id in AppMonitorTopo.get_set_by_plugin_id(plugin_id=template.plugin_id) + ], + ) + + res = BKMonitorV3Api.save_collect_config(collect_params, use_admin=True) + + # 实例化Rule + obj, _ = CollectInstance.objects.update_or_create( + defaults={"details": collect_params, "collect_id": res["id"]}, + bk_biz_id=template.bk_biz_id, + db_type=template.db_type, + plugin_id=template.plugin_id, + name=template.name, + short_name=template.short_name, + ) + + updated_collectors += 1 + except Exception as e: # pylint: disable=wildcard-import + logger.error("[init_collect_strategy] sync bkmonitor collector: %s (%s)", template.db_type, e) + + logger.warning( + "[init_collect_strategy] finish sync bkmonitor collector end: %s, update_cnt: %s", + datetime.datetime.now() - now, + updated_collectors, + ) + class Meta: verbose_name = _("采集策略实例") diff --git a/dbm-ui/backend/db_monitor/readme.md b/dbm-ui/backend/db_monitor/readme.md index e4424ccbdc..27d8bf4e8c 100644 --- a/dbm-ui/backend/db_monitor/readme.md +++ b/dbm-ui/backend/db_monitor/readme.md @@ -14,13 +14,20 @@ 采集模板数据表:db_monitor_collecttemplate -python manage.py extract_collect mysql 111 114 -python manage.py extract_collect redis 115 116 117 -python manage.py extract_collect es 113 -python manage.py extract_collect kafka 122 123 -python manage.py extract_collect pulsar 177 178 180 -python manage.py extract_collect hdfs 190 -python manage.py extract_collect influxdb 228 +python manage.py extract_collect mysql proxy 7 +python manage.py extract_collect mysql mysql 2 +python manage.py extract_collect mysql spider 14 +python manage.py extract_collect redis predixy 10 +python manage.py extract_collect redis twemproxy 5 +python manage.py extract_collect redis redis 9 +python manage.py extract_collect es es 1 +python manage.py extract_collect kafka zookeeper 8 +python manage.py extract_collect kafka kafka 3 +python manage.py extract_collect pulsar bookkeeper 12 +python manage.py extract_collect pulsar zookeeper 13 +python manage.py extract_collect pulsar broker 4 +python manage.py extract_collect hdfs hdfs 11 +python manage.py extract_collect influxdb influxdb 6 # 提取告警策略模板 @@ -38,7 +45,8 @@ python manage.py extract_alarm kafka 5676 5677 5678 5679 5685 python manage.py extract_alarm pulsar 5683 5682 5681 5680 python manage.py extract_alarm hdfs 5891 5894 5895 5898 5899 python manage.py extract_alarm influxdb 5946 5947 5948 5949 5950 5951 5952 - +python manage.py extract_alarm riak 39876 39877 39878 39879 39882 39881 39882 + - 事件 python manage.py extract_alarm mysql 73474 73473 73472 73471 73418 73456 73370 73382 73381 73379 73380 73378 73377 73363 73376 73670 73669 python manage.py extract_alarm redis 73762 73761 73760 73759 73757 73756 73742 73741 @@ -48,6 +56,8 @@ python manage.py extract_alarm redis 73762 73761 73760 73759 73757 73756 73742 7 # 导出模板到文件 > python manage.py export_template -t all +> python manage.py export_template -t collect -d mysql +> python manage.py export_template -t alarm -d hdfs # 导入到生产环境 diff --git a/dbm-ui/backend/db_monitor/serializers.py b/dbm-ui/backend/db_monitor/serializers.py index a5e03b5ca8..d79d706ab7 100644 --- a/dbm-ui/backend/db_monitor/serializers.py +++ b/dbm-ui/backend/db_monitor/serializers.py @@ -8,13 +8,27 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import urllib.parse from django.utils.translation import gettext_lazy as _ from rest_framework import serializers +from backend import env from backend.bk_web.serializers import AuditedSerializer +from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType -from backend.db_monitor.models import CollectTemplate, RuleTemplate +from backend.db_monitor import mock_data +from backend.db_monitor.constants import ( + MONITOR_EVENTS_PREFIX, + AlertLevelEnum, + DetectAlgEnum, + OperatorEnum, + TargetLevel, +) +from backend.db_monitor.models import CollectTemplate, MonitorPolicy, NoticeGroup, RuleTemplate +from backend.db_monitor.models.alarm import DutyRule +from backend.db_periodic_task.constants import NoticeSignalEnum +from backend.utils.redis import RedisConn class GetDashboardSerializer(serializers.Serializer): @@ -28,6 +42,51 @@ class DashboardUrlSerializer(serializers.Serializer): url = serializers.URLField(help_text=_("监控仪表盘地址")) +class NoticeGroupSerializer(AuditedSerializer, serializers.ModelSerializer): + used_count = serializers.SerializerMethodField() + + def get_used_count(self, obj): + return self.context["group_used"].get(obj.id, 0) + + class Meta: + model = NoticeGroup + fields = "__all__" + + +class NoticeGroupCreateSerializer(NoticeGroupSerializer): + class Meta: + model = NoticeGroup + fields = ["name", "bk_biz_id", "receivers", "details"] + swagger_schema_fields = {"example": mock_data.CREATE_NOTICE_GROUP} + + +class NoticeGroupUpdateSerializer(NoticeGroupSerializer): + class Meta: + model = NoticeGroup + fields = ["name", "bk_biz_id", "receivers", "details"] + swagger_schema_fields = {"example": mock_data.UPDATE_NOTICE_GROUP} + + +class DutyRuleSerializer(AuditedSerializer, serializers.ModelSerializer): + class Meta: + model = DutyRule + fields = "__all__" + + +class DutyRuleCreateSerializer(DutyRuleSerializer): + class Meta: + model = NoticeGroup + fields = "__all__" + swagger_schema_fields = {"example": mock_data.CREATE_HANDOFF_DUTY_RULE} + + +class DutyRuleUpdateSerializer(DutyRuleSerializer): + class Meta: + model = NoticeGroup + fields = "__all__" + swagger_schema_fields = {"example": mock_data.CREATE_CUSTOM_DUTY_RULE} + + class CollectTemplateSerializer(AuditedSerializer, serializers.ModelSerializer): class Meta: model = CollectTemplate @@ -38,3 +97,112 @@ class RuleTemplateSerializer(AuditedSerializer, serializers.ModelSerializer): class Meta: model = RuleTemplate fields = "__all__" + + +class MonitorPolicySerializer(AuditedSerializer, serializers.ModelSerializer): + event_url = serializers.SerializerMethodField(method_name="get_event_url") + + def get_event_url(self, obj): + """监控事件跳转链接""" + + bk_biz_id = obj.bk_biz_id or env.DBA_APP_BK_BIZ_ID + query_string = urllib.parse.urlencode( + { + "queryString": _("策略ID : {} AND 状态 : {}").format(obj.monitor_policy_id, _("未恢复")), + "from": "now-30d", + "to": "now", + "bizIds": bk_biz_id, + } + ) + + return f"{env.BKMONITOR_URL}/?bizId={bk_biz_id}#/event-center?{query_string}" + + class Meta: + model = MonitorPolicy + fields = "__all__" + + +class MonitorPolicyListSerializer(MonitorPolicySerializer): + event_count = serializers.SerializerMethodField(method_name="get_event_count") + + def get_event_count(self, obj): + bk_biz_id = int(self.context["request"].query_params.get("bk_biz_id")) + events = RedisConn.hgetall(f"{MONITOR_EVENTS_PREFIX}|{obj.monitor_policy_id}") + if bk_biz_id > 0: + return int(events.get(str(bk_biz_id), 0)) + return sum(map(lambda x: int(x), events.values())) + + class Meta: + model = MonitorPolicy + exclude = ["details", "parent_details"] + + +class MonitorPolicyUpdateSerializer(AuditedSerializer, serializers.ModelSerializer): + class TargetSerializer(serializers.Serializer): + """告警目标""" + + class TargetRuleSerializer(serializers.Serializer): + key = serializers.ChoiceField(choices=TargetLevel.get_choices()) + value = serializers.ListSerializer(child=serializers.CharField(), allow_empty=True) + + level = serializers.ChoiceField(choices=TargetLevel.get_choices()) + rule = TargetRuleSerializer() + + class TestRuleSerializer(serializers.Serializer): + """检测规则""" + + class TestRuleConfigSerializer(serializers.Serializer): + method = serializers.ChoiceField(choices=OperatorEnum.get_choices()) + threshold = serializers.IntegerField() + + type = serializers.ChoiceField(choices=DetectAlgEnum.get_choices()) + level = serializers.ChoiceField(choices=AlertLevelEnum.get_choices()) + config = serializers.ListSerializer( + child=serializers.ListField(child=TestRuleConfigSerializer()), allow_empty=False + ) + unit_prefix = serializers.CharField(allow_blank=True) + + targets = serializers.ListField(child=TargetSerializer(), allow_empty=False) + test_rules = serializers.ListField(child=TestRuleSerializer(), allow_empty=False) + notify_rules = serializers.ListField( + child=serializers.ChoiceField(choices=NoticeSignalEnum.get_choices()), allow_empty=False + ) + notify_groups = serializers.ListField(child=serializers.IntegerField(), allow_empty=True) + + class Meta: + model = MonitorPolicy + fields = ["targets", "test_rules", "notify_rules", "notify_groups"] + + +class MonitorPolicyCloneSerializer(MonitorPolicyUpdateSerializer): + bk_biz_id = serializers.IntegerField(help_text=_("业务ID"), min_value=1) + + def validate(self, attrs): + """补充校验 + 1. 非平台级告警必须指定目标业务 + """ + bk_biz_id = str(attrs["bk_biz_id"]) + target_app = list( + filter(lambda x: x["level"] == TargetLevel.APP and x["rule"]["value"] == [bk_biz_id], attrs["targets"]) + ) + + if not target_app: + raise serializers.ValidationError(_("请确认告警目标包含当前业务")) + + return attrs + + class Meta: + model = MonitorPolicy + fields = ["name", "bk_biz_id", "parent_id", "targets", "test_rules", "notify_rules", "notify_groups"] + + +class MonitorPolicyEmptySerializer(serializers.Serializer): + pass + + +class ListClusterSerializer(serializers.Serializer): + dbtype = serializers.ChoiceField(help_text=_("数据库类型"), choices=DBType.get_choices()) + + +class ListModuleSerializer(ListClusterSerializer): + pass diff --git a/dbm-ui/backend/db_monitor/tasks.py b/dbm-ui/backend/db_monitor/tasks.py new file mode 100644 index 0000000000..6409fc9fd1 --- /dev/null +++ b/dbm-ui/backend/db_monitor/tasks.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging + +from celery import shared_task + +from .. import env +from ..configuration.constants import PLAT_BIZ_ID + +logger = logging.getLogger("celery") + + +@shared_task +def update_app_policy(bk_biz_id, notify_group_id, db_type): + """业务监控策略刷新 + 当业务运维配置了业务dba时,可调用该task立即下发策略更新 + notify_group_id: 新建的蓝鲸告警组 + """ + from .models import MonitorPolicy, NoticeGroup + + if not notify_group_id: + logger.error("update_app_policy skip empty notify_group_id: %s", notify_group_id) + return + + logger.warning( + "update_app_policy start bk_biz_id=%s, notify_group_id=%s, db_type=%s", bk_biz_id, notify_group_id, db_type + ) + + # TODO: 批量更新,不太适合自定义策略,告警组很难做聚合 + # policies = MonitorPolicy.get_policies(db_type, bk_biz_id) + # BKMonitorV3Api.update_partial_strategy_v3({ + # "ids": policies, + # "edit_data": { + # "notice_group_list": [ + # monitor_group_id + # ] + # }, + # "bk_biz_id": env.DBA_APP_BK_BIZ_ID + # }) + + if bk_biz_id == PLAT_BIZ_ID: + logger.error("update_app_policy skip built in policy of %s", bk_biz_id) + return + + # 逐个策略更新 + for policy in MonitorPolicy.objects.filter(db_type=db_type, bk_biz_id=bk_biz_id): + plat_groups = NoticeGroup.get_groups(PLAT_BIZ_ID, id_name="id") + plat_group_id = plat_groups.get(policy.db_type) + + old_notify_groups = copy.deepcopy(policy.notify_groups) + + # 移除平台告警组 + if plat_group_id in policy.notify_groups: + try: + policy.notify_groups.remove(plat_group_id) + except ValueError: + pass + + # 添加目标告警组 + if notify_group_id not in policy.notify_groups: + policy.notify_groups.append(notify_group_id) + + if set(policy.notify_groups) != set(old_notify_groups): + logger.warning( + "update_app_policy update policy=%s, notify_group_id=%s, db_type=%s: %s -> %s", + policy.name, + notify_group_id, + db_type, + old_notify_groups, + policy.notify_groups, + ) + policy.save() + else: + logger.warning( + "update_app_policy skip policy=%s, notify_group_id=%s, db_type=%s", + policy.name, + notify_group_id, + db_type, + ) diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" similarity index 83% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" index 929eb3a9b5..6eccf27857 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5669, - "name": "[ES]-主机 CPU 使用率", + "name": "ES \u4e3b\u673a CPU \u4f7f\u7528\u7387", "db_type": "es", "details": { "app": "", - "name": "[ES]-主机 CPU 使用率", + "name": "ES \u4e3b\u673a CPU \u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(CPU使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(CPU\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6212, "type": "Threshold", "level": 1, "config": [ @@ -54,22 +31,22 @@ "origin_sql": "", "query_configs": [ { - "id": 6208, - "name": "CPU使用率", + "name": "CPU\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.cpu_summary.usage", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", "agg_method": "AVG", "agg_interval": 60, "metric_field": "usage", "agg_condition": [], "agg_dimension": [ "bk_target_cloud_id", - "bk_target_ip" + "bk_target_ip", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.cpu_summary", + "result_table_id": "dbm_system.cpu_summary", "data_source_label": "bk_monitor" } ], @@ -85,10 +62,9 @@ } ], "labels": [ - "ES", - "DBM_ES", + "DBM", "DBM_ES", - "DBM" + "ES" ], "notice": { "config": { @@ -120,7 +96,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -224,11 +202,9 @@ }, "config_id": 8723, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -255,8 +231,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" similarity index 84% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" index 64ffbbc9d1..747ac1ac3f 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5668, - "name": "[ES]-主机磁盘IO利用率", + "name": "ES \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "db_type": "es", "details": { "app": "", - "name": "[ES]-主机磁盘IO利用率", + "name": "ES \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(I/O使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6211, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6207, - "name": "I/O使用率", + "name": "I/O\u4f7f\u7528\u7387", "unit": "percentunit", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.io.util", + "metric_id": "bk_monitor.dbm_system.io.util", "agg_method": "AVG", "agg_interval": 60, "metric_field": "util", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.io", + "result_table_id": "dbm_system.io", "data_source_label": "bk_monitor" } ], @@ -86,10 +63,9 @@ } ], "labels": [ - "ES", - "DBM_ES", + "DBM", "DBM_ES", - "DBM" + "ES" ], "notice": { "config": { @@ -121,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -225,11 +203,9 @@ }, "config_id": 8722, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -256,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" similarity index 83% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" index 6b233437cd..f56181fc78 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5670, - "name": "[ES]-主机磁盘空间使用率", + "name": "ES \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "db_type": "es", "details": { "app": "", - "name": "[ES]-主机磁盘空间使用率", + "name": "ES \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(磁盘空间使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6213, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6209, - "name": "磁盘空间使用率", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.disk.in_use", + "metric_id": "bk_monitor.dbm_system.disk.in_use", "agg_method": "AVG", "agg_interval": 60, "metric_field": "in_use", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "mount_point" + "mount_point", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.disk", + "result_table_id": "dbm_system.disk", "data_source_label": "bk_monitor" } ], @@ -86,10 +63,9 @@ } ], "labels": [ - "ES", - "DBM_ES", + "DBM", "DBM_ES", - "DBM" + "ES" ], "notice": { "config": { @@ -121,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -225,11 +203,9 @@ }, "config_id": 8724, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -256,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" similarity index 84% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" index f8a0708558..5adfc72233 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5671, - "name": "[ES]-主机网络入流量", + "name": "ES \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "db_type": "es", "details": { "app": "", - "name": "[ES]-主机网络入流量", + "name": "ES \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "path": "", "type": "monitor", "items": [ { - "name": "AVG(网卡入流量)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "target": [], "functions": [], "algorithms": [ { - "id": 6214, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6210, - "name": "网卡入流量", + "name": "\u7f51\u5361\u5165\u6d41\u91cf", "unit": "Bps", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.net.speed_recv", + "metric_id": "bk_monitor.dbm_system.net.speed_recv", "agg_method": "AVG", "agg_interval": 60, "metric_field": "speed_recv", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.net", + "result_table_id": "dbm_system.net", "data_source_label": "bk_monitor" } ], @@ -86,10 +63,9 @@ } ], "labels": [ - "ES", - "DBM_ES", + "DBM", "DBM_ES", - "DBM" + "ES" ], "notice": { "config": { @@ -121,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -225,11 +203,9 @@ }, "config_id": 8725, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -256,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-SafeNode.json "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\213\222\347\273\235.json" similarity index 76% rename from dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-SafeNode.json rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\213\222\347\273\235.json" index d5a3b062e4..67feb3110b 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-SafeNode.json +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\213\222\347\273\235.json" @@ -1,96 +1,84 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5899, - "name": "[HDFS]-SafeNode", - "db_type": "hdfs", + "name": "ES \u5199\u62d2\u7edd", + "db_type": "es", "details": { "app": "", - "name": "[HDFS]-SafeNode", + "name": "ES \u5199\u62d2\u7edd", "path": "", "type": "monitor", "items": [ { - "name": "SUM(hadoop_namenode_f_s_state)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - } - ], - "method": "eq" - } - ] - ], - "functions": [], - "algorithms": [ - { - "id": 6475, - "type": "Threshold", - "level": 1, - "config": [ - [ - { - "method": "lt", - "threshold": 1 - } - ] - ], - "unit_prefix": "" - } - ], + "name": "max_without_time(elasticsearch_thread_pool_rejected_count)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], "expression": "a", + "functions": [], "origin_sql": "", "query_configs": [ { - "id": 6446, - "name": "hadoop_namenode_f_s_state", - "unit": "", + "data_label": "exporter_dbm_elasticsearch_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", "alias": "a", - "functions": [], - "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_f_s", - "agg_method": "SUM", + "result_table_id": "exporter_dbm_elasticsearch_exporter.group6", + "agg_method": "max_without_time", "agg_interval": 60, - "metric_field": "hadoop_namenode_f_s_state", + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_name", + "name", + "app_id" + ], "agg_condition": [ { - "key": "instance_role", + "key": "type", + "method": "eq", "value": [ - "hdfs_namenode" + "write" ], - "method": "eq", - "condition": "and", - "dimension_name": "instance_role" + "dimension_name": "type" } ], - "agg_dimension": [ - "app", - "cluster_domain" - ], - "data_type_label": "time_series", - "result_table_id": "exporter_dbm_hdfs_exporter.group1", - "data_source_label": "bk_monitor" + "metric_field": "elasticsearch_thread_pool_rejected_count", + "unit": "", + "metric_id": "bk_monitor.exporter_dbm_elasticsearch_exporter.group6.elasticsearch_thread_pool_rejected_count", + "index_set_id": "", + "query_string": "*", + "custom_event_name": "elasticsearch_thread_pool_rejected_count", + "functions": [], + "time_field": "time", + "bkmonitor_strategy_id": "elasticsearch_thread_pool_rejected_count", + "alert_name": "elasticsearch_thread_pool_rejected_count" } ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + "algorithms": [ + { + "level": 1, + "type": "Threshold", + "config": [ + [ + { + "method": "gte", + "threshold": 0 + } + ] + ], + "unit_prefix": "" + } + ] } ], "labels": [ - "HDFS", - "DBM_HDFS", - "DBM" + "DBM", + "DBM_ES", + "ES" ], "notice": { "config": { @@ -116,16 +104,16 @@ "interval_notify_mode": "standard" }, "signal": [ - "no_data", - "abnormal" + "abnormal", + "no_data" ], "options": { "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], + "upgrade_config": {}, "converge_config": { "count": 1, "condition": [ @@ -222,20 +210,15 @@ "unit": "percent", "count": 10, "timedelta": 5, - "dimensions": [ - "app", - "cluster_domain" - ], + "dimensions": [], "is_enabled": false } }, - "config_id": 8953, + "config_id": 8728, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -262,8 +245,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(ES\u7ebf\u7a0b\u6c60\u4e2d\u88ab\u62d2\u7edd\u4efb\u52a1\u6570)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\216\222\351\230\237.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\216\222\351\230\237.json" new file mode 100644 index 0000000000..f88f4be240 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \345\206\231\346\216\222\351\230\237.json" @@ -0,0 +1,250 @@ +{ + "bk_biz_id": 0, + "name": "ES \u5199\u6392\u961f", + "db_type": "es", + "details": { + "app": "", + "name": "ES \u5199\u6392\u961f", + "path": "", + "type": "monitor", + "items": [ + { + "name": "MAX(elasticsearch_thread_pool_queue_count)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", + "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.exporter_dbm_elasticsearch_exporter.group6.elasticsearch_thread_pool_queue_count", + "functions": [], + "result_table_id": "exporter_dbm_elasticsearch_exporter.group6", + "data_label": "exporter_dbm_elasticsearch_exporter", + "agg_method": "MAX", + "agg_interval": 60, + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_name", + "name", + "app_id" + ], + "agg_condition": [ + { + "key": "type", + "method": "eq", + "value": [ + "write" + ], + "dimension_name": "type" + } + ], + "metric_field": "elasticsearch_thread_pool_queue_count", + "unit": "" + } + ], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "threshold": 0, + "method": "gte" + } + ] + ], + "unit_prefix": "" + } + ] + } + ], + "labels": [ + "DBM", + "DBM_ES", + "ES" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "abnormal", + "no_data" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": {}, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "exclude_notice_ways": { + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 8727, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 + }, + "is_enabled": true, + "monitor_indicator": "MAX(ES\u7ebf\u7a0b\u6c60\u4e2d\u7684\u6392\u961f\u4efb\u52a1\u6570)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/ES \346\220\234\347\264\242\346\213\222\347\273\235.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \346\220\234\347\264\242\346\213\222\347\273\235.json" new file mode 100644 index 0000000000..5f87ee29b6 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \346\220\234\347\264\242\346\213\222\347\273\235.json" @@ -0,0 +1,256 @@ +{ + "bk_biz_id": 0, + "name": "ES \u641c\u7d22\u62d2\u7edd", + "db_type": "es", + "details": { + "app": "", + "name": "ES \u641c\u7d22\u62d2\u7edd", + "path": "", + "type": "monitor", + "items": [ + { + "name": "max_without_time(elasticsearch_thread_pool_rejected_count)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", + "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_label": "exporter_dbm_elasticsearch_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "result_table_id": "exporter_dbm_elasticsearch_exporter.group6", + "agg_method": "max_without_time", + "agg_interval": 60, + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_name", + "name", + "app_id" + ], + "agg_condition": [ + { + "key": "type", + "method": "eq", + "value": [ + "search" + ], + "dimension_name": "type" + } + ], + "metric_field": "elasticsearch_thread_pool_rejected_count", + "unit": "", + "metric_id": "bk_monitor.exporter_dbm_elasticsearch_exporter.group6.elasticsearch_thread_pool_rejected_count", + "index_set_id": "", + "query_string": "*", + "custom_event_name": "elasticsearch_thread_pool_rejected_count", + "functions": [], + "time_field": "time", + "bkmonitor_strategy_id": "elasticsearch_thread_pool_rejected_count", + "alert_name": "elasticsearch_thread_pool_rejected_count" + } + ], + "algorithms": [ + { + "level": 1, + "type": "Threshold", + "config": [ + [ + { + "method": "gte", + "threshold": 0 + } + ] + ], + "unit_prefix": "" + } + ] + } + ], + "labels": [ + "DBM", + "DBM_ES", + "ES" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "abnormal", + "no_data" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": {}, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "exclude_notice_ways": { + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 8729, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 + }, + "is_enabled": true, + "monitor_indicator": "MAX(ES\u7ebf\u7a0b\u6c60\u4e2d\u88ab\u62d2\u7edd\u7684\u4efb\u52a1\u6570)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\351\233\206\347\276\244\347\212\266\346\200\201.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \351\233\206\347\276\244\347\212\266\346\200\201.json" similarity index 87% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\351\233\206\347\276\244\347\212\266\346\200\201.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/ES \351\233\206\347\276\244\347\212\266\346\200\201.json" index 9519e7d563..f28ece6b88 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\351\233\206\347\276\244\347\212\266\346\200\201.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/ES \351\233\206\347\276\244\347\212\266\346\200\201.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5757, - "name": "[ES]-集群状态", + "name": "ES \u96c6\u7fa4\u72b6\u6001", "db_type": "es", "details": { "app": "", - "name": "[ES]-集群状态", + "name": "ES \u96c6\u7fa4\u72b6\u6001", "path": "", "type": "monitor", "items": [ { "name": "MAX(elasticsearch_cluster_health_status)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6300, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6296, "name": "elasticsearch_cluster_health_status", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_elasticsearch_exporter.group15.elasticse", + "metric_id": "bk_monitor.exporter_dbm_elasticsearch_exporter.group15.elasticsearch_cluster_health_status", "agg_method": "MAX", "agg_interval": 60, "metric_field": "elasticsearch_cluster_health_status", @@ -77,7 +53,8 @@ "agg_dimension": [ "bk_target_service_instance_id", "app", - "cluster_domain" + "cluster_domain", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_elasticsearch_exporter.group15", @@ -95,10 +72,9 @@ } ], "labels": [ - "ES", - "DBM_ES", + "DBM", "DBM_ES", - "DBM" + "ES" ], "notice": { "config": { @@ -130,7 +106,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -238,11 +216,9 @@ }, "config_id": 8811, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -269,8 +245,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(ES\u96c6\u7fa4\u5065\u5eb7\u72b6\u6001)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS CorruptBlocks.json similarity index 83% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" rename to dbm-ui/backend/db_monitor/tpls/alarm/HDFS CorruptBlocks.json index a87e4fe25d..0cd012c574 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" +++ b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS CorruptBlocks.json @@ -1,103 +1,85 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5891, - "name": "[HDFS]-容量使用率", + "name": "HDFS CorruptBlocks", "db_type": "hdfs", "details": { "app": "", - "name": "[HDFS]-容量使用率", + "name": "HDFS CorruptBlocks", "path": "", "type": "monitor", "items": [ { - "name": "AVG(hadoop_namenode_capacity_used)/AVG(hadoop_namenode_capacity_total)*100", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(hadoop_namenode_corrupt_blocks)/MIN(hadoop_namenode_State)", + "target": [], "functions": [], "algorithms": [ { - "id": 6463, "type": "Threshold", "level": 1, "config": [ [ { "method": "gte", - "threshold": 86 + "threshold": 500 } ] ], "unit_prefix": "" }, { - "id": 6464, "type": "Threshold", "level": 2, "config": [ [ { "method": "gte", - "threshold": 80 + "threshold": 10 } ] ], "unit_prefix": "" } ], - "expression": "a/b*100", + "expression": "a/b", "origin_sql": "", "query_configs": [ { - "id": 6437, - "name": "hadoop_namenode_capacity_used", + "name": "hadoop_namenode_corrupt_blocks", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_cap", + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_corrupt_blocks", "agg_method": "AVG", + "data_label": "exporter_dbm_hdfs_exporter", "agg_interval": 60, - "metric_field": "hadoop_namenode_capacity_used", + "metric_field": "hadoop_namenode_corrupt_blocks", "agg_condition": [], "agg_dimension": [ + "bk_target_service_instance_id", "app", "cluster_domain", - "bk_target_service_instance_id" + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_hdfs_exporter.group1", "data_source_label": "bk_monitor" }, { - "id": 6438, - "name": "hadoop_namenode_capacity_total", + "name": "hadoop_namenode_State", "unit": "", "alias": "b", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_cap", - "agg_method": "AVG", + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_State", + "agg_method": "MIN", + "data_label": "exporter_dbm_hdfs_exporter", "agg_interval": 60, - "metric_field": "hadoop_namenode_capacity_total", + "metric_field": "hadoop_namenode_State", "agg_condition": [], "agg_dimension": [ "bk_target_service_instance_id", + "app", "cluster_domain", - "app" + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_hdfs_exporter.group1", @@ -115,10 +97,9 @@ } ], "labels": [ - "HDFS", + "DBM", "DBM_HDFS", - "DBM_HDFS", - "DBM" + "HDFS" ], "notice": { "config": { @@ -150,8 +131,14 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, "converge_config": { "count": 1, "condition": [ @@ -240,7 +227,9 @@ "converge_func": "collect_alarm" } }, + "chart_image_enabled": true, "exclude_notice_ways": { + "ack": [], "closed": [], "recovered": [] }, @@ -256,13 +245,11 @@ "is_enabled": false } }, - "config_id": 8945, + "config_id": 1124, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -310,9 +297,14 @@ } } ], + "priority": 0, "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u574f\u6570\u636e\u5757)/MIN(NameNode\u72b6\u6001)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\216\222\351\230\237.json" b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS DataNode Last Contact.json similarity index 73% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\216\222\351\230\237.json" rename to dbm-ui/backend/db_monitor/tpls/alarm/HDFS DataNode Last Contact.json index cf3a3440fd..1fed08a8b6 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\216\222\351\230\237.json" +++ b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS DataNode Last Contact.json @@ -1,65 +1,41 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5673, - "name": "[ES]-写排队", - "db_type": "es", + "name": "HDFS DataNode Last Contact", + "db_type": "hdfs", "details": { "app": "", - "name": "[ES]-写排队", + "name": "HDFS DataNode Last Contact", "path": "", "type": "monitor", "items": [ { - "name": "[ES]-写排队", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], + "name": "[HDFS]-DataNode Last Contact", + "target": [], "functions": [], "algorithms": [ { - "id": 6216, "type": "Threshold", "level": 2, "config": [ [ { - "method": "gt", - "threshold": 100 + "method": "gte", + "threshold": 570 } ] ], "unit_prefix": "" } ], - "expression": "a", - "origin_sql": "max by(bk_target_service_instance_id, app, cluster_name, name) (max_over_time(bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_queue_count{type=\"write\"}[1m]))", + "expression": "a * b", + "origin_sql": "", "query_configs": [ { - "id": 6212, "name": "", "alias": "a", - "promql": "max by(bk_target_service_instance_id, app, cluster_name, name) (max_over_time(bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_queue_count{type=\"write\"}[1m]))", + "promql": "max by (bk_target_service_instance_id, datanode) (max_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_live_nodes_last_contact{instance_role=\"hdfs_namenode\"}[1m])) * ignoring(datanode) group_left avg by (bk_target_service_instance_id) (avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_State{instance_role=\"hdfs_namenode\"}[1m]))", "functions": [], - "metric_id": "max by(bk_target_service_instance_id, app, cluster_name, name) (", + "metric_id": "max by (bk_target_service_instance_id, datanode) (max_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_live_nodes_", "agg_interval": 60, "data_type_label": "time_series", "data_source_label": "prometheus" @@ -74,10 +50,9 @@ } ], "labels": [ - "ES", - "DBM_ES", - "DBM_ES", - "DBM" + "DBM", + "DBM_HDFS", + "HDFS" ], "notice": { "config": { @@ -85,17 +60,17 @@ { "signal": "abnormal", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" }, { "signal": "recovered", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" }, { "signal": "closed", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" } ], "need_poll": true, @@ -103,14 +78,20 @@ "interval_notify_mode": "standard" }, "signal": [ - "abnormal", - "no_data" + "no_data", + "abnormal" ], "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, "converge_config": { "count": 1, "condition": [ @@ -199,7 +180,9 @@ "converge_func": "collect_alarm" } }, + "chart_image_enabled": true, "exclude_notice_ways": { + "ack": [], "closed": [], "recovered": [] }, @@ -211,13 +194,11 @@ "is_enabled": false } }, - "config_id": 8727, + "config_id": 40184, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -235,7 +216,7 @@ } ] }, - "check_window": 5 + "check_window": 1 }, "recovery_config": { "check_window": 5, @@ -243,9 +224,14 @@ } } ], + "priority": 0, "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority_group_key": "" }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "DataNode\u6700\u540e\u4e00\u6b21\u901a\u4fe1\u65f6\u95f4", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/HDFS EditLogRoll.json b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS EditLogRoll.json new file mode 100644 index 0000000000..ceb90d0ee6 --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS EditLogRoll.json @@ -0,0 +1,311 @@ +{ + "bk_biz_id": 0, + "name": "HDFS EditLogRoll", + "db_type": "hdfs", + "details": { + "app": "", + "name": "HDFS EditLogRoll", + "path": "", + "type": "monitor", + "items": [ + { + "name": "AVG(hadoop_namenode_transactions_since_last_checkpoint)/MIN(hadoop_namenode_State)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 6000000 + } + ] + ], + "unit_prefix": "" + }, + { + "type": "Threshold", + "level": 2, + "config": [ + [ + { + "method": "gte", + "threshold": 5000000 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a/b", + "origin_sql": "", + "query_configs": [ + { + "name": "hadoop_namenode_transactions_since_last_checkpoint", + "unit": "", + "alias": "a", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_transactions_since_last_checkpoint", + "agg_method": "AVG", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_transactions_since_last_checkpoint", + "agg_condition": [], + "agg_dimension": [ + "app", + "cluster_domain", + "instance_host", + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + }, + { + "name": "hadoop_namenode_State", + "unit": "", + "alias": "b", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_State", + "agg_method": "MIN", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_State", + "agg_condition": [], + "agg_dimension": [ + "app", + "cluster_domain", + "instance_host", + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_HDFS", + "HDFS" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "app", + "cluster_domain", + "instance_host", + "bk_target_service_instance_id" + ], + "is_enabled": false + } + }, + "config_id": 1123, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + }, + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "NameNode\u7f16\u8f91\u65e5\u5fd7\u6eda\u52a8\u64cd\u4f5c\u6570", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/HDFS MissingBlocks.json b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS MissingBlocks.json new file mode 100644 index 0000000000..cbe977e715 --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS MissingBlocks.json @@ -0,0 +1,310 @@ +{ + "bk_biz_id": 0, + "name": "HDFS MissingBlocks", + "db_type": "hdfs", + "details": { + "app": "", + "name": "HDFS MissingBlocks", + "path": "", + "type": "monitor", + "items": [ + { + "name": "AVG(hadoop_namenode_missing_blocks)/MIN(hadoop_namenode_State)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 500 + } + ] + ], + "unit_prefix": "" + }, + { + "type": "Threshold", + "level": 2, + "config": [ + [ + { + "method": "gte", + "threshold": 10 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "b/a", + "origin_sql": "", + "query_configs": [ + { + "name": "hadoop_namenode_State", + "unit": "", + "alias": "a", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_State", + "agg_method": "MIN", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_State", + "agg_condition": [], + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_domain", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + }, + { + "name": "hadoop_namenode_missing_blocks", + "unit": "", + "alias": "b", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_missing_blocks", + "agg_method": "AVG", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_missing_blocks", + "agg_condition": [], + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_domain", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [ + "bk_target_service_instance_id" + ] + } + } + ], + "labels": [ + "DBM", + "DBM_HDFS", + "HDFS" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "app", + "cluster_domain", + "bk_target_service_instance_id" + ], + "is_enabled": false + } + }, + "config_id": 1136, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + }, + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "\u4e22\u5931\u7684\u6570\u636e\u5757\u6570\u91cf", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/HDFS NameNode Failover.json b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS NameNode Failover.json new file mode 100644 index 0000000000..a727bef0fd --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS NameNode Failover.json @@ -0,0 +1,302 @@ +{ + "bk_biz_id": 0, + "name": "HDFS NameNode Failover", + "db_type": "hdfs", + "details": { + "app": "", + "name": "HDFS NameNode Failover", + "path": "", + "type": "monitor", + "items": [ + { + "name": "MIN(hadoop_namenode_State)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "lt", + "threshold": 0 + } + ] + ], + "unit_prefix": "" + }, + { + "type": "Threshold", + "level": 2, + "config": [ + [ + { + "method": "gt", + "threshold": 0 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "hadoop_namenode_State", + "unit": "", + "alias": "a", + "functions": [ + { + "id": "delta", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_State", + "agg_method": "MIN", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_State", + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "hdfs_namenode" + ], + "method": "eq", + "dimension_name": "instance_role" + } + ], + "agg_dimension": [ + "app", + "cluster_name", + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_HDFS", + "HDFS" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 40185, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + }, + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "NameNode\u6545\u969c\u8f6c\u79fb\u6b21\u6570", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/HDFS \345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS \345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" new file mode 100644 index 0000000000..40753cb9fa --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/HDFS \345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" @@ -0,0 +1,327 @@ +{ + "bk_biz_id": 0, + "name": "HDFS \u5bb9\u91cf\u4f7f\u7528\u7387", + "db_type": "hdfs", + "details": { + "app": "", + "name": "HDFS \u5bb9\u91cf\u4f7f\u7528\u7387", + "path": "", + "type": "monitor", + "items": [ + { + "name": "AVG(hadoop_namenode_capacity_used)/AVG(hadoop_namenode_capacity_total)*MIN(hadoop_namenode_State)*100", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 86 + } + ] + ], + "unit_prefix": "" + }, + { + "type": "Threshold", + "level": 2, + "config": [ + [ + { + "method": "gte", + "threshold": 80 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a/b*c*100", + "origin_sql": "", + "query_configs": [ + { + "name": "hadoop_namenode_capacity_used", + "unit": "", + "alias": "a", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_capacity_used", + "agg_method": "AVG", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_capacity_used", + "agg_condition": [], + "agg_dimension": [ + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + }, + { + "name": "hadoop_namenode_capacity_total", + "unit": "", + "alias": "b", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_capacity_total", + "agg_method": "AVG", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_capacity_total", + "agg_condition": [], + "agg_dimension": [ + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + }, + { + "name": "hadoop_namenode_State", + "unit": "", + "alias": "c", + "functions": [], + "metric_id": "bk_monitor.exporter_dbm_hdfs_exporter.group1.hadoop_namenode_State", + "agg_method": "MIN", + "data_label": "exporter_dbm_hdfs_exporter", + "agg_interval": 60, + "metric_field": "hadoop_namenode_State", + "agg_condition": [], + "agg_dimension": [ + "app", + "cluster_domain", + "bk_target_service_instance_id", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "exporter_dbm_hdfs_exporter.group1", + "data_source_label": "bk_monitor" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [ + "bk_target_service_instance_id" + ] + } + } + ], + "labels": [ + "DBM", + "DBM_HDFS", + "HDFS" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "app", + "cluster_domain", + "bk_target_service_instance_id" + ], + "is_enabled": false + } + }, + "config_id": 1140, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + }, + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "\u5bb9\u91cf\u4f7f\u7528\u7387", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB CPU \344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB CPU \344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" index 2169e6e2d1..aae33feefc 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB CPU \344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB CPU \344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5952, - "name": "InfluxDB CPU 使用率告警", + "name": "InfluxDB CPU \u4f7f\u7528\u7387\u544a\u8b66", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB CPU 使用率告警", + "name": "InfluxDB CPU \u4f7f\u7528\u7387\u544a\u8b66", "path": "", "type": "monitor", "items": [ { - "name": "AVG(CPU使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(CPU\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6533, "type": "Threshold", "level": 3, "config": [ @@ -42,7 +27,6 @@ "unit_prefix": "%" }, { - "id": 6534, "type": "Threshold", "level": 2, "config": [ @@ -60,22 +44,22 @@ "origin_sql": "", "query_configs": [ { - "id": 6499, - "name": "CPU使用率", + "name": "CPU\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.cpu_summary.usage", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", "agg_method": "AVG", "agg_interval": 60, "metric_field": "usage", "agg_condition": [], "agg_dimension": [ "bk_target_ip", - "bk_target_cloud_id" + "bk_target_cloud_id", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.cpu_summary", + "result_table_id": "dbm_system.cpu_summary", "data_source_label": "bk_monitor" } ], @@ -91,9 +75,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -126,8 +110,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -237,11 +220,9 @@ }, "config_id": 9006, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -290,8 +271,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB Series \345\242\236\351\225\277\351\207\217.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB Series \345\242\236\351\225\277\351\207\217.json" index c2b491e437..e47f77cb73 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB Series \345\242\236\351\225\277\351\207\217.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB Series \345\242\236\351\225\277\351\207\217.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5950, - "name": "InfluxDB Series 增长量", + "name": "InfluxDB Series \u589e\u957f\u91cf", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB Series 增长量", + "name": "InfluxDB Series \u589e\u957f\u91cf", "path": "", "type": "monitor", "items": [ { "name": "AVG(influxdb_database_numSeries)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6530, "type": "Threshold", "level": 2, "config": [ @@ -46,7 +31,6 @@ "origin_sql": "", "query_configs": [ { - "id": 6497, "name": "influxdb_database_numSeries", "unit": "", "alias": "a", @@ -68,7 +52,8 @@ "agg_condition": [], "agg_dimension": [ "bk_target_service_instance_id", - "_database" + "_database", + "app_id" ], "data_type_label": "time_series", "result_table_id": "pushgateway_dbm_influxdb_bkpull.group1", @@ -86,9 +71,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -121,8 +106,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -232,11 +216,9 @@ }, "config_id": 9004, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -263,8 +245,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u65f6\u95f4\u5e8f\u5217\u6570\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\205\345\255\230\344\275\277\347\224\250\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\205\345\255\230\344\275\277\347\224\250\345\221\212\350\255\246.json" index 39d193e6be..5e3d245aef 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\205\345\255\230\344\275\277\347\224\250\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\205\345\255\230\344\275\277\347\224\250\345\221\212\350\255\246.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5946, - "name": "InfluxDB 内存使用告警", + "name": "InfluxDB \u5185\u5b58\u4f7f\u7528\u544a\u8b66", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB 内存使用告警", + "name": "InfluxDB \u5185\u5b58\u4f7f\u7528\u544a\u8b66", "path": "", "type": "monitor", "items": [ { - "name": "AVG(应用程序内存使用占比)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u4f7f\u7528\u5360\u6bd4)", + "target": [], "functions": [], "algorithms": [ { - "id": 6524, "type": "Threshold", "level": 2, "config": [ @@ -42,7 +27,6 @@ "unit_prefix": "%" }, { - "id": 6525, "type": "Threshold", "level": 1, "config": [ @@ -60,22 +44,22 @@ "origin_sql": "", "query_configs": [ { - "id": 6493, - "name": "应用程序内存使用占比", + "name": "\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u4f7f\u7528\u5360\u6bd4", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.mem.pct_used", + "metric_id": "bk_monitor.dbm_system.mem.pct_used", "agg_method": "AVG", "agg_interval": 60, "metric_field": "pct_used", "agg_condition": [], "agg_dimension": [ "bk_target_ip", - "bk_target_cloud_id" + "bk_target_cloud_id", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.mem", + "result_table_id": "dbm_system.mem", "data_source_label": "bk_monitor" } ], @@ -91,9 +75,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -126,8 +110,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -237,11 +220,9 @@ }, "config_id": 9000, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -290,8 +271,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u4f7f\u7528\u5360\u6bd4)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\231\345\205\245\345\274\202\345\270\270\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\231\345\205\245\345\274\202\345\270\270\345\221\212\350\255\246.json" index e891498808..f661fd40be 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\231\345\205\245\345\274\202\345\270\270\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\206\231\345\205\245\345\274\202\345\270\270\345\221\212\350\255\246.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5948, - "name": "InfluxDB 写入异常告警", + "name": "InfluxDB \u5199\u5165\u5f02\u5e38\u544a\u8b66", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB 写入异常告警", + "name": "InfluxDB \u5199\u5165\u5f02\u5e38\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "AVG(influxdb_httpd_pointsWrittenFail)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6528, "type": "Threshold", "level": 2, "config": [ @@ -46,7 +31,6 @@ "origin_sql": "", "query_configs": [ { - "id": 6495, "name": "influxdb_httpd_pointsWrittenFail", "unit": "", "alias": "a", @@ -68,7 +52,8 @@ "agg_condition": [], "agg_dimension": [ "bk_target_service_instance_id", - "ip" + "ip", + "app_id" ], "data_type_label": "time_series", "result_table_id": "pushgateway_dbm_influxdb_bkpull.group6", @@ -86,9 +71,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -121,8 +106,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -232,11 +216,9 @@ }, "config_id": 9002, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -263,8 +245,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u5199\u5165\u5931\u8d25\u7684\u6570\u636e\u70b9\u6570\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\256\236\344\276\213\347\253\257\345\217\243\345\274\202\345\270\270.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\256\236\344\276\213\347\253\257\345\217\243\345\274\202\345\270\270.json" index c7fe8dfb24..650e549903 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\256\236\344\276\213\347\253\257\345\217\243\345\274\202\345\270\270.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \345\256\236\344\276\213\347\253\257\345\217\243\345\274\202\345\270\270.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5949, - "name": "InfluxDB 实例端口异常", + "name": "InfluxDB \u5b9e\u4f8b\u7aef\u53e3\u5f02\u5e38", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB 实例端口异常", + "name": "InfluxDB \u5b9e\u4f8b\u7aef\u53e3\u5f02\u5e38", "path": "", "type": "monitor", "items": [ { "name": "MAX(http_response_result_code)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6529, "type": "Threshold", "level": 2, "config": [ @@ -46,7 +31,6 @@ "origin_sql": "", "query_configs": [ { - "id": 6496, "name": "http_response_result_code", "unit": "", "alias": "a", @@ -58,7 +42,8 @@ "agg_condition": [], "agg_dimension": [ "bk_target_service_instance_id", - "ip" + "ip", + "app_id" ], "data_type_label": "time_series", "result_table_id": "pushgateway_dbm_influxdb_bkpull.group2", @@ -76,9 +61,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -86,7 +71,7 @@ { "signal": "abnormal", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}} : connection_failed" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}} :\u00a0connection_failed" }, { "signal": "recovered", @@ -111,8 +96,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -222,11 +206,9 @@ }, "config_id": 9003, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -253,8 +235,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(http_response_result_code)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230 IO \345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230 IO \345\210\251\347\224\250\347\216\207.json" index 5bc4761daf..bd842c812d 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230 IO \345\210\251\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230 IO \345\210\251\347\224\250\347\216\207.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5951, - "name": "InfluxDB 磁盘 IO 利用率", + "name": "InfluxDB \u78c1\u76d8 IO \u5229\u7528\u7387", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB 磁盘 IO 利用率", + "name": "InfluxDB \u78c1\u76d8 IO \u5229\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(I/O使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6531, "type": "Threshold", "level": 2, "config": [ @@ -42,7 +27,6 @@ "unit_prefix": "%" }, { - "id": 6532, "type": "Threshold", "level": 1, "config": [ @@ -60,12 +44,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6498, - "name": "I/O使用率", + "name": "I/O\u4f7f\u7528\u7387", "unit": "percentunit", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.io.util", + "metric_id": "bk_monitor.dbm_system.io.util", "agg_method": "AVG", "agg_interval": 60, "metric_field": "util", @@ -73,10 +56,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.io", + "result_table_id": "dbm_system.io", "data_source_label": "bk_monitor" } ], @@ -92,9 +76,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -127,8 +111,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -238,11 +221,9 @@ }, "config_id": 9005, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -291,8 +272,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" index 96fc705888..86bd52321d 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/InfluxDB \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" @@ -1,34 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5947, - "name": "InfluxDB 磁盘空间告警", + "name": "InfluxDB \u78c1\u76d8\u7a7a\u95f4\u544a\u8b66", "db_type": "influxdb", "details": { "app": "", - "name": "InfluxDB 磁盘空间告警", + "name": "InfluxDB \u78c1\u76d8\u7a7a\u95f4\u544a\u8b66", "path": "", "type": "monitor", "items": [ { - "name": "MAX(磁盘空间使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008245 - } - ], - "method": "eq" - } - ] - ], + "name": "MAX(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6526, "type": "Threshold", "level": 2, "config": [ @@ -42,7 +27,6 @@ "unit_prefix": "%" }, { - "id": 6527, "type": "Threshold", "level": 1, "config": [ @@ -60,12 +44,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6494, - "name": "磁盘空间使用率", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.disk.in_use", + "metric_id": "bk_monitor.dbm_system.disk.in_use", "agg_method": "MAX", "agg_interval": 60, "metric_field": "in_use", @@ -73,10 +56,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "mount_point" + "mount_point", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.disk", + "result_table_id": "dbm_system.disk", "data_source_label": "bk_monitor" } ], @@ -92,9 +76,9 @@ } ], "labels": [ - "InfluxDB", + "DBM", "DBM_INFLUXDB", - "DBM" + "InfluxDB" ], "notice": { "config": { @@ -127,8 +111,7 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "by_rule", - "only_notice" + "by_rule" ], "upgrade_config": { "is_enabled": false, @@ -238,11 +221,9 @@ }, "config_id": 9001, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -291,8 +272,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000191, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" similarity index 79% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" index 33509e8dec..7db3c1b542 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" @@ -1,79 +1,66 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5679, - "name": "[Kafka]-主机 CPU 使用率", + "name": "Kafka \u4e3b\u673a CPU \u4f7f\u7528\u7387", "db_type": "kafka", "details": { "app": "", - "name": "[Kafka]-主机 CPU 使用率", + "name": "Kafka \u4e3b\u673a CPU \u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "[Kafka]-主机 CPU 使用率", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008155 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008156 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(CPU\u4f7f\u7528\u7387)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", + "functions": [], + "result_table_id": "dbm_system.cpu_summary", + "agg_method": "AVG", + "agg_interval": 60, + "agg_dimension": [ + "bk_target_ip", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [], + "metric_field": "usage", + "unit": "" + } + ], "algorithms": [ { - "id": 6222, "type": "Threshold", "level": 1, "config": [ [ { - "method": "gte", - "threshold": 90 + "threshold": 90, + "method": "gte" } ] ], "unit_prefix": "" } - ], - "expression": "a", - "origin_sql": "avg by(bk_target_cloud_id, bk_target_ip) (avg_over_time(bkmonitor:system:cpu_summary:usage[1m]))", - "query_configs": [ - { - "id": 6218, - "name": "", - "alias": "a", - "promql": "avg by(bk_target_cloud_id, bk_target_ip) (avg_over_time(bkmonitor:system:cpu_summary:usage[1m]))", - "functions": [], - "metric_id": "avg by(bk_target_cloud_id, bk_target_ip) (avg_over_time(bkmonito", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "Kafka", + "DBM", "DBM_KAFKA", - "DBM_KAFKA", - "DBM" + "Kafka" ], "notice": { "config": { @@ -105,7 +92,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -209,11 +198,9 @@ }, "config_id": 8733, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -240,8 +227,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" similarity index 85% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" index 289c64ecdd..0d69549ede 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" @@ -1,38 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5676, - "name": "[Kafka]-主机磁盘IO利用率", + "name": "Kafka \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "db_type": "kafka", "details": { "app": "", - "name": "[Kafka]-主机磁盘IO利用率", + "name": "Kafka \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(I/O使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008155 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008156 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6219, "type": "Threshold", "level": 1, "config": [ @@ -50,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6215, - "name": "I/O使用率", + "name": "I/O\u4f7f\u7528\u7387", "unit": "percentunit", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.io.util", + "metric_id": "bk_monitor.dbm_system.io.util", "agg_method": "AVG", "agg_interval": 60, "metric_field": "util", @@ -63,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.io", + "result_table_id": "dbm_system.io", "data_source_label": "bk_monitor" } ], @@ -82,10 +63,9 @@ } ], "labels": [ - "Kafka", + "DBM", "DBM_KAFKA", - "DBM_KAFKA", - "DBM" + "Kafka" ], "notice": { "config": { @@ -117,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -221,11 +203,9 @@ }, "config_id": 8730, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -252,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" similarity index 85% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" index 0d8ee2a3c1..95681cfc72 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" @@ -1,38 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5677, - "name": "[Kafka]-主机磁盘空间使用率", + "name": "Kafka \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "db_type": "kafka", "details": { "app": "", - "name": "[Kafka]-主机磁盘空间使用率", + "name": "Kafka \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(磁盘空间使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008155 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008156 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6220, "type": "Threshold", "level": 1, "config": [ @@ -50,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6216, - "name": "磁盘空间使用率", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.disk.in_use", + "metric_id": "bk_monitor.dbm_system.disk.in_use", "agg_method": "AVG", "agg_interval": 60, "metric_field": "in_use", @@ -63,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "mount_point" + "mount_point", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.disk", + "result_table_id": "dbm_system.disk", "data_source_label": "bk_monitor" } ], @@ -82,10 +63,9 @@ } ], "labels": [ - "Kafka", + "DBM", "DBM_KAFKA", - "DBM_KAFKA", - "DBM" + "Kafka" ], "notice": { "config": { @@ -117,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -221,11 +203,9 @@ }, "config_id": 8731, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -252,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" similarity index 85% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" index c24a8c2fdb..daf5ef23f9 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" @@ -1,38 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5678, - "name": "[Kafka]-主机网络入流量", + "name": "Kafka \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "db_type": "kafka", "details": { "app": "", - "name": "[Kafka]-主机网络入流量", + "name": "Kafka \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "path": "", "type": "monitor", "items": [ { - "name": "AVG(网卡入流量)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008155 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008156 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "target": [], "functions": [], "algorithms": [ { - "id": 6221, "type": "Threshold", "level": 1, "config": [ @@ -50,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6217, - "name": "网卡入流量", + "name": "\u7f51\u5361\u5165\u6d41\u91cf", "unit": "Bps", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.net.speed_recv", + "metric_id": "bk_monitor.dbm_system.net.speed_recv", "agg_method": "AVG", "agg_interval": 60, "metric_field": "speed_recv", @@ -63,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.net", + "result_table_id": "dbm_system.net", "data_source_label": "bk_monitor" } ], @@ -82,10 +63,9 @@ } ], "labels": [ - "Kafka", + "DBM", "DBM_KAFKA", - "DBM_KAFKA", - "DBM" + "Kafka" ], "notice": { "config": { @@ -117,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -221,11 +203,9 @@ }, "config_id": 8732, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -252,8 +232,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" similarity index 78% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Kafka \346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" index b91a92ff7c..2f843b5aae 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Kafka]-\346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Kafka \346\266\210\350\264\271\347\273\204\345\273\266\350\277\237.json" @@ -1,79 +1,69 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5685, - "name": "[Kafka]-消费组延迟", + "name": "Kafka \u6d88\u8d39\u7ec4\u5ef6\u8fdf", "db_type": "kafka", "details": { "app": "", - "name": "[Kafka]-消费组延迟", + "name": "Kafka \u6d88\u8d39\u7ec4\u5ef6\u8fdf", "path": "", "type": "monitor", "items": [ { - "name": "[Kafka]-消费组延迟", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008155 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008156 - } - ], - "method": "eq" - } - ] - ], + "name": "avg_without_time(kafka_consumergroup_lag_sum)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.exporter_dbm_kafka_exporter.group1.kafka_consumergroup_lag_sum", + "functions": [], + "result_table_id": "exporter_dbm_kafka_exporter.group1", + "data_label": "exporter_dbm_kafka_exporter", + "agg_method": "avg_without_time", + "agg_interval": 60, + "agg_dimension": [ + "bk_target_service_instance_id", + "app", + "cluster_name", + "consumergroup", + "app_id" + ], + "agg_condition": [], + "metric_field": "kafka_consumergroup_lag_sum", + "unit": "" + } + ], "algorithms": [ { - "id": 6228, "type": "Threshold", - "level": 2, + "level": 1, "config": [ [ { - "method": "gte", - "threshold": 100000 + "threshold": 0, + "method": "gte" } ] ], "unit_prefix": "" } - ], - "expression": "a", - "origin_sql": "avg by(bk_target_service_instance_id, app, cluster_name, consumergroup) (bkmonitor:exporter_dbm_kafka_exporter:group1:kafka_consumergroup_lag_sum)", - "query_configs": [ - { - "id": 6224, - "name": "", - "alias": "a", - "promql": "avg by(bk_target_service_instance_id, app, cluster_name, consumergroup) (bkmonitor:exporter_dbm_kafka_exporter:group1:kafka_consumergroup_lag_sum)", - "functions": [], - "metric_id": "avg by(bk_target_service_instance_id, app, cluster_name, consume", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "Kafka", + "DBM", "DBM_KAFKA", - "DBM_KAFKA", - "DBM" + "Kafka" ], "notice": { "config": { @@ -105,7 +95,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -209,11 +201,9 @@ }, "config_id": 8739, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -240,8 +230,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "\u6d88\u8d39\u7ec4\u4e2d\u6d88\u8d39\u8005\u6ede\u540e\u603b\u548c\u7684\u5e73\u5747\u503c", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\233\347\250\213down.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\233\347\250\213down.json" index 07a2f128b6..b95790cf3b 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\233\347\250\213down.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\233\347\250\213down.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5627, - "name": "MySQL 进程down", + "name": "MySQL \u8fdb\u7a0bdown", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 进程down", + "name": "MySQL \u8fdb\u7a0bdown", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_up)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6169, "type": "Threshold", "level": 2, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6163, "name": "mysql_up", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.mysqlup.mysql_up", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.group_default.mysql_up", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_up", @@ -69,10 +45,11 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "exporter_dbm_mysqld_exporter.mysqlup", + "result_table_id": "exporter_dbm_mysqld_exporter.group_default", "data_source_label": "bk_monitor" } ], @@ -87,10 +64,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -122,7 +98,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -226,11 +204,9 @@ }, "config_id": 8681, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +233,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysql_up)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Ext3 \346\226\207\344\273\266\350\277\207\345\244\247.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Ext3 \346\226\207\344\273\266\350\277\207\345\244\247.json" index 5cd95ffd11..9b403e4852 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Ext3 \346\226\207\344\273\266\350\277\207\345\244\247.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Ext3 \346\226\207\344\273\266\350\277\207\345\244\247.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73456, - "name": "MySQL Ext3 文件过大", + "name": "MySQL Ext3 \u6587\u4ef6\u8fc7\u5927", "db_type": "mysql", "details": { "app": "", - "name": "MySQL Ext3 文件过大", + "name": "MySQL Ext3 \u6587\u4ef6\u8fc7\u5927", "path": "", "type": "monitor", "items": [ { "name": "COUNT(ext3-check)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78808, "type": "Threshold", "level": 1, "config": [ @@ -54,25 +31,24 @@ "origin_sql": "", "query_configs": [ { - "id": 77909, "name": "ext3-check", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.ext3-check", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.ext3-check", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], "agg_dimension": [ "app_id", "bk_cloud_id", - "immute_domain", + "cluster_domain", "role", "port", "machine_type", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "ext3-check", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72133, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(ext3-check)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL InnoDB log waits.json b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL InnoDB log waits.json index 4345cb6d28..2a08469a9b 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL InnoDB log waits.json +++ b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL InnoDB log waits.json @@ -1,6 +1,5 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5703, "name": "MySQL InnoDB log waits", "db_type": "mysql", "details": { @@ -11,32 +10,10 @@ "items": [ { "name": "AVG(mysql_global_status_innodb_log_waits)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6246, "type": "Threshold", "level": 2, "config": [ @@ -54,7 +31,6 @@ "origin_sql": "", "query_configs": [ { - "id": 6242, "name": "mysql_global_status_innodb_log_waits", "unit": "", "alias": "a", @@ -69,7 +45,7 @@ ] } ], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_sta", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_status_innodb_log_waits", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_global_status_innodb_log_waits", @@ -79,7 +55,8 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", @@ -97,10 +74,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -132,7 +108,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -242,11 +220,9 @@ }, "config_id": 8757, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -273,8 +249,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(InnoDB\u5f85\u5199\u5165\u65e5\u5fd7\u4e8b\u4ef6\u6570)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Monitor \346\211\247\350\241\214\345\274\202\345\270\270.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Monitor \346\211\247\350\241\214\345\274\202\345\270\270.json" index 02d8b7ff2c..f76bfe7d07 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Monitor \346\211\247\350\241\214\345\274\202\345\270\270.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Monitor \346\211\247\350\241\214\345\274\202\345\270\270.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73376, - "name": "MySQL Monitor 执行异常", + "name": "MySQL Monitor \u6267\u884c\u5f02\u5e38", "db_type": "mysql", "details": { "app": "", - "name": "MySQL Monitor 执行异常", + "name": "MySQL Monitor \u6267\u884c\u5f02\u5e38", "path": "", "type": "monitor", "items": [ { "name": "COUNT(monitor-internal-error)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78711, "type": "Threshold", "level": 2, "config": [ @@ -54,25 +31,24 @@ "origin_sql": "", "query_configs": [ { - "id": 77809, "name": "monitor-internal-error", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.monitor-internal-error", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.monitor-internal-error", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], "agg_dimension": [ "app_id", "bk_cloud_id", - "immute_domain", + "cluster_domain", "machine_type", "port", "role", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "monitor-internal-error", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72041, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(monitor-internal-error)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Routine Definer.json b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Routine Definer.json index 0d0f486acb..72a17acd27 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Routine Definer.json +++ b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Routine Definer.json @@ -1,6 +1,5 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73473, "name": "MySQL Routine Definer", "db_type": "mysql", "details": { @@ -11,32 +10,10 @@ "items": [ { "name": "COUNT(routine-definer)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78825, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77926, "name": "routine-definer", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.routine-definer", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.routine-definer", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "role", "port", "machine_type", - "immute_domain", + "cluster_domain", "bk_cloud_id", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "routine-definer", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72159, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(routine-definer)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Slave \345\220\214\346\255\245\345\274\202\345\270\270.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Slave \345\220\214\346\255\245\345\274\202\345\270\270.json" index 0df6128744..0997ce675a 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Slave \345\220\214\346\255\245\345\274\202\345\270\270.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Slave \345\220\214\346\255\245\345\274\202\345\270\270.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73370, - "name": "MySQL Slave 同步异常", + "name": "MySQL Slave \u540c\u6b65\u5f02\u5e38", "db_type": "mysql", "details": { "app": "", - "name": "MySQL Slave 同步异常", + "name": "MySQL Slave \u540c\u6b65\u5f02\u5e38", "path": "", "type": "monitor", "items": [ { "name": "COUNT(slave-status)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78705, "type": "Threshold", "level": 1, "config": [ @@ -54,25 +31,24 @@ "origin_sql": "", "query_configs": [ { - "id": 77802, "name": "slave-status", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.slave-status", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.slave-status", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], "agg_dimension": [ "app_id", "bk_cloud_id", - "immute_domain", + "cluster_domain", "machine_type", "port", "role", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "slave-status", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72034, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(slave-status)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Trigger Definer.json b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Trigger Definer.json index df96e52bf6..a50954373e 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Trigger Definer.json +++ b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL Trigger Definer.json @@ -1,6 +1,5 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73471, "name": "MySQL Trigger Definer", "db_type": "mysql", "details": { @@ -11,32 +10,10 @@ "items": [ { "name": "COUNT(trigger-definer)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78823, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77924, "name": "trigger-definer", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.trigger-definer", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.trigger-definer", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -68,11 +44,11 @@ "machine_type", "role", "port", - "immute_domain", + "cluster_domain", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "trigger-definer", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72157, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(trigger-definer)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL View Definer.json b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL View Definer.json index 1984542b72..662916d99e 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL View Definer.json +++ b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL View Definer.json @@ -1,6 +1,5 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73472, "name": "MySQL View Definer", "db_type": "mysql", "details": { @@ -11,32 +10,10 @@ "items": [ { "name": "COUNT(view-definer)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78824, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77925, "name": "view-definer", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.view-definer", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.view-definer", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -68,11 +44,11 @@ "machine_type", "role", "port", - "immute_domain", + "cluster_domain", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "view-definer", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72158, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(view-definer)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL int\346\272\242\345\207\272\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL int\346\272\242\345\207\272\345\221\212\350\255\246.json" index f5ffc40af3..c26d03b9cd 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL int\346\272\242\345\207\272\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL int\346\272\242\345\207\272\345\221\212\350\255\246.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5758, - "name": "MySQL int溢出告警", + "name": "MySQL int\u6ea2\u51fa\u544a\u8b66", "db_type": "mysql", "details": { "app": "", - "name": "MySQL int溢出告警", + "name": "MySQL int\u6ea2\u51fa\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_info_schema_auto_increment_column) / AVG(mysql_info_schema_auto_increment_column_max) * 100", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6301, "type": "Threshold", "level": 2, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6297, "name": "mysql_info_schema_auto_increment_column", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.tableincr.mysql_info_sch", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.tableincr.mysql_info_schema_auto_increment_column", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_info_schema_auto_increment_column", @@ -80,19 +56,19 @@ "cluster_domain", "schema", "table", - "column" + "column", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.tableincr", "data_source_label": "bk_monitor" }, { - "id": 6298, "name": "mysql_info_schema_auto_increment_column_max", "unit": "", "alias": "b", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.tableincr.mysql_info_sch", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.tableincr.mysql_info_schema_auto_increment_column_max", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_info_schema_auto_increment_column_max", @@ -113,7 +89,8 @@ "cluster_domain", "schema", "table", - "column" + "column", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.tableincr", @@ -131,10 +108,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -166,7 +142,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -270,11 +248,9 @@ }, "config_id": 8812, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -301,8 +277,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "\u81ea\u589e\u5217\u7684\u5e73\u5747\u4f7f\u7528\u7387", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL proxy\350\277\233\347\250\213down.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL proxy\350\277\233\347\250\213down.json" index 78ec498d61..c171672a91 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL proxy\350\277\233\347\250\213down.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL proxy\350\277\233\347\250\213down.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5763, - "name": "MySQL proxy进程down", + "name": "MySQL proxy\u8fdb\u7a0bdown", "db_type": "mysql", "details": { "app": "", - "name": "MySQL proxy进程down", + "name": "MySQL proxy\u8fdb\u7a0bdown", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysqlproxy_up)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6306, "type": "Threshold", "level": 2, "config": [ @@ -54,7 +31,6 @@ "origin_sql": "", "query_configs": [ { - "id": 6303, "name": "mysqlproxy_up", "unit": "", "alias": "a", @@ -68,7 +44,8 @@ "bk_target_service_instance_id", "app", "cluster_domain", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqlproxy_exporter.mproxy", @@ -86,10 +63,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -121,7 +97,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -225,11 +203,9 @@ }, "config_id": 8817, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -256,8 +232,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysqlproxy_up)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL restarted.json b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL restarted.json index 1d6a2ee3a7..6423bb1b86 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL restarted.json +++ b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL restarted.json @@ -1,6 +1,5 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5704, "name": "MySQL restarted", "db_type": "mysql", "details": { @@ -11,32 +10,10 @@ "items": [ { "name": "AVG(mysql_global_status_uptime)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6247, "type": "Threshold", "level": 2, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6243, "name": "mysql_global_status_uptime", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_sta", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_status_uptime", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_global_status_uptime", @@ -69,7 +45,8 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", @@ -87,10 +64,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -122,7 +98,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -226,11 +204,9 @@ }, "config_id": 8758, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +233,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysql_global_status_uptime)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" index 17dd6c41e7..802555c005 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" @@ -1,63 +1,39 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5623, - "name": "MySQL 主机 CPU 负载", + "name": "MySQL \u4e3b\u673a CPU \u8d1f\u8f7d", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 主机 CPU 负载", + "name": "MySQL \u4e3b\u673a CPU \u8d1f\u8f7d", "path": "", "type": "monitor", "items": [ { "name": "AVG(CPU usage)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6163, "type": "Threshold", "level": 3, "config": [ [ { "method": "gte", - "threshold": 90 + "threshold": 80 } ] ], "unit_prefix": "%" }, { - "id": 6164, "type": "Threshold", "level": 2, "config": [ [ { "method": "gte", - "threshold": 80 + "threshold": 90 } ] ], @@ -68,8 +44,7 @@ "origin_sql": "", "query_configs": [ { - "id": 6158, - "name": "CPU使用率", + "name": "CPU\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], @@ -83,7 +58,8 @@ "bk_target_ip", "instance_role", "app", - "cluster_domain" + "cluster_domain", + "app_id" ], "data_type_label": "time_series", "result_table_id": "dbm_system.cpu_summary", @@ -102,10 +78,9 @@ } ], "labels": [ - "MySQL", + "DBM", "DBM_MYSQL", - "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -137,7 +112,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -241,11 +218,9 @@ }, "config_id": 8677, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -294,8 +269,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU usage)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" index 06333a9145..eff8ee84f4 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5630, - "name": "MySQL 主机磁盘IO利用率", + "name": "MySQL \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 主机磁盘IO利用率", + "name": "MySQL \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(I/O使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6173, "type": "Threshold", "level": 2, "config": [ @@ -54,8 +31,7 @@ "origin_sql": "", "query_configs": [ { - "id": 6166, - "name": "I/O使用率", + "name": "I/O\u4f7f\u7528\u7387", "unit": "percentunit", "alias": "a", "functions": [], @@ -70,7 +46,8 @@ "app", "bk_target_ip", "cluster_domain", - "bk_target_cloud_id" + "bk_target_cloud_id", + "app_id" ], "data_type_label": "time_series", "result_table_id": "dbm_system.io", @@ -89,10 +66,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -124,7 +100,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -228,11 +206,9 @@ }, "config_id": 8684, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -259,8 +235,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" index 94e4c9b8a1..53e18c0ba3 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5629, - "name": "MySQL 主机磁盘空间使用率", + "name": "MySQL \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 主机磁盘空间使用率", + "name": "MySQL \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { "name": "AVG(Disk space usage)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6171, "type": "Threshold", "level": 2, "config": [ @@ -50,7 +27,6 @@ "unit_prefix": "%" }, { - "id": 6172, "type": "Threshold", "level": 1, "config": [ @@ -68,8 +44,7 @@ "origin_sql": "", "query_configs": [ { - "id": 6165, - "name": "磁盘空间使用率", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], @@ -84,7 +59,8 @@ "app", "bk_target_ip", "cluster_domain", - "bk_target_cloud_id" + "bk_target_cloud_id", + "app_id" ], "data_type_label": "time_series", "result_table_id": "dbm_system.disk", @@ -103,10 +79,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -138,7 +113,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -242,11 +219,9 @@ }, "config_id": 8683, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -295,8 +270,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(Disk space usage)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\275\221\347\273\234\345\207\272\346\265\201\351\207\217.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\275\221\347\273\234\345\207\272\346\265\201\351\207\217.json" index af9b59d15b..3163e99631 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\275\221\347\273\234\345\207\272\346\265\201\351\207\217.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\270\273\346\234\272\347\275\221\347\273\234\345\207\272\346\265\201\351\207\217.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5624, - "name": "MySQL 主机网络出流量", + "name": "MySQL \u4e3b\u673a\u7f51\u7edc\u51fa\u6d41\u91cf", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 主机网络出流量", + "name": "MySQL \u4e3b\u673a\u7f51\u7edc\u51fa\u6d41\u91cf", "path": "", "type": "monitor", "items": [ { - "name": "AVG(网卡出流量)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u7f51\u5361\u51fa\u6d41\u91cf)", + "target": [], "functions": [], "algorithms": [ { - "id": 6165, "type": "Threshold", "level": 2, "config": [ @@ -54,8 +31,7 @@ "origin_sql": "", "query_configs": [ { - "id": 6159, - "name": "网卡出流量", + "name": "\u7f51\u5361\u51fa\u6d41\u91cf", "unit": "", "alias": "a", "functions": [ @@ -80,7 +56,8 @@ "instance_role", "app", "device_name", - "cluster_domain" + "cluster_domain", + "app_id" ], "data_type_label": "time_series", "result_table_id": "dbm_system.net", @@ -99,10 +76,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -134,7 +110,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -238,11 +216,9 @@ }, "config_id": 8678, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -269,8 +245,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u7f51\u5361\u51fa\u6d41\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\220\214\346\255\245\345\274\202\345\270\270.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\220\214\346\255\245\345\274\202\345\270\270.json" index e45aa5b281..65827217f0 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\220\214\346\255\245\345\274\202\345\270\270.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\220\214\346\255\245\345\274\202\345\270\270.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5626, - "name": "MySQL 从库同步异常", + "name": "MySQL \u4ece\u5e93\u540c\u6b65\u5f02\u5e38", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 从库同步异常", + "name": "MySQL \u4ece\u5e93\u540c\u6b65\u5f02\u5e38", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_slave_status_slave_io_running) + AVG(mysql_slave_status_slave_sql_running)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6168, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6161, "name": "mysql_slave_status_slave_io_running", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_st", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_status_slave_io_running", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_slave_status_slave_io_running", @@ -78,19 +54,19 @@ "bk_target_service_instance_id", "app", "cluster_domain", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", "data_source_label": "bk_monitor" }, { - "id": 6162, "name": "mysql_slave_status_slave_sql_running", "unit": "", "alias": "b", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_st", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_status_slave_sql_running", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_slave_status_slave_sql_running", @@ -109,7 +85,8 @@ "bk_target_service_instance_id", "app", "cluster_domain", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", @@ -127,10 +104,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -162,7 +138,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -271,11 +249,9 @@ }, "config_id": 8680, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -302,8 +278,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "\u4e3b\u4ece\u590d\u5236\u4e2dSlave\u72b6\u6001\u7684\u5e73\u5747\u503c", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\273\266\350\277\237.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\273\266\350\277\237.json" index 8bb74df95b..6aa571f86e 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\273\266\350\277\237.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \344\273\216\345\272\223\345\273\266\350\277\237.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5625, - "name": "MySQL 从库延迟", + "name": "MySQL \u4ece\u5e93\u5ef6\u8fdf", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 从库延迟", + "name": "MySQL \u4ece\u5e93\u5ef6\u8fdf", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_slave_status_seconds_behind_master)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6166, "type": "Threshold", "level": 2, "config": [ @@ -50,7 +27,6 @@ "unit_prefix": "" }, { - "id": 6167, "type": "Threshold", "level": 1, "config": [ @@ -68,12 +44,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6160, "name": "mysql_slave_status_seconds_behind_master", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_st", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.slavestat.mysql_slave_status_seconds_behind_master", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_slave_status_seconds_behind_master", @@ -83,7 +58,8 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", @@ -101,10 +77,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -136,7 +111,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -246,11 +223,9 @@ }, "config_id": 8679, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -299,8 +274,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysql_slave_status_seconds_behind_master)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\255\230\345\202\250\345\274\225\346\223\216\346\243\200\346\237\245.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\255\230\345\202\250\345\274\225\346\223\216\346\243\200\346\237\245.json" index 95371e8364..af08d20c5d 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\255\230\345\202\250\345\274\225\346\223\216\346\243\200\346\237\245.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\255\230\345\202\250\345\274\225\346\223\216\346\243\200\346\237\245.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73418, - "name": "MySQL 存储引擎检查", + "name": "MySQL \u5b58\u50a8\u5f15\u64ce\u68c0\u67e5", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 存储引擎检查", + "name": "MySQL \u5b58\u50a8\u5f15\u64ce\u68c0\u67e5", "path": "", "type": "monitor", "items": [ { "name": "COUNT(engine)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78766, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77867, "name": "engine", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.engine", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.engine", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -66,13 +42,13 @@ "bk_cloud_id", "server_ip", "role", - "immute_domain", + "cluster_domain", "machine_type", "app_id", "port" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "engine", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72083, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(engine)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\256\236\344\276\213 Threads_running.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\256\236\344\276\213 Threads_running.json" index 68df38a377..6c1db24f61 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\256\236\344\276\213 Threads_running.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\256\236\344\276\213 Threads_running.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5621, - "name": "MySQL 实例 Threads_running", + "name": "MySQL \u5b9e\u4f8b Threads_running", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 实例 Threads_running", + "name": "MySQL \u5b9e\u4f8b Threads_running", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_global_status_threads_running)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6159, "type": "Threshold", "level": 2, "config": [ @@ -50,7 +27,6 @@ "unit_prefix": "" }, { - "id": 6160, "type": "Threshold", "level": 1, "config": [ @@ -68,12 +44,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6156, "name": "mysql_global_status_threads_running", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_sta", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_status_threads_running", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_global_status_threads_running", @@ -83,7 +58,8 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", @@ -101,10 +77,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -136,7 +111,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -246,11 +223,9 @@ }, "config_id": 8675, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -299,8 +274,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysql_global_status_threads_running)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\272\223\345\255\227\347\254\246\351\233\206.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\272\223\345\255\227\347\254\246\351\233\206.json" index 4b6935a5c2..463ea7f091 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\272\223\345\255\227\347\254\246\351\233\206.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \345\272\223\345\255\227\347\254\246\351\233\206.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73474, - "name": "MySQL 库字符集", + "name": "MySQL \u5e93\u5b57\u7b26\u96c6", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 库字符集", + "name": "MySQL \u5e93\u5b57\u7b26\u96c6", "path": "", "type": "monitor", "items": [ { "name": "COUNT(character-consistency)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78826, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77927, "name": "character-consistency", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.character-consistency", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.character-consistency", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "machine_type", "port", "bk_cloud_id", - "immute_domain", + "cluster_domain", "server_ip", "role" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "character-consistency", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72160, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(character-consistency)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\350\207\264\345\221\275.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\350\207\264\345\221\275.json" index 5835d2ae32..ca77112ac0 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\350\207\264\345\221\275.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\350\207\264\345\221\275.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73381, - "name": "MySQL 日志监控-致命", + "name": "MySQL \u65e5\u5fd7\u76d1\u63a7-\u81f4\u547d", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 日志监控-致命", + "name": "MySQL \u65e5\u5fd7\u76d1\u63a7-\u81f4\u547d", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-err-critical)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78716, "type": "Threshold", "level": 1, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77814, "name": "mysql-err-critical", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-err-critical", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-err-critical", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "server_ip", "role", "machine_type", - "immute_domain", + "cluster_domain", "app_id", "port" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-err-critical", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72046, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-err-critical)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\351\242\204\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\351\242\204\350\255\246.json" index 49064a7470..0d18007d14 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\351\242\204\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\227\245\345\277\227\347\233\221\346\216\247-\351\242\204\350\255\246.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73382, - "name": "MySQL 日志监控-预警", + "name": "MySQL \u65e5\u5fd7\u76d1\u63a7-\u9884\u8b66", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 日志监控-预警", + "name": "MySQL \u65e5\u5fd7\u76d1\u63a7-\u9884\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-err-notice)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78717, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77815, "name": "mysql-err-notice", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-err-notice", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-err-notice", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "server_ip", "role", "machine_type", - "immute_domain", + "cluster_domain", "app_id", "port" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-err-notice", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72047, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-err-notice)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\263\250\345\205\245.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\263\250\345\205\245.json" index 656504aed5..2279501802 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\263\250\345\205\245.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \346\263\250\345\205\245.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73380, - "name": "MySQL 注入", + "name": "MySQL \u6ce8\u5165", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 注入", + "name": "MySQL \u6ce8\u5165", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-inject)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78715, "type": "Threshold", "level": 1, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77813, "name": "mysql-inject", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-inject", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-inject", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "server_ip", "role", "machine_type", - "immute_domain", + "cluster_domain", "port", "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-inject", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72045, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-inject)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\345\244\261\350\264\245.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\345\244\261\350\264\245.json" index 034e669554..e71016f61f 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\345\244\261\350\264\245.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\345\244\261\350\264\245.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73363, - "name": "MySQL 连接失败", + "name": "MySQL \u8fde\u63a5\u5931\u8d25", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 连接失败", + "name": "MySQL \u8fde\u63a5\u5931\u8d25", "path": "", "type": "monitor", "items": [ { "name": "COUNT(db-up)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78695, "type": "Threshold", "level": 1, "config": [ @@ -54,25 +31,24 @@ "origin_sql": "", "query_configs": [ { - "id": 77795, "name": "db-up", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.db-up", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.db-up", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], "agg_dimension": [ "server_ip", "port", - "immute_domain", + "cluster_domain", "bk_cloud_id", "machine_type", "role", "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "db-up", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72020, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(db-up)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\225\260\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\225\260\344\275\277\347\224\250\347\216\207.json" index cbcbc16b27..1994d94ca9 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\225\260\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\225\260\344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5614, - "name": "MySQL 连接数使用率", + "name": "MySQL \u8fde\u63a5\u6570\u4f7f\u7528\u7387", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 连接数使用率", + "name": "MySQL \u8fde\u63a5\u6570\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { "name": "100 * AVG(mysql_global_status_threads_connected) / AVG(mysql_global_variables_max_connections)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6151, "type": "Threshold", "level": 3, "config": [ @@ -50,7 +27,6 @@ "unit_prefix": "" }, { - "id": 6152, "type": "Threshold", "level": 2, "config": [ @@ -68,12 +44,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6148, "name": "mysql_global_status_threads_connected", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_sta", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gstatus.mysql_global_status_threads_connected", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_global_status_threads_connected", @@ -83,19 +58,19 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", "data_source_label": "bk_monitor" }, { - "id": 6149, "name": "mysql_global_variables_max_connections", "unit": "", "alias": "b", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gvars.mysql_global_varia", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.gvars.mysql_global_variables_max_connections", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_global_variables_max_connections", @@ -105,7 +80,8 @@ "app", "cluster_domain", "instance_role", - "instance" + "instance", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.gvars", @@ -123,10 +99,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -158,7 +133,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -262,11 +239,9 @@ }, "config_id": 8668, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -315,8 +290,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "\u6570\u636e\u5e93\u8fde\u63a5\u6570\u5e73\u5747\u4f7f\u7528\u7387", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\227\245\345\277\227\350\277\207\345\244\232.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\227\245\345\277\227\350\277\207\345\244\232.json" index e388f5fa1c..79ba955f81 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\227\245\345\277\227\350\277\207\345\244\232.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \350\277\236\346\216\245\346\227\245\345\277\227\350\277\207\345\244\232.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73378, - "name": "MySQL 连接日志过多", + "name": "MySQL \u8fde\u63a5\u65e5\u5fd7\u8fc7\u591a", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 连接日志过多", + "name": "MySQL \u8fde\u63a5\u65e5\u5fd7\u8fc7\u591a", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-connlog-size)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78713, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77811, "name": "mysql-connlog-size", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-connlog-size", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-connlog-size", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -68,11 +44,11 @@ "app_id", "server_ip", "role", - "immute_domain", + "cluster_domain", "machine_type" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-connlog-size", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72043, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-connlog-size)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\205\215\347\275\256\345\274\202\345\270\270.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\205\215\347\275\256\345\274\202\345\270\270.json" index eedf8ea5c1..a617588f58 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\205\215\347\275\256\345\274\202\345\270\270.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\205\215\347\275\256\345\274\202\345\270\270.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73377, - "name": "MySQL 配置异常", + "name": "MySQL \u914d\u7f6e\u5f02\u5e38", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 配置异常", + "name": "MySQL \u914d\u7f6e\u5f02\u5e38", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-config-diff)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78712, "type": "Threshold", "level": 2, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77810, "name": "mysql-config-diff", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-config-diff", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-config-diff", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -68,11 +44,11 @@ "app_id", "server_ip", "role", - "immute_domain", + "cluster_domain", "machine_type" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-config-diff", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72042, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-config-diff)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\224\201\350\241\250.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\224\201\350\241\250.json" index 0e3490ac3f..708c340c87 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\224\201\350\241\250.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\224\201\350\241\250.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73379, - "name": "MySQL 锁表", + "name": "MySQL \u9501\u8868", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 锁表", + "name": "MySQL \u9501\u8868", "path": "", "type": "monitor", "items": [ { "name": "COUNT(mysql-lock)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 78714, "type": "Threshold", "level": 1, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 77812, "name": "mysql-lock", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.mysql-lock", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.mysql-lock", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "server_ip", "role", "machine_type", - "immute_domain", + "cluster_domain", "port", "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "mysql-lock", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72044, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(mysql-lock)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\225\277\347\251\272\351\227\262\344\272\213\345\212\241\346\234\252\345\205\263\351\227\255.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\225\277\347\251\272\351\227\262\344\272\213\345\212\241\346\234\252\345\205\263\351\227\255.json" index ff3890be86..996385a7cd 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\225\277\347\251\272\351\227\262\344\272\213\345\212\241\346\234\252\345\205\263\351\227\255.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/MySQL \351\225\277\347\251\272\351\227\262\344\272\213\345\212\241\346\234\252\345\205\263\351\227\255.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5762, - "name": "MySQL 长空闲事务未关闭", + "name": "MySQL \u957f\u7a7a\u95f2\u4e8b\u52a1\u672a\u5173\u95ed", "db_type": "mysql", "details": { "app": "", - "name": "MySQL 长空闲事务未关闭", + "name": "MySQL \u957f\u7a7a\u95f2\u4e8b\u52a1\u672a\u5173\u95ed", "path": "", "type": "monitor", "items": [ { "name": "AVG(mysql_engine_innodb_trx_idle_time_max)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 6305, "type": "Threshold", "level": 2, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6302, "name": "mysql_engine_innodb_trx_idle_time_max", "unit": "", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.innodbtrx.mysql_engine_i", + "metric_id": "bk_monitor.exporter_dbm_mysqld_exporter.innodbtrx.mysql_engine_innodb_trx_idle_time_max", "agg_method": "AVG", "agg_interval": 60, "metric_field": "mysql_engine_innodb_trx_idle_time_max", @@ -69,7 +45,8 @@ "app", "cluster_domain", "instance", - "instance_role" + "instance_role", + "app_id" ], "data_type_label": "time_series", "result_table_id": "exporter_dbm_mysqld_exporter.innodbtrx", @@ -87,10 +64,9 @@ } ], "labels": [ - "MySQL", - "DBM_MYSQL", + "DBM", "DBM_MYSQL", - "DBM" + "MySQL" ], "notice": { "config": { @@ -122,7 +98,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -226,11 +204,9 @@ }, "config_id": 8816, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +233,12 @@ } ], "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(mysql_engine_innodb_trx_idle_time_max)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition.json b/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition.json new file mode 100644 index 0000000000..738e1142eb --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition.json @@ -0,0 +1,246 @@ +{ + "bk_biz_id": 0, + "name": "Mysql Partition", + "db_type": "mysql", + "details": { + "app": "", + "name": "Mysql Partition", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(partition-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "partition", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.partition", + "agg_method": "COUNT", + "agg_interval": 86400, + "agg_condition": [], + "agg_dimension": [ + "cluster_domain", + "app_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "partition", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_MYSQL", + "MySQL" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "cluster_domain" + ], + "is_enabled": false + } + }, + "config_id": 40899, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 2, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 2 + }, + "recovery_config": { + "check_window": 1, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(partition-dbm_report_channel)", + "version": 1, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition\346\234\215\345\212\241\347\256\241\347\220\206.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition\346\234\215\345\212\241\347\256\241\347\220\206.json" new file mode 100644 index 0000000000..dc09a77267 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Mysql Partition\346\234\215\345\212\241\347\256\241\347\220\206.json" @@ -0,0 +1,244 @@ +{ + "bk_biz_id": 0, + "name": "Mysql Partition\u670d\u52a1\u7ba1\u7406", + "db_type": "mysql", + "details": { + "app": "", + "name": "Mysql Partition\u670d\u52a1\u7ba1\u7406", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(partition_dev-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "partition_dev", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.partition_dev", + "agg_method": "COUNT", + "agg_interval": 10, + "agg_condition": [], + "agg_dimension": [ + "cluster_domain", + "app_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "partition_dev", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_MYSQL", + "MySQL" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 40898, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 1 + }, + "recovery_config": { + "check_window": 10, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(partition_dev-dbm_report_channel)", + "version": 1, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \345\220\216\347\253\257.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \345\220\216\347\253\257.json" index d52747eb41..ab3a643645 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \345\220\216\347\253\257.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \345\220\216\347\253\257.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73669, - "name": "Proxy 后端", + "name": "Proxy \u540e\u7aef", "db_type": "mysql", "details": { "app": "", - "name": "Proxy 后端", + "name": "Proxy \u540e\u7aef", "path": "", "type": "monitor", "items": [ { "name": "COUNT(proxy-backend)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79036, "type": "Threshold", "level": 1, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78127, "name": "proxy-backend", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.proxy-backend", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.proxy-backend", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "role", "port", "machine_type", - "immute_domain", + "cluster_domain", "bk_cloud_id", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "proxy-backend", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72372, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(proxy-backend)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \347\231\275\345\220\215\345\215\225.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \347\231\275\345\220\215\345\215\225.json" index 9b339b8c01..5221856dcd 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \347\231\275\345\220\215\345\215\225.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Proxy \347\231\275\345\220\215\345\215\225.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73670, - "name": "Proxy 白名单", + "name": "Proxy \u767d\u540d\u5355", "db_type": "mysql", "details": { "app": "", - "name": "Proxy 白名单", + "name": "Proxy \u767d\u540d\u5355", "path": "", "type": "monitor", "items": [ { "name": "COUNT(proxy-user-list)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008148 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008149 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79037, "type": "Threshold", "level": 1, "config": [ @@ -54,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78128, "name": "proxy-user-list", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.proxy-user-list", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.proxy-user-list", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -67,12 +43,12 @@ "role", "port", "machine_type", - "immute_domain", + "cluster_domain", "bk_cloud_id", "server_ip" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "proxy-user-list", "data_source_label": "custom" } @@ -86,8 +62,8 @@ } ], "labels": [ - "DBM_MYSQL", - "DBM" + "DBM", + "DBM_MYSQL" ], "notice": { "config": { @@ -120,7 +96,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +201,9 @@ }, "config_id": 72373, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +230,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(proxy-user-list)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" similarity index 83% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" index a0375c0a06..416039811f 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272 CPU \344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5683, - "name": "[Pulsar]-主机 CPU 使用率", + "name": "Pulsar \u4e3b\u673a CPU \u4f7f\u7528\u7387", "db_type": "pulsar", "details": { "app": "", - "name": "[Pulsar]-主机 CPU 使用率", + "name": "Pulsar \u4e3b\u673a CPU \u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(CPU使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008231 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008232 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008233 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(CPU\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6226, "type": "Threshold", "level": 1, "config": [ @@ -54,22 +31,22 @@ "origin_sql": "", "query_configs": [ { - "id": 6222, - "name": "CPU使用率", + "name": "CPU\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.cpu_summary.usage", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", "agg_method": "AVG", "agg_interval": 60, "metric_field": "usage", "agg_condition": [], "agg_dimension": [ "bk_target_cloud_id", - "bk_target_ip" + "bk_target_ip", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.cpu_summary", + "result_table_id": "dbm_system.cpu_summary", "data_source_label": "bk_monitor" } ], @@ -85,9 +62,9 @@ } ], "labels": [ - "Pulsar", + "DBM", "DBM_PULSAR", - "DBM" + "Pulsar" ], "notice": { "config": { @@ -120,7 +97,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -225,11 +201,9 @@ }, "config_id": 8737, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -256,8 +230,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" similarity index 84% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" index b2fabeb740..8ee4d04321 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5680, - "name": "[Pulsar]-主机磁盘IO利用率", + "name": "Pulsar \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "db_type": "pulsar", "details": { "app": "", - "name": "[Pulsar]-主机磁盘IO利用率", + "name": "Pulsar \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(I/O使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008231 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008232 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008233 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6223, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6219, - "name": "I/O使用率", + "name": "I/O\u4f7f\u7528\u7387", "unit": "percentunit", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.io.util", + "metric_id": "bk_monitor.dbm_system.io.util", "agg_method": "AVG", "agg_interval": 60, "metric_field": "util", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.io", + "result_table_id": "dbm_system.io", "data_source_label": "bk_monitor" } ], @@ -86,9 +63,9 @@ } ], "labels": [ - "Pulsar", + "DBM", "DBM_PULSAR", - "DBM" + "Pulsar" ], "notice": { "config": { @@ -121,7 +98,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +202,9 @@ }, "config_id": 8734, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +231,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" similarity index 83% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" index 363cc7a7ca..cfc66862ec 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\243\201\347\233\230\347\251\272\351\227\264\344\275\277\347\224\250\347\216\207.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5681, - "name": "[Pulsar]-主机磁盘空间使用率", + "name": "Pulsar \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "db_type": "pulsar", "details": { "app": "", - "name": "[Pulsar]-主机磁盘空间使用率", + "name": "Pulsar \u4e3b\u673a\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "AVG(磁盘空间使用率)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008231 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008232 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008233 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6224, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6220, - "name": "磁盘空间使用率", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.disk.in_use", + "metric_id": "bk_monitor.dbm_system.disk.in_use", "agg_method": "AVG", "agg_interval": 60, "metric_field": "in_use", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "mount_point" + "mount_point", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.disk", + "result_table_id": "dbm_system.disk", "data_source_label": "bk_monitor" } ], @@ -86,9 +63,9 @@ } ], "labels": [ - "Pulsar", + "DBM", "DBM_PULSAR", - "DBM" + "Pulsar" ], "notice": { "config": { @@ -121,7 +98,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +202,9 @@ }, "config_id": 8735, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +231,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" similarity index 84% rename from "dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" index cf9c7fad18..fd6c800c7d 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[Pulsar]-\344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Pulsar \344\270\273\346\234\272\347\275\221\347\273\234\345\205\245\346\265\201\351\207\217.json" @@ -1,42 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5682, - "name": "[Pulsar]-主机网络入流量", + "name": "Pulsar \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "db_type": "pulsar", "details": { "app": "", - "name": "[Pulsar]-主机网络入流量", + "name": "Pulsar \u4e3b\u673a\u7f51\u7edc\u5165\u6d41\u91cf", "path": "", "type": "monitor", "items": [ { - "name": "AVG(网卡入流量)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008231 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008232 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008233 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "target": [], "functions": [], "algorithms": [ { - "id": 6225, "type": "Threshold", "level": 1, "config": [ @@ -54,12 +31,11 @@ "origin_sql": "", "query_configs": [ { - "id": 6221, - "name": "网卡入流量", + "name": "\u7f51\u5361\u5165\u6d41\u91cf", "unit": "Bps", "alias": "a", "functions": [], - "metric_id": "bk_monitor.system.net.speed_recv", + "metric_id": "bk_monitor.dbm_system.net.speed_recv", "agg_method": "AVG", "agg_interval": 60, "metric_field": "speed_recv", @@ -67,10 +43,11 @@ "agg_dimension": [ "bk_target_ip", "bk_target_cloud_id", - "device_name" + "device_name", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "system.net", + "result_table_id": "dbm_system.net", "data_source_label": "bk_monitor" } ], @@ -86,9 +63,9 @@ } ], "labels": [ - "Pulsar", + "DBM", "DBM_PULSAR", - "DBM" + "Pulsar" ], "notice": { "config": { @@ -121,7 +98,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -226,11 +202,9 @@ }, "config_id": 8736, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -257,8 +231,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(\u7f51\u5361\u5165\u6d41\u91cf)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state error\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.error\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state error\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.error\344\272\213\344\273\266\345\221\212\350\255\246.json" index 8ef8310f5a..1703ad6fa9 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state error\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.error\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73761, - "name": "redis_cluster_state error事件告警", + "name": "Redis cluster_state.error\u4e8b\u4ef6\u544a\u8b66.json", "db_type": "redis", "details": { "app": "", - "name": "redis_cluster_state error事件告警", + "name": "Redis cluster_state.error\u4e8b\u4ef6\u544a\u8b66.json", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_cluster_state)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79143, "type": "Threshold", "level": 1, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78219, "name": "redis_cluster_state", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_cluster_state", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_cluster_state", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -87,10 +55,11 @@ "server_ip", "server_port", "warn_level", - "target" + "target", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_cluster_state", "data_source_label": "custom" } @@ -104,9 +73,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -139,7 +108,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -245,11 +213,9 @@ }, "config_id": 72468, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -276,8 +242,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_cluster_state)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state warn\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.warn\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state warn\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.warn\344\272\213\344\273\266\345\221\212\350\255\246.json" index 82bcb42397..a989477d3c 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_cluster_state warn\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis cluster_state.warn\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73762, - "name": "redis_cluster_state warn事件告警", + "name": "Redis cluster_state.warn\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_cluster_state warn事件告警", + "name": "Redis cluster_state.warn\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_cluster_state)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79144, "type": "Threshold", "level": 2, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78220, "name": "redis_cluster_state", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_cluster_state", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_cluster_state", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -87,10 +55,11 @@ "server_ip", "server_port", "warn_level", - "target" + "target", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_cluster_state", "data_source_label": "custom" } @@ -104,9 +73,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -139,7 +108,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -245,11 +213,9 @@ }, "config_id": 72469, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -276,8 +242,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_cluster_state)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_login\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis login\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_login\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis login\344\272\213\344\273\266\345\221\212\350\255\246.json" index f93db167a7..45b7cb8757 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_login\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis login\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73741, - "name": "redis_login事件告警", + "name": "Redis login\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_login事件告警", + "name": "Redis login\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(REDIS_LOGIN)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79120, "type": "Threshold", "level": 1, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78199, "name": "REDIS_LOGIN", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.REDIS_LOGIN", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.REDIS_LOGIN", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -80,7 +48,7 @@ "target" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "REDIS_LOGIN", "data_source_label": "custom" } @@ -94,9 +62,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -129,7 +97,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -235,11 +202,9 @@ }, "config_id": 72448, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -266,8 +231,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(REDIS_LOGIN)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_persist error\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.error\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_persist error\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.error\344\272\213\344\273\266\345\221\212\350\255\246.json" index f17cb1acd7..fc904da72b 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_persist error\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.error\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73759, - "name": "redis_persist error事件告警", + "name": "Redis persist.error\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_persist error事件告警", + "name": "Redis persist.error\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_persist)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79141, "type": "Threshold", "level": 1, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78217, "name": "redis_persist", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_persist", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_persist", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -87,10 +55,11 @@ "target", "server_ip", "role", - "domain" + "domain", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_persist", "data_source_label": "custom" } @@ -104,9 +73,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -139,7 +108,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -245,11 +213,9 @@ }, "config_id": 72466, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -276,8 +242,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_persist)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_persist warning\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_persist warning\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" index 692ce0f743..c77566ea87 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_persist warning\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis persist.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73760, - "name": "redis_persist warning事件告警", + "name": "Redis persist.warning\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_persist warning事件告警", + "name": "Redis persist.warning\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_persist)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79142, "type": "Threshold", "level": 2, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78218, "name": "redis_persist", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_persist", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_persist", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -87,10 +55,11 @@ "target", "server_ip", "role", - "domain" + "domain", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_persist", "data_source_label": "custom" } @@ -104,9 +73,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -139,7 +108,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -245,11 +213,9 @@ }, "config_id": 72467, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -276,8 +242,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_persist)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/predixy_login\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis predixy.login\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 81% rename from "dbm-ui/backend/db_monitor/tpls/alarm/predixy_login\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis predixy.login\344\272\213\344\273\266\345\221\212\350\255\246.json" index 22562afb76..a093788b84 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/predixy_login\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis predixy.login\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73742, - "name": "predixy_login事件告警", + "name": "Redis predixy.login\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "predixy_login事件告警", + "name": "Redis predixy.login\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(predixy_login)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79121, "type": "Threshold", "level": 1, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78200, "name": "predixy_login", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.predixy_login", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.predixy_login", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [], @@ -77,10 +45,11 @@ "role", "server_ip", "target", - "warn_level" + "warn_level", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "predixy_login", "data_source_label": "custom" } @@ -94,9 +63,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -129,7 +98,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -235,11 +203,9 @@ }, "config_id": 72449, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -266,8 +232,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(predixy_login)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_sync error\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.error\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_sync error\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.error\344\272\213\344\273\266\345\221\212\350\255\246.json" index 1730eb7c1c..d506c7beef 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_sync error\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.error\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73757, - "name": "redis_sync error事件告警", + "name": "Redis sync.error\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_sync error事件告警", + "name": "Redis sync.error\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_sync)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79136, "type": "Threshold", "level": 1, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78215, "name": "redis_sync", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_sync", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_sync", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -86,10 +54,11 @@ "server_ip", "server_port", "domain", - "warn_level" + "warn_level", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_sync", "data_source_label": "custom" } @@ -103,9 +72,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -138,7 +107,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -244,11 +212,9 @@ }, "config_id": 72464, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -275,8 +241,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_sync)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_sync warning\344\272\213\344\273\266\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" similarity index 82% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis_sync warning\344\272\213\344\273\266\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" index 19017d292b..c98309690b 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis_sync warning\344\272\213\344\273\266\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis sync.warning\344\272\213\344\273\266\345\221\212\350\255\246.json" @@ -1,50 +1,19 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 73756, - "name": "redis_sync warning事件告警", + "name": "Redis sync.warning\u4e8b\u4ef6\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis_sync warning事件告警", + "name": "Redis sync.warning\u4e8b\u4ef6\u544a\u8b66", "path": "", "type": "monitor", "items": [ { "name": "COUNT(redis_sync)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "target": [], "functions": [], "algorithms": [ { - "id": 79135, "type": "Threshold", "level": 2, "config": [ @@ -62,11 +31,10 @@ "origin_sql": "", "query_configs": [ { - "id": 78214, "name": "redis_sync", "alias": "a", "functions": [], - "metric_id": "custom.event.{bk_biz_id}_bkmonitor_event_{event_data_id}.redis_sync", + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.redis_sync", "agg_method": "COUNT", "agg_interval": 60, "agg_condition": [ @@ -86,10 +54,11 @@ "server_ip", "server_port", "domain", - "warn_level" + "warn_level", + "app_id" ], "data_type_label": "event", - "result_table_id": "{bk_biz_id}_bkmonitor_event_{event_data_id}", + "result_table_id": "bkmonitor_event_{event_data_id}", "custom_event_name": "redis_sync", "data_source_label": "custom" } @@ -103,9 +72,9 @@ } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -138,7 +107,6 @@ "end_time": "23:59:59", "start_time": "00:00:00", "assign_mode": [ - "only_notice", "by_rule" ], "converge_config": { @@ -244,11 +212,9 @@ }, "config_id": 72463, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -275,8 +241,12 @@ } ], "scenario": "other_rt", - "bk_biz_id": 100465, - "data_source_type": "自定义事件" + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "COUNT(redis_sync)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" similarity index 74% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" index 475cd7d678..261b411afe 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272CPU\344\275\277\347\224\250\347\216\207\345\221\212\350\255\246.json" @@ -1,104 +1,92 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5765, - "name": "redis主机CPU使用率告警", + "name": "Redis \u4e3b\u673aCPU\u4f7f\u7528\u7387\u544a\u8b66", "db_type": "redis", "details": { "app": "", - "name": "redis主机CPU使用率告警", + "name": "Redis \u4e3b\u673aCPU\u4f7f\u7528\u7387\u544a\u8b66", "path": "", "type": "monitor", "items": [ { - "name": "redis主机CPU使用率告警", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "name": "MIN(CPU\u4f7f\u7528\u7387)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", + "functions": [], + "result_table_id": "dbm_system.cpu_summary", + "agg_method": "MIN", + "agg_interval": 60, + "agg_dimension": [ + "app", + "bk_target_ip", + "instance_role", + "cluster_type", + "cluster_domain", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "redis_master" + ], + "method": "eq", + "dimension_name": "dbm_meta instance role" + } + ], + "metric_field": "usage", + "unit": "percent" + } + ], "algorithms": [ { - "id": 6309, "type": "Threshold", "level": 1, "config": [ [ { - "method": "gte", - "threshold": 90 + "threshold": 90, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6310, "type": "Threshold", "level": 2, "config": [ [ { - "method": "gte", - "threshold": 80 + "threshold": 80, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" } - ], - "expression": "a", - "origin_sql": "min(min_over_time(bkmonitor:dbm_system:cpu_summary:usage{instance_role=\"redis_master\"}[1m])) by (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "query_configs": [ - { - "id": 6305, - "alias": "a", - "promql": "min(min_over_time(bkmonitor:dbm_system:cpu_summary:usage{instance_role=\"redis_master\"}[1m])) by (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "functions": [], - "metric_id": "min(min_over_time(bkmonitor:dbm_system:cpu_summary:usage{instanc", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -130,7 +118,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -234,11 +224,9 @@ }, "config_id": 8819, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -287,8 +275,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MIN(CPU\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" similarity index 75% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" index e3b2a6b648..6202811b7f 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\206\205\345\255\230\344\275\277\347\224\250\347\216\207.json" @@ -1,104 +1,92 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5779, - "name": "redis主机内存使用率", + "name": "Redis \u4e3b\u673a\u5185\u5b58\u4f7f\u7528\u7387", "db_type": "redis", "details": { "app": "", - "name": "redis主机内存使用率", + "name": "Redis \u4e3b\u673a\u5185\u5b58\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "redis主机内存使用率", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "name": "MIN(\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u4f7f\u7528\u5360\u6bd4)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.mem.pct_used", + "functions": [], + "result_table_id": "dbm_system.mem", + "agg_method": "MIN", + "agg_interval": 60, + "agg_dimension": [ + "app", + "bk_target_ip", + "instance_role", + "cluster_type", + "cluster_domain", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "redis_master" + ], + "method": "eq", + "dimension_name": "dbm_meta instance role" + } + ], + "metric_field": "pct_used", + "unit": "percent" + } + ], "algorithms": [ { - "id": 6327, "type": "Threshold", - "level": 1, + "level": 2, "config": [ [ { - "method": "gte", - "threshold": 90 + "threshold": 90, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6328, "type": "Threshold", - "level": 2, + "level": 1, "config": [ [ { - "method": "gte", - "threshold": 80 + "threshold": 95, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" } - ], - "expression": "a", - "origin_sql": "min(min_over_time(bkmonitor:dbm_system:mem:pct_used{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "query_configs": [ - { - "id": 6319, - "alias": "a", - "promql": "min(min_over_time(bkmonitor:dbm_system:mem:pct_used{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "functions": [], - "metric_id": "min(min_over_time(bkmonitor:dbm_system:mem:pct_used{instance_rol", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "REDIS", - "DBM_REDIS", + "DBM", "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -130,7 +118,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -234,11 +224,9 @@ }, "config_id": 8833, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -287,8 +275,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MIN(\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u4f7f\u7528\u5360\u6bd4)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-EditLogRoll.json "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" similarity index 76% rename from dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-EditLogRoll.json rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" index 3dc3309ebb..773de25e2d 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-EditLogRoll.json +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" @@ -1,102 +1,92 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5894, - "name": "[HDFS]-EditLogRoll", - "db_type": "hdfs", + "name": "Redis \u4e3b\u673a\u5355\u6838CPU\u4f7f\u7528\u7387", + "db_type": "redis", "details": { "app": "", - "name": "[HDFS]-EditLogRoll", + "name": "Redis \u4e3b\u673a\u5355\u6838CPU\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "MAX(hadoop_namenode_transactions_since_last_checkpoint)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - } - ], - "method": "eq" - } - ] - ], + "name": "MAX(CPU\u5355\u6838\u4f7f\u7528\u7387)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.cpu_detail.usage", + "functions": [], + "result_table_id": "dbm_system.cpu_detail", + "agg_method": "MAX", + "agg_interval": 60, + "agg_dimension": [ + "app", + "bk_target_ip", + "instance_role", + "cluster_type", + "cluster_domain", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "redis_master" + ], + "method": "eq", + "dimension_name": "dbm_meta instance role" + } + ], + "metric_field": "usage", + "unit": "percent" + } + ], "algorithms": [ { - "id": 6467, "type": "Threshold", "level": 2, "config": [ [ { - "method": "gte", - "threshold": 5000000 + "threshold": 80, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6468, "type": "Threshold", "level": 1, "config": [ [ { - "method": "gte", - "threshold": 6000000 + "threshold": 90, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" } - ], - "expression": "a", - "origin_sql": "", - "query_configs": [ - { - "id": 6441, - "name": "hadoop_namenode_transactions_since_last_checkpoint", - "unit": "", - "alias": "a", - "functions": [], - "metric_id": "bk_monitor.exporter_hdfs_exporter.group1.hadoop_namenode_transac", - "agg_method": "MAX", - "agg_interval": 60, - "metric_field": "hadoop_namenode_transactions_since_last_checkpoint", - "agg_condition": [], - "agg_dimension": [ - "bk_target_service_instance_id" - ], - "data_type_label": "time_series", - "result_table_id": "exporter_hdfs_exporter.group1", - "data_source_label": "bk_monitor" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [ - "bk_target_service_instance_id" - ] - } + ] } ], "labels": [ - "HDFS", - "DBM_HDFS", - "DBM_HDFS", - "DBM" + "DBM", + "DBM_REDIS", + "REDIS" ], "notice": { "config": { @@ -118,7 +108,7 @@ } ], "need_poll": true, - "notify_interval": 7200, + "notify_interval": 1800, "interval_notify_mode": "standard" }, "signal": [ @@ -128,7 +118,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -230,21 +222,19 @@ "is_enabled": false } }, - "config_id": 8948, + "config_id": 8836, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { - "level": 2, + "level": 1, "connector": "and", "expression": "", "trigger_config": { - "count": 1, + "count": 2, "uptime": { "calendars": [], "time_ranges": [ @@ -262,11 +252,11 @@ } }, { - "level": 1, + "level": 2, "connector": "and", "expression": "", "trigger_config": { - "count": 1, + "count": 2, "uptime": { "calendars": [], "time_ranges": [ @@ -284,9 +274,13 @@ } } ], - "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "scenario": "os", + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(CPU\u5355\u6838\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" similarity index 75% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" index 17c4404001..72b4f1f120 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230IO\344\275\277\347\224\250\347\216\207.json" @@ -1,104 +1,92 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5781, - "name": "redis主机磁盘IO使用率", + "name": "Redis \u4e3b\u673a\u78c1\u76d8IO\u4f7f\u7528\u7387", "db_type": "redis", "details": { "app": "", - "name": "redis主机磁盘IO使用率", + "name": "Redis \u4e3b\u673a\u78c1\u76d8IO\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "redis主机磁盘IO使用率", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "name": "MIN(I/O\u4f7f\u7528\u7387)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.io.util", + "functions": [], + "result_table_id": "dbm_system.io", + "agg_method": "MIN", + "agg_interval": 60, + "agg_dimension": [ + "app", + "bk_target_ip", + "instance_role", + "cluster_type", + "cluster_domain", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "redis_master" + ], + "method": "eq", + "dimension_name": "dbm_meta instance role" + } + ], + "metric_field": "util", + "unit": "percentunit" + } + ], "algorithms": [ { - "id": 6331, "type": "Threshold", "level": 1, "config": [ [ { - "method": "gte", - "threshold": 90 + "threshold": 90, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6332, "type": "Threshold", "level": 2, "config": [ [ { - "method": "gte", - "threshold": 80 + "threshold": 80, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" } - ], - "expression": "a", - "origin_sql": "min(min_over_time(bkmonitor:dbm_system:io:util{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "query_configs": [ - { - "id": 6321, - "alias": "a", - "promql": "min(min_over_time(bkmonitor:dbm_system:io:util{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "functions": [], - "metric_id": "min(min_over_time(bkmonitor:dbm_system:io:util{instance_role=\"re", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -130,7 +118,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -234,11 +224,9 @@ }, "config_id": 8835, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -287,8 +275,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MIN(I/O\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" similarity index 74% rename from "dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" rename to "dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" index 20a7c892b0..b2096d044f 100644 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Redis \344\270\273\346\234\272\347\243\201\347\233\230\345\256\271\351\207\217\344\275\277\347\224\250\347\216\207.json" @@ -1,104 +1,92 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5780, - "name": "redis主机磁盘容量使用率", + "name": "Redis \u4e3b\u673a\u78c1\u76d8\u5bb9\u91cf\u4f7f\u7528\u7387", "db_type": "redis", "details": { "app": "", - "name": "redis主机磁盘容量使用率", + "name": "Redis \u4e3b\u673a\u78c1\u76d8\u5bb9\u91cf\u4f7f\u7528\u7387", "path": "", "type": "monitor", "items": [ { - "name": "redis主机磁盘容量使用率", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], + "name": "MIN(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "no_data_config": { + "continuous": 10, + "is_enabled": false, + "agg_dimension": [], + "level": 2 + }, + "target": [], + "expression": "a", "functions": [], + "origin_sql": "", + "query_configs": [ + { + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "alias": "a", + "metric_id": "bk_monitor.dbm_system.disk.in_use", + "functions": [], + "result_table_id": "dbm_system.disk", + "agg_method": "MIN", + "agg_interval": 60, + "agg_dimension": [ + "app", + "bk_target_ip", + "instance_role", + "cluster_type", + "cluster_domain", + "bk_target_cloud_id", + "app_id" + ], + "agg_condition": [ + { + "key": "instance_role", + "value": [ + "redis_master" + ], + "method": "eq", + "dimension_name": "dbm_meta instance role" + } + ], + "metric_field": "in_use", + "unit": "percent" + } + ], "algorithms": [ { - "id": 6329, "type": "Threshold", "level": 1, "config": [ [ { - "method": "gte", - "threshold": 90 + "threshold": 90, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6330, "type": "Threshold", "level": 2, "config": [ [ { - "method": "gte", - "threshold": 80 + "threshold": 80, + "method": "gte" } ] ], - "unit_prefix": "" + "unit_prefix": "%" } - ], - "expression": "a", - "origin_sql": "min(min_over_time(bkmonitor:dbm_system:disk:in_use{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "query_configs": [ - { - "id": 6320, - "alias": "a", - "promql": "min(min_over_time(bkmonitor:dbm_system:disk:in_use{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "functions": [], - "metric_id": "min(min_over_time(bkmonitor:dbm_system:disk:in_use{instance_role", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } + ] } ], "labels": [ - "REDIS", + "DBM", "DBM_REDIS", - "DBM_REDIS", - "DBM" + "REDIS" ], "notice": { "config": { @@ -130,7 +118,9 @@ "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], + "assign_mode": [ + "by_rule" + ], "upgrade_config": {}, "converge_config": { "count": 1, @@ -234,11 +224,9 @@ }, "config_id": 8834, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -287,8 +275,12 @@ } ], "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" + "bk_biz_id": "", + "data_source_type": "Prometheus", + "priority": 0 }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MIN(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 2, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Riak Ring Status\351\233\206\347\276\244\347\212\266\346\200\201.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak Ring Status\351\233\206\347\276\244\347\212\266\346\200\201.json" new file mode 100644 index 0000000000..59c4a3d7fe --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak Ring Status\351\233\206\347\276\244\347\212\266\346\200\201.json" @@ -0,0 +1,244 @@ +{ + "bk_biz_id": 0, + "name": "Riak Ring Status\u96c6\u7fa4\u72b6\u6001", + "db_type": "riak", + "details": { + "app": "", + "name": "Riak Ring Status\u96c6\u7fa4\u72b6\u6001", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(riak-ring-status-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "riak-ring-status", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.riak-ring-status", + "agg_method": "COUNT", + "agg_interval": 60, + "agg_condition": [], + "agg_dimension": [ + "cluster_domain", + "app_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "riak-ring-status", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_RIAK", + "RIAK" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 40905, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(riak-ring-status-dbm_report_channel)", + "version": 1, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-CorruptBlocks.json "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" similarity index 79% rename from dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-CorruptBlocks.json rename to "dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" index f435725b6d..8fd9606bf5 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-CorruptBlocks.json +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272 CPU \350\264\237\350\275\275.json" @@ -1,84 +1,66 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5895, - "name": "[HDFS]-CorruptBlocks", - "db_type": "hdfs", + "name": "Riak \u4e3b\u673a CPU \u8d1f\u8f7d", + "db_type": "riak", "details": { "app": "", - "name": "[HDFS]-CorruptBlocks", + "name": "Riak \u4e3b\u673a CPU \u8d1f\u8f7d", "path": "", "type": "monitor", "items": [ { - "name": "AVG(hadoop_namenode_corrupt_blocks)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - } - ], - "method": "eq" - } - ] - ], + "name": "AVG(CPU\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6469, "type": "Threshold", - "level": 2, + "level": 3, "config": [ [ { "method": "gte", - "threshold": 10 + "threshold": 80 } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6470, "type": "Threshold", - "level": 1, + "level": 2, "config": [ [ { "method": "gte", - "threshold": 500 + "threshold": 90 } ] ], - "unit_prefix": "" + "unit_prefix": "%" } ], "expression": "a", "origin_sql": "", "query_configs": [ { - "id": 6442, - "name": "hadoop_namenode_corrupt_blocks", - "unit": "", + "name": "CPU\u4f7f\u7528\u7387", + "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_hdfs_exporter.group1.hadoop_namenode_corrupt", + "metric_id": "bk_monitor.dbm_system.cpu_summary.usage", "agg_method": "AVG", "agg_interval": 60, - "metric_field": "hadoop_namenode_corrupt_blocks", + "metric_field": "usage", "agg_condition": [], "agg_dimension": [ - "bk_target_service_instance_id" + "bk_target_cloud_id", + "bk_target_ip", + "cluster_domain", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "exporter_hdfs_exporter.group1", + "result_table_id": "dbm_system.cpu_summary", "data_source_label": "bk_monitor" } ], @@ -87,16 +69,16 @@ "continuous": 10, "is_enabled": false, "agg_dimension": [ - "bk_target_service_instance_id" + "bk_target_ip", + "bk_target_cloud_id" ] } } ], "labels": [ - "HDFS", - "DBM_HDFS", - "DBM_HDFS", - "DBM" + "DBM", + "DBM_RIAK", + "RIAK" ], "notice": { "config": { @@ -122,14 +104,20 @@ "interval_notify_mode": "standard" }, "signal": [ - "abnormal", - "no_data" + "no_data", + "abnormal" ], "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, "converge_config": { "count": 1, "condition": [ @@ -218,7 +206,9 @@ "converge_func": "collect_alarm" } }, + "chart_image_enabled": true, "exclude_notice_ways": { + "ack": [], "closed": [], "recovered": [] }, @@ -230,17 +220,15 @@ "is_enabled": false } }, - "config_id": 8949, + "config_id": 40900, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { - "level": 2, + "level": 3, "connector": "and", "expression": "", "trigger_config": { @@ -262,7 +250,7 @@ } }, { - "level": 1, + "level": 2, "connector": "and", "expression": "", "trigger_config": { @@ -284,9 +272,14 @@ } } ], - "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "priority": 0, + "scenario": "os", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "AVG(CPU\u4f7f\u7528\u7387)", + "version": 1, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" new file mode 100644 index 0000000000..439fea2236 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \344\270\273\346\234\272\347\243\201\347\233\230IO\345\210\251\347\224\250\347\216\207.json" @@ -0,0 +1,251 @@ +{ + "bk_biz_id": 0, + "name": "Riak \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", + "db_type": "riak", + "details": { + "app": "", + "name": "Riak \u4e3b\u673a\u78c1\u76d8IO\u5229\u7528\u7387", + "path": "", + "type": "monitor", + "items": [ + { + "name": "AVG(I/O\u4f7f\u7528\u7387)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 90 + } + ] + ], + "unit_prefix": "%" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "I/O\u4f7f\u7528\u7387", + "unit": "percentunit", + "alias": "a", + "functions": [], + "metric_id": "bk_monitor.dbm_system.io.util", + "agg_method": "AVG", + "agg_interval": 60, + "metric_field": "util", + "agg_condition": [], + "agg_dimension": [ + "bk_target_ip", + "bk_target_cloud_id", + "device_name", + "cluster_domain", + "app_id" + ], + "data_type_label": "time_series", + "result_table_id": "dbm_system.io", + "data_source_label": "bk_monitor" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [ + "bk_target_ip", + "bk_target_cloud_id" + ] + } + } + ], + "labels": [ + "DBM", + "DBM_RIAK", + "RIAK" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 40902, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "os", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "AVG(I/O\u4f7f\u7528\u7387)", + "version": 1, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Riak \345\223\215\345\272\224\346\205\242\346\210\226\350\200\205\350\256\277\351\227\256\346\213\222\347\273\235.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \345\223\215\345\272\224\346\205\242\346\210\226\350\200\205\350\256\277\351\227\256\346\213\222\347\273\235.json" new file mode 100644 index 0000000000..83c410aad8 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \345\223\215\345\272\224\346\205\242\346\210\226\350\200\205\350\256\277\351\227\256\346\213\222\347\273\235.json" @@ -0,0 +1,252 @@ +{ + "bk_biz_id": 0, + "name": "Riak \u54cd\u5e94\u6162\u6216\u8005\u8bbf\u95ee\u62d2\u7edd", + "db_type": "riak", + "details": { + "app": "", + "name": "Riak \u54cd\u5e94\u6162\u6216\u8005\u8bbf\u95ee\u62d2\u7edd", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(riak-load-health-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "riak-load-health", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.riak-load-health", + "agg_method": "COUNT", + "agg_interval": 60, + "agg_condition": [], + "agg_dimension": [ + "app_id", + "bk_target_ip", + "bk_cloud_id", + "bk_target_service_instance_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "riak-load-health", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_RIAK", + "RIAK" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "app_id", + "cluster_domain", + "bk_cloud_id", + "bk_target_ip", + "bk_target_service_instance_id" + ], + "is_enabled": false + } + }, + "config_id": 40906, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 1 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(riak-load-health-dbm_report_channel)", + "version": 1, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Riak \346\227\245\345\277\227\347\233\221\346\216\247.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \346\227\245\345\277\227\347\233\221\346\216\247.json" new file mode 100644 index 0000000000..994cf5ccbc --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \346\227\245\345\277\227\347\233\221\346\216\247.json" @@ -0,0 +1,247 @@ +{ + "bk_biz_id": 0, + "name": "Riak \u65e5\u5fd7\u76d1\u63a7", + "db_type": "riak", + "details": { + "app": "", + "name": "Riak \u65e5\u5fd7\u76d1\u63a7", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(riak-err-notice-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 2, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "riak-err-notice", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.riak-err-notice", + "agg_method": "COUNT", + "agg_interval": 60, + "agg_condition": [], + "agg_dimension": [ + "app_id", + "cluster_domain", + "bk_cloud_id", + "bk_target_ip", + "bk_target_service_instance_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "riak-err-notice", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_RIAK", + "RIAK" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [], + "is_enabled": false + } + }, + "config_id": 40903, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 2, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 5 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(riak-err-notice-dbm_report_channel)", + "version": 1, + "alert_source": "event" +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-MissingBlocks.json "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" similarity index 77% rename from dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-MissingBlocks.json rename to "dbm-ui/backend/db_monitor/tpls/alarm/Riak \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" index cf6d2e4f83..4d4e5ed4f4 100644 --- a/dbm-ui/backend/db_monitor/tpls/alarm/[HDFS]-MissingBlocks.json +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \347\243\201\347\233\230\347\251\272\351\227\264\345\221\212\350\255\246.json" @@ -1,84 +1,67 @@ { "bk_biz_id": 0, - "monitor_strategy_id": 5898, - "name": "[HDFS]-MissingBlocks", - "db_type": "hdfs", + "name": "Riak \u78c1\u76d8\u7a7a\u95f4\u544a\u8b66", + "db_type": "riak", "details": { "app": "", - "name": "[HDFS]-MissingBlocks", + "name": "Riak \u78c1\u76d8\u7a7a\u95f4\u544a\u8b66", "path": "", "type": "monitor", "items": [ { - "name": "MAX(hadoop_namenode_missing_blocks)", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008157 - } - ], - "method": "eq" - } - ] - ], + "name": "MAX(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "target": [], "functions": [], "algorithms": [ { - "id": 6473, "type": "Threshold", "level": 1, "config": [ [ { "method": "gte", - "threshold": 500 + "threshold": 80 } ] ], - "unit_prefix": "" + "unit_prefix": "%" }, { - "id": 6474, "type": "Threshold", "level": 2, "config": [ [ { "method": "gte", - "threshold": 10 + "threshold": 70 } ] ], - "unit_prefix": "" + "unit_prefix": "%" } ], "expression": "a", "origin_sql": "", "query_configs": [ { - "id": 6445, - "name": "hadoop_namenode_missing_blocks", - "unit": "", + "name": "\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387", + "unit": "percent", "alias": "a", "functions": [], - "metric_id": "bk_monitor.exporter_hdfs_exporter.group1.hadoop_namenode_missing", + "metric_id": "bk_monitor.dbm_system.disk.in_use", "agg_method": "MAX", "agg_interval": 60, - "metric_field": "hadoop_namenode_missing_blocks", + "metric_field": "in_use", "agg_condition": [], "agg_dimension": [ - "bk_target_service_instance_id" + "bk_target_ip", + "bk_target_cloud_id", + "mount_point", + "cluster_domain", + "app_id" ], "data_type_label": "time_series", - "result_table_id": "exporter_hdfs_exporter.group1", + "result_table_id": "dbm_system.disk", "data_source_label": "bk_monitor" } ], @@ -87,16 +70,16 @@ "continuous": 10, "is_enabled": false, "agg_dimension": [ - "bk_target_service_instance_id" + "bk_target_ip", + "bk_target_cloud_id" ] } } ], "labels": [ - "HDFS", - "DBM_HDFS", - "DBM_HDFS", - "DBM" + "DBM", + "DBM_RIAK", + "RIAK" ], "notice": { "config": { @@ -104,17 +87,17 @@ { "signal": "abnormal", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" }, { "signal": "recovered", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" }, { "signal": "closed", "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" } ], "need_poll": true, @@ -122,14 +105,20 @@ "interval_notify_mode": "standard" }, "signal": [ - "abnormal", - "no_data" + "no_data", + "abnormal" ], "options": { "end_time": "23:59:59", "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 86400 + }, "converge_config": { "count": 1, "condition": [ @@ -218,7 +207,9 @@ "converge_func": "collect_alarm" } }, + "chart_image_enabled": true, "exclude_notice_ways": { + "ack": [], "closed": [], "recovered": [] }, @@ -230,13 +221,11 @@ "is_enabled": false } }, - "config_id": 8952, + "config_id": 40901, "relate_type": "NOTICE", - "user_groups": [ - 0 - ] + "user_groups": [] }, - "source": "bkmonitorv3", + "source": "dbm", "actions": [], "detects": [ { @@ -284,9 +273,14 @@ } } ], - "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "监控采集指标" + "priority": 0, + "scenario": "os", + "bk_biz_id": "", + "data_source_type": "\u76d1\u63a7\u91c7\u96c6\u6307\u6807", + "priority_group_key": "" }, - "is_enabled": true -} + "is_enabled": true, + "monitor_indicator": "MAX(\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u7387)", + "version": 1, + "alert_source": "time_series" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/Riak \350\277\236\346\216\245\345\244\261\350\264\245.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \350\277\236\346\216\245\345\244\261\350\264\245.json" new file mode 100644 index 0000000000..437175e7d8 --- /dev/null +++ "b/dbm-ui/backend/db_monitor/tpls/alarm/Riak \350\277\236\346\216\245\345\244\261\350\264\245.json" @@ -0,0 +1,252 @@ +{ + "bk_biz_id": 0, + "name": "Riak \u8fde\u63a5\u5931\u8d25", + "db_type": "riak", + "details": { + "app": "", + "name": "Riak \u8fde\u63a5\u5931\u8d25", + "path": "", + "type": "monitor", + "items": [ + { + "name": "COUNT(riak-db-up-dbm_report_channel)", + "target": [], + "functions": [], + "algorithms": [ + { + "type": "Threshold", + "level": 1, + "config": [ + [ + { + "method": "gte", + "threshold": 1 + } + ] + ], + "unit_prefix": "" + } + ], + "expression": "a", + "origin_sql": "", + "query_configs": [ + { + "name": "riak-db-up", + "alias": "a", + "functions": [], + "metric_id": "custom.event.bkmonitor_event_{event_data_id}.riak-db-up", + "agg_method": "COUNT", + "agg_interval": 60, + "agg_condition": [], + "agg_dimension": [ + "app_id", + "cluster_domain", + "bk_cloud_id", + "bk_target_ip", + "bk_target_service_instance_id" + ], + "data_type_label": "event", + "result_table_id": "bkmonitor_event_{event_data_id}", + "custom_event_name": "riak-db-up", + "data_source_label": "custom" + } + ], + "no_data_config": { + "level": 2, + "continuous": 10, + "is_enabled": false, + "agg_dimension": [] + } + } + ], + "labels": [ + "DBM", + "DBM_RIAK", + "RIAK" + ], + "notice": { + "config": { + "template": [ + { + "signal": "abnormal", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "recovered", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + }, + { + "signal": "closed", + "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", + "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.assign_detail}}\n{{content.related_info}}" + } + ], + "need_poll": true, + "notify_interval": 7200, + "interval_notify_mode": "standard" + }, + "signal": [ + "no_data", + "abnormal" + ], + "options": { + "end_time": "23:59:59", + "start_time": "00:00:00", + "assign_mode": [ + "by_rule" + ], + "upgrade_config": { + "is_enabled": false, + "user_groups": [], + "upgrade_interval": 1440 + }, + "converge_config": { + "count": 1, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "strategy_id" + }, + { + "value": [ + "self" + ], + "dimension": "dimensions" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + }, + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + } + ], + "timedelta": 60, + "is_enabled": true, + "converge_func": "collect", + "need_biz_converge": true, + "sub_converge_config": { + "count": 2, + "condition": [ + { + "value": [ + "self" + ], + "dimension": "bk_biz_id" + }, + { + "value": [ + "self" + ], + "dimension": "notice_receiver" + }, + { + "value": [ + "self" + ], + "dimension": "notice_way" + }, + { + "value": [ + "self" + ], + "dimension": "alert_level" + }, + { + "value": [ + "self" + ], + "dimension": "signal" + } + ], + "timedelta": 60, + "converge_func": "collect_alarm" + } + }, + "chart_image_enabled": true, + "exclude_notice_ways": { + "ack": [], + "closed": [], + "recovered": [] + }, + "noise_reduce_config": { + "unit": "percent", + "count": 10, + "timedelta": 5, + "dimensions": [ + "app_id", + "bk_cloud_id", + "bk_target_ip", + "bk_target_service_instance_id" + ], + "is_enabled": false + } + }, + "config_id": 40931, + "relate_type": "NOTICE", + "user_groups": [] + }, + "source": "dbm", + "actions": [], + "detects": [ + { + "level": 1, + "connector": "and", + "expression": "", + "trigger_config": { + "count": 1, + "uptime": { + "calendars": [], + "time_ranges": [ + { + "end": "23:59", + "start": "00:00" + } + ] + }, + "check_window": 1 + }, + "recovery_config": { + "check_window": 5, + "status_setter": "recovery" + } + } + ], + "priority": 0, + "scenario": "component", + "bk_biz_id": "", + "data_source_type": "\u81ea\u5b9a\u4e49\u4e8b\u4ef6", + "priority_group_key": "8fc5d015c4b4004b" + }, + "is_enabled": true, + "monitor_indicator": "COUNT(riak-db-up-dbm_report_channel)", + "version": 2, + "alert_source": "event" +} \ No newline at end of file diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\213\222\347\273\235.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\213\222\347\273\235.json" deleted file mode 100644 index 22e127ca70..0000000000 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\345\206\231\346\213\222\347\273\235.json" +++ /dev/null @@ -1,251 +0,0 @@ -{ - "bk_biz_id": 0, - "monitor_strategy_id": 5674, - "name": "[ES]-写拒绝", - "db_type": "es", - "details": { - "app": "", - "name": "[ES]-写拒绝", - "path": "", - "type": "monitor", - "items": [ - { - "name": "[ES]-写拒绝", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], - "functions": [], - "algorithms": [ - { - "id": 6217, - "type": "Threshold", - "level": 1, - "config": [ - [ - { - "method": "gt", - "threshold": 100 - } - ] - ], - "unit_prefix": "" - } - ], - "expression": "a", - "origin_sql": "max by(bk_target_service_instance_id, app, cluster_name, name) (bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_rejected_coun{type=\"write\"})", - "query_configs": [ - { - "id": 6213, - "name": "", - "alias": "a", - "promql": "max by(bk_target_service_instance_id, app, cluster_name, name) (bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_rejected_coun{type=\"write\"})", - "functions": [], - "metric_id": "max by(bk_target_service_instance_id, app, cluster_name, name) (", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } - } - ], - "labels": [ - "ES", - "DBM_ES", - "DBM_ES", - "DBM" - ], - "notice": { - "config": { - "template": [ - { - "signal": "abnormal", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "recovered", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "closed", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - } - ], - "need_poll": true, - "notify_interval": 7200, - "interval_notify_mode": "standard" - }, - "signal": [ - "abnormal", - "no_data" - ], - "options": { - "end_time": "23:59:59", - "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, - "converge_config": { - "count": 1, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "strategy_id" - }, - { - "value": [ - "self" - ], - "dimension": "dimensions" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - }, - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - } - ], - "timedelta": 60, - "is_enabled": true, - "converge_func": "collect", - "need_biz_converge": true, - "sub_converge_config": { - "count": 2, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - } - ], - "timedelta": 60, - "converge_func": "collect_alarm" - } - }, - "exclude_notice_ways": { - "closed": [], - "recovered": [] - }, - "noise_reduce_config": { - "unit": "percent", - "count": 10, - "timedelta": 5, - "dimensions": [], - "is_enabled": false - } - }, - "config_id": 8728, - "relate_type": "NOTICE", - "user_groups": [ - 0 - ] - }, - "source": "bkmonitorv3", - "actions": [], - "detects": [ - { - "level": 1, - "connector": "and", - "expression": "", - "trigger_config": { - "count": 1, - "uptime": { - "calendars": [], - "time_ranges": [ - { - "end": "23:59", - "start": "00:00" - } - ] - }, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5, - "status_setter": "recovery" - } - } - ], - "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" - }, - "is_enabled": true -} diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\346\220\234\347\264\242\346\213\222\347\273\235.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\346\220\234\347\264\242\346\213\222\347\273\235.json" deleted file mode 100644 index dd8d774e3e..0000000000 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/[ES]-\346\220\234\347\264\242\346\213\222\347\273\235.json" +++ /dev/null @@ -1,251 +0,0 @@ -{ - "bk_biz_id": 0, - "monitor_strategy_id": 5675, - "name": "[ES]-搜索拒绝", - "db_type": "es", - "details": { - "app": "", - "name": "[ES]-搜索拒绝", - "path": "", - "type": "monitor", - "items": [ - { - "name": "[ES]-搜索拒绝", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008154 - } - ], - "method": "eq" - } - ] - ], - "functions": [], - "algorithms": [ - { - "id": 6218, - "type": "Threshold", - "level": 1, - "config": [ - [ - { - "method": "gt", - "threshold": 100 - } - ] - ], - "unit_prefix": "" - } - ], - "expression": "a", - "origin_sql": "max by(bk_target_service_instance_id, app, cluster_name, name) (bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_rejected_count{type=\"search\"})", - "query_configs": [ - { - "id": 6214, - "name": "", - "alias": "a", - "promql": "max by(bk_target_service_instance_id, app, cluster_name, name) (bkmonitor:exporter_dbm_elasticsearch_exporter:group6:elasticsearch_thread_pool_rejected_count{type=\"search\"})", - "functions": [], - "metric_id": "max by(bk_target_service_instance_id, app, cluster_name, name) (", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } - } - ], - "labels": [ - "ES", - "DBM_ES", - "DBM_ES", - "DBM" - ], - "notice": { - "config": { - "template": [ - { - "signal": "abnormal", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "recovered", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "closed", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - } - ], - "need_poll": true, - "notify_interval": 7200, - "interval_notify_mode": "standard" - }, - "signal": [ - "abnormal", - "no_data" - ], - "options": { - "end_time": "23:59:59", - "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, - "converge_config": { - "count": 1, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "strategy_id" - }, - { - "value": [ - "self" - ], - "dimension": "dimensions" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - }, - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - } - ], - "timedelta": 60, - "is_enabled": true, - "converge_func": "collect", - "need_biz_converge": true, - "sub_converge_config": { - "count": 2, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - } - ], - "timedelta": 60, - "converge_func": "collect_alarm" - } - }, - "exclude_notice_ways": { - "closed": [], - "recovered": [] - }, - "noise_reduce_config": { - "unit": "percent", - "count": 10, - "timedelta": 5, - "dimensions": [], - "is_enabled": false - } - }, - "config_id": 8729, - "relate_type": "NOTICE", - "user_groups": [ - 0 - ] - }, - "source": "bkmonitorv3", - "actions": [], - "detects": [ - { - "level": 1, - "connector": "and", - "expression": "", - "trigger_config": { - "count": 1, - "uptime": { - "calendars": [], - "time_ranges": [ - { - "end": "23:59", - "start": "00:00" - } - ] - }, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5, - "status_setter": "recovery" - } - } - ], - "scenario": "component", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" - }, - "is_enabled": true -} diff --git "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" "b/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" deleted file mode 100644 index 8b74150c00..0000000000 --- "a/dbm-ui/backend/db_monitor/tpls/alarm/redis\344\270\273\346\234\272\345\215\225\346\240\270CPU\344\275\277\347\224\250\347\216\207.json" +++ /dev/null @@ -1,294 +0,0 @@ -{ - "bk_biz_id": 0, - "monitor_strategy_id": 5782, - "name": "redis主机单核CPU使用率", - "db_type": "redis", - "details": { - "app": "", - "name": "redis主机单核CPU使用率", - "path": "", - "type": "monitor", - "items": [ - { - "name": "redis主机单核CPU使用率", - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "set", - "bk_inst_id": 2000008150 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008151 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008152 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008153 - }, - { - "bk_obj_id": "set", - "bk_inst_id": 2000008230 - } - ], - "method": "eq" - } - ] - ], - "functions": [], - "algorithms": [ - { - "id": 6333, - "type": "Threshold", - "level": 1, - "config": [ - [ - { - "method": "gte", - "threshold": 90 - } - ] - ], - "unit_prefix": "" - }, - { - "id": 6334, - "type": "Threshold", - "level": 2, - "config": [ - [ - { - "method": "gte", - "threshold": 80 - } - ] - ], - "unit_prefix": "" - } - ], - "expression": "a", - "origin_sql": "min(max_over_time(bkmonitor:dbm_system:cpu_detail:usage{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "query_configs": [ - { - "id": 6322, - "alias": "a", - "promql": "min(max_over_time(bkmonitor:dbm_system:cpu_detail:usage{instance_role=\"redis_master\"}[1m])) \nby (bk_target_cloud_id,app,cluster_domain,instance_role,cluster_type,bk_target_ip)", - "functions": [], - "metric_id": "min(max_over_time(bkmonitor:dbm_system:cpu_detail:usage{instance", - "agg_interval": 60, - "data_type_label": "time_series", - "data_source_label": "prometheus" - } - ], - "no_data_config": { - "level": 2, - "continuous": 10, - "is_enabled": false, - "agg_dimension": [] - } - } - ], - "labels": [ - "REDIS", - "DBM_REDIS", - "DBM_REDIS", - "DBM" - ], - "notice": { - "config": { - "template": [ - { - "signal": "abnormal", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "recovered", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - }, - { - "signal": "closed", - "title_tmpl": "{{business.bk_biz_name}} - {{alarm.name}}{{alarm.display_type}}", - "message_tmpl": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}" - } - ], - "need_poll": true, - "notify_interval": 1800, - "interval_notify_mode": "standard" - }, - "signal": [ - "abnormal", - "no_data" - ], - "options": { - "end_time": "23:59:59", - "start_time": "00:00:00", - "assign_mode": [], - "upgrade_config": {}, - "converge_config": { - "count": 1, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "strategy_id" - }, - { - "value": [ - "self" - ], - "dimension": "dimensions" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - }, - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - } - ], - "timedelta": 60, - "is_enabled": true, - "converge_func": "collect", - "need_biz_converge": true, - "sub_converge_config": { - "count": 2, - "condition": [ - { - "value": [ - "self" - ], - "dimension": "bk_biz_id" - }, - { - "value": [ - "self" - ], - "dimension": "notice_receiver" - }, - { - "value": [ - "self" - ], - "dimension": "notice_way" - }, - { - "value": [ - "self" - ], - "dimension": "alert_level" - }, - { - "value": [ - "self" - ], - "dimension": "signal" - } - ], - "timedelta": 60, - "converge_func": "collect_alarm" - } - }, - "exclude_notice_ways": { - "closed": [], - "recovered": [] - }, - "noise_reduce_config": { - "unit": "percent", - "count": 10, - "timedelta": 5, - "dimensions": [], - "is_enabled": false - } - }, - "config_id": 8836, - "relate_type": "NOTICE", - "user_groups": [ - 0 - ] - }, - "source": "bkmonitorv3", - "actions": [], - "detects": [ - { - "level": 1, - "connector": "and", - "expression": "", - "trigger_config": { - "count": 2, - "uptime": { - "calendars": [], - "time_ranges": [ - { - "end": "23:59", - "start": "00:00" - } - ] - }, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5, - "status_setter": "recovery" - } - }, - { - "level": 2, - "connector": "and", - "expression": "", - "trigger_config": { - "count": 2, - "uptime": { - "calendars": [], - "time_ranges": [ - { - "end": "23:59", - "start": "00:00" - } - ] - }, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5, - "status_setter": "recovery" - } - } - ], - "scenario": "os", - "bk_biz_id": 2005000194, - "data_source_type": "Prometheus" - }, - "is_enabled": true -} diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_bkpull.json b/dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_bkpull.json deleted file mode 100644 index 815f39fb6b..0000000000 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_bkpull.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "bk_biz_id": 0, - "plugin_id": "dbm_kafka_bkpull", - "db_type": "kafka", - "details": { - "name": "dbm_kafka_bkpull", - "label": "component", - "params": { - "plugin": { - "服务实例维度注入": { - "app": "app", - "instance": "instance", - "cluster_name": "cluster_name", - "cluster_type": "cluster_type", - "instance_host": "instance_host", - "instance_port": "instance_port", - "instance_role": "instance_role", - "cluster_domain": "cluster_domain" - } - }, - "collector": { - "period": 60, - "timeout": 60, - "password": "", - "username": "", - "metrics_url": "http://localhost:7071" - }, - "target_node_type": "TOPO", - "target_object_type": "SERVICE" - }, - "plugin_info": { - "plugin_id": "dbm_kafka_bkpull", - "metric_json": [], - "plugin_type": "Pushgateway", - "os_type_list": [ - "linux", - "windows", - "linux_aarch64" - ] - }, - "collect_type": "Pushgateway", - "target_nodes": [], - "target_node_type": "TOPO", - "target_object_type": "SERVICE" - } -} diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.es.dbm_elasticsearch_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/es.dbm_elasticsearch_exporter.es.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.es.dbm_elasticsearch_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/es.dbm_elasticsearch_exporter.es.json index 770ace9e71..782d3e18e9 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.es.dbm_elasticsearch_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/es.dbm_elasticsearch_exporter.es.json @@ -1,20 +1,23 @@ { "bk_biz_id": 0, "plugin_id": "dbm_elasticsearch_exporter", + "name": "dbm_elasticsearch_exporter", "db_type": "es", + "short_name": "es", "details": { "name": "dbm_elasticsearch_exporter", "label": "component", "params": { "plugin": { "--es.all": "", - "--es.uri": "http://{{ target.host.bk_host_innerip }}:{{ target.process[\"java\"].bind_info[0].port }}", + "--es.uri": "http://{{ target.host.bk_host_innerip }}:{{ target.service.labels[\"instance_port\"] }}", "--es.shards": "", "--es.indices": "", "--es.timeout": "30s", "--web.listen-address": "${host}:${port}", - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", + "bk_app_code": "app_id", "instance": "instance", "cluster_name": "cluster_name", "cluster_type": "cluster_type", @@ -534,7 +537,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group1", - "table_desc": "分组1", + "table_desc": "\u5206\u7ec41", "table_name": "Group1" }, { @@ -2399,7 +2402,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group2", - "table_desc": "分组2", + "table_desc": "\u5206\u7ec42", "table_name": "Group2" }, { @@ -2566,7 +2569,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group3", - "table_desc": "分组3", + "table_desc": "\u5206\u7ec43", "table_name": "Group3" }, { @@ -2753,7 +2756,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group4", - "table_desc": "分组4", + "table_desc": "\u5206\u7ec44", "table_name": "Group4" }, { @@ -2920,7 +2923,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group5", - "table_desc": "分组5", + "table_desc": "\u5206\u7ec45", "table_name": "Group5" }, { @@ -3167,7 +3170,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group6", - "table_desc": "分组6", + "table_desc": "\u5206\u7ec46", "table_name": "Group6" }, { @@ -3294,7 +3297,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group7", - "table_desc": "分组7", + "table_desc": "\u5206\u7ec47", "table_name": "Group7" }, { @@ -3441,7 +3444,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group8", - "table_desc": "分组8", + "table_desc": "\u5206\u7ec48", "table_name": "Group8" }, { @@ -3608,7 +3611,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group9", - "table_desc": "分组9", + "table_desc": "\u5206\u7ec49", "table_name": "Group9" }, { @@ -3724,7 +3727,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group10", - "table_desc": "分组10", + "table_desc": "\u5206\u7ec410", "table_name": "Group10" }, { @@ -4840,7 +4843,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group11", - "table_desc": "分组11", + "table_desc": "\u5206\u7ec411", "table_name": "Group11" }, { @@ -4903,7 +4906,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group12", - "table_desc": "分组12", + "table_desc": "\u5206\u7ec412", "table_name": "Group12" }, { @@ -4966,7 +4969,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group13", - "table_desc": "分组13", + "table_desc": "\u5206\u7ec413", "table_name": "Group13" }, { @@ -5018,7 +5021,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group14", - "table_desc": "分组14", + "table_desc": "\u5206\u7ec414", "table_name": "Group14" }, { @@ -5059,7 +5062,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group15", - "table_desc": "分组15", + "table_desc": "\u5206\u7ec415", "table_name": "Group15" }, { @@ -5102,7 +5105,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group16", - "table_desc": "分组16", + "table_desc": "\u5206\u7ec416", "table_name": "Group16" }, { @@ -5145,7 +5148,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group17", - "table_desc": "分组17", + "table_desc": "\u5206\u7ec417", "table_name": "Group17" }, { @@ -5175,7 +5178,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group18", - "table_desc": "分组18", + "table_desc": "\u5206\u7ec418", "table_name": "Group18" }, { @@ -5205,7 +5208,7 @@ } ], "table_id": "exporter_dbm_elasticsearch_exporter.Group19", - "table_desc": "分组19", + "table_desc": "\u5206\u7ec419", "table_name": "Group19" } ], @@ -5218,5 +5221,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 2 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.hdfs.dbm_hdfs_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/hdfs.dbm_hdfs_exporter.hdfs.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.hdfs.dbm_hdfs_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/hdfs.dbm_hdfs_exporter.hdfs.json index 56c87b76d3..01161ac790 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.hdfs.dbm_hdfs_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/hdfs.dbm_hdfs_exporter.hdfs.json @@ -1,7 +1,9 @@ { "bk_biz_id": 0, "plugin_id": "dbm_hdfs_exporter", + "name": "dbm_hdfs_exporter", "db_type": "hdfs", + "short_name": "hdfs", "details": { "name": "dbm_hdfs_exporter", "label": "component", @@ -12,9 +14,10 @@ "-jmx.http.port": "{{ target.service.labels[\"jmx_http_port\"] }}", "-component.rpc.port": "{{ target.service.labels[\"rpc_port\"] }}", "-web.listen.address": "${host}:${port}", - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", + "bk_app_code": "app_id", "cluster_name": "cluster_name", "cluster_type": "cluster_type", "instance_host": "instance_host", @@ -26,11 +29,8 @@ "collector": { "host": "127.0.0.1", "port": "9070", - "period": 60, - "timeout": 60 - }, - "target_node_type": "TOPO", - "target_object_type": "SERVICE" + "period": 60 + } }, "plugin_info": { "plugin_id": "dbm_hdfs_exporter", @@ -1986,7 +1986,7 @@ } ], "table_id": "exporter_dbm_hdfs_exporter.Group1", - "table_desc": "分组1", + "table_desc": "\u5206\u7ec41", "table_name": "Group1" }, { @@ -2016,7 +2016,7 @@ } ], "table_id": "exporter_dbm_hdfs_exporter.Group2", - "table_desc": "分组2", + "table_desc": "\u5206\u7ec42", "table_name": "Group2" }, { @@ -2046,7 +2046,7 @@ } ], "table_id": "exporter_dbm_hdfs_exporter.Group3", - "table_desc": "分组3", + "table_desc": "\u5206\u7ec43", "table_name": "Group3" } ], @@ -2059,5 +2059,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.influxdb.dbm_influxdb_bkpull.json b/dbm-ui/backend/db_monitor/tpls/collect/influxdb.dbm_influxdb_bkpull.influxdb.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.influxdb.dbm_influxdb_bkpull.json rename to dbm-ui/backend/db_monitor/tpls/collect/influxdb.dbm_influxdb_bkpull.influxdb.json index 0b7f6a3f55..fac1645888 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.influxdb.dbm_influxdb_bkpull.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/influxdb.dbm_influxdb_bkpull.influxdb.json @@ -1,31 +1,31 @@ { "bk_biz_id": 0, "plugin_id": "dbm_influxdb_bkpull", + "name": "dbm_influxdb_bkpull", "db_type": "influxdb", + "short_name": "influxdb", "details": { "name": "dbm_influxdb_bkpull", "label": "component", "params": { "plugin": { - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "db_group": "db_group", "instance": "instance", "bk_app_code": "app_id", "cluster_name": "cluster_name", "instance_host": "instance_host", - "instance_port": "instance_port" + "instance_port": "instance_port", + "cluster_domain": "cluster_domain" } }, "collector": { "period": 60, - "timeout": 60, - "password": "", - "username": "", + "password": false, + "bk_username": "", "metrics_url": "http://127.0.0.1:9274/metrics" - }, - "target_node_type": "TOPO", - "target_object_type": "SERVICE" + } }, "plugin_info": { "plugin_id": "dbm_influxdb_bkpull", @@ -2737,7 +2737,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group1", - "table_desc": "分组1", + "table_desc": "\u5206\u7ec41", "table_name": "Group1" }, { @@ -2936,7 +2936,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group2", - "table_desc": "分组2", + "table_desc": "\u5206\u7ec42", "table_name": "Group2" }, { @@ -3214,7 +3214,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group3", - "table_desc": "分组3", + "table_desc": "\u5206\u7ec43", "table_name": "Group3" }, { @@ -4717,7 +4717,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group4", - "table_desc": "分组4", + "table_desc": "\u5206\u7ec44", "table_name": "Group4" }, { @@ -4890,7 +4890,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group5", - "table_desc": "分组5", + "table_desc": "\u5206\u7ec45", "table_name": "Group5" }, { @@ -5491,7 +5491,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group6", - "table_desc": "分组6", + "table_desc": "\u5206\u7ec46", "table_name": "Group6" }, { @@ -5778,7 +5778,7 @@ } ], "table_id": "pushgateway_dbm_influxdb_bkpull.Group7", - "table_desc": "分组7", + "table_desc": "\u5206\u7ec47", "table_name": "Group7" } ], @@ -5793,5 +5793,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 2 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_bkpull.kafka.json b/dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_bkpull.kafka.json new file mode 100644 index 0000000000..f8cfad67d8 --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_bkpull.kafka.json @@ -0,0 +1,2584 @@ +{ + "bk_biz_id": 0, + "plugin_id": "dbm_kafka_bkpull", + "name": "dbm_kafka_bkpull", + "db_type": "kafka", + "short_name": "kafka", + "details": { + "name": "dbm_kafka_bkpull", + "label": "component", + "params": { + "plugin": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { + "app": "app", + "instance": "instance", + "bk_app_code": "app_id", + "cluster_name": "cluster_name", + "cluster_type": "cluster_type", + "instance_host": "instance_host", + "instance_port": "instance_port", + "instance_role": "instance_role", + "cluster_domain": "cluster_domain" + } + }, + "collector": { + "period": 60, + "password": false, + "bk_username": "", + "metrics_url": "http://localhost:7071" + } + }, + "plugin_info": { + "plugin_id": "dbm_kafka_bkpull", + "metric_json": [ + { + "fields": [ + { + "name": "kafka_controller_controllerchannelmanager_requestrateandqueuetimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerchannelmanager_requestrateandqueuetimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerchannelmanager_queuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "__name", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "name", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "jvm_memory_objects_pending_finalization", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_bytes_used", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_bytes_committed", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_bytes_max", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_bytes_init", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_bytes_used", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_bytes_committed", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_bytes_max", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_bytes_init", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_collection_used_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_collection_committed_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_collection_max_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_collection_init_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_transaction_transactionmarkerchannelmanager_unknowndestinationqueuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicuncleanleaderelectionenablerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleanermanager_max_dirty_percent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_producemessageconversions_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicafetchermanager_minfetchrate", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_invalidoffsetorsequencerecords_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_replicascount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_totaltimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicdeletionrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_globalpartitioncount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_requestbytes_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_kafkaserver_yammer_metrics_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeeperexpires_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroupsstable", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_messageconversionstimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_leaderandisrresponsereceivedrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_partitionreassignmentrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_delayedoperationpurgatory_numdelayedoperations", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_throttletimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleanermanager_uncleanable_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_socketserver_networkprocessoravgidlepercent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleaner_max_clean_time_secs", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_uncleanleaderelections_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_socketserver_memorypoolavailable", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllereventmanager_eventqueuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetchsessioncache_numincrementalfetchsessions", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_topicstodeletecount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_messagesin_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controllershutdownrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_logdirchangerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_insyncreplicascount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_bytesout_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_processor_idlepercent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicafetchermanager_maxlag", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_remotetimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicaalterlogdirsmanager_maxlag", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_underminisrpartitioncount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numoffsets", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_utils_throttler_cleaner_io_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicchangerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetchsessioncache_incrementalfetchsessionevictions_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_offlinereplicacount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroupsdead", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeeperdisconnects_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_activecontrollercount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_acceptor_acceptorblockedpercent_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_leaderelectionrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controlledshutdownrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_totalfetchrequests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_preferredreplicaimbalancecount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_zookeeperclientmetrics_zookeeperrequestlatencyms_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_uncleanleaderelectionenablerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicdeletionrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controlledshutdownrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_invalidmagicnumberrecords_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_failedisrupdates_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_offlinepartitionscount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_invalidmessagecrcrecords_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleanermanager_time_since_last_run_ms", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_totaltimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_requestqueuetimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_responsequeuetimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_uncleanleaderelectionenablerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_messageconversionstimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_errors_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_kafkaserver_brokerstate", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controllerchangerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleaner_max_buffer_utilization_percent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_globaltopiccount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_failedproducerequests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleanermanager_uncleanable_partitions_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_failedfetchrequests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetchsessioncache_numincrementalfetchpartitionscached", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeepersaslauthentications_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_zookeeperclientmetrics_zookeeperrequestlatencyms", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_log_logendoffset", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_requestbytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetcherstats_requests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_replicasineligibletodeletecount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleaner_deadthreadcount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_temporarymemorybytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controllershutdownrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroupscompletingrebalance", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_leaderandisrresponsereceivedrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicaalterlogdirsmanager_minfetchrate", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_laststableoffsetlag", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_totalproducerequests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_underreplicatedpartitions", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_localtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllereventmanager_eventqueuetimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_responsequeuetimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_socketserver_memorypoolused", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicaalterlogdirsmanager_deadthreadcount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_socketserver_controlplaneexpiredconnectionskilledcount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_underminisr", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleaner_cleaner_recopy_percent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_delayedoperationpurgatory_purgatorysize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_throttletimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_listpartitionreassignmentrateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_transaction_transactionmarkerchannelmanager_logappendretryqueuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_underreplicated", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_replicationbytesout_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_autoleaderbalancerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_listpartitionreassignmentrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicafetchermanager_failedpartitionscount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_partitionreassignmentrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_isrchangerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_socketserver_expiredconnectionskilledcount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_delayedfetchmetrics_expires_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_partitioncount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_atminisrpartitioncount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logmanager_offlinelogdirectorycount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_controllerstate", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetcherstats_bytes_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_requests_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicafetchermanager_deadthreadcount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestchannel_responsequeuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logmanager_logdirectoryoffline", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeepersyncconnects_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_logdirchangerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_cluster_partition_atminisr", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_responsesendtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_replicationbytesin_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_kafkarequesthandlerpool_requesthandleravgidlepercent_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_nokeycompactedtopicrecords_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_fetcherlagmetrics_consumerlag", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicaalterlogdirsmanager_failedpartitionscount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_remotetimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_manualleaderbalancerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeeperauthfailures_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_log_numlogsegments", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_temporarymemorybytes_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_localtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_sessionexpirelistener_zookeeperreadonlyconnects_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_log_size", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_controllerchangerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroupsempty", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroups", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_isrchangerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicuncleanleaderelectionenablerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_leaderelectionrateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_autoleaderbalancerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_topicchangerateandtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_bytesrejected_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestchannel_requestqueuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_isrexpands_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_logcleaner_max_compaction_delay_secs", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_leadercount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_replicamanager_isrshrinks_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_responsesendtimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_network_requestmetrics_requestqueuetimems", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllereventmanager_eventqueuetimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_coordinator_group_groupmetadatamanager_numgroupspreparingrebalance", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_replicastodeletecount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_kafkarequesthandlerpool_requesthandleravgidle_percent", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_log_log_logstartoffset", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_bytesin_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerstats_manualleaderbalancerateandtimems_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_controllerchannelmanager_totalqueuesize", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_controller_kafkacontroller_topicsineligibletodeletecount", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "kafka_server_brokertopicmetrics_fetchmessageconversions_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_scrape_duration_seconds", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_scrape_error", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_scrape_cached_beans", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_buffer_pool_used_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_buffer_pool_capacity_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_buffer_pool_used_buffers", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_config_reload_failure_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_config_reload_failure_created", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_exporter_build_info", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_cpu_seconds_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_start_time_seconds", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_open_fds", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_max_fds", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_virtual_memory_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "process_resident_memory_bytes", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_info", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_gc_collection_seconds_count", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_gc_collection_seconds_sum", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_current", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_daemon", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_peak", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_started_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_deadlocked", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_deadlocked_monitor", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_threads_state", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_classes_currently_loaded", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_classes_loaded_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_classes_unloaded_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_config_reload_success_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jmx_config_reload_success_created", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_allocated_bytes_total", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "jvm_memory_pool_allocated_bytes_created", + "type": "double", + "unit": "none", + "is_active": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "area", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "pool", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "quantile", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "clientId", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "partition", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "topic", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "request", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "delayedOperation", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "logDirectory", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "networkProcessor", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "listener", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "error", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "clientId_ReplicaFetcherThread_75_1002_brokerHost", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "brokerPort", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "fetcherType", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "clientId_ReplicaFetcherThread_15_1002_brokerHost", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "version", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "processor", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "runtime", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "vendor", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "gc", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "state", + "type": "string", + "unit": "none", + "is_active": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "pushgateway_dbm_kafka_bkpull.group1", + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group1" + } + ], + "plugin_type": "Pushgateway", + "os_type_list": [ + "linux", + "windows", + "linux_aarch64" + ] + }, + "collect_type": "Pushgateway", + "target_nodes": [], + "target_node_type": "TOPO", + "target_object_type": "SERVICE" + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_exporter.zookeeper.json similarity index 87% rename from dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_exporter.zookeeper.json index 9364b360fa..b2447b61aa 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.kafka.dbm_kafka_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/kafka.dbm_kafka_exporter.zookeeper.json @@ -1,7 +1,9 @@ { "bk_biz_id": 0, "plugin_id": "dbm_kafka_exporter", + "name": "dbm_kafka_exporter", "db_type": "kafka", + "short_name": "zookeeper", "details": { "name": "dbm_kafka_exporter", "label": "component", @@ -11,8 +13,9 @@ "--sasl.enabled": "", "--sasl.mechanism": "scram-sha512", "--web.listen-address": "${host}:${port}", - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", + "bk_app_code": "app_id", "instance": "instance", "cluster_name": "cluster_name", "cluster_type": "cluster_type", @@ -43,5 +46,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqld_exporter.mysql.json b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqld_exporter.mysql.json new file mode 100644 index 0000000000..6b09af2108 --- /dev/null +++ b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqld_exporter.mysql.json @@ -0,0 +1,9385 @@ +{ + "bk_biz_id": 0, + "plugin_id": "dbm_mysqld_exporter", + "name": "dbm_mysqld_exporter", + "db_type": "mysql", + "short_name": "mysql", + "details": { + "name": "dbm_mysqld_exporter", + "label": "component", + "params": { + "plugin": { + "--config.my-cnf": "/etc/{{ target.service.labels[\"exporter_conf_path\"] }}", + "--web.listen-address": "${host}:${port}", + "--collect.datadir_size": "true", + "--collect.global_status": "", + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { + "app": "app", + "instance": "instance", + "bk_app_code": "app_id", + "cluster_name": "cluster_name", + "cluster_type": "cluster_type", + "instance_host": "instance_host", + "instance_role": "instance_role", + "cluster_domain": "cluster_domain" + }, + "--collect.global_variables": "true", + "--collect.slave_status_ext": "true", + "--collect.engine_innodb_status": "true", + "--collect.info_schema.innodb_trx": "true", + "--collect.infodba_schema.heartbeat": "true", + "--collect.info_schema.innodb_metrics": "true", + "--collect.info_schema.query_response_time": "true", + "--collect.auto_increment_ext.columns --collect.auto_increment_ext.interval=1h": "true", + "--collect.info_schema.processlist_ext --collect.info_schema.processlist_ext.by_user": "true", + "--collect.info_schema.tables_ext --collect.info_schema.tables_ext.interval=1h --collect.info_schema.tables_ext.databases=*": "true" + }, + "collector": { + "host": "127.0.0.1", + "port": "7000", + "period": 60, + "timeout": 60 + }, + "target_node_type": "TOPO", + "target_object_type": "SERVICE" + }, + "plugin_info": { + "plugin_id": "dbm_mysqld_exporter", + "metric_json": [ + { + "fields": [ + { + "name": "mysql_up", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": false, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.group_default", + "rule_list": [], + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group_default" + }, + { + "fields": [ + { + "name": "mysql_global_status_aborted_clients", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_aborted_connects", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_binlog_cache_disk_use", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_binlog_cache_use", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_binlog_snapshot_position", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_binlog_stmt_cache_disk_use", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_binlog_stmt_cache_use", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_bytes_received", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_bytes_sent", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_compression", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_connections", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_created_tmp_disk_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_created_tmp_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_created_tmp_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_delayed_errors", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_delayed_insert_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_delayed_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_flush_commands", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_available_undo_logs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_background_log_sync", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_bytes_data", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_bytes_dirty", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_read_ahead", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_read_ahead_evicted", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_read_ahead_rnd", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_read_requests", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_reads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_wait_free", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffer_pool_write_requests", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_buffered_aio_submitted", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_checkpoint_age", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_checkpoint_max_age", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_fsyncs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_pending_fsyncs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_pending_reads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_pending_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_read", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_reads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_data_written", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_dblwr_pages_written", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_dblwr_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_ibuf_free_list", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_ibuf_segment_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_log_waits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_log_write_requests", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_log_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_lsn_current", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_lsn_flushed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_lsn_last_checkpoint", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_master_thread_active_loops", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_master_thread_idle_loops", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_max_trx_id", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_mem_adaptive_hash", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_mem_dictionary", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_num_open_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_oldest_view_low_limit_trx_id", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_os_log_fsyncs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_os_log_pending_fsyncs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_os_log_pending_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_os_log_written", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_page_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_pages_created", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_pages_read", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_pages_written", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_purge_trx_id", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_purge_undo_no", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_lock_current_waits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_lock_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_lock_time_avg", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_lock_time_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_lock_waits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_scan_data_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_scan_deleted_recs_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_scan_pages_contiguous", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_scan_pages_disjointed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_scan_pages_total_seek_distance", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_secondary_index_triggered_cluster_reads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_secondary_index_triggered_cluster_reads_avoided", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_truncated_status_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_blocks_not_flushed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_blocks_unused", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_blocks_used", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_read_requests", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_reads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_write_requests", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_key_writes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_last_query_cost", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_last_query_partial_plans", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_locked_connects", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_max_execution_time_exceeded", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_max_execution_time_set", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_max_execution_time_set_failed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_max_used_connections", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_max_used_connections_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_not_flushed_delayed_rows", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ongoing_anonymous_transaction_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_open_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_open_streams", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_open_table_definitions", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_open_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_opened_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_opened_table_definitions", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_opened_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_prepared_stmt_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_free_blocks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_free_memory", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_hits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_inserts", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_lowmem_prunes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_not_cached", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_queries_in_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_qcache_total_blocks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_queries", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_questions", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_select_full_join", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_select_full_range_join", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_select_range", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_select_range_check", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_select_scan", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slave_heartbeat_period", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slave_open_temp_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slave_received_heartbeats", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slave_retried_transactions", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slave_running", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slow_launch_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_slow_queries", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_sort_merge_passes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_sort_range", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_sort_rows", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_sort_scan", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_accept_renegotiates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_accepts", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_callback_cache_hits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_client_connects", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_connect_renegotiates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_ctx_verify_depth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_ctx_verify_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_default_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_finished_accepts", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_finished_connects", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_session_cache_hits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_session_cache_misses", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_session_cache_overflows", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_session_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_session_cache_timeouts", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_sessions_reused", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_used_session_cache_entries", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_verify_depth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_ssl_verify_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_table_locks_immediate", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_table_locks_waited", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_table_open_cache_hits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_table_open_cache_misses", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_table_open_cache_overflows", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_tc_log_max_pages_used", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_tc_log_page_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_tc_log_page_waits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threadpool_idle_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threadpool_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threads_cached", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threads_connected", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threads_created", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_threads_running", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_uptime", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_uptime_since_flush_status", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_buffer_pool_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "state" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_commands_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "command" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_buffer_pool_page_changes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "operation" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_innodb_row_ops_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "operation" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_handlers_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "handler" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_status_connection_errors_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "error" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "state", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "command", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "operation", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "handler", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "error", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.gstatus", + "rule_list": [], + "table_desc": "mysql_global_status", + "table_name": "gstatus" + }, + { + "fields": [ + { + "name": "mysql_global_variables_auto_generate_certs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_auto_increment_increment", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_auto_increment_offset", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_autocommit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_automatic_sp_privileges", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_avoid_temporal_upgrade", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_back_log", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_big_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_direct_non_transactional_updates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_group_commit_sync_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_group_commit_sync_no_delay_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_gtid_simple_recovery", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_max_flush_queue_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_order_commits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_rows_query_log_events", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_binlog_stmt_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_blob_compressed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_bulk_insert_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_check_proxy_users", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_connect_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_core_file", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_datetime_precision_use_v1", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_default_password_lifetime", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_default_week_format", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_delay_key_write", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_delayed_insert_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_delayed_insert_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_delayed_queue_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_disconnect_on_expired_password", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_div_precision_increment", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_end_markers_in_json", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_enforce_gtid_consistency", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_eq_range_index_dive_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_event_scheduler", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_expand_fast_index_creation", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_expire_logs_days", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_explicit_defaults_for_timestamp", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_extra_max_connections", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_extra_port", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_flush", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_flush_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_foreign_key_checks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_ft_max_word_len", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_ft_min_word_len", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_ft_query_expansion_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_general_log", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_group_concat_max_len", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_gtid_executed_compression_period", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_gtid_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_backup_locks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_backup_safe_binlog_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_compress", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_crypt", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_dynamic_loading", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_geometry", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_openssl", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_profiling", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_query_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_rtree_keys", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_snapshot_cloning", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_ssl", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_statement_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_have_symlink", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_host_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_ignore_builtin_innodb", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_adaptive_flushing", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_adaptive_flushing_lwm", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_adaptive_hash_index", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_adaptive_hash_index_parts", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_adaptive_max_sleep_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_api_bk_commit_interval", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_api_disable_rowlock", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_api_enable_binlog", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_api_enable_mdl", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_api_trx_level", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_autoextend_increment", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_autoinc_lock_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_chunk_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_dump_at_shutdown", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_dump_now", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_dump_pct", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_in_core_file", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_load_abort", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_load_at_startup", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_load_now", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_buffer_pool_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_change_buffer_max_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_checksums", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_cmp_per_index_enabled", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_commit_concurrency", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_compressed_columns_threshold", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_compressed_columns_zip_level", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_compression_failure_threshold_pct", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_compression_level", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_compression_pad_pct_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_concurrency_tickets", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_deadlock_detect", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_disable_sort_file_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_doublewrite", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_fast_shutdown", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_file_format_check", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_file_per_table", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_fill_factor", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_flush_log_at_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_flush_log_at_trx_commit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_flush_neighbors", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_flush_sync", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_flushing_avg_loops", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_force_load_corrupted", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_force_recovery", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_enable_diag_print", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_enable_stopword", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_ignore_stopwords", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_max_token_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_min_token_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_num_word_optimize", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_result_cache_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_sort_pll_degree", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_ft_total_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_io_capacity", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_io_capacity_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_kill_idle_transaction", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_large_prefix", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_lock_wait_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_locks_unsafe_for_binlog", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_checksums", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_compressed_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_file_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_files_in_group", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_log_write_ahead_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_lru_scan_depth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_bitmap_file_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_changed_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_dirty_pages_pct", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_dirty_pages_pct_lwm", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_purge_lag", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_purge_lag_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_max_undo_log_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_min_blob_compress_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_old_blocks_pct", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_old_blocks_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_online_alter_log_max_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_open_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_optimize_fulltext_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_page_cleaners", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_page_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_print_all_deadlocks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_print_lock_wait_timeout_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_purge_batch_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_purge_rseg_truncate_frequency", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_purge_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_random_read_ahead", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_read_ahead_threshold", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_read_io_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_read_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_replication_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_rollback_on_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_rollback_segments", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_show_locks_held", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_show_verbose_locks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_sort_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_spin_wait_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_auto_recalc", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_include_delete_marked", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_on_metadata", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_persistent", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_persistent_sample_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_sample_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_stats_transient_sample_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_status_output", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_status_output_locks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_strict_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_support_xa", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_sync_array_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_sync_spin_loops", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_table_locks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_thread_concurrency", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_thread_sleep_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_track_changed_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_undo_log_truncate", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_undo_logs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_undo_tablespaces", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_use_global_flush_log_at_trx_commit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_use_native_aio", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_innodb_write_io_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_interactive_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_join_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_keep_files_on_create", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_key_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_key_cache_age_threshold", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_key_cache_block_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_key_cache_division_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_kill_idle_transaction", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_large_files_support", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_large_page_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_large_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_local_infile", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_lock_wait_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_locked_in_memory", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_bin", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_bin_compress", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_bin_compress_min_len", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_bin_trust_function_creators", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_bin_use_v1_row_events", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_builtin_as_identified_by_password", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_error_verbosity", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_queries_not_using_indexes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_slave_updates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_slow_admin_statements", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_slow_rate_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_slow_slave_statements", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_slow_sp_statements", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_statements_unsafe_for_binlog", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_syslog", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_syslog_include_pid", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_throttle_queries_not_using_indexes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_log_warnings", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_long_query_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_low_priority_updates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_lower_case_file_system", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_lower_case_table_names", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_master_verify_checksum", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_allowed_packet", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_binlog_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_binlog_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_binlog_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_binlog_stmt_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_connect_errors", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_connections", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_delayed_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_digest_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_error_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_execution_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_heap_table_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_insert_delayed_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_join_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_length_for_sort_data", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_points_in_geometry", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_prepared_stmt_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_relay_log_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_seeks_for_key", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_slowlog_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_slowlog_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_sort_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_sp_recursion_depth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_tmp_tables", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_user_connections", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_write_lock_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_max_xa_commit_logs", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_metadata_locks_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_metadata_locks_hash_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_min_examined_row_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_multi_range_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_data_pointer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_max_sort_file_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_mmap_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_recover_options", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_repair_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_sort_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_myisam_use_mmap", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_mysql_native_password_proxy_users", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_net_buffer_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_net_read_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_net_retry_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_net_write_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_new", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_ngram_token_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_offline_mode", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_old", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_old_alter_table", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_old_passwords", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_open_files_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_optimizer_prune_level", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_optimizer_search_depth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_optimizer_trace_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_optimizer_trace_max_mem_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_optimizer_trace_offset", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_parser_max_mem_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_accounts_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_digests_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_stages_history_long_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_stages_history_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_statements_history_long_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_statements_history_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_transactions_history_long_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_transactions_history_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_waits_history_long_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_events_waits_history_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_hosts_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_cond_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_cond_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_digest_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_file_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_file_handles", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_file_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_index_stat", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_memory_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_metadata_locks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_mutex_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_mutex_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_prepared_statements_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_program_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_rwlock_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_rwlock_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_socket_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_socket_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_sql_text_length", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_stage_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_statement_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_statement_stack", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_table_handles", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_table_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_table_lock_stat", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_thread_classes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_max_thread_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_session_connect_attrs_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_setup_actors_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_setup_objects_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_performance_schema_users_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_port", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_preload_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_profiling", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_profiling_history_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_protocol_version", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_alloc_block_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_min_res_unit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_strip_comments", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_type", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_cache_wlock_invalidate", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_prealloc_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_response_time_flush", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_response_time_range_base", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_query_response_time_stats", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_range_alloc_block_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_range_optimizer_max_mem_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_read_binlog_speed_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_read_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_read_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_read_rnd_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_relay_log_purge", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_relay_log_recovery", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_relay_log_space_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_relay_log_uncompress", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_report_port", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_require_secure_transport", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_rpl_stop_slave_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_secure_auth", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_server_id", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_server_id_bits", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_session_track_gtids", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_session_track_schema", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_session_track_state_change", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_session_track_transaction_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sha256_password_auto_generate_rsa_keys", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sha256_password_proxy_users", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_show_compatibility_56", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_show_old_temporals", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_skip_external_locking", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_skip_name_resolve", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_skip_networking", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_skip_show_database", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_allow_batching", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_checkpoint_group", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_checkpoint_period", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_compressed_protocol", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_max_allowed_packet", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_net_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_parallel_workers", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_pending_jobs_size_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_preserve_commit_order", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_skip_errors", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_sql_verify_checksum", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slave_transaction_retries", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slow_launch_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slow_query_log", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_slow_query_log_always_write_time", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sort_buffer_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sort_when_partition_prefix_order", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_auto_is_null", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_big_selects", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_buffer_result", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_log_bin", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_log_off", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_notes", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_quote_show_create", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_safe_updates", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_select_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_slave_skip_counter", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sql_warnings", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_stored_program_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_super_read_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sync_binlog", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sync_frm", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sync_master_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sync_relay_log", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_sync_relay_log_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_table_definition_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_table_open_cache", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_table_open_cache_instances", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_cache_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_high_prio_tickets", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_idle_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_max_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_oversubscribe", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_pool_stall_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_stack", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_thread_statistics", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_tmp_table_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_transaction_alloc_block_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_transaction_prealloc_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_transaction_read_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_transaction_write_set_extraction", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_tx_read_only", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_unique_checks", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_updatable_views_with_limit", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_userstat", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_global_variables_wait_timeout", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.gvars", + "rule_list": [], + "table_desc": "mysql_global_variables", + "table_name": "gvars" + }, + { + "fields": [ + { + "name": "mysql_datadir_df_total_fs_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_total_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_avail_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_usage", + "type": "double", + "unit": "percentunit", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_used_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_du_used_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "path", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "mount_point", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "fs_type", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.datasize", + "rule_list": [], + "table_desc": "mysql_datadir_size", + "table_name": "datasize" + }, + { + "fields": [ + { + "name": "mysql_info_schema_innodb_metrics_adaptive_hash_index_adaptive_hash_searches_btree_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_adaptive_hash_index_adaptive_hash_searches_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_data_reads_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_data_written_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pages_created_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pages_read_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pages_written_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_bytes_data", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_bytes_dirty", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_read_ahead_evicted_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_read_ahead_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_read_requests_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_reads_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_wait_free_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_buffer_pool_write_requests_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_buffer_pool_dirty_pages", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_delete_mark_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_delete_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_discard_delete_mark_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_discard_delete_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_discard_insert_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_insert_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_merges_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_change_buffer_ibuf_size_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_dml_dml_deletes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_dml_dml_inserts_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_dml_dml_updates_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_file_system_file_num_open_files", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_deadlocks_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_row_lock_current_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_row_lock_time_avg", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_row_lock_time_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_row_lock_time_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_row_lock_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_lock_lock_timeouts_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_data_fsyncs_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_data_reads_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_data_writes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_log_bytes_written_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_log_fsyncs_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_log_pending_fsyncs_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_os_os_log_pending_writes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_recovery_log_padded_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_recovery_log_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_recovery_log_write_requests_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_recovery_log_writes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_buffer_pool_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_activity_count_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_dblwr_pages_written_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_dblwr_writes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_page_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_s_os_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_s_spin_rounds_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_s_spin_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_sx_os_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_sx_spin_rounds_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_sx_spin_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_x_os_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_x_spin_rounds_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_server_innodb_rwlock_x_spin_waits_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_innodb_metrics_transaction_trx_rseg_history_len", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_queries_in_queue", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_queries_inside_innodb", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_read_views_open_inside_innodb", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.innodbmtr", + "rule_list": [], + "table_desc": "mysql_info_schema_innodb_metrics", + "table_name": "innodbmtr" + }, + { + "fields": [ + { + "name": "mysql_engine_innodb_lock_waits_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_locks_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_trx_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_trx_long_query_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_trx_long_time_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_engine_innodb_trx_idle_time_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "trx_state", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "command", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "state", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "user", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.innodbtrx", + "rule_list": [], + "table_desc": "mysql_engine_innodb_metrics_locks", + "table_name": "innodbtrx" + }, + { + "fields": [ + { + "name": "mysql_info_schema_query_response_time_seconds_sum", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_query_response_time_seconds_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_read_query_response_time_seconds_sum", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_read_query_response_time_seconds_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_write_query_response_time_seconds_sum", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_write_query_response_time_seconds_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_query_response_time_seconds_bucket", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "le" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_read_query_response_time_seconds_bucket", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "le" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_write_query_response_time_seconds_bucket", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "le" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "le", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.resptime", + "rule_list": [], + "table_desc": "mysql_info_schema_query_response_time", + "table_name": "resptime" + }, + { + "fields": [ + { + "name": "mysql_info_schema_auto_increment_column", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "column", + "schema", + "table" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_auto_increment_column_max", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "column", + "schema", + "table" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "int_type", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "column", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "schema", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "table", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.tableincr", + "rule_list": [], + "table_desc": "mysql_info_schema_auto_increment", + "table_name": "tableincr" + }, + { + "fields": [ + { + "name": "mysql_info_schema_table_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "component", + "schema", + "table" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_total_size", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "schema" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_table_rows", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "table", + "schema" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "component", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "schema", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "table", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.tablesize", + "rule_list": [], + "table_desc": "mysql_info_schema_table_size schema", + "table_name": "tablesize" + }, + { + "fields": [ + { + "name": "mysql_info_schema_table_version", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "schema", + "table", + "type", + "create_options", + "engine", + "row_format" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "schema", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "table", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "type", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "create_options", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "engine", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "row_format", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "le", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.tabledef", + "rule_list": [], + "table_desc": "mysql_info_schema_table_version", + "table_name": "tabledef" + }, + { + "fields": [ + { + "name": "mysql_version_info", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "version", + "version_comment", + "innodb_version" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "version", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "version_comment", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "innodb_version", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.version", + "rule_list": [], + "table_desc": "mysql_version_info", + "table_name": "version" + }, + { + "fields": [ + { + "name": "mysql_info_schema_processlist_seconds", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "command", + "state" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_processlist_threads", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "command", + "state" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_info_schema_processlist_processes_by_user", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "mysql_user" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_user", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "command", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "state", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.plist", + "rule_list": [], + "table_desc": "mysql_info_schema_processlist", + "table_name": "plist" + }, + { + "fields": [ + { + "name": "mysql_infodba_schema_heartbeat_delay_sec", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_infodba_schema_heartbeat_beat_sec", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_auto_position", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_connect_retry", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_exec_master_log_pos", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_last_errno", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_last_io_errno", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_last_sql_errno", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_master_port", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_master_retry_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_master_server_id", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_master_ssl_allowed", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_master_ssl_verify_server_cert", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_read_master_log_pos", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_relay_log_pos", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_relay_log_space", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_seconds_behind_master", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_skip_counter", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_slave_io_running", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_slave_sql_running", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_sql_delay", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_slave_status_until_log_pos", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "channel_name", + "connection_name", + "master_host", + "master_uuid" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "beat_from", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "master_server_id", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "channel_name", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "connection_name", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "master_host", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "master_uuid", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.slavestat", + "rule_list": [], + "table_desc": "mysql_slave_status", + "table_name": "slavestat" + }, + { + "fields": [ + { + "name": "mysql_exporter_collector_duration_seconds", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [ + "collector" + ], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_exporter_last_scrape_error", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_exporter_scrapes_total", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "collector", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + } + ], + "table_id": "exporter_dbm_mysqld_exporter.internal", + "rule_list": [], + "table_desc": "exporter collector", + "table_name": "internal" + } + ], + "plugin_type": "Exporter", + "os_type_list": [ + "linux" + ] + }, + "collect_type": "Exporter", + "target_nodes": [], + "target_node_type": "TOPO", + "target_object_type": "SERVICE" + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqlproxy_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqlproxy_exporter.proxy.json similarity index 98% rename from dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqlproxy_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqlproxy_exporter.proxy.json index 8d66cf7167..4ca82a5973 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqlproxy_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_mysqlproxy_exporter.proxy.json @@ -1,7 +1,9 @@ { "bk_biz_id": 0, "plugin_id": "dbm_mysqlproxy_exporter", + "name": "dbm_mysqlproxy_exporter", "db_type": "mysql", + "short_name": "proxy", "details": { "name": "dbm_mysqlproxy_exporter", "label": "component", @@ -9,7 +11,7 @@ "plugin": { "-mysqlproxy.file": "/etc/{{ target.service.labels[\"exporter_conf_path\"]}}", "-web.listen-address": "${host}:${port}", - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", "bk_app_code": "app_id", @@ -274,5 +276,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqld_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_spider_exporter.spider.json similarity index 90% rename from dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqld_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_spider_exporter.spider.json index 28fa4db5a4..1db104d4b5 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.mysql.dbm_mysqld_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/mysql.dbm_spider_exporter.spider.json @@ -1,18 +1,19 @@ { "bk_biz_id": 0, "plugin_id": "dbm_mysqld_exporter", + "name": "dbm_spider_exporter", "db_type": "mysql", + "short_name": "spider", "details": { - "name": "dbm_mysqld_exporter", + "name": "dbm_spider_exporter", "label": "component", "params": { "plugin": { "--config.my-cnf": "/etc/{{ target.service.labels[\"exporter_conf_path\"] }}", "--web.listen-address": "${host}:${port}", - "--collect.datadir_size": "", - "--collect.slave_status": "", + "--collect.datadir_size": "true", "--collect.global_status": "", - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", "bk_app_code": "app_id", @@ -22,14 +23,16 @@ "instance_role": "instance_role", "cluster_domain": "cluster_domain" }, - "--collect.global_variables": "", - "--collect.engine_innodb_status": "", - "--collect.auto_increment.columns": "", - "--collect.info_schema.innodb_trx": "", - "--collect.info_schema.innodb_metrics": "", - "--collect.info_schema.query_response_time": "", - "--collect.info_schema.processlist_ext --collect.info_schema.processlist_ext.by_user": "", - "--collect.info_schema.tables_ext --collect.info_schema.tables_ext.interval=1h --collect.info_schema.tables_ext.databases=*": "" + "--collect.global_variables": "true", + "--collect.slave_status_ext": "false", + "--collect.engine_innodb_status": "false", + "--collect.info_schema.innodb_trx": "false", + "--collect.infodba_schema.heartbeat": "false", + "--collect.info_schema.innodb_metrics": "false", + "--collect.info_schema.query_response_time": "true", + "--collect.auto_increment_ext.columns --collect.auto_increment_ext.interval=1h": "false", + "--collect.info_schema.processlist_ext --collect.info_schema.processlist_ext.by_user": "true", + "--collect.info_schema.tables_ext --collect.info_schema.tables_ext.interval=1h --collect.info_schema.tables_ext.databases=*": "false" }, "collector": { "host": "127.0.0.1", @@ -47,6 +50,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": false, "dimensions": [], "description": "", "source_name": "", @@ -54,9 +58,10 @@ "is_diff_metric": false } ], - "table_id": "exporter_dbm_mysqld_exporter.mysqlup", - "table_desc": "mysql_up", - "table_name": "mysqlup" + "table_id": "exporter_dbm_mysqld_exporter.group_default", + "rule_list": [], + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group_default" }, { "fields": [ @@ -65,6 +70,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -76,6 +82,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -87,6 +94,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -98,6 +106,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -109,6 +118,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -120,6 +130,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -131,6 +142,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -142,6 +154,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -153,6 +166,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -164,6 +178,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -175,6 +190,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -186,6 +202,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -197,6 +214,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -208,6 +226,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -219,6 +238,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -230,6 +250,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -241,6 +262,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -252,6 +274,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -263,6 +286,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -274,6 +298,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -285,6 +310,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -296,6 +322,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -307,6 +334,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -318,6 +346,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -329,6 +358,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -340,6 +370,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -351,6 +382,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -362,6 +394,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -373,6 +406,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -384,6 +418,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -395,6 +430,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -406,6 +442,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -417,6 +454,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -428,6 +466,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -439,6 +478,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -450,6 +490,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -461,6 +502,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -472,6 +514,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -483,6 +526,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -494,6 +538,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -505,6 +550,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -516,6 +562,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -527,6 +574,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -538,6 +586,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -549,6 +598,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -560,6 +610,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -571,6 +622,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -582,6 +634,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -593,6 +646,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -604,6 +658,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -615,6 +670,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -626,6 +682,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -637,6 +694,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -648,6 +706,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -659,6 +718,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -670,6 +730,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -681,6 +742,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -692,6 +754,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -703,6 +766,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -714,6 +778,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -725,6 +790,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -736,6 +802,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -747,6 +814,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -758,6 +826,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -769,6 +838,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -780,6 +850,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -791,6 +862,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -802,6 +874,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -813,6 +886,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -824,6 +898,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -835,6 +910,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -846,6 +922,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -857,6 +934,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -868,6 +946,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -879,6 +958,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -890,6 +970,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -901,6 +982,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -912,6 +994,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -923,6 +1006,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -934,6 +1018,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -945,6 +1030,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -956,6 +1042,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -967,6 +1054,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -978,6 +1066,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -989,6 +1078,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1000,6 +1090,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1011,6 +1102,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1022,6 +1114,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1033,6 +1126,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1044,6 +1138,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1055,6 +1150,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1066,6 +1162,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1077,6 +1174,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1088,6 +1186,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1099,6 +1198,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1110,6 +1210,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1121,6 +1222,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1132,6 +1234,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1143,6 +1246,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1154,6 +1258,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1165,6 +1270,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1176,6 +1282,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1187,6 +1294,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1198,6 +1306,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1209,6 +1318,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1220,6 +1330,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1231,6 +1342,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1242,6 +1354,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1253,6 +1366,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1264,6 +1378,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1275,6 +1390,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1286,6 +1402,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1297,6 +1414,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1308,6 +1426,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1319,6 +1438,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1330,6 +1450,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1341,6 +1462,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1352,6 +1474,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1363,6 +1486,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1374,6 +1498,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1385,6 +1510,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1396,6 +1522,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1407,6 +1534,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1418,6 +1546,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1429,6 +1558,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1440,6 +1570,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1451,6 +1582,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1462,6 +1594,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1473,6 +1606,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1484,6 +1618,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1495,6 +1630,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1506,6 +1642,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1517,6 +1654,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1528,6 +1666,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1539,6 +1678,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1550,6 +1690,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1561,6 +1702,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1572,6 +1714,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1583,6 +1726,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1594,6 +1738,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1605,6 +1750,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1616,6 +1762,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1627,6 +1774,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1638,6 +1786,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1649,6 +1798,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1660,6 +1810,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1671,6 +1822,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1682,6 +1834,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1693,6 +1846,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1704,6 +1858,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1715,6 +1870,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1726,6 +1882,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1737,6 +1894,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1748,6 +1906,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1759,6 +1918,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1770,6 +1930,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1781,6 +1942,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1792,6 +1954,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1803,6 +1966,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1814,6 +1978,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1825,6 +1990,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1836,6 +2002,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1847,6 +2014,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1858,6 +2026,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1869,6 +2038,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1880,6 +2050,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1891,6 +2062,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "state" ], @@ -1904,6 +2076,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "command" ], @@ -1917,6 +2090,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "operation" ], @@ -1930,6 +2104,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "operation" ], @@ -1943,6 +2118,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "handler" ], @@ -1956,6 +2132,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "error" ], @@ -1969,6 +2146,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -1979,6 +2157,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -1989,6 +2168,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -1999,6 +2179,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -2009,6 +2190,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -2016,6 +2198,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.gstatus", + "rule_list": [], "table_desc": "mysql_global_status", "table_name": "gstatus" }, @@ -2026,6 +2209,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2037,6 +2221,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2048,6 +2233,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2059,6 +2245,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2070,6 +2257,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2081,6 +2269,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2092,6 +2281,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2103,6 +2293,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2114,6 +2305,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2125,6 +2317,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2136,6 +2329,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2147,6 +2341,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2158,6 +2353,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2169,6 +2365,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2180,6 +2377,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2191,6 +2389,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2202,6 +2401,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2213,6 +2413,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2224,6 +2425,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2235,6 +2437,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2246,6 +2449,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2257,6 +2461,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2268,6 +2473,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2279,6 +2485,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2290,6 +2497,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2301,6 +2509,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2312,6 +2521,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2323,6 +2533,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2334,6 +2545,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2345,6 +2557,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2356,6 +2569,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2367,6 +2581,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2378,6 +2593,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2389,6 +2605,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2400,6 +2617,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2411,6 +2629,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2422,6 +2641,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2433,6 +2653,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2444,6 +2665,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2455,6 +2677,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2466,6 +2689,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2477,6 +2701,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2488,6 +2713,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2499,6 +2725,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2510,6 +2737,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2521,6 +2749,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2532,6 +2761,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2543,6 +2773,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2554,6 +2785,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2565,6 +2797,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2576,6 +2809,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2587,6 +2821,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2598,6 +2833,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2609,6 +2845,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2620,6 +2857,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2631,6 +2869,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2642,6 +2881,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2653,6 +2893,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2664,6 +2905,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2675,6 +2917,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2686,6 +2929,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2697,6 +2941,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2708,6 +2953,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2719,6 +2965,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2730,6 +2977,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2741,6 +2989,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2752,6 +3001,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2763,6 +3013,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2774,6 +3025,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2785,6 +3037,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2796,6 +3049,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2807,6 +3061,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2818,6 +3073,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2829,6 +3085,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2840,6 +3097,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2851,6 +3109,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2862,6 +3121,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2873,6 +3133,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2884,6 +3145,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2895,6 +3157,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2906,6 +3169,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2917,6 +3181,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2928,6 +3193,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2939,6 +3205,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2950,6 +3217,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2961,6 +3229,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2972,6 +3241,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2983,6 +3253,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2994,6 +3265,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3005,6 +3277,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3016,6 +3289,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3027,6 +3301,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3038,6 +3313,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3049,6 +3325,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3060,6 +3337,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3071,6 +3349,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3082,6 +3361,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3093,6 +3373,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3104,6 +3385,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3115,6 +3397,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3126,6 +3409,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3137,6 +3421,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3148,6 +3433,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3159,6 +3445,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3170,6 +3457,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3181,6 +3469,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3192,6 +3481,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3203,6 +3493,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3214,6 +3505,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3225,6 +3517,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3236,6 +3529,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3247,6 +3541,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3258,6 +3553,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3269,6 +3565,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3280,6 +3577,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3291,6 +3589,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3302,6 +3601,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3313,6 +3613,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3324,6 +3625,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3335,6 +3637,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3346,6 +3649,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3357,6 +3661,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3368,6 +3673,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3379,6 +3685,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3390,6 +3697,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3401,6 +3709,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3412,6 +3721,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3423,6 +3733,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3434,6 +3745,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3445,6 +3757,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3456,6 +3769,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3467,6 +3781,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3478,6 +3793,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3489,6 +3805,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3500,6 +3817,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3511,6 +3829,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3522,6 +3841,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3533,6 +3853,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3544,6 +3865,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3555,6 +3877,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3566,6 +3889,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3577,6 +3901,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3588,6 +3913,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3599,6 +3925,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3610,6 +3937,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3621,6 +3949,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3632,6 +3961,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3643,6 +3973,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3654,6 +3985,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3665,6 +3997,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3676,6 +4009,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3687,6 +4021,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3698,6 +4033,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3709,6 +4045,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3720,6 +4057,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3731,6 +4069,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3742,6 +4081,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3753,6 +4093,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3764,6 +4105,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3775,6 +4117,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3786,6 +4129,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3797,6 +4141,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3808,6 +4153,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3819,6 +4165,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3830,6 +4177,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3841,6 +4189,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3852,6 +4201,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3863,6 +4213,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3874,6 +4225,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3885,6 +4237,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3896,6 +4249,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3907,6 +4261,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3918,6 +4273,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3929,6 +4285,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3940,6 +4297,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3951,6 +4309,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3962,6 +4321,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3973,6 +4333,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3984,6 +4345,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3995,6 +4357,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4006,6 +4369,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4017,6 +4381,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4028,6 +4393,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4039,6 +4405,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4050,6 +4417,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4061,6 +4429,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4072,6 +4441,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4083,6 +4453,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4094,6 +4465,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4105,6 +4477,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4116,6 +4489,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4127,6 +4501,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4138,6 +4513,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4149,6 +4525,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4160,6 +4537,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4171,6 +4549,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4182,6 +4561,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4193,6 +4573,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4204,6 +4585,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4215,6 +4597,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4226,6 +4609,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4237,6 +4621,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4248,6 +4633,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4259,6 +4645,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4270,6 +4657,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4281,6 +4669,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4292,6 +4681,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4303,6 +4693,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4314,6 +4705,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4325,6 +4717,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4336,6 +4729,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4347,6 +4741,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4358,6 +4753,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4369,6 +4765,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4380,6 +4777,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4391,6 +4789,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4402,6 +4801,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4413,6 +4813,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4424,6 +4825,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4435,6 +4837,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4446,6 +4849,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4457,6 +4861,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4468,6 +4873,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4479,6 +4885,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4490,6 +4897,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4501,6 +4909,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4512,6 +4921,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4523,6 +4933,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4534,6 +4945,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4545,6 +4957,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4556,6 +4969,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4567,6 +4981,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4578,6 +4993,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4589,6 +5005,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4600,6 +5017,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4611,6 +5029,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4622,6 +5041,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4633,6 +5053,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4644,6 +5065,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4655,6 +5077,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4666,6 +5089,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4677,6 +5101,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4688,6 +5113,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4699,6 +5125,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4710,6 +5137,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4721,6 +5149,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4732,6 +5161,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4743,6 +5173,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4754,6 +5185,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4765,6 +5197,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4776,6 +5209,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4787,6 +5221,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4798,6 +5233,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4809,6 +5245,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4820,6 +5257,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4831,6 +5269,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4842,6 +5281,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4853,6 +5293,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4864,6 +5305,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4875,6 +5317,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4886,6 +5329,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4897,6 +5341,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4908,6 +5353,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4919,6 +5365,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4930,6 +5377,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4941,6 +5389,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4952,6 +5401,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4963,6 +5413,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4974,6 +5425,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4985,6 +5437,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -4996,6 +5449,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5007,6 +5461,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5018,6 +5473,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5029,6 +5485,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5040,6 +5497,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5051,6 +5509,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5062,6 +5521,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5073,6 +5533,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5084,6 +5545,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5095,6 +5557,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5106,6 +5569,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5117,6 +5581,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5128,6 +5593,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5139,6 +5605,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5150,6 +5617,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5161,6 +5629,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5172,6 +5641,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5183,6 +5653,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5194,6 +5665,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5205,6 +5677,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5216,6 +5689,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5227,6 +5701,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5238,6 +5713,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5249,6 +5725,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5260,6 +5737,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5271,6 +5749,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5282,6 +5761,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5293,6 +5773,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5304,6 +5785,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5315,6 +5797,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5326,6 +5809,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5337,6 +5821,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5348,6 +5833,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5359,6 +5845,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5370,6 +5857,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5381,6 +5869,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5392,6 +5881,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5403,6 +5893,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5414,6 +5905,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5425,6 +5917,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5436,6 +5929,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5447,6 +5941,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5458,6 +5953,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5469,6 +5965,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5480,6 +5977,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5491,6 +5989,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5502,6 +6001,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5513,6 +6013,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5524,6 +6025,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5535,6 +6037,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5546,6 +6049,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5557,6 +6061,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5568,6 +6073,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5579,6 +6085,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5590,6 +6097,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5601,6 +6109,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5612,6 +6121,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5623,6 +6133,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5634,6 +6145,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5645,6 +6157,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5656,6 +6169,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5667,6 +6181,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5678,6 +6193,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5689,6 +6205,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5700,6 +6217,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5711,6 +6229,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5722,6 +6241,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5733,6 +6253,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5744,6 +6265,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5755,6 +6277,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5766,6 +6289,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5777,6 +6301,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5788,6 +6313,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5799,6 +6325,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5810,6 +6337,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5821,6 +6349,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5832,6 +6361,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5843,6 +6373,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5854,6 +6385,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5865,6 +6397,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5876,6 +6409,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5887,6 +6421,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5898,6 +6433,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5909,6 +6445,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5920,6 +6457,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5931,6 +6469,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5942,6 +6481,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5953,6 +6493,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5964,6 +6505,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5975,6 +6517,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5986,6 +6529,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -5997,6 +6541,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6008,6 +6553,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6019,6 +6565,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6030,6 +6577,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6041,6 +6589,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6052,6 +6601,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6063,6 +6613,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6074,6 +6625,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6085,6 +6637,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6096,6 +6649,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6107,6 +6661,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6118,6 +6673,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6129,6 +6685,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6140,6 +6697,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6151,6 +6709,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6162,6 +6721,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6173,6 +6733,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6184,6 +6745,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6195,6 +6757,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6206,6 +6769,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6217,6 +6781,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6228,6 +6793,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6239,6 +6805,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6250,6 +6817,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6261,6 +6829,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6272,6 +6841,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6283,6 +6853,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6294,6 +6865,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6305,6 +6877,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6316,6 +6889,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6327,6 +6901,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6338,6 +6913,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6349,6 +6925,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6360,6 +6937,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6371,6 +6949,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6382,6 +6961,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6393,6 +6973,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6404,6 +6985,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6415,6 +6997,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6426,6 +7009,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6437,6 +7021,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6448,6 +7033,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6459,6 +7045,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6470,6 +7057,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6481,6 +7069,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6492,6 +7081,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6503,6 +7093,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6514,6 +7105,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6525,6 +7117,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6536,6 +7129,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6547,6 +7141,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6558,6 +7153,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6569,6 +7165,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6580,6 +7177,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6591,6 +7189,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6602,6 +7201,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6613,6 +7213,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6624,6 +7225,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6635,6 +7237,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6646,6 +7249,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6657,6 +7261,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6668,6 +7273,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6679,6 +7285,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6690,6 +7297,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6698,24 +7306,120 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.gvars", + "rule_list": [], "table_desc": "mysql_global_variables", "table_name": "gvars" }, { "fields": [ { - "name": "mysql_datadir_size_kb", + "name": "mysql_datadir_df_total_fs_mb", "type": "double", - "unit": "none", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_total_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_avail_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_usage", + "type": "double", + "unit": "percentunit", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_df_used_mb", + "type": "double", + "unit": "mbytes", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_datadir_du_used_mb", + "type": "double", + "unit": "mbytes", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", "monitor_type": "metric", "is_diff_metric": false + }, + { + "name": "path", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "mount_point", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "fs_type", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false } ], "table_id": "exporter_dbm_mysqld_exporter.datasize", + "rule_list": [], "table_desc": "mysql_datadir_size", "table_name": "datasize" }, @@ -6726,6 +7430,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6737,6 +7442,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6748,6 +7454,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6759,6 +7466,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6770,6 +7478,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6781,6 +7490,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6792,6 +7502,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6803,6 +7514,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6814,6 +7526,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6825,6 +7538,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6836,6 +7550,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6847,6 +7562,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6858,6 +7574,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6869,6 +7586,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6880,6 +7598,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6891,6 +7610,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6902,6 +7622,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6913,6 +7634,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6924,6 +7646,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6935,6 +7658,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6946,6 +7670,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6957,6 +7682,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6968,6 +7694,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6979,6 +7706,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -6990,6 +7718,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7001,6 +7730,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7012,6 +7742,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7023,6 +7754,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7034,6 +7766,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7045,6 +7778,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7056,6 +7790,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7067,6 +7802,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7078,6 +7814,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7089,6 +7826,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7100,6 +7838,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7111,6 +7850,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7122,6 +7862,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7133,6 +7874,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7144,6 +7886,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7155,6 +7898,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7166,6 +7910,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7177,6 +7922,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7188,6 +7934,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7199,6 +7946,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7210,6 +7958,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7221,6 +7970,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7232,6 +7982,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7243,6 +7994,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7254,6 +8006,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7265,6 +8018,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7276,6 +8030,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7287,6 +8042,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7298,6 +8054,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7309,6 +8066,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7320,6 +8078,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7331,6 +8090,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7342,6 +8102,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7353,6 +8114,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7364,6 +8126,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7375,6 +8138,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7386,6 +8150,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7397,6 +8162,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7408,6 +8174,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7419,6 +8186,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7427,6 +8195,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.innodbmtr", + "rule_list": [], "table_desc": "mysql_info_schema_innodb_metrics", "table_name": "innodbmtr" }, @@ -7437,6 +8206,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7448,6 +8218,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7459,6 +8230,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7470,6 +8242,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7481,6 +8254,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7492,6 +8266,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7503,6 +8278,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7513,6 +8289,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7523,6 +8300,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7533,6 +8311,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7540,6 +8319,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.innodbtrx", + "rule_list": [], "table_desc": "mysql_engine_innodb_metrics_locks", "table_name": "innodbtrx" }, @@ -7550,6 +8330,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7561,6 +8342,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7572,6 +8354,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7583,6 +8366,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7594,6 +8378,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7605,6 +8390,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -7616,6 +8402,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "le" ], @@ -7629,6 +8416,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "le" ], @@ -7642,6 +8430,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "le" ], @@ -7655,6 +8444,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7662,6 +8452,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.resptime", + "rule_list": [], "table_desc": "mysql_info_schema_query_response_time", "table_name": "resptime" }, @@ -7672,6 +8463,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "column", "schema", @@ -7687,6 +8479,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "column", "schema", @@ -7697,11 +8490,23 @@ "monitor_type": "metric", "is_diff_metric": false }, + { + "name": "int_type", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, { "name": "column", "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7712,6 +8517,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7722,6 +8528,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7729,6 +8536,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.tableincr", + "rule_list": [], "table_desc": "mysql_info_schema_auto_increment", "table_name": "tableincr" }, @@ -7739,6 +8547,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "component", "schema", @@ -7754,6 +8563,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "schema" ], @@ -7767,6 +8577,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "table", "schema" @@ -7781,6 +8592,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7791,6 +8603,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7801,6 +8614,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7808,6 +8622,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.tablesize", + "rule_list": [], "table_desc": "mysql_info_schema_table_size schema", "table_name": "tablesize" }, @@ -7818,6 +8633,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "schema", "table", @@ -7836,6 +8652,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7846,6 +8663,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7856,6 +8674,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7866,6 +8685,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7876,6 +8696,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7886,6 +8707,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7896,6 +8718,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7903,6 +8726,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.tabledef", + "rule_list": [], "table_desc": "mysql_info_schema_table_version", "table_name": "tabledef" }, @@ -7913,6 +8737,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "version", "version_comment", @@ -7928,6 +8753,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7938,6 +8764,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7948,6 +8775,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -7955,6 +8783,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.version", + "rule_list": [], "table_desc": "mysql_version_info", "table_name": "version" }, @@ -7965,6 +8794,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "command", "state" @@ -7979,6 +8809,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "command", "state" @@ -7993,6 +8824,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "mysql_user" ], @@ -8006,6 +8838,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8016,6 +8849,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8026,6 +8860,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8033,16 +8868,42 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.plist", + "rule_list": [], "table_desc": "mysql_info_schema_processlist", "table_name": "plist" }, { "fields": [ + { + "name": "mysql_infodba_schema_heartbeat_delay_sec", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "mysql_infodba_schema_heartbeat_beat_sec", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, { "name": "mysql_slave_status_auto_position", "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8059,6 +8920,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8075,6 +8937,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8091,6 +8954,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8107,6 +8971,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8123,6 +8988,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8139,6 +9005,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8155,6 +9022,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8171,6 +9039,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8187,6 +9056,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8203,6 +9073,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8219,6 +9090,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8235,6 +9107,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8251,6 +9124,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8267,6 +9141,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8283,6 +9158,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8299,6 +9175,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8315,6 +9192,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8331,6 +9209,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8347,6 +9226,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "channel_name", "connection_name", @@ -8358,11 +9238,34 @@ "monitor_type": "metric", "is_diff_metric": false }, + { + "name": "beat_from", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, + { + "name": "master_server_id", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "", + "monitor_type": "dimension", + "is_diff_metric": false + }, { "name": "channel_name", "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8373,6 +9276,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8383,6 +9287,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8393,6 +9298,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8400,6 +9306,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.slavestat", + "rule_list": [], "table_desc": "mysql_slave_status", "table_name": "slavestat" }, @@ -8410,6 +9317,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "collector" ], @@ -8423,6 +9331,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -8434,6 +9343,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -8445,6 +9355,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -8452,6 +9363,7 @@ } ], "table_id": "exporter_dbm_mysqld_exporter.internal", + "rule_list": [], "table_desc": "exporter collector", "table_name": "internal" } @@ -8465,5 +9377,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbookkeeper_bkpull.json b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbookkeeper_bkpull.bookkeeper.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbookkeeper_bkpull.json rename to dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbookkeeper_bkpull.bookkeeper.json index d4a003df95..46fb48c04b 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbookkeeper_bkpull.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbookkeeper_bkpull.bookkeeper.json @@ -1,14 +1,17 @@ { "bk_biz_id": 0, "plugin_id": "dbm_pulsarbookkeeper_bkpull", + "name": "dbm_pulsarbookkeeper_bkpull", "db_type": "pulsar", + "short_name": "bookkeeper", "details": { "name": "dbm_pulsarbookkeeper_bkpull", "label": "component", "params": { "plugin": { - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", + "bk_app_code": "app_id", "instance": "instance", "cluster_name": "cluster_name", "cluster_type": "cluster_type", @@ -21,8 +24,7 @@ "collector": { "period": 60, "timeout": 60, - "password": "", - "username": "", + "password": false, "metrics_url": "http://{{ target.host.bk_host_innerip }}:8000/metrics" }, "target_node_type": "TOPO", @@ -4517,7 +4519,7 @@ } ], "table_id": "pushgateway_dbm_pulsarbookkeeper_bkpull.group1", - "table_desc": "默认分组", + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", "table_name": "group1" } ], @@ -4532,5 +4534,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbroker_bkpull.json b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbroker_bkpull.broker.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbroker_bkpull.json rename to dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbroker_bkpull.broker.json index e20047ebdd..4a838c1ec8 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarbroker_bkpull.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarbroker_bkpull.broker.json @@ -1,14 +1,17 @@ { "bk_biz_id": 0, "plugin_id": "dbm_pulsarbroker_bkpull", + "name": "dbm_pulsarbroker_bkpull", "db_type": "pulsar", + "short_name": "broker", "details": { "name": "dbm_pulsarbroker_bkpull", "label": "component", "params": { "plugin": { - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", + "bk_app_code": "app_id", "instance": "instance", "cluster_name": "cluster_name", "cluster_type": "cluster_type", @@ -21,8 +24,7 @@ "collector": { "period": 60, "timeout": 60, - "password": "", - "username": "", + "password": false, "metrics_url": "http://{{ target.host.bk_host_innerip }}:8080/metrics/" }, "target_node_type": "TOPO", @@ -2632,7 +2634,7 @@ } ], "table_id": "pushgateway_dbm_pulsarbroker_bkpull.group1", - "table_desc": "默认分组", + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", "table_name": "group1" } ], @@ -2647,5 +2649,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarzookeeper_bkpull.json b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarzookeeper_bkpull.zookeeper.json similarity index 99% rename from dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarzookeeper_bkpull.json rename to dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarzookeeper_bkpull.zookeeper.json index b33e05936a..2c0687aeba 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.pulsar.dbm_pulsarzookeeper_bkpull.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/pulsar.dbm_pulsarzookeeper_bkpull.zookeeper.json @@ -1,14 +1,17 @@ { "bk_biz_id": 0, "plugin_id": "dbm_pulsarzookeeper_bkpull", + "name": "dbm_pulsarzookeeper_bkpull", "db_type": "pulsar", + "short_name": "zookeeper", "details": { "name": "dbm_pulsarzookeeper_bkpull", "label": "component", "params": { "plugin": { - "服务实例维度注入": { + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", + "bk_app_code": "app_id", "instance": "instance", "cluster_name": "cluster_name", "cluster_type": "cluster_type", @@ -21,8 +24,8 @@ "collector": { "period": 60, "timeout": 60, - "password": "", - "username": "", + "password": false, + "bk_username": "", "metrics_url": "http://{{ target.host.bk_host_innerip }}:8000/metrics" }, "target_node_type": "TOPO", @@ -3084,7 +3087,7 @@ } ], "table_id": "pushgateway_dbm_pulsarzookeeper_bkpull.group1", - "table_desc": "默认分组", + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", "table_name": "group1" } ], @@ -3099,5 +3102,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_predixy_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_predixy_exporter.predixy.json similarity index 90% rename from dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_predixy_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_predixy_exporter.predixy.json index 138ac67e2b..f796255bc1 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_predixy_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_predixy_exporter.predixy.json @@ -1,18 +1,21 @@ { "bk_biz_id": 0, "plugin_id": "dbm_predixy_exporter", + "name": "dbm_predixy_exporter", "db_type": "redis", + "short_name": "predixy", "details": { - "name": "dbm_predixy", + "name": "dbm_predixy_exporter", "label": "component", "params": { "plugin": { - "-addr": "{{ target.host.bk_host_innerip }}:{{ target.process[\"redis\"].bind_info[0].port }}", + "-addr": "{{ target.host.bk_host_innerip }}:{{ target.process[\"redis-predixy\"].bind_info[0].port }}", "-bind": "${host}:${port}", - "-password-file": "/home/mysql/.exporter/{{ target.process[\"redis\"].bind_info[0].port }}.conf", - "服务实例维度注入": { + "-password-file": "/home/mysql/.exporter/{{ target.process[\"redis-predixy\"].bind_info[0].port }}.conf", + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", + "bk_app_code": "app_id", "cluster_name": "cluster_name", "cluster_type": "cluster_type", "instance_host": "instance_host", @@ -33,23 +36,21 @@ "plugin_info": { "plugin_id": "dbm_predixy_exporter", "metric_json": [ + { + "fields": [], + "table_id": "exporter_dbm_predixy_exporter.group_default", + "rule_list": [], + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group_default" + }, { "fields": [ - { - "name": "_server", - "type": "string", - "unit": "none", - "is_active": true, - "description": "", - "source_name": "server", - "monitor_type": "dimension", - "is_diff_metric": false - }, { "name": "go_gc_duration_seconds", "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -61,6 +62,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -72,6 +74,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -83,6 +86,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -94,6 +98,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -105,6 +110,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -116,6 +122,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -127,6 +134,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -138,6 +146,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -149,6 +158,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -160,6 +170,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -171,6 +182,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -182,6 +194,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -193,6 +206,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -204,6 +218,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -215,6 +230,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -226,6 +242,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -237,6 +254,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -248,6 +266,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -259,6 +278,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -270,6 +290,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -281,6 +302,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -292,6 +314,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -303,6 +326,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -314,6 +338,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -325,6 +350,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -336,6 +362,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -347,6 +374,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -358,6 +386,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -369,6 +398,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -380,6 +410,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -391,6 +422,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -402,6 +434,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -413,6 +446,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -424,6 +458,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -435,6 +470,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -446,6 +482,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -457,6 +494,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -468,6 +506,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -479,6 +518,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -490,6 +530,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -501,6 +542,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -512,6 +554,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -523,6 +566,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "latency", "le", @@ -539,6 +583,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "latency", "le", @@ -554,6 +599,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "latency", "server", @@ -569,6 +615,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "latency", "server", @@ -584,6 +631,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "latency" @@ -598,6 +646,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "latency" @@ -612,6 +661,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -626,6 +676,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -640,6 +691,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -654,6 +706,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -668,6 +721,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -682,6 +736,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "server" @@ -696,6 +751,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -709,6 +765,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -722,6 +779,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -735,6 +793,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -748,6 +807,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -761,6 +821,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -774,6 +835,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -787,6 +849,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -800,6 +863,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -813,6 +877,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -826,6 +891,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -839,6 +905,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -852,6 +919,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -865,6 +933,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr" ], @@ -878,6 +947,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cluster", "addr" @@ -892,6 +962,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "cluster" @@ -906,6 +977,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "cluster" @@ -920,6 +992,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "cluster" @@ -934,6 +1007,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "cluster" @@ -948,6 +1022,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "addr", "cluster" @@ -957,11 +1032,23 @@ "monitor_type": "metric", "is_diff_metric": false }, + { + "name": "_server", + "type": "string", + "unit": "none", + "is_active": true, + "is_manual": true, + "description": "", + "source_name": "server", + "monitor_type": "dimension", + "is_diff_metric": false + }, { "name": "version", "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -972,6 +1059,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -982,6 +1070,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -992,6 +1081,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -1002,6 +1092,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -1009,7 +1100,8 @@ } ], "table_id": "exporter_dbm_predixy_exporter.Group1", - "table_desc": "分组1", + "rule_list": [], + "table_desc": "\u5206\u7ec41", "table_name": "Group1" } ], @@ -1022,5 +1114,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_redis_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_redis_exporter.redis.json similarity index 90% rename from dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_redis_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_redis_exporter.redis.json index 2a92b02739..2a8a476e38 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_redis_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_redis_exporter.redis.json @@ -1,19 +1,22 @@ { "bk_biz_id": 0, "plugin_id": "dbm_redis_exporter", + "name": "dbm_redis_exporter", "db_type": "redis", + "short_name": "redis", "details": { - "name": "dbm_redis", + "name": "dbm_redis_exporter", "label": "component", "params": { "plugin": { - "-redis.addr": "{{ target.host.bk_host_innerip }}:{{ target.process[\"redis\"].bind_info[0].port }}", + "-redis.addr": "{{ target.host.bk_host_innerip }}:{{ target.service.labels[\"instance_port\"] }}", "-config-command": "CONFXX", "-web.listen-address": "${host}:${port}", - "-redis.password-file": "/home/mysql/.exporter/{{ target.process[\"redis\"].bind_info[0].port }}.conf", - "服务实例维度注入": { + "-redis.password-file": "/home/mysql/.exporter/{{ target.service.labels[\"instance_port\"] }}.conf", + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", + "bk_app_code": "app_id", "cluster_name": "cluster_name", "cluster_type": "cluster_type", "instance_host": "instance_host", @@ -34,13 +37,69 @@ "plugin_info": { "plugin_id": "dbm_redis_exporter", "metric_json": [ + { + "fields": [], + "table_id": "exporter_dbm_redis_exporter.group_default", + "rule_list": [], + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group_default" + }, { "fields": [ + { + "name": "redis_rocksdb_disk_expiredkeys", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "redis_rocksdb_expired_keys_to_delete", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "redis_rocksdb_perfstat_internal_key_skipped_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, + { + "name": "redis_rocksdb_perfstat_internal_delete_skipped_count", + "type": "double", + "unit": "none", + "is_active": true, + "is_manual": true, + "dimensions": [], + "description": "", + "source_name": "", + "monitor_type": "metric", + "is_diff_metric": false + }, { "name": "redis_rocksdb_level_deletions", "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "store", "level" @@ -55,6 +114,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "level", "store" @@ -69,6 +129,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "level", "store" @@ -83,6 +144,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "store", "level" @@ -97,6 +159,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -108,6 +171,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -119,6 +183,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -130,6 +195,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -141,6 +207,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -152,6 +219,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -163,6 +231,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -174,6 +243,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -185,6 +255,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -196,6 +267,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -207,6 +279,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -218,6 +291,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -229,6 +303,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -240,6 +315,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -251,6 +327,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -262,6 +339,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -273,6 +351,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -284,6 +363,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -295,6 +375,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -306,6 +387,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -317,6 +399,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -328,6 +411,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -339,6 +423,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -350,6 +435,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -361,6 +447,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -372,6 +459,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -383,6 +471,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -394,6 +483,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -405,6 +495,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -416,6 +507,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -427,6 +519,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -438,6 +531,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -449,6 +543,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -460,6 +555,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -471,6 +567,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -482,6 +579,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -493,6 +591,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -504,6 +603,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -515,6 +615,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -526,6 +627,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -537,6 +639,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -548,6 +651,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -559,6 +663,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -570,6 +675,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -581,6 +687,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -592,6 +699,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -603,6 +711,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -614,6 +723,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -625,6 +735,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -636,6 +747,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -647,6 +759,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -658,6 +771,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -669,6 +783,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -680,6 +795,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -691,6 +807,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -702,6 +819,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -713,6 +831,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -724,6 +843,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "master_host", "master_port" @@ -738,6 +858,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -749,6 +870,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -760,6 +882,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -771,6 +894,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -782,6 +906,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -793,6 +918,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -804,6 +930,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -815,6 +942,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "err" ], @@ -828,6 +956,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -839,6 +968,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -850,6 +980,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -861,6 +992,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -872,6 +1004,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -883,6 +1016,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -894,6 +1028,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -905,6 +1040,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -916,6 +1052,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -927,6 +1064,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -938,6 +1076,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -949,6 +1088,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -960,6 +1100,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -971,6 +1112,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -982,6 +1124,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -993,6 +1136,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1004,6 +1148,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1015,6 +1160,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1026,6 +1172,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1037,6 +1184,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1048,6 +1196,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -1061,6 +1210,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1072,6 +1222,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1083,6 +1234,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1094,6 +1246,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -1107,6 +1260,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1118,6 +1272,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1129,6 +1284,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1140,6 +1296,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1151,6 +1308,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "slave_ip", "slave_port", @@ -1166,6 +1324,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "process_id", "run_id", @@ -1187,6 +1346,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1198,6 +1358,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1209,6 +1370,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -1222,6 +1384,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1233,6 +1396,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1244,6 +1408,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "version" ], @@ -1257,6 +1422,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1268,6 +1434,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1279,6 +1446,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1290,6 +1458,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1301,6 +1470,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1312,6 +1482,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1323,6 +1494,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1334,6 +1506,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1345,6 +1518,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1356,6 +1530,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1367,6 +1542,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1378,6 +1554,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1389,6 +1566,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1400,6 +1578,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1411,6 +1590,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1422,6 +1602,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1433,6 +1614,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1444,6 +1626,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1455,6 +1638,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1466,6 +1650,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1477,6 +1662,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1488,6 +1674,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1499,6 +1686,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1510,6 +1698,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1521,6 +1710,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1532,6 +1722,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1543,6 +1734,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1554,6 +1746,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1565,6 +1758,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1576,6 +1770,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1587,6 +1782,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1598,6 +1794,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1609,6 +1806,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1620,6 +1818,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1631,6 +1830,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1642,6 +1842,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1653,6 +1854,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1664,6 +1866,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1675,6 +1878,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1686,6 +1890,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1697,6 +1902,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1708,6 +1914,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1719,6 +1926,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1730,6 +1938,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "db" ], @@ -1743,6 +1952,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1754,6 +1964,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1765,6 +1976,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1776,6 +1988,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1787,6 +2000,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1798,6 +2012,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1809,6 +2024,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1820,6 +2036,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1831,6 +2048,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1842,6 +2060,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1853,6 +2072,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1864,6 +2084,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1875,6 +2096,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1886,6 +2108,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1897,6 +2120,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1908,6 +2132,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1919,6 +2144,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1930,6 +2156,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1941,6 +2168,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1952,6 +2180,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1963,6 +2192,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1974,6 +2204,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1985,6 +2216,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -1996,6 +2228,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2007,6 +2240,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2018,6 +2252,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2029,6 +2264,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2040,6 +2276,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "db" ], @@ -2053,6 +2290,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "master_host", "master_port" @@ -2067,6 +2305,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2078,6 +2317,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2089,6 +2329,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2100,6 +2341,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2111,6 +2353,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2122,6 +2365,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2133,6 +2377,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2144,6 +2389,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2155,6 +2401,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2166,6 +2413,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2177,6 +2425,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2188,6 +2437,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2199,6 +2449,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2210,6 +2461,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2221,6 +2473,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2232,6 +2485,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2243,6 +2497,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2254,6 +2509,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2265,6 +2521,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2276,6 +2533,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2287,6 +2545,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2298,6 +2557,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2309,6 +2569,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2320,6 +2581,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2331,6 +2593,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2342,6 +2605,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2353,6 +2617,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2364,6 +2629,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2375,6 +2641,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2386,6 +2653,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2397,6 +2665,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2408,6 +2677,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2419,6 +2689,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2430,6 +2701,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "master_host", "master_port" @@ -2444,6 +2716,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2455,6 +2728,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2466,6 +2740,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2477,6 +2752,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2488,6 +2764,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2499,6 +2776,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "master_host", "master_port", @@ -2514,6 +2792,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2525,6 +2804,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "master_host", "master_port" @@ -2539,6 +2819,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2550,6 +2831,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2561,6 +2843,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2572,6 +2855,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2583,6 +2867,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2594,6 +2879,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2605,6 +2891,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2616,6 +2903,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2627,6 +2915,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2638,6 +2927,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2649,6 +2939,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2660,6 +2951,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2671,6 +2963,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2682,6 +2975,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2693,6 +2987,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2704,6 +2999,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2715,6 +3011,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2726,6 +3023,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2737,6 +3035,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2748,6 +3047,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2759,6 +3059,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2770,6 +3071,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2781,6 +3083,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "slave_ip", "slave_port", @@ -2796,6 +3099,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2807,6 +3111,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2818,6 +3123,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2829,6 +3135,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2840,6 +3147,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2851,6 +3159,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2862,6 +3171,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2873,6 +3183,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2884,6 +3195,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2895,6 +3207,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2906,6 +3219,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2917,6 +3231,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2928,6 +3243,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2939,6 +3255,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2950,6 +3267,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2961,6 +3279,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2972,6 +3291,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2983,6 +3303,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -2994,6 +3315,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3005,6 +3327,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3016,6 +3339,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3027,6 +3351,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3038,6 +3363,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3049,6 +3375,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3060,6 +3387,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3071,6 +3399,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3082,6 +3411,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3093,6 +3423,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3104,6 +3435,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3115,6 +3447,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3126,6 +3459,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3137,6 +3471,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3148,6 +3483,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3159,6 +3495,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3170,6 +3507,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3181,6 +3519,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3192,6 +3531,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3203,6 +3543,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3214,6 +3555,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3225,6 +3567,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3236,6 +3579,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3247,6 +3591,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3258,6 +3603,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3269,6 +3615,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "db" ], @@ -3282,6 +3629,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3293,6 +3641,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3304,6 +3653,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3315,6 +3665,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3326,6 +3677,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3337,6 +3689,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -3350,6 +3703,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3361,6 +3715,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3372,6 +3727,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3383,6 +3739,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3394,6 +3751,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3405,6 +3763,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3416,6 +3775,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3427,6 +3787,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3438,6 +3799,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "slave_ip", "slave_port", @@ -3453,6 +3815,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3464,6 +3827,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3475,6 +3839,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3486,6 +3851,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3497,6 +3863,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3508,6 +3875,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3519,6 +3887,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3530,6 +3899,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3541,6 +3911,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3552,6 +3923,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3563,6 +3935,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3574,6 +3947,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3585,6 +3959,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3596,6 +3971,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3607,6 +3983,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3618,6 +3995,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3629,6 +4007,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3640,6 +4019,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3651,6 +4031,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3662,6 +4043,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3673,6 +4055,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3684,6 +4067,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3695,6 +4079,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3706,6 +4091,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3717,6 +4103,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3728,6 +4115,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "golang_version", "version", @@ -3744,6 +4132,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3755,6 +4144,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "err" ], @@ -3768,6 +4158,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3779,6 +4170,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3790,6 +4182,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3801,6 +4194,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3812,6 +4206,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3823,6 +4218,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3834,6 +4230,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3845,6 +4242,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3856,6 +4254,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3867,6 +4266,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "quantile" ], @@ -3880,6 +4280,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3891,6 +4292,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3902,6 +4304,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3913,6 +4316,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3924,6 +4328,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3935,6 +4340,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3946,6 +4352,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3957,6 +4364,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -3968,6 +4376,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -3978,6 +4387,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -3988,6 +4398,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -3998,6 +4409,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4008,6 +4420,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4018,6 +4431,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4028,6 +4442,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4038,6 +4453,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4048,6 +4464,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4058,6 +4475,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4068,6 +4486,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4078,6 +4497,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4088,6 +4508,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4098,6 +4519,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4108,6 +4530,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4118,6 +4541,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4128,6 +4552,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4138,6 +4563,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4148,6 +4574,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4158,6 +4585,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4168,6 +4596,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4178,6 +4607,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4188,6 +4618,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4198,6 +4629,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4208,6 +4640,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -4215,6 +4648,7 @@ } ], "table_id": "exporter_dbm_redis_exporter.group1", + "rule_list": [], "table_desc": "group1", "table_name": "group1" } @@ -4228,5 +4662,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_twemproxy_exporter.json b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_twemproxy_exporter.twemproxy.json similarity index 86% rename from dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_twemproxy_exporter.json rename to dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_twemproxy_exporter.twemproxy.json index 482555aef5..945fec3b89 100644 --- a/dbm-ui/backend/db_monitor/tpls/collect/0.redis.dbm_twemproxy_exporter.json +++ b/dbm-ui/backend/db_monitor/tpls/collect/redis.dbm_twemproxy_exporter.twemproxy.json @@ -1,18 +1,21 @@ { "bk_biz_id": 0, "plugin_id": "dbm_twemproxy_exporter", + "name": "dbm_twemproxy_exporter", "db_type": "redis", + "short_name": "twemproxy", "details": { - "name": "dbm_twemproxy", + "name": "dbm_twemproxy_exporter", "label": "component", "params": { "plugin": { - "-addr": "{{ target.host.bk_host_innerip }}:{{ target.process[\"redis\"].bind_info[0].port }}", + "-addr": "{{ target.host.bk_host_innerip }}:{{ target.process[\"redis-twemproxy\"].bind_info[0].port }}", "-bind": "${host}:${port}", - "-password-file": "/home/mysql/.exporter/{{ target.process[\"redis\"].bind_info[0].port }}.conf", - "服务实例维度注入": { + "-password-file": "/home/mysql/.exporter/{{ target.process[\"redis-twemproxy\"].bind_info[0].port }}.conf", + "\u670d\u52a1\u5b9e\u4f8b\u7ef4\u5ea6\u6ce8\u5165": { "app": "app", "instance": "instance", + "bk_app_code": "app_id", "cluster_name": "cluster_name", "cluster_type": "cluster_type", "instance_host": "instance_host", @@ -33,6 +36,13 @@ "plugin_info": { "plugin_id": "dbm_twemproxy_exporter", "metric_json": [ + { + "fields": [], + "table_id": "exporter_dbm_twemproxy_exporter.group_default", + "rule_list": [], + "table_desc": "\u9ed8\u8ba4\u5206\u7ec4", + "table_name": "group_default" + }, { "fields": [ { @@ -40,6 +50,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -51,6 +62,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -62,6 +74,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -73,6 +86,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -84,6 +98,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -95,6 +110,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -106,6 +122,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -117,6 +134,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -128,6 +146,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -139,6 +158,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -150,6 +170,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -161,6 +182,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -172,6 +194,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -183,6 +206,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -194,6 +218,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [], "description": "", "source_name": "", @@ -202,7 +227,8 @@ } ], "table_id": "exporter_dbm_twemproxy_exporter.Group1", - "table_desc": "分组1", + "rule_list": [], + "table_desc": "\u5206\u7ec41", "table_name": "Group1" }, { @@ -212,6 +238,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "build_date", "commit_sha", @@ -228,6 +255,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "version" ], @@ -241,6 +269,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -251,6 +280,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -261,6 +291,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -271,6 +302,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -278,7 +310,8 @@ } ], "table_id": "exporter_dbm_twemproxy_exporter.Group2", - "table_desc": "分组2", + "rule_list": [], + "table_desc": "\u5206\u7ec42", "table_name": "Group2" }, { @@ -288,6 +321,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "code" ], @@ -301,6 +335,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -308,7 +343,8 @@ } ], "table_id": "exporter_dbm_twemproxy_exporter.Group3", - "table_desc": "分组3", + "rule_list": [], + "table_desc": "\u5206\u7ec43", "table_name": "Group3" }, { @@ -318,6 +354,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -331,6 +368,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "cmd" ], @@ -344,6 +382,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -351,7 +390,8 @@ } ], "table_id": "exporter_dbm_twemproxy_exporter.Group4", - "table_desc": "分组4", + "rule_list": [], + "table_desc": "\u5206\u7ec44", "table_name": "Group4" }, { @@ -361,6 +401,7 @@ "type": "double", "unit": "none", "is_active": true, + "is_manual": true, "dimensions": [ "le" ], @@ -374,6 +415,7 @@ "type": "string", "unit": "none", "is_active": true, + "is_manual": true, "description": "", "source_name": "", "monitor_type": "dimension", @@ -381,7 +423,8 @@ } ], "table_id": "exporter_dbm_twemproxy_exporter.Group5", - "table_desc": "分组5", + "rule_list": [], + "table_desc": "\u5206\u7ec45", "table_name": "Group5" } ], @@ -394,5 +437,6 @@ "target_nodes": [], "target_node_type": "TOPO", "target_object_type": "SERVICE" - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/dbm-ui/backend/db_monitor/urls.py b/dbm-ui/backend/db_monitor/urls.py index 22b4ea9167..84c98c6ef7 100644 --- a/dbm-ui/backend/db_monitor/urls.py +++ b/dbm-ui/backend/db_monitor/urls.py @@ -8,13 +8,18 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ - from rest_framework.routers import DefaultRouter +from backend.db_monitor.views.duty_rule import MonitorDutyRuleViewSet from backend.db_monitor.views.grafana import MonitorGrafanaViewSet +from backend.db_monitor.views.notice_group import MonitorNoticeGroupViewSet +from backend.db_monitor.views.policy import MonitorPolicyViewSet routers = DefaultRouter(trailing_slash=True) routers.register(r"grafana", MonitorGrafanaViewSet, basename="grafana") +routers.register(r"policy", MonitorPolicyViewSet, basename="policy") +routers.register(r"notice_group", MonitorNoticeGroupViewSet, basename="notice_group") +routers.register(r"duty_rule", MonitorDutyRuleViewSet, basename="duty_rule") urlpatterns = routers.urls diff --git a/dbm-ui/backend/db_monitor/views/duty_rule.py b/dbm-ui/backend/db_monitor/views/duty_rule.py new file mode 100644 index 0000000000..8893a29850 --- /dev/null +++ b/dbm-ui/backend/db_monitor/views/duty_rule.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.decorators import method_decorator +from django.utils.translation import ugettext_lazy as _ + +from backend.bk_web import viewsets +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.db_monitor import serializers +from backend.db_monitor.models.alarm import DutyRule +from backend.db_monitor.serializers import DutyRuleSerializer +from backend.iam_app.handlers.drf_perm import GlobalManageIAMPermission + +SWAGGER_TAG = _("告警轮值规则") + + +@method_decorator( + name="list", + decorator=common_swagger_auto_schema(operation_summary=_("查询轮值规则列表"), tags=[SWAGGER_TAG]), +) +@method_decorator( + name="create", + decorator=common_swagger_auto_schema( + operation_summary=_("新建轮值规则"), tags=[SWAGGER_TAG], request_body=serializers.DutyRuleCreateSerializer() + ), +) +@method_decorator( + name="retrieve", + decorator=common_swagger_auto_schema(operation_summary=_("获取轮值规则"), tags=[SWAGGER_TAG]), +) +@method_decorator( + name="update", + decorator=common_swagger_auto_schema( + operation_summary=_("更新轮值规则"), tags=[SWAGGER_TAG], request_body=serializers.DutyRuleUpdateSerializer() + ), +) +@method_decorator( + name="partial_update", + decorator=common_swagger_auto_schema( + operation_summary=_("部分更新轮值规则"), tags=[SWAGGER_TAG], request_body=serializers.DutyRuleUpdateSerializer() + ), +) +@method_decorator( + name="destroy", + decorator=common_swagger_auto_schema(operation_summary=_("删除轮值规则"), tags=[SWAGGER_TAG]), +) +class MonitorDutyRuleViewSet(viewsets.AuditedModelViewSet): + """ + 轮值规则视图 + """ + + queryset = DutyRule.objects.all() + serializer_class = DutyRuleSerializer + filter_fields = {"db_type": ["exact"]} + + def _get_custom_permissions(self): + return [GlobalManageIAMPermission()] diff --git a/dbm-ui/backend/db_monitor/views/grafana.py b/dbm-ui/backend/db_monitor/views/grafana.py index 45ac9c57b8..4d8e645c82 100644 --- a/dbm-ui/backend/db_monitor/views/grafana.py +++ b/dbm-ui/backend/db_monitor/views/grafana.py @@ -24,7 +24,7 @@ from backend.db_monitor.serializers import DashboardUrlSerializer, GetDashboardSerializer from backend.iam_app.handlers.drf_perm import DBManageIAMPermission -SWAGGER_TAG = _("监控告警管理") +from .. import constants class MonitorGrafanaViewSet(viewsets.SystemViewSet): @@ -39,7 +39,7 @@ def _get_custom_permissions(self): operation_summary=_("查询内嵌仪表盘地址"), query_serializer=GetDashboardSerializer, responses={status.HTTP_200_OK: DashboardUrlSerializer}, - tags=[SWAGGER_TAG], + tags=[constants.SWAGGER_TAG], ) @action(methods=["GET"], detail=False, serializer_class=GetDashboardSerializer, pagination_class=None) def get_dashboard(self, request): diff --git a/dbm-ui/backend/db_monitor/views/notice_group.py b/dbm-ui/backend/db_monitor/views/notice_group.py new file mode 100644 index 0000000000..46e45bbca5 --- /dev/null +++ b/dbm-ui/backend/db_monitor/views/notice_group.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from collections import Counter + +import django_filters +from django.db.models import Q +from django.utils.decorators import method_decorator +from django.utils.translation import ugettext_lazy as _ +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.response import Response + +from backend.bk_web import viewsets +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.components import CCApi, CmsiApi +from backend.configuration.constants import PLAT_BIZ_ID +from backend.db_monitor import serializers +from backend.db_monitor.models import MonitorPolicy, NoticeGroup +from backend.db_monitor.serializers import NoticeGroupSerializer +from backend.iam_app.handlers.drf_perm import DBManageIAMPermission + +SWAGGER_TAG = _("监控告警组") + + +class MonitorPolicyListFilter(django_filters.FilterSet): + name = django_filters.CharFilter(field_name="name", lookup_expr="icontains", label=_("告警组名称")) + bk_biz_id = django_filters.NumberFilter(method="filter_bk_biz_id", label=_("业务ID")) + + def filter_bk_biz_id(self, queryset, name, value): + """ + 内置告警组优先使用业务配置, + """ + biz_built_in_group = queryset.filter(bk_biz_id=value, is_built_in=True) + db_types = set(list(biz_built_in_group.values_list("db_type", flat=True))) + plat_built_in_group_ids = ( + queryset.filter(bk_biz_id=PLAT_BIZ_ID, is_built_in=True) + .exclude(db_type__in=db_types) + .values_list("id", flat=True) + ) + return queryset.filter(Q(bk_biz_id=value) | Q(id__in=plat_built_in_group_ids)).order_by("is_built_in") + + class Meta: + model = NoticeGroup + fields = ["bk_biz_id", "name"] + + +@method_decorator( + name="list", + decorator=common_swagger_auto_schema(operation_summary=_("查询监控告警组列表"), tags=[SWAGGER_TAG]), +) +@method_decorator( + name="create", + decorator=common_swagger_auto_schema( + operation_summary=_("新建监控告警组"), tags=[SWAGGER_TAG], request_body=serializers.NoticeGroupCreateSerializer() + ), +) +@method_decorator( + name="retrieve", + decorator=common_swagger_auto_schema(operation_summary=_("获取监控告警组"), tags=[SWAGGER_TAG]), +) +@method_decorator( + name="update", + decorator=common_swagger_auto_schema( + operation_summary=_("更新监控告警组"), tags=[SWAGGER_TAG], request_body=serializers.NoticeGroupUpdateSerializer() + ), +) +@method_decorator( + name="destroy", + decorator=common_swagger_auto_schema(operation_summary=_("删除监控告警组"), tags=[SWAGGER_TAG]), +) +class MonitorNoticeGroupViewSet(viewsets.AuditedModelViewSet): + """ + 监控告警组视图 + """ + + queryset = NoticeGroup.objects.all() + serializer_class = NoticeGroupSerializer + filter_class = MonitorPolicyListFilter + + def _get_custom_permissions(self): + return [DBManageIAMPermission()] + + def get_serializer_context(self): + context = super().get_serializer_context() + notify_groups = MonitorPolicy.objects.exclude(notify_groups=[]).values_list("notify_groups", flat=True) + context["group_used"] = dict(Counter([item for group in notify_groups for item in group])) + return context + + @common_swagger_auto_schema(operation_summary=_("查询通知类型"), tags=[SWAGGER_TAG]) + @action(methods=["GET"], detail=False) + def get_msg_type(self, request, *args, **kwargs): + return Response(CmsiApi.get_msg_type()) diff --git a/dbm-ui/backend/db_monitor/views/policy.py b/dbm-ui/backend/db_monitor/views/policy.py new file mode 100644 index 0000000000..3c51942574 --- /dev/null +++ b/dbm-ui/backend/db_monitor/views/policy.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.db.models import Q +from django.utils.decorators import method_decorator +from django.utils.translation import ugettext as _ +from django_filters import rest_framework as filters +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.response import Response + +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.bk_web.viewsets import AuditedModelViewSet + +from ...configuration.constants import PLAT_BIZ_ID, DBType +from ...db_meta.enums import ClusterType, InstanceRole +from ...db_meta.models import Cluster, DBModule, StorageInstance +from ...iam_app.handlers.drf_perm import DBManageIAMPermission +from .. import constants +from ..models import MonitorPolicy +from ..serializers import ( + ListClusterSerializer, + ListModuleSerializer, + MonitorPolicyCloneSerializer, + MonitorPolicyEmptySerializer, + MonitorPolicyListSerializer, + MonitorPolicySerializer, + MonitorPolicyUpdateSerializer, +) + + +class MonitorPolicyListFilter(filters.FilterSet): + name = filters.CharFilter(field_name="name", lookup_expr="icontains", label=_("策略名")) + updater = filters.CharFilter(lookup_expr="exact", label=_("更新人")) + creator = filters.CharFilter(lookup_expr="creator", label=_("创建人")) + db_type = filters.CharFilter(lookup_expr="exact", label=_("db类型")) + target_keyword = filters.CharFilter(lookup_expr="icontains", label=_("目标关键字检索")) + is_enabled = filters.BooleanFilter(label=_("是否启用")) + + bk_biz_id = filters.NumberFilter(method="filter_bk_biz_id", label=_("业务ID")) + + # 如果只需要开区间,可以简化配置,这里的注释留作学习示例 + # (create_at_after, create_at_before): create_at_after=2023-09-05 14:29:00&create_at_before=2023-09-05 14:30:05 + # create_at = filters.DateTimeFromToRangeFilter("create_at") + # 拆分rangeFilter,支持两端闭区间 + create_at_before = filters.DateTimeFilter(field_name="create_at", lookup_expr="lte") + create_at_after = filters.DateTimeFilter(field_name="create_at", lookup_expr="gte") + + # 需要利用Q查询 + notify_groups = filters.CharFilter(method="filter_notify_groups", label=_("告警组")) + + def filter_notify_groups(self, queryset, name, value): + """过滤多个告警组: value=1,2,3""" + + qs = Q() + for group in map(lambda x: int(x), value.split(",")): + qs = qs | Q(notify_groups__contains=group) + + return queryset.filter(qs) + + def filter_bk_biz_id(self, queryset, name, value): + """默认包含平台告警策略""" + return queryset.filter(bk_biz_id__in=[PLAT_BIZ_ID, value]) + + class Meta: + model = MonitorPolicy + fields = [ + "bk_biz_id", + "name", + "db_type", + "updater", + "creator", + "create_at_before", + "create_at_after", + "is_enabled", + "target_keyword", + "notify_groups", + ] + + +@method_decorator( + name="list", + decorator=common_swagger_auto_schema( + operation_summary=_("获取策略列表"), + tags=[constants.SWAGGER_TAG], + responses={status.HTTP_200_OK: MonitorPolicyListSerializer()}, + ), +) +@method_decorator( + name="retrieve", + decorator=common_swagger_auto_schema( + operation_summary=_("获取策略详情"), + tags=[constants.SWAGGER_TAG], + responses={status.HTTP_200_OK: MonitorPolicySerializer()}, + ), +) +@method_decorator( + name="update", + decorator=common_swagger_auto_schema(tags=[constants.SWAGGER_TAG]), +) +@method_decorator( + name="destroy", + decorator=common_swagger_auto_schema(operation_summary=_("删除策略"), tags=[constants.SWAGGER_TAG]), +) +@method_decorator( + name="create", + decorator=common_swagger_auto_schema(tags=[constants.SWAGGER_TAG]), +) +class MonitorPolicyViewSet(AuditedModelViewSet): + """监控策略管理""" + + queryset = MonitorPolicy.objects.order_by("-create_at") + + http_method_names = ["get", "post", "delete"] + + # filter_fields = { + # "name": ["exact", "contains"], + # "bk_biz_id": ["exact", "in"], + # "db_type": ["exact", "in"], + # "is_enabled": ["exact"], + # "policy_status": ["exact", "in"], + # "create_at": ["lte", "gte"], + # } + filter_class = MonitorPolicyListFilter + ordering_fields = ("-create_at",) + + def _get_custom_permissions(self): + return [DBManageIAMPermission()] + + def get_serializer_class(self): + if self.action == "list": + return MonitorPolicyListSerializer + return MonitorPolicySerializer + + @common_swagger_auto_schema( + operation_summary=_("启用策略"), tags=[constants.SWAGGER_TAG], request_body=MonitorPolicyEmptySerializer() + ) + @action(methods=["POST"], detail=True) + def enable(self, request, *args, **kwargs): + return Response(self.get_object().enable()) + + @common_swagger_auto_schema( + operation_summary=_("停用策略"), tags=[constants.SWAGGER_TAG], request_body=MonitorPolicyEmptySerializer() + ) + @action(methods=["POST"], detail=True) + def disable(self, request, *args, **kwargs): + return Response(self.get_object().disable()) + + @common_swagger_auto_schema( + operation_summary=_("克隆策略"), tags=[constants.SWAGGER_TAG], request_body=MonitorPolicyCloneSerializer() + ) + @action(methods=["POST"], detail=False, serializer_class=MonitorPolicyCloneSerializer) + def clone_strategy(self, request, *args, **kwargs): + return Response(MonitorPolicy.clone(self.validated_data, request.user.username)) + + @common_swagger_auto_schema( + operation_summary=_("更新策略"), tags=[constants.SWAGGER_TAG], request_body=MonitorPolicyUpdateSerializer() + ) + @action(methods=["POST"], detail=True, serializer_class=MonitorPolicyUpdateSerializer) + def update_strategy(self, request, *args, **kwargs): + return Response(self.get_object().update(self.validated_data, request.user.username)) + + # @common_swagger_auto_schema( + # operation_summary=_("恢复默认策略"), tags=[constants.SWAGGER_TAG], request_body=MonitorPolicyEmptySerializer() + # ) + # @action(methods=["POST"], detail=True) + # def reset(self, request, *args, **kwargs): + # return Response(self.get_object().reset()) + + @common_swagger_auto_schema( + operation_summary=_("根据db类型查询集群列表"), + tags=[constants.SWAGGER_TAG], + query_serializer=ListClusterSerializer, + ) + @action( + methods=["GET"], detail=False, serializer_class=ListClusterSerializer, pagination_class=None, filter_class=None + ) + def cluster_list(self, request, *args, **kwargs): + dbtype = self.validated_data["dbtype"] + + if dbtype == DBType.InfluxDB: + return Response( + StorageInstance.objects.filter(instance_role=InstanceRole.INFLUXDB).values_list( + "machine__ip", flat=True + ) + ) + + clusters = Cluster.objects.filter(cluster_type__in=ClusterType.db_type_to_cluster_type(dbtype)) + + return Response(clusters.values_list("immute_domain", flat=True)) + + @common_swagger_auto_schema( + operation_summary=_("根据db类型查询模块列表"), + tags=[constants.SWAGGER_TAG], + query_serializer=ListModuleSerializer, + ) + @action( + methods=["GET"], detail=False, serializer_class=ListModuleSerializer, pagination_class=None, filter_class=None + ) + def db_module_list(self, request, *args, **kwargs): + dbtype = self.validated_data["dbtype"] + return Response( + DBModule.objects.filter(cluster_type__in=ClusterType.db_type_to_cluster_type(dbtype)).values( + "db_module_id", "db_module_name" + ) + ) diff --git a/dbm-ui/backend/db_package/views.py b/dbm-ui/backend/db_package/views.py index 34bbdd801d..1a74602084 100644 --- a/dbm-ui/backend/db_package/views.py +++ b/dbm-ui/backend/db_package/views.py @@ -46,6 +46,16 @@ def _get_custom_permissions(self): def create(self, request, *args, **kwargs): return super().create(request, *args, **kwargs) + @common_swagger_auto_schema( + operation_summary=_("新建或者更新版本文件"), + tags=[DB_PACKAGE_TAG], + ) + @action(methods=["POST"], detail=False) + def update_or_create(self, request, *args, **kwargs): + data = self.params_validate(self.get_serializer_class()) + Package.objects.update_or_create(**data) + return Response() + @common_swagger_auto_schema( operation_summary=_("查询版本文件列表"), tags=[DB_PACKAGE_TAG], diff --git a/dbm-ui/backend/db_periodic_task/constants.py b/dbm-ui/backend/db_periodic_task/constants.py index 5a74efcd42..c93a8d58cd 100644 --- a/dbm-ui/backend/db_periodic_task/constants.py +++ b/dbm-ui/backend/db_periodic_task/constants.py @@ -20,3 +20,11 @@ class PeriodicTaskType(str, StructuredEnum): REMOTE = EnumField("remote", _("远程 API 周期任务")) LOCAL = EnumField("local", _("本地函数周期任务")) + + +class NoticeSignalEnum(str, StructuredEnum): + recovered = EnumField("recovered", _("告警恢复时")) + abnormal = EnumField("abnormal", _("告警触发时")) + closed = EnumField("closed", _("告警关闭时")) + ack = EnumField("ack", _("告警确认时")) + no_data = EnumField("no_data", _("无数据告警")) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/ReadMe.md b/dbm-ui/backend/db_periodic_task/local_tasks/ReadMe.md new file mode 100644 index 0000000000..fc7743b7f2 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/ReadMe.md @@ -0,0 +1 @@ +# 如果检查结果需要持久存储, 在 `dbm-ui/backend/db_report` 中添加 `module` \ No newline at end of file diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/__init__.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/__init__.py new file mode 100644 index 0000000000..3427fcdbf0 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/__init__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from .db_meta_check import db_meta_check_task +from .sync_cluster_stat import sync_cluster_stat_from_monitor +from .update_app_cache import update_app_cache +from .update_host_dbmeta import update_host_dbmeta diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/constants.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/constants.py new file mode 100644 index 0000000000..2dbf531e4c --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/constants.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from backend.db_meta.enums import ClusterType + +UNIFY_QUERY_PARAMS = params = { + "bk_biz_id": 3, + "query_configs": [ + { + "data_source_label": "prometheus", + "data_type_label": "time_series", + "promql": "", + "interval": 60, + "alias": "a", + } + ], + "expression": "a", + "alias": "a", + # 单位:s + "start_time": 1697100405, + "end_time": 1697101305, + "slimit": 500, + "down_sample_range": "1s", +} + +QUERY_TEMPLATE = { + ClusterType.TendisTwemproxyRedisInstance: { + "range": 5, + "used": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:exporter_dbm_redis_exporter:redis_memory_used_bytes{ instance_role="redis_master"}[1m] + ))""", + "total": """sum by (cluster_domain) ( + avg by (cluster_domain, bk_target_ip) ( + avg_over_time( + bkmonitor:dbm_system:mem:total{instance_role="redis_master"}[1m] + ) + ))""", + }, + # TODO: 待完善,从采集器出发,直接上报total + ClusterType.TwemproxyTendisSSDInstance: { + "range": 5, + "used": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:exporter_dbm_redis_exporter:redis_rocksdb_datadir_size_kb{ instance_role="redis_master"}[1m] + ) * 1024)""", + "total": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:total{ instance_role="redis_master", mount_point=~"^/data|/data1$"}[1m] + ))""", + }, + ClusterType.TenDBSingle: { + "range": 15, + "used": """max by (cluster_domain) ( + max_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_used_mb{instance_role="orphan"}[5m] + ) * 1024 * 1024 )""", + "total": """max by (cluster_domain) ( + max_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_total_mb{instance_role="orphan"}[5m] + ) * 1024 * 1024 )""", + }, + ClusterType.TenDBHA: { + "range": 15, + "used": """sum by (cluster_domain) ( + max by (cluster_domain, ip) ( + max_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_used_mb{instance_role="backend_master"}[5m] + ) * 1024 * 1024 + ))""", + "total": """sum by (cluster_domain) ( + max by (cluster_domain, ip) ( + max_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_total_mb{instance_role="backend_master"}[5m] + ) * 1024 * 1024 + ))""", + }, + ClusterType.TenDBCluster: { + "range": 5, + "used": """sum by (cluster_domain) ( + avg by (cluster_domain, ip) ( + avg_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_used_mb{instance_role="remote_master"}[1m] + ) * 1024))""", + "total": """sum by (cluster_domain) ( + avg by (cluster_domain, ip) ( + avg_over_time( + bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_total_mb{instance_role="remote_master"}[1m] + ) * 1024))""", + }, + # es采集器本身存在容量统计指标(elasticsearch_filesystem_data_size_bytes、elasticsearch_indices_store_size_bytes) + # 但数据节点只注册了一个,这里暂时用磁盘容量计算 + ClusterType.Es: { + "range": 5, + "used": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:used{ + device_type=~"ext.?|xfs", + instance_role=~"^(es_datanode_hot|es_datanode_cold)$", + mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + "total": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:total{ + device_type=~"ext.?|xfs", + instance_role=~"^(es_datanode_hot|es_datanode_cold)$", + mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + }, + ClusterType.Kafka: { + "range": 5, + "used": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:used{ + device_type=~"ext.?|xfs",instance_role="broker",mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + "total": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:total{ + device_type=~"ext.?|xfs", + instance_role="broker", + mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + }, + ClusterType.Pulsar: { + "range": 5, + "used": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:used{ + device_type=~"ext.?|xfs", + instance_role="pulsar_bookkeeper", + mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + "total": """sum by (cluster_domain) ( + sum_over_time( + bkmonitor:dbm_system:disk:total{ + device_type=~"ext.?|xfs", + instance_role="pulsar_bookkeeper", + mount_point!~"^(/|/usr/local)$" + }[1m] + ))""", + }, + ClusterType.Hdfs: { + "range": 5, + "used": """avg by (cluster_domain) ( + avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_capacity_used[1m]))""", + "total": """avg by (cluster_domain) ( + avg_over_time(bkmonitor:exporter_dbm_hdfs_exporter:hadoop_namenode_capacity_total[1m]))""", + }, + ClusterType.Influxdb: { + "range": 5, + "used": """max by (instance_host) ( + max_over_time(bkmonitor:pushgateway_dbm_influxdb_bkpull:disk_used{path=~"^/data|/data1$"}[1m]))""", + "total": """max by (instance_host) ( + max_over_time(bkmonitor:pushgateway_dbm_influxdb_bkpull:disk_total{path=~"^/data|/data1$"}[1m]))""", + }, +} diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/__init__.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/__init__.py new file mode 100644 index 0000000000..c0e3d9b019 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from .task import db_meta_check_task diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py new file mode 100644 index 0000000000..adb55d14b8 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.translation import ugettext as _ + +from backend.db_meta.enums import ClusterType, InstanceInnerRole, InstanceRole, MachineType +from backend.db_meta.models import Cluster +from backend.db_report.enums import MetaCheckSubType +from backend.db_report.models import MetaCheckReport + + +def check_cluster_topo(): + _check_tendbsingle_topo() + _check_tendbha_topo() + _check_tendbcluster_topo() + + +def _check_tendbsingle_topo(): + """ + 有且只有一个存储实例 + """ + for c in Cluster.objects.filter(cluster_type=ClusterType.TenDBSingle): + messages = [] + if c.proxyinstance_set.exists(): + messages.append(_("有 {} 个接入层实例".format(c.proxyinstance_set.count()))) + + if c.storageinstance_set.count() != 1: + messages.append(_("有 {} 个存储层实例".format(c.storageinstance_set.count()))) + + ins = c.storageinstance_set.get() + if not ( + ins.machine.machine_type == MachineType.SINGLE.value + and ins.instance_role == InstanceRole.ORPHAN.value + and ins.instance_inner_role == InstanceInnerRole.ORPHAN.value + ): + messages.append( + _( + "实例 {} ({}-{}-{}) 与集群类型不匹配".format( + ins.ip_port, ins.machine.machine_type, ins.instance_role, ins.instance_inner_role + ) + ) + ) + + if messages: + MetaCheckReport.objects.create( + bk_biz_id=c.bk_biz_id, + bk_cloud_id=c.bk_cloud_id, + cluster=c.immute_domain, + cluster_type=ClusterType.TenDBSingle, + status=False, + msg=", ".join(messages), + subtype=MetaCheckSubType.ClusterTopo.value, + ) + + +def _check_tendbha_topo(): + """ + 1. 至少 2 个 proxy + 2. 1 个 master + 3. 至少 1 个 slave + """ + Cluster.objects.filter(cluster_type=ClusterType.TenDBHA) + + +def _check_tendbcluster_topo(): + Cluster.objects.filter(cluster_type=ClusterType.TenDBCluster) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py new file mode 100644 index 0000000000..5d498ead4b --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from typing import Union + +from django.db.models import Count, Q, QuerySet +from django.utils.translation import ugettext_lazy as _ + +from backend.db_meta.models import ProxyInstance, StorageInstance +from backend.db_report.enums import MetaCheckSubType +from backend.db_report.models import MetaCheckReport + + +def check_instance_belong(): + """ + 所有实例都应该属于唯一一个集群 + """ + _instance_belong(StorageInstance.objects.all()) + _instance_belong(ProxyInstance.objects.all()) + + +def _instance_belong(qs: QuerySet): + for ins in qs.annotate(cluster_count=Count("cluster")).filter(~Q(cluster_count=1)): + if ins.cluster.exists(): # 大于 1 个集群 + msg = _("{} 属于 {} 个集群".format(ins.ip_port(), ins.cluster.count())) # ToDo 详情 + else: # 不属于任何集群 + msg = _("{} 不属于任何集群".format(ins.ip_port())) + + MetaCheckReport.objects.create( + bk_biz_id=ins.bk_biz_id, + bk_cloud_id=ins.machine.bk_cloud_id, + ip=ins.machine.ip, + port=ins.port, + cluster_type=ins.cluster_type, + machine_type=ins.machine.machine_type, + status=False, + msg=msg, + subtype=MetaCheckSubType.InstanceBelong.value, + ) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py new file mode 100644 index 0000000000..24e4dd815d --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.core.exceptions import ObjectDoesNotExist +from django.utils.translation import ugettext_lazy as _ + +from backend.db_meta.enums import InstanceInnerRole +from backend.db_meta.models import StorageInstanceTuple +from backend.db_report.enums import MetaCheckSubType +from backend.db_report.models import MetaCheckReport + + +def check_replicate_role(): + """ + ejector 只能是 master, repeater; 即不能是 slave + receiver 只能是 slave, repeater; 即不能是 master + """ + for bad_ejector_tuple in StorageInstanceTuple.objects.filter( + ejector__instance_inner_role=InstanceInnerRole.SLAVE.value + ): + ejector = bad_ejector_tuple.ejector + try: + MetaCheckReport.objects.create( + bk_biz_id=ejector.bk_biz_id, + bk_cloud_id=ejector.machine.bk_cloud_id, + ip=ejector.machine.ip, + port=ejector.port, + cluster=ejector.cluster.get().immute_domain, + cluster_type=ejector.cluster_type, + machine_type=ejector.machine.machine_type, + status=False, + msg=_("{} {} 不能作为同步 ejector".format(ejector.ip_port(), ejector.instance_inner_role)), + subtype=MetaCheckSubType.ReplicateRole.value, + ) + except ObjectDoesNotExist: # 忽略实例没有集群关系的异常, instance-belong 会发现这个错误 + pass + + for bad_receiver_tuple in StorageInstanceTuple.objects.filter( + receiver__instance_inner_role=InstanceInnerRole.MASTER.value + ): + receiver = bad_receiver_tuple.ejector + try: + MetaCheckReport.objects.create( + bk_biz_id=receiver.bk_biz_id, + bk_cloud_id=receiver.machine.bk_cloud_id, + ip=receiver.machine.ip, + port=receiver.port, + cluster=receiver.cluster.get().immute_domain, + cluster_type=receiver.cluster_type, + machine_type=receiver.machine.machine_type, + status=False, + msg=_("{} {} 不能作为同步 receiver".format(receiver.ip_port(), receiver.instance_inner_role)), + subtype=MetaCheckSubType.ReplicateRole.value, + ) + except ObjectDoesNotExist: # 忽略实例没有集群关系的异常, instance-belong 会发现这个错误 + pass diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/task.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/task.py new file mode 100644 index 0000000000..5e850ab4b0 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/task.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging + +from celery.schedules import crontab + +from backend.db_periodic_task.local_tasks.register import register_periodic_task + +from .check_instance_belong import check_instance_belong +from .check_replicate_role import check_replicate_role + +logger = logging.getLogger("celery") + + +# @register_periodic_task(run_every=crontab(minute="*/1")) +@register_periodic_task(run_every=crontab(minute=3, hour=2)) +def db_meta_check_task(): + """ + 巡检校验元数据 + """ + check_instance_belong() + check_replicate_role() diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/sync_cluster_stat.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/sync_cluster_stat.py new file mode 100644 index 0000000000..d157db4dea --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/sync_cluster_stat.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import datetime +import json +import logging +from collections import defaultdict + +from celery.schedules import crontab +from django.core.cache import cache + +from backend import env +from backend.components import BKMonitorV3Api +from backend.constants import CACHE_CLUSTER_STATS +from backend.db_meta.enums import ClusterType, InstanceRole +from backend.db_meta.models import Cluster, StorageInstance + +from ..register import register_periodic_task +from .constants import QUERY_TEMPLATE, UNIFY_QUERY_PARAMS + +logger = logging.getLogger("celery") + + +def query_cap(cluster_type, cap_key="used"): + """查询某类集群的某种容量: used/total""" + + query_template = QUERY_TEMPLATE.get(cluster_type) + if not query_template: + logger.error("No query template for cluster type: %s", cluster_type) + return {} + + # now-5/15m ~ now + end_time = datetime.datetime.now() + start_time = end_time - datetime.timedelta(minutes=query_template["range"]) + + params = copy.deepcopy(UNIFY_QUERY_PARAMS) + params["bk_biz_id"] = env.DBA_APP_BK_BIZ_ID + params["start_time"] = int(start_time.timestamp()) + params["end_time"] = int(end_time.timestamp()) + + params["query_configs"][0]["promql"] = query_template[cap_key] + series = BKMonitorV3Api.unify_query(params)["series"] + + # print(cluster_type, cap_key, json.dumps(params, indent=2), json.dumps(series, indent=2)) + + cluster_bytes = {} + for serie in series: + # 集群:cluster_domain | influxdb: instance_host + cluster_domain = list(serie["dimensions"].values())[0] + # cluster_domain = serie["dimensions"]["cluster_domain"] + datapoints = list(filter(lambda dp: dp[0] is not None, serie["datapoints"])) + + if not datapoints: + logger.info("No datapoints for cluster: %s -> %s", cluster_domain, serie["datapoints"]) + continue + cluster_bytes[cluster_domain] = datapoints[-1][0] + + return cluster_bytes + + +def query_cluster_capacity(cluster_type): + """查询集群容量""" + + cluster_cap_bytes = defaultdict(dict) + + domains = list( + Cluster.objects.filter(cluster_type=cluster_type).values_list("immute_domain", flat=True).distinct() + ) + + influxdb_hosts = StorageInstance.objects.filter(instance_role=InstanceRole.INFLUXDB).values_list( + "machine__ip", flat=True + ) + domains.extend(influxdb_hosts) + + used_data = query_cap(cluster_type, "used") + for cluster, used in used_data.items(): + # 排除无效集群 + if cluster not in domains: + continue + cluster_cap_bytes[cluster]["used"] = used + + total_data = query_cap(cluster_type, "total") + for cluster, used in total_data.items(): + # 排除无效集群 + if cluster not in domains: + continue + cluster_cap_bytes[cluster]["total"] = used + + # print(cluster_type, cluster_cap_bytes) + return cluster_cap_bytes + + +@register_periodic_task(run_every=crontab(minute="*/5")) +def sync_cluster_stat_from_monitor(): + """ + 同步各集群容量状态 + """ + + logger.info("sync_cluster_stat_from_monitor started") + cluster_types = list(Cluster.objects.values_list("cluster_type", flat=True).distinct()) + cluster_types.append(ClusterType.Influxdb.value) + + cluster_stats = {} + for cluster_type in cluster_types: + try: + cluster_capacity = query_cluster_capacity(cluster_type) + cluster_stats.update(cluster_capacity) + except Exception as e: + logger.error("query_cluster_capacity error: %s -> %s", cluster_type, e) + + # 计算使用率 + for cluster, cap in cluster_stats.items(): + cap["in_use"] = round(cap["used"] * 100.0 / cap["total"], 2) + + # print(cluster_stats) + cache.set(CACHE_CLUSTER_STATS, json.dumps(cluster_stats)) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_app_cache.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_app_cache.py new file mode 100644 index 0000000000..5b84899004 --- /dev/null +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_app_cache.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import datetime +import logging + +from celery.schedules import crontab + +from backend import env +from backend.components import CCApi +from backend.db_meta.models import AppCache +from backend.db_periodic_task.local_tasks.register import register_periodic_task +from backend.dbm_init.constants import CC_APP_ABBR_ATTR + +logger = logging.getLogger("celery") + + +@register_periodic_task(run_every=crontab(minute="*/20")) +def update_app_cache(): + """缓存空闲机拓扑""" + now = datetime.datetime.now() + logger.warning("[db_meta] start update app cache start: %s", now) + + bizs = CCApi.search_business().get("info", []) + + updated_hosts, created_hosts = [], [] + for biz in bizs: + try: + logger.warning("[db_meta] sync app : %s", biz["bk_biz_id"]) + bk_app_abbr = biz.get(env.BK_APP_ABBR, "") + db_app_abbr = biz.get(CC_APP_ABBR_ATTR, "").lower().replace(" ", "-").replace("_", "-") + + # 目标环境中存在bk_app_abbr,则同步过来 + if env.BK_APP_ABBR and env.BK_APP_ABBR != CC_APP_ABBR_ATTR: + # db_app_abbr为空才同步 + if not db_app_abbr and db_app_abbr != bk_app_abbr: + CCApi.update_business( + {"bk_biz_id": biz["bk_biz_id"], "data": {"db_app_abbr": bk_app_abbr}}, use_admin=True + ) + db_app_abbr = bk_app_abbr + + obj, created = AppCache.objects.update_or_create( + defaults={ + "db_app_abbr": db_app_abbr, + "bk_biz_name": biz["bk_biz_name"], + "language": biz["language"], + "time_zone": biz["time_zone"], + "bk_biz_maintainer": biz["bk_biz_maintainer"], + }, + bk_biz_id=biz["bk_biz_id"], + ) + + if created: + created_hosts.append(obj.bk_biz_id) + else: + updated_hosts.append(obj.bk_biz_id) + except Exception as e: # pylint: disable=wildcard-import + logger.error("[db_meta] cache app error: %s (%s)", biz, e) + + logger.warning( + "[db_meta] finish update app cache end: %s, create_cnt: %s, update_cnt: %s", + datetime.datetime.now() - now, + len(created_hosts), + len(updated_hosts), + ) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_host_dbmeta.py similarity index 63% rename from dbm-ui/backend/db_periodic_task/local_tasks/db_meta.py rename to dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_host_dbmeta.py index 4edb4eb98d..c422c8037b 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/update_host_dbmeta.py @@ -13,26 +13,65 @@ import logging from celery.schedules import crontab -from celery.task import periodic_task from backend import env from backend.components import CCApi -from backend.db_meta.models import AppCache, Cluster, Machine +from backend.db_meta.models import Cluster, Machine from backend.db_meta.models.cluster_monitor import SyncFailedMachine from backend.db_periodic_task.local_tasks.register import register_periodic_task -from backend.dbm_init.constants import CC_APP_ABBR_ATTR, CC_HOST_DBM_ATTR +from backend.db_services.ipchooser.query.resource import ResourceQueryHelper +from backend.dbm_init.constants import CC_HOST_DBM_ATTR logger = logging.getLogger("celery") -@register_periodic_task(run_every=5, args=[1], kwargs={"z": 3}) -def check_db_meta(x=None, y=None, z=None): +@register_periodic_task(run_every=crontab(minute="*/5")) +def reset_host_dbmeta(bk_biz_id=env.DBA_APP_BK_BIZ_ID, bk_host_ids=None): """ - 巡检校验元数据 + 重置业务下空闲集群主机的dbm_meta属性 """ - print("x:", x) - print("y:", y) - print("z:", z) + now = datetime.datetime.now() + logger.info("[reset_host_dbmeta] start reset begin: %s", now) + + if not bk_host_ids: + machines = ResourceQueryHelper.query_cc_hosts( + { + "bk_biz_id": bk_biz_id, + "bk_inst_id": CCApi.get_biz_internal_module({"bk_biz_id": bk_biz_id}, use_admin=True)["bk_set_id"], + "bk_obj_id": "set", + }, + fields=["bk_host_id"], + )["info"] + bk_host_ids = list(map(lambda x: x["bk_host_id"], machines)) + + # 批量更新接口限制最多500条 + step_size = 496 + reset_hosts, failed_hosts = [], [] + for step in range(len(bk_host_ids) // step_size + 1): + updates = [] + for bk_host_id in bk_host_ids[step * step_size : (step + 1) * step_size]: + updates.append({"properties": {CC_HOST_DBM_ATTR: json.dumps([])}, "bk_host_id": bk_host_id}) + reset_hosts.extend(updates) + + try: + logger.info("[reset_host_dbmeta] batch_update_host: %s", updates) + CCApi.batch_update_host({"update": updates}, use_admin=True) + except Exception as e: # pylint: disable=wildcard-import + failed_hosts.extend(updates) + logger.error("[reset_host_dbmeta] batch reset exception: %s (%s)", updates, e) + + # 容错处理:逐个更新,避免批量更新误伤有效ip + for fail_host in failed_hosts: + try: + CCApi.update_host({"bk_host_id": fail_host["bk_host_id"], "data": fail_host["properties"]}, use_admin=True) + except Exception as e: # pylint: disable=wildcard-import + logger.error("[reset_host_dbmeta] single reset error: %s (%s)", fail_host, e) + + logger.info( + "[reset_host_dbmeta] finish reset end: %s, update_cnt: %s", + datetime.datetime.now() - now, + len(reset_hosts), + ) @register_periodic_task(run_every=crontab(minute="*/2")) @@ -69,12 +108,12 @@ def update_host_dbmeta(bk_biz_id=None, cluster_id=None, cluster_ips=None, dbm_me machines = machines.filter(ip__in=cluster_ips) # 批量更新接口限制最多500条,这里取456条 - STEP = 456 + step_size = 456 updated_hosts, failed_updates = [], [] machine_count = machines.count() - for step in range(machine_count // STEP + 1): + for step in range(machine_count // step_size + 1): updates = [] - for machine in machines[step * STEP : (step + 1) * STEP]: + for machine in machines[step * step_size : (step + 1) * step_size]: cc_dbm_meta = machine.dbm_meta if dbm_meta is None else dbm_meta updates.append( {"properties": {CC_HOST_DBM_ATTR: json.dumps(cc_dbm_meta)}, "bk_host_id": machine.bk_host_id} @@ -103,53 +142,3 @@ def update_host_dbmeta(bk_biz_id=None, cluster_id=None, cluster_ips=None, dbm_me datetime.datetime.now() - now, len(updated_hosts), ) - - -@register_periodic_task(run_every=crontab(minute="*/20")) -def update_app_cache(): - """缓存空闲机拓扑""" - now = datetime.datetime.now() - logger.warning("[db_meta] start update app cache start: %s", now) - - bizs = CCApi.search_business().get("info", []) - - updated_hosts, created_hosts = [], [] - for biz in bizs: - try: - logger.warning("[db_meta] sync app : %s", biz["bk_biz_id"]) - bk_app_abbr = biz.get(env.BK_APP_ABBR, "") - db_app_abbr = biz.get(CC_APP_ABBR_ATTR, "").lower().replace(" ", "-").replace("_", "-") - - # 目标环境中存在bk_app_abbr,则同步过来 - if env.BK_APP_ABBR and env.BK_APP_ABBR != CC_APP_ABBR_ATTR: - # db_app_abbr为空才同步 - if not db_app_abbr and db_app_abbr != bk_app_abbr: - CCApi.update_business( - {"bk_biz_id": biz["bk_biz_id"], "data": {"db_app_abbr": bk_app_abbr}}, use_admin=True - ) - db_app_abbr = bk_app_abbr - - obj, created = AppCache.objects.update_or_create( - defaults={ - "db_app_abbr": db_app_abbr, - "bk_biz_name": biz["bk_biz_name"], - "language": biz["language"], - "time_zone": biz["time_zone"], - "bk_biz_maintainer": biz["bk_biz_maintainer"], - }, - bk_biz_id=biz["bk_biz_id"], - ) - - if created: - created_hosts.append(obj.bk_biz_id) - else: - updated_hosts.append(obj.bk_biz_id) - except Exception as e: # pylint: disable=wildcard-import - logger.error("[db_meta] cache app error: %s (%s)", biz, e) - - logger.warning( - "[db_meta] finish update app cache end: %s, create_cnt: %s, update_cnt: %s", - datetime.datetime.now() - now, - len(created_hosts), - len(updated_hosts), - ) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py index 498564b886..c221bcf5e8 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py @@ -9,18 +9,24 @@ specific language governing permissions and limitations under the License. """ import datetime +import glob +import json import logging +import os from celery.schedules import crontab -from celery.task import periodic_task -from django.utils.translation import ugettext as _ +from django_redis import get_redis_connection from backend import env from backend.components import BKMonitorV3Api -from backend.configuration.constants import DEFAULT_DB_ADMINISTRATORS +from backend.configuration.constants import DEFAULT_DB_ADMINISTRATORS, PLAT_BIZ_ID from backend.configuration.models import DBAdministrator -from backend.db_monitor.models import NoticeGroup -from backend.db_periodic_task.local_tasks import register_periodic_task +from backend.db_monitor.constants import MONITOR_EVENTS_PREFIX, TPLS_ALARM_DIR, TargetPriority +from backend.db_monitor.exceptions import BkMonitorSaveAlarmException +from backend.db_monitor.models import DispatchGroup, MonitorPolicy, NoticeGroup +from backend.db_monitor.tasks import update_app_policy + +from .register import register_periodic_task logger = logging.getLogger("celery") @@ -32,22 +38,33 @@ def update_local_notice_group(): now = datetime.datetime.now() logger.info("[local_notice_group] start update local group at: %s", now) - platform_dbas = DBAdministrator.objects.filter(bk_biz_id=0) + dbas = DBAdministrator.objects.all() updated_groups, created_groups = 0, 0 - for dba in platform_dbas: - # 跳过不需要同步的告警组 - if NoticeGroup.objects.filter(db_type=dba.db_type, dba_sync=False).exists(): - continue - - obj, updated = NoticeGroup.objects.update_or_create( - defaults={"receivers": dba.users}, bk_biz_id=0, db_type=dba.db_type - ) + for dba in dbas: + receiver_users = dba.users or DEFAULT_DB_ADMINISTRATORS - if updated: - updated_groups += 1 - else: - created_groups += 1 + try: + group_name = f"{dba.get_db_type_display()}_DBA" + logger.info("[local_notice_group] update_or_create notice group: %s", group_name) + + obj, created = NoticeGroup.objects.update_or_create( + defaults={ + "name": group_name, + "receivers": [{"id": user, "type": "user"} for user in receiver_users], + }, + bk_biz_id=dba.bk_biz_id, + db_type=dba.db_type, + is_built_in=True, + ) + + if created: + created_groups += 1 + else: + updated_groups += 1 + except Exception as e: + logger.error("[local_notice_group] update_or_create notice group error: %s", e) + continue logger.info( "[local_notice_group] finish update local group end: %s, create_cnt: %s, update_cnt: %s", @@ -57,44 +74,170 @@ def update_local_notice_group(): ) -@register_periodic_task(run_every=crontab(minute="*/3")) -def update_remote_notice_group(): - """同步告警组""" +@register_periodic_task(run_every=crontab(minute="*/5")) +def sync_plat_monitor_policy(): + """同步平台告警策略""" + + def get_bkm_strategy(name, bk_biz_id=env.DBA_APP_BK_BIZ_ID): + res = BKMonitorV3Api.search_alarm_strategy_v3( + { + "page": 1, + "page_size": 1, + "conditions": [{"key": "name", "value": name}], + "bk_biz_id": bk_biz_id, + "with_notice_group": False, + "with_notice_group_detail": False, + }, + use_admin=True, + ) + + # 批量获取策略 + strategy_config_list = res["strategy_config_list"] + return strategy_config_list[0] if strategy_config_list else None now = datetime.datetime.now() - logger.info("[remote_notice_group] start update remote group start: %s", now) + logger.warning("[sync_plat_monitor_policy] sync bkm alarm policy start: %s", now) + + # 逐个json导入,本地+远程 + updated_policies = 0 + alarm_tpls = glob.glob(os.path.join(TPLS_ALARM_DIR, "*.json")) + + for alarm_tpl in alarm_tpls: + with open(alarm_tpl, "r") as f: + template_dict = json.loads(f.read()) + + # just for test + # template_dict["name"] = template_dict["name"] + "-" + get_random_string(5) + + # patch template + template_dict["details"]["labels"] = list(set(template_dict["details"]["labels"])) + template_dict["details"]["name"] = template_dict["name"] + template_dict["details"]["priority"] = TargetPriority.PLATFORM.value + # 平台策略仅开启基于分派通知 + template_dict["details"]["notice"]["options"]["assign_mode"] = ["by_rule"] - groups = NoticeGroup.objects.filter(dba_sync=True) + policy = MonitorPolicy(**template_dict) - updated_groups = 0 - for group in groups: + policy_name = policy.name + logger.info("[sync_plat_monitor_policy] start sync bkm alarm policy: %s " % policy_name) try: - logger.info("[remote_notice_group] update remote group: %s " % group.db_type) - group_users = set(group.receivers + DEFAULT_DB_ADMINISTRATORS) - group_params = { - "bk_biz_id": env.DBA_APP_BK_BIZ_ID, - "notice_receiver": [{"type": "user", "id": user} for user in group_users], - "name": f"{group.get_db_type_display()}_DBA_{group.bk_biz_id}", - "notice_way": {"1": ["rtx", "voice"], "2": ["rtx"], "3": ["rtx"]}, - "webhook_url": "", - "message": _("DBA系统专用"), - "wxwork_group": {}, - } - - # update or create - if group.monitor_group_id: - group_params["id"] = group.monitor_group_id - - res = BKMonitorV3Api.save_notice_group(group_params) - group.monitor_group_id = res["id"] - group.save() - - updated_groups += 1 - except Exception as e: # pylint: disable=wildcard-import - logger.error("[remote_notice_group] update remote group error: %s (%s)", group.db_type, e) + synced_policy = MonitorPolicy.objects.get( + bk_biz_id=policy.bk_biz_id, db_type=policy.db_type, name=policy_name + ) + + if synced_policy.version >= policy.version: + logger.info("[sync_plat_monitor_policy] skip same version alarm: %s " % policy_name) + continue + + for keeped_field in MonitorPolicy.KEEPED_FIELDS: + setattr(policy, keeped_field, getattr(synced_policy, keeped_field)) + + policy.details["id"] = synced_policy.monitor_policy_id + logger.info("[sync_plat_monitor_policy] update bkm alarm policy: %s " % policy_name) + except MonitorPolicy.DoesNotExist: + # # 支持从监控反向同步 + # bkm_strategy = get_bkm_strategy(policy_name) + # if bkm_strategy: + # policy.details = bkm_strategy + # logger.info("[sync_plat_monitor_policy] sync and update bkm alarm policy: %s " % policy_name) + # else: + # logger.info("[sync_plat_monitor_policy] create bkm alarm policy: %s " % policy_name) + logger.info("[sync_plat_monitor_policy] create bkm alarm policy: %s " % policy_name) - logger.info( - "[remote_notice_group] finish update remote group end: %s, update_cnt: %s", + try: + # fetch targets/test_rules/notify_rules/notify_groups from parent details + for attr, value in policy.parse_details().items(): + setattr(policy, attr, value) + + policy.save() + updated_policies += 1 + logger.error("[sync_plat_monitor_policy] save bkm alarm policy success: %s", policy_name) + except BkMonitorSaveAlarmException as e: + logger.error("[sync_plat_monitor_policy] save bkm alarm policy failed: %s, %s ", policy_name, e) + + logger.warning( + "[sync_plat_monitor_policy] finish sync bkm alarm policy end: %s, update_cnt: %s", datetime.datetime.now() - now, - updated_groups, + updated_policies, ) + + +@register_periodic_task(run_every=crontab(minute="*/5")) +def sync_plat_dispatch_policy(): + """同步平台分派通知策略 + 按照app_id->db_type来拆分策略: + bk_biz_id=0: db_type=redis and policy=1,2,3 -> notify_group: 1 + bk_biz_id>0: db_type=redis and policy=1,2,3 and app_id=6 -> notify_group: 2 + """ + + logger.info("sync_plat_dispatch_policy started") + # 同步平台/业务分派策略 + for bk_biz_id in NoticeGroup.objects.exclude(monitor_group_id=0).values_list("bk_biz_id", flat=True).distinct(): + latest_rules = DispatchGroup.get_rules(bk_biz_id) + try: + dispatch_group = DispatchGroup.objects.get(bk_biz_id=bk_biz_id) + # 暂时只需比对db_type有没有增减,没有,则无需处理 + # if len(latest_rules) != len(dispatch_group.rules): + logger.info("sync_plat_dispatch_policy: update biz_rules(%s)\n %s \n", bk_biz_id, latest_rules) + dispatch_group.rules = latest_rules + dispatch_group.save() + except DispatchGroup.DoesNotExist: + logger.info("sync_plat_dispatch_policy: create biz_rules(%s)\n %s \n", bk_biz_id, latest_rules) + dispatch_group = DispatchGroup(bk_biz_id=bk_biz_id, rules=latest_rules) + dispatch_group.save() + + +@register_periodic_task(run_every=crontab(minute="*/5")) +def sync_custom_monitor_policy(): + """同步自定义监控策略的告警组设置 + 1. 提取各业务各db类型的最新"业务dba"告警组 + 2. 逐个业务逐个db类型比对: + """ + + logger.info("sync_custom_monitor_policy started") + cloned_policies = MonitorPolicy.objects.exclude(bk_biz_id=PLAT_BIZ_ID) + bk_biz_ids = cloned_policies.values_list("bk_biz_id", flat=True).distinct() + + for bk_biz_id in bk_biz_ids: + plat_groups = NoticeGroup.get_groups(PLAT_BIZ_ID, id_name="id") + expected_groups = NoticeGroup.get_groups(bk_biz_id, id_name="id") + + # 逐个db类型更新 + for db_type in cloned_policies.filter(bk_biz_id=bk_biz_id).values_list("db_type", flat=True).distinct(): + plat_group = plat_groups.get(db_type) + expected_group = expected_groups.get(db_type, plat_group) + + logger.info("sync_custom_monitor_policy: %s, %s, %s", bk_biz_id, expected_group, db_type) + update_app_policy(bk_biz_id, expected_group, db_type) + + +@register_periodic_task(run_every=crontab(minute="*/5")) +def sync_monitor_policy_events(): + """ + 同步各监控策略的告警事件数量 + """ + + logger.info("sync_monitor_policy_events started") + + event_counts = {} + for bk_biz_id in MonitorPolicy.objects.values_list("bk_biz_id", flat=True).distinct(): + monitor_policy_ids = list( + MonitorPolicy.objects.filter(bk_biz_id=bk_biz_id).values_list("monitor_policy_id", flat=True).distinct() + ) + + bk_biz_id = bk_biz_id or env.DBA_APP_BK_BIZ_ID + biz_event_counts = MonitorPolicy.bkm_search_event( + bk_biz_ids=[bk_biz_id], strategy_id=monitor_policy_ids, days=14 + ) + event_counts.update(biz_event_counts) + + # {strategy_id: { bk_biz_id: count }} + r = get_redis_connection("default") + + # delete all monitor_events + for key in r.keys(f"{MONITOR_EVENTS_PREFIX}|*"): + r.delete(key) + + # update latest monitor_events + for monitor_policy_id, policy_event_counts in event_counts.items(): + r.hset(f"{MONITOR_EVENTS_PREFIX}|{monitor_policy_id}", mapping=policy_event_counts) diff --git a/dbm-ui/backend/db_proxy/apps.py b/dbm-ui/backend/db_proxy/apps.py new file mode 100644 index 0000000000..621936dc09 --- /dev/null +++ b/dbm-ui/backend/db_proxy/apps.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.apps import AppConfig + + +class DBProxyConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "backend.db_proxy" diff --git a/dbm-ui/backend/db_proxy/constants.py b/dbm-ui/backend/db_proxy/constants.py index 72ba9532ff..0df69f2b9e 100644 --- a/dbm-ui/backend/db_proxy/constants.py +++ b/dbm-ui/backend/db_proxy/constants.py @@ -27,6 +27,7 @@ class ExtensionType(str, StructuredEnum): DNS = EnumField("DNS", _("域名解析服务")) DRS = EnumField("DRS", _("SQL 远程执行服务")) DBHA = EnumField("DBHA", _("数据库高可用服务")) + REDIS_DTS = EnumField("REDIS_DTS", _("Redis DTS服务")) class ExtensionServiceStatus(str, StructuredEnum): diff --git a/dbm-ui/backend/db_proxy/models.py b/dbm-ui/backend/db_proxy/models.py index d3f2d03ded..e77232c7d8 100644 --- a/dbm-ui/backend/db_proxy/models.py +++ b/dbm-ui/backend/db_proxy/models.py @@ -73,10 +73,7 @@ def get_latest_extension(cls, bk_cloud_id: int, extension_type: ExtensionType) - @classmethod def get_extension_access_hosts(cls, bk_cloud_id: int, extension_type: ExtensionType): extensions = cls.get_extension_in_cloud(bk_cloud_id, extension_type) - if extension_type == ExtensionType.DBHA: - extensions = extensions.filter(details__dbha_type=CloudDBHATypeEnum.AGENT) - - access_hosts = [ext.details["ip"] for ext in extensions] + access_hosts = list(set([ext.details["ip"] for ext in extensions])) return access_hosts @classmethod diff --git a/dbm-ui/backend/db_report/ReadMe.md b/dbm-ui/backend/db_report/ReadMe.md new file mode 100644 index 0000000000..d13b18391a --- /dev/null +++ b/dbm-ui/backend/db_report/ReadMe.md @@ -0,0 +1,4 @@ +1. 报告结果 _model_ 继承 `BaseReportABS` +2. 报告结果视图继承 `ReportBaseViewSet` +3. 在 `dbm-ui/backend/db_report/urls.py` 中注册 +4. 示例可以参考 `dbm-ui/backend/db_report/views/meta_check_view.py` \ No newline at end of file diff --git a/dbm-ui/backend/db_report/__init__.py b/dbm-ui/backend/db_report/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dbm-ui/backend/db_report/admin.py b/dbm-ui/backend/db_report/admin.py new file mode 100644 index 0000000000..8c38f3f3da --- /dev/null +++ b/dbm-ui/backend/db_report/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/dbm-ui/backend/db_report/apps.py b/dbm-ui/backend/db_report/apps.py new file mode 100644 index 0000000000..4b98cd720f --- /dev/null +++ b/dbm-ui/backend/db_report/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class DbReportConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "backend.db_report" diff --git a/dbm-ui/backend/db_report/database_router.py b/dbm-ui/backend/db_report/database_router.py new file mode 100644 index 0000000000..c1520973a8 --- /dev/null +++ b/dbm-ui/backend/db_report/database_router.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.db import models + + +class ReportRouter: + route_app_labels = {"db_report"} + + def db_for_read(self, model: models.Model, **hints): + if model._meta.app_label in self.route_app_labels: + return "report_db" + return "default" + + def db_for_write(self, model: models.Model, **hints): + if model._meta.app_label in self.route_app_labels: + return "report_db" + return "default" + + def allow_migrate(self, db, app_label, model_name=None, **hints): + if app_label in self.route_app_labels: + return db == "report_db" + return db == "default" diff --git a/dbm-ui/backend/db_report/enums/__init__.py b/dbm-ui/backend/db_report/enums/__init__.py new file mode 100644 index 0000000000..ab9d2c95b2 --- /dev/null +++ b/dbm-ui/backend/db_report/enums/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from blue_krill.data_types.enum import EnumField, StructuredEnum +from django.utils.translation import ugettext_lazy as _ + +from .meta_check_sub_type import MetaCheckSubType + +SWAGGER_TAG = _("巡检报告") + + +class ReportFieldFormat(str, StructuredEnum): + TEXT = EnumField("text", _("文本渲染")) + STATUS = EnumField("status", _("状态渲染")) diff --git a/dbm-ui/backend/db_report/enums/meta_check_sub_type.py b/dbm-ui/backend/db_report/enums/meta_check_sub_type.py new file mode 100644 index 0000000000..44b532afd3 --- /dev/null +++ b/dbm-ui/backend/db_report/enums/meta_check_sub_type.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from blue_krill.data_types.enum import EnumField, StructuredEnum +from django.utils.translation import gettext_lazy as _ + + +class MetaCheckSubType(str, StructuredEnum): + InstanceBelong = EnumField("instance_belong", _("实例集群归属")) + ReplicateRole = EnumField("replicate_role", _("数据同步实例角色")) + ClusterTopo = EnumField("cluster_topo", _("集群结构")) diff --git a/dbm-ui/backend/db_report/migrations/0001_initial.py b/dbm-ui/backend/db_report/migrations/0001_initial.py new file mode 100644 index 0000000000..3f336f73fa --- /dev/null +++ b/dbm-ui/backend/db_report/migrations/0001_initial.py @@ -0,0 +1,115 @@ +# Generated by Django 3.2.19 on 2023-10-08 01:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="MetaCheckReport", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("creator", models.CharField(max_length=64, verbose_name="创建人")), + ("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), + ("updater", models.CharField(max_length=64, verbose_name="修改人")), + ("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), + ("bk_biz_id", models.IntegerField(default=0, help_text="业务的 cmdb id")), + ("bk_cloud_id", models.IntegerField(default=0, help_text="云区域 id")), + ("status", models.BooleanField(default=True, help_text="巡检结果状态, 默认正常")), + ("msg", models.TextField(default="", help_text="备注信息")), + ("ip", models.GenericIPAddressField(default="")), + ("port", models.PositiveIntegerField(default=0)), + ("cluster", models.CharField(default="", max_length=255)), + ( + "cluster_type", + models.CharField( + choices=[ + ("tendbsingle", "tendbsingle"), + ("tendbha", "tendbha"), + ("tendbcluster", "tendbcluster"), + ("redis", "Redis集群"), + ("PredixyRedisCluster", "Redis集群"), + ("PredixyTendisplusCluster", "Tendisplus存储版集群"), + ("TwemproxyRedisInstance", "TendisCache集群"), + ("TwemproxyTendisSSDInstance", "TendisSSD集群"), + ("TwemproxyTendisplusInstance", "Tendis存储版集群"), + ("RedisInstance", "RedisCache主从版"), + ("TendisSSDInstance", "TendisSSD主从版"), + ("TendisplusInstance", "Tendisplus主从版"), + ("RedisCluster", "RedisCluster集群"), + ("TendisplusCluster", "TendisplusCluster集群"), + ("TendisplusInstance", "Tendisplus存储版集群 GetTendisType 获取redis类型值"), + ("RedisInstance", "TendisCache集群 GetTendisType 获取redis类型值"), + ("TendisSSDInstance", "TendisSSD集群 GetTendisType 获取redis类型值"), + ("es", "ES集群"), + ("kafka", "Kafka集群"), + ("hdfs", "Hdfs集群"), + ("influxdb", "Influxdb实例"), + ("pulsar", "Pulsar集群"), + ("MongoReplicaSet", "Mongo副本集"), + ("MongoShardedCluster", "Mongo分片集群"), + ("riak", "Riak集群"), + ], + default="", + max_length=64, + ), + ), + ( + "machine_type", + models.CharField( + choices=[ + ("spider", "spider"), + ("remote", "remote"), + ("proxy", "proxy"), + ("backend", "backend"), + ("single", "single"), + ("predixy", "predixy"), + ("twemproxy", "twemproxy"), + ("redis", "redis"), + ("tendiscache", "tendiscache"), + ("tendisssd", "tendisssd"), + ("tendisplus", "tendisplus"), + ("es_datanode", "es_datanode"), + ("es_master", "es_master"), + ("es_client", "es_client"), + ("broker", "broker"), + ("zookeeper", "zookeeper"), + ("hdfs_master", "hdfs_master"), + ("hdfs_datanode", "hdfs_datanode"), + ("mongos", "mongos"), + ("mongodb", "mongodb"), + ("mongo_config", "mongo_config"), + ("influxdb", "influxdb"), + ("pulsar_zookeeper", "pulsar_zookeeper"), + ("pulsar_bookkeeper", "pulsar_bookkeeper"), + ("pulsar_broker", "pulsar_broker"), + ("riak", "riak"), + ], + default="", + max_length=64, + ), + ), + ( + "subtype", + models.CharField( + choices=[ + ("instance_belong", "实例集群归属"), + ("replicate_role", "数据同步实例角色"), + ("cluster_topo", "集群结构"), + ], + default="", + help_text="元数据检查子项", + max_length=64, + ), + ), + ], + options={ + "abstract": False, + }, + ), + ] diff --git a/dbm-ui/backend/db_report/migrations/0002_alter_metacheckreport_cluster_type.py b/dbm-ui/backend/db_report/migrations/0002_alter_metacheckreport_cluster_type.py new file mode 100644 index 0000000000..d3570b993a --- /dev/null +++ b/dbm-ui/backend/db_report/migrations/0002_alter_metacheckreport_cluster_type.py @@ -0,0 +1,48 @@ +# Generated by Django 3.2.19 on 2023-10-08 11:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_report", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="metacheckreport", + name="cluster_type", + field=models.CharField( + choices=[ + ("tendbsingle", "tendbsingle"), + ("tendbha", "tendbha"), + ("tendbcluster", "tendbcluster"), + ("redis", "Redis集群"), + ("PredixyRedisCluster", "Tendisplus集群"), + ("PredixyTendisplusCluster", "Tendisplus存储版集群"), + ("TwemproxyRedisInstance", "TendisCache集群"), + ("TwemproxyTendisSSDInstance", "TendisSSD集群"), + ("TwemproxyTendisplusInstance", "Tendis存储版集群"), + ("RedisInstance", "RedisCache主从版"), + ("TendisSSDInstance", "TendisSSD主从版"), + ("TendisplusInstance", "Tendisplus主从版"), + ("RedisCluster", "RedisCluster集群"), + ("TendisplusCluster", "TendisplusCluster集群"), + ("TendisplusInstance", "Tendisplus存储版集群 GetTendisType 获取redis类型值"), + ("RedisInstance", "TendisCache集群 GetTendisType 获取redis类型值"), + ("TendisSSDInstance", "TendisSSD集群 GetTendisType 获取redis类型值"), + ("es", "ES集群"), + ("kafka", "Kafka集群"), + ("hdfs", "Hdfs集群"), + ("influxdb", "Influxdb实例"), + ("pulsar", "Pulsar集群"), + ("MongoReplicaSet", "Mongo副本集"), + ("MongoShardedCluster", "Mongo分片集群"), + ("riak", "Riak集群"), + ], + default="", + max_length=64, + ), + ), + ] diff --git a/dbm-ui/backend/db_report/migrations/__init__.py b/dbm-ui/backend/db_report/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dbm-ui/backend/db_report/mock_data.py b/dbm-ui/backend/db_report/mock_data.py new file mode 100644 index 0000000000..10814dadee --- /dev/null +++ b/dbm-ui/backend/db_report/mock_data.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +META_CHECK_DATA = { + "count": 1, + "next": None, + "previous": None, + "results": [ + {"bk_biz_id": 3, "ip": "127.0.0.1", "port": 3600, "machine_type": "remote", "status": True, "msg": ""} + ], + "name": "实例集群归属", + "title": [ + {"name": "bk_biz_id", "display_name": "业务", "format": "text"}, + {"name": "ip", "display_name": "IP", "format": "text"}, + {"name": "port", "display_name": "端口", "format": "text"}, + {"name": "machine_type", "display_name": "实例类型", "format": "text"}, + {"name": "status", "display_name": "元数据状态", "format": "status"}, + {"name": "msg", "display_name": "详情", "format": "text"}, + ], +} diff --git a/dbm-ui/backend/db_report/models/__init__.py b/dbm-ui/backend/db_report/models/__init__.py new file mode 100644 index 0000000000..849d942962 --- /dev/null +++ b/dbm-ui/backend/db_report/models/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from .meta_check_report import MetaCheckReport diff --git a/dbm-ui/backend/db_report/models/meta_check_report.py b/dbm-ui/backend/db_report/models/meta_check_report.py new file mode 100644 index 0000000000..6ef6a0e7ee --- /dev/null +++ b/dbm-ui/backend/db_report/models/meta_check_report.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from backend.db_meta.enums import ClusterType, MachineType +from backend.db_report.enums import MetaCheckSubType +from backend.db_report.report_basemodel import BaseReportABS + + +class MetaCheckReport(BaseReportABS): + ip = models.GenericIPAddressField(default="") + port = models.PositiveIntegerField(default=0) + cluster = models.CharField(max_length=255, default="") + cluster_type = models.CharField(max_length=64, choices=ClusterType.get_choices(), default="") + machine_type = models.CharField(max_length=64, choices=MachineType.get_choices(), default="") + subtype = models.CharField( + max_length=64, choices=MetaCheckSubType.get_choices(), default="", help_text=_("元数据检查子项") + ) diff --git a/dbm-ui/backend/db_report/report_basemodel.py b/dbm-ui/backend/db_report/report_basemodel.py new file mode 100644 index 0000000000..189b6fdb67 --- /dev/null +++ b/dbm-ui/backend/db_report/report_basemodel.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from backend.bk_web.models import AuditedModel + + +class BaseReportABS(AuditedModel): + bk_biz_id = models.IntegerField(default=0, help_text=_("业务的 cmdb id")) + bk_cloud_id = models.IntegerField(default=0, help_text=_("云区域 id")) + status = models.BooleanField(default=True, help_text=_("巡检结果状态, 默认正常")) # True = 正常, False = 异常 + msg = models.TextField(default="", help_text=_("备注信息")) + + class Meta: + abstract = True diff --git a/dbm-ui/backend/db_report/report_baseview.py b/dbm-ui/backend/db_report/report_baseview.py new file mode 100644 index 0000000000..5328e32ec8 --- /dev/null +++ b/dbm-ui/backend/db_report/report_baseview.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from rest_framework import mixins +from rest_framework.permissions import AllowAny +from rest_framework.viewsets import GenericViewSet + +from backend.bk_web.pagination import AuditedLimitOffsetPagination + + +class ReportBaseViewSet(GenericViewSet, mixins.ListModelMixin): + permission_classes = [AllowAny] + pagination_class = AuditedLimitOffsetPagination + + filter_fields = { + "bk_biz_id": ["exact"], + "cluster": ["exact", "in"], + "cluster_type": ["exact", "in"], + "create_at": ["gte", "lte"], + "status": ["exact", "in"], + } + + report_name = "" + report_title = [] + + def list(self, request, *args, **kwargs): + response = super().list(request, *args, **kwargs) + response.data["name"] = self.report_name + response.data["title"] = self.report_title + + return response diff --git a/dbm-ui/backend/db_report/urls.py b/dbm-ui/backend/db_report/urls.py new file mode 100644 index 0000000000..5c80ce6a27 --- /dev/null +++ b/dbm-ui/backend/db_report/urls.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.conf.urls import url + +from backend.db_report import views + +urlpatterns = [ + url("^meta_check/instance_belong$", views.MetaCheckReportInstanceBelongViewSet.as_view({"get": "list"})) +] diff --git a/dbm-ui/backend/db_report/views/__init__.py b/dbm-ui/backend/db_report/views/__init__.py new file mode 100644 index 0000000000..df8ae98c59 --- /dev/null +++ b/dbm-ui/backend/db_report/views/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from .meta_check_view import MetaCheckReportInstanceBelongViewSet diff --git a/dbm-ui/backend/db_report/views/meta_check_view.py b/dbm-ui/backend/db_report/views/meta_check_view.py new file mode 100644 index 0000000000..e8b415a036 --- /dev/null +++ b/dbm-ui/backend/db_report/views/meta_check_view.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + + +import logging + +from django.utils.translation import ugettext_lazy as _ +from rest_framework import serializers, status + +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.db_report import mock_data +from backend.db_report.enums import SWAGGER_TAG, ReportFieldFormat +from backend.db_report.models import MetaCheckReport +from backend.db_report.report_baseview import ReportBaseViewSet + +logger = logging.getLogger("root") + + +class MetaCheckReportInstanceBelongSerializer(serializers.ModelSerializer): + class Meta: + model = MetaCheckReport + fields = ("bk_biz_id", "ip", "port", "machine_type", "status", "msg") + swagger_schema_fields = {"example": mock_data.META_CHECK_DATA} + + +class MetaCheckReportInstanceBelongViewSet(ReportBaseViewSet): + queryset = MetaCheckReport.objects.all() + serializer_class = MetaCheckReportInstanceBelongSerializer + filter_fields = { # 大部分时候不需要覆盖默认的filter + "bk_biz_id": ["exact"], + "cluster_type": ["exact", "in"], + "create_at": ["gte", "lte"], + "status": ["exact", "in"], + } + report_name = _("实例集群归属") + report_title = [ + { + "name": "bk_biz_id", + "display_name": _("业务"), + "format": ReportFieldFormat.TEXT.value, + }, + { + "name": "ip", + "display_name": _("IP"), + "format": ReportFieldFormat.TEXT.value, + }, + { + "name": "port", + "display_name": _("端口"), + "format": ReportFieldFormat.TEXT.value, + }, + { + "name": "machine_type", + "display_name": _("实例类型"), + "format": ReportFieldFormat.TEXT.value, + }, + { + "name": "status", + "display_name": _("元数据状态"), + "format": ReportFieldFormat.STATUS.value, + }, + { + "name": "msg", + "display_name": _("详情"), + "format": ReportFieldFormat.TEXT.value, + }, + ] + + @common_swagger_auto_schema( + operation_summary=_("元数据检查报告列表"), + responses={status.HTTP_200_OK: MetaCheckReportInstanceBelongSerializer()}, + tags=[SWAGGER_TAG], + ) + def list(self, request, *args, **kwargs): + return super().list(request, *args, **kwargs) diff --git a/dbm-ui/backend/db_services/bigdata/hdfs/views.py b/dbm-ui/backend/db_services/bigdata/hdfs/views.py index 41c48715d1..e71827a371 100644 --- a/dbm-ui/backend/db_services/bigdata/hdfs/views.py +++ b/dbm-ui/backend/db_services/bigdata/hdfs/views.py @@ -94,7 +94,7 @@ def get_xmls(self, request, bk_biz_id: int, cluster_id: int): """ 获取集群访问配置文件信息 """ - cluster = Cluster.objects.get(id=cluster_id) + cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=cluster_id) jn_ips = list( cluster.storageinstance_set.filter(instance_role=InstanceRole.HDFS_JOURNAL_NODE).values_list( "machine__ip", flat=True diff --git a/dbm-ui/backend/db_services/cmdb/biz.py b/dbm-ui/backend/db_services/cmdb/biz.py index 9f526a530e..37601cddd8 100644 --- a/dbm-ui/backend/db_services/cmdb/biz.py +++ b/dbm-ui/backend/db_services/cmdb/biz.py @@ -74,3 +74,39 @@ def get_db_app_abbr(bk_biz_id: int) -> str: use_admin=True, )["info"][0].get(CC_APP_ABBR_ATTR, "") return abbr + + +def list_cc_obj_user(bk_biz_id: int) -> list: + # 查询 CC 的角色对象 + roles = { + attr["bk_property_id"]: attr["bk_property_name"] + for attr in CCApi.search_object_attribute({"bk_obj_id": "biz"}, use_admin=True) + if attr["bk_property_type"] == "objuser" + } + results = CCApi.search_business( + { + "fields": list(roles.keys()), + "biz_property_filter": { + "condition": "AND", + "rules": [{"field": "bk_biz_id", "operator": "equal", "value": int(bk_biz_id)}], + }, + }, + use_admin=True, + ).get("info", []) + try: + biz_info = results[0] + except IndexError: + biz_info = {} + cc_obj_users = [ + { + "id": role, + "display_name": role_display, + "logo": "", + "type": "group", + "members": [] if not biz_info.get(role) else [member for member in biz_info[role].split(",")], + } + for role, role_display in roles.items() + ] + # TODO dbm 角色录入 cmdb ?不合适, db type 会导致角色太多 + # 考虑以虚拟角色维护 DBA + return cc_obj_users diff --git a/dbm-ui/backend/db_services/cmdb/views.py b/dbm-ui/backend/db_services/cmdb/views.py index ddd52af25e..5a60ee5af6 100644 --- a/dbm-ui/backend/db_services/cmdb/views.py +++ b/dbm-ui/backend/db_services/cmdb/views.py @@ -77,3 +77,8 @@ def set_db_app_abbr(self, request, bk_biz_id): validated_data = self.params_validate(self.get_serializer_class()) biz.set_db_app_abbr(bk_biz_id, validated_data["db_app_abbr"], raise_exception=True) return Response() + + @common_swagger_auto_schema(operation_summary=_("查询 CC 角色对象"), tags=[SWAGGER_TAG]) + @action(methods=["GET"], detail=True) + def list_cc_obj_user(self, request, bk_biz_id): + return Response(biz.list_cc_obj_user(bk_biz_id)) diff --git a/dbm-ui/backend/db_services/dbbase/serializers.py b/dbm-ui/backend/db_services/dbbase/serializers.py new file mode 100644 index 0000000000..ea3cee4db2 --- /dev/null +++ b/dbm-ui/backend/db_services/dbbase/serializers.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import gettext_lazy as _ +from rest_framework import serializers + +from backend.db_meta.enums import ClusterType + + +class IsClusterDuplicatedSerializer(serializers.Serializer): + cluster_type = serializers.ChoiceField(help_text=_("集群类型"), choices=ClusterType.get_choices()) + name = serializers.CharField(help_text=_("集群名")) + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + + +class IsClusterDuplicatedResponseSerializer(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": {"is_duplicated": True}} diff --git a/dbm-ui/backend/db_services/dbbase/urls.py b/dbm-ui/backend/db_services/dbbase/urls.py new file mode 100644 index 0000000000..300261e550 --- /dev/null +++ b/dbm-ui/backend/db_services/dbbase/urls.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from rest_framework.routers import DefaultRouter + +from . import views + +routers = DefaultRouter(trailing_slash=True) +routers.register("", views.DBBaseViewSet, basename="dbbase") + +urlpatterns = routers.urls diff --git a/dbm-ui/backend/db_services/dbbase/views.py b/dbm-ui/backend/db_services/dbbase/views.py new file mode 100644 index 0000000000..d52f0548ae --- /dev/null +++ b/dbm-ui/backend/db_services/dbbase/views.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import ugettext as _ +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.response import Response + +from backend.bk_web import viewsets +from backend.bk_web.pagination import AuditedLimitOffsetPagination +from backend.bk_web.swagger import ( + PaginatedResponseSwaggerAutoSchema, + ResponseSwaggerAutoSchema, + common_swagger_auto_schema, +) +from backend.db_meta.models import Cluster, Group +from backend.db_services.dbbase.serializers import IsClusterDuplicatedResponseSerializer, IsClusterDuplicatedSerializer +from backend.db_services.group.handlers import GroupHandler +from backend.db_services.group.serializers import GroupMoveInstancesSerializer, GroupSerializer +from backend.iam_app.handlers.drf_perm import DBManageIAMPermission, GlobalManageIAMPermission + +SWAGGER_TAG = _("集群通用接口") + + +class DBBaseViewSet(viewsets.SystemViewSet): + """ + 集群通用接口,用于查询/操作集群公共的属性 + """ + + @common_swagger_auto_schema( + operation_summary=_("查询集群名字是否重复"), + auto_schema=ResponseSwaggerAutoSchema, + query_serializer=IsClusterDuplicatedSerializer(), + responses={status.HTTP_200_OK: IsClusterDuplicatedResponseSerializer()}, + tags=[SWAGGER_TAG], + ) + @action(methods=["GET"], detail=False, serializer_class=IsClusterDuplicatedSerializer) + def verify_duplicated_cluster_name(self, request, *args, **kwargs): + validate_data = self.params_validate(self.get_serializer_class()) + is_duplicated = Cluster.objects.filter(**validate_data).exists() + return Response(is_duplicated) diff --git a/dbm-ui/backend/db_services/dbconfig/views.py b/dbm-ui/backend/db_services/dbconfig/views.py index 25dc634ac2..884690de2c 100644 --- a/dbm-ui/backend/db_services/dbconfig/views.py +++ b/dbm-ui/backend/db_services/dbconfig/views.py @@ -26,7 +26,7 @@ class ConfigViewSet(viewsets.SystemViewSet): def _get_custom_permissions(self): bk_biz_id = self.request.query_params.get("bk_biz_id", 0) or self.request.data.get("bk_biz_id", 0) - if bk_biz_id: + if int(bk_biz_id): return [DBManageIAMPermission()] return [GlobalManageIAMPermission()] diff --git a/dbm-ui/backend/db_services/dbresource/handlers.py b/dbm-ui/backend/db_services/dbresource/handlers.py index 32ebfd87e3..c30499690a 100644 --- a/dbm-ui/backend/db_services/dbresource/handlers.py +++ b/dbm-ui/backend/db_services/dbresource/handlers.py @@ -12,15 +12,18 @@ from typing import Any, Dict, List from django.forms import model_to_dict +from django.utils.translation import ugettext as _ from backend.components.dbresource.client import DBResourceApi +from backend.db_meta.enums import ClusterType from backend.db_meta.models import Spec +from backend.db_services.dbresource.exceptions import SpecOperateException class ClusterSpecFilter(object): """集群规格的过滤器""" - def __init__(self, capacity, future_capacity, qps, spec_cluster_type, spec_machine_type, shard_num=0): + def __init__(self, capacity, future_capacity, spec_cluster_type, spec_machine_type, qps=None, shard_num=0): # 用户的当前容量,期望容量,期望qps范围和分片数(可选) self.capacity: int = capacity self.future_capacity: int = future_capacity @@ -38,7 +41,8 @@ def calc_machine_pair(self): spec["machine_pair"] = math.ceil(self.capacity / spec["capacity"]) # 集群容量:机器组数 * 规格容量;集群qps:机器组数 * 规格qps的min spec["cluster_capacity"] = spec["machine_pair"] * spec["capacity"] - spec["cluster_qps"] = spec["machine_pair"] * spec["qps"]["min"] + if self.qps: + spec["cluster_qps"] = spec["machine_pair"] * spec["qps"]["min"] def calc_cluster_shard_num(self): """计算每种规格的分片数, 根据不同的集群计算方式也不同""" @@ -55,16 +59,17 @@ def system_filter(self): """系统自带的过滤:qps和分片数""" valid_specs: List[Dict[str, Any]] = [] for spec in self.specs: - qps_range = { - "min": spec["machine_pair"] * spec["qps"]["min"], - "max": spec["machine_pair"] * spec["qps"]["max"], - } - if not self._qps_check(self.qps, qps_range): - continue - if self.filter_shard_num and spec["cluster_shard_num"] != self.filter_shard_num: continue + if self.qps: + qps_range = { + "min": spec["machine_pair"] * spec["qps"]["min"], + "max": spec["machine_pair"] * spec["qps"]["max"], + } + if not self._qps_check(self.qps, qps_range): + continue + valid_specs.append(spec) self.specs = valid_specs @@ -95,44 +100,16 @@ def calc_cluster_shard_num(self): class RedisSpecFilter(ClusterSpecFilter): """Redis规格过滤器基类""" - # 建议规格数,超出将淘汰末尾规格 - RECOMMEND_SPEC_NUM = 4 - # 淘汰规格比例 - DISUSE_SPEC_RATIO = 0.5 - # 按照机器组数正向/逆向排序 - MACHINE_PAIR_SORT = False - def _qps_check(self, user_qps_range, spec_qps_range): - # redis可以接受规格qps过大,不接受规格qps小于用户的最小值 - if user_qps_range["min"] > spec_qps_range["max"]: - return False - + # redis不需要qps校验 return True def custom_filter(self): - """对规格方案进行排序,如果存在大于4个方案,则按比例淘汰末尾规格方案""" - self.specs.sort(key=lambda x: x["machine_pair"], reverse=self.MACHINE_PAIR_SORT) - if len(self.specs) > self.RECOMMEND_SPEC_NUM: - self.specs = self.specs[: -int(len(self.specs) * self.DISUSE_SPEC_RATIO)] - - def filter_too_large_building_capacity(self): - """过滤掉过大的建设容量,当建设容量大于目标容量时,默认只保留最小的一个""" - exceed_target_capacity_specs: List[Dict[str, Any]] = [] - in_target_capacity_specs: List[Dict[str, Any]] = [] - for spec in self.specs: - # 首先筛选出建设容量超出目标容量的规格 - if spec["machine_pair"] * spec["capacity"] > self.capacity: - exceed_target_capacity_specs.append(spec) - else: - in_target_capacity_specs.append(spec) - - # 如果存在多个建设容量>目标容量的规格,则取最接近目标容量的规格 - if exceed_target_capacity_specs: - in_target_capacity_specs.append( - sorted(exceed_target_capacity_specs, key=lambda x: x["machine_pair"] * x["capacity"])[0] - ) - - self.specs = in_target_capacity_specs + """对规格方案进行排序,根据目标容量,以及未来容量来决定排序方式""" + if self.future_capacity >= self.capacity: + self.specs.sort(key=lambda x: (-x["cluster_shard_num"], -x["capacity"], x["machine_pair"])) + else: + self.specs.sort(key=lambda x: (x["cluster_shard_num"], -x["capacity"], x["machine_pair"])) class TendisPlusSpecFilter(RedisSpecFilter): @@ -141,10 +118,6 @@ class TendisPlusSpecFilter(RedisSpecFilter): # 最佳容量管理大小 300G OPTIMAL_MANAGE_CAPACITY = 300 - def _qps_check(self, user_qps_range, spec_qps_range): - # TendisPlus集群不需要qps过滤 - return True - def calc_machine_pair(self): """计算每种规格所需的机器组数,TendisPlus至少需要三组""" for spec in self.specs: @@ -184,15 +157,51 @@ def custom_filter(self): class TendisCacheSpecFilter(RedisSpecFilter): """TendisCache集群规格过滤器""" + # 单个实例建议的容量规格 + BASE_SINGLE_CAPCITY = 6 + # 支持简单阔缩容倍数(非DTS方式) + SCALE_MULITPLE = 4 + def calc_cluster_shard_num(self): + valid_specs: List[Dict[str, Any]] = [] + max_capcity = self.capacity + if self.future_capacity > self.capacity: + max_capcity = min(self.future_capacity, self.capacity * self.SCALE_MULITPLE / 2) + # 先进行排序 + self.specs.sort(key=lambda x: (x["capacity"])) + + # 选取合适的规格 + spec_idx, instance_cap, spec_cnt, avaiable_specs = 0, self.BASE_SINGLE_CAPCITY, len(self.specs), [] for spec in self.specs: - # 计算单机分片数,CPU去中间数的偶数 - single_machine_shard_num = int((spec["cpu"]["min"] + spec["cpu"]["max"]) / 2) + if self.capacity <= spec["capacity"]: + avaiable_specs.append(spec) + if spec_idx >= 1: + avaiable_specs.append(self.specs[spec_idx - 1]) + if spec_idx >= 3: + avaiable_specs.append(self.specs[spec_idx - 2]) + break + spec_idx += 1 + + if self.capacity > self.specs[spec_cnt - 1]["capacity"] * self.SCALE_MULITPLE: + instance_cap = self.BASE_SINGLE_CAPCITY * self.SCALE_MULITPLE + + if self.capacity > self.specs[spec_cnt - 1]["capacity"]: + avaiable_specs.append(self.specs[spec_cnt - 1]) + if spec_cnt > 2: + avaiable_specs.append(self.specs[spec_cnt - 2]) + + for spec_new in avaiable_specs: + # 一定要保证集群总分片数是机器组数的整数倍,并且单机分片数需要取整,取偶 + cluster_shard_num = math.ceil(max_capcity / instance_cap) + single_machine_shard_num = math.ceil(cluster_shard_num / spec_new["machine_pair"]) single_machine_shard_num = max(single_machine_shard_num + (single_machine_shard_num & 1), 2) - spec["cluster_shard_num"] = single_machine_shard_num * spec["machine_pair"] + spec_new["cluster_shard_num"] = max(single_machine_shard_num * spec_new["machine_pair"], 4) + + valid_specs.append(spec_new) + + self.specs = valid_specs def custom_filter(self): - super().filter_too_large_building_capacity() super().custom_filter() @@ -200,11 +209,17 @@ class ResourceHandler(object): """资源池接口的处理函数""" @classmethod - def spec_resource_count(cls, bk_biz_id: int, resource_type: str, bk_cloud_id: int, spec_ids: List[int]): + def spec_resource_count(cls, bk_biz_id: int, bk_cloud_id: int, spec_ids: List[int]): + specs = Spec.objects.filter(spec_id__in=spec_ids) + # 获取resource_type + spec_cluster_type = list(set(specs.values_list("spec_cluster_type", flat=True))) + if len(spec_cluster_type) > 1: + raise SpecOperateException(_("请保证请求的规格类型一致")) + resource_type = ClusterType.cluster_type_to_db_type(spec_cluster_type[0]) # 构造申请参数 spec_count_details = [ spec.get_apply_params_detail(group_mark=str(spec.spec_id), count=0, bk_cloud_id=bk_cloud_id) - for spec in Spec.objects.filter(spec_id__in=spec_ids) + for spec in specs ] spec_count_params = { "bk_biz_id": bk_biz_id, diff --git a/dbm-ui/backend/db_services/dbresource/serializers.py b/dbm-ui/backend/db_services/dbresource/serializers.py index 349184266a..dc3eca9333 100644 --- a/dbm-ui/backend/db_services/dbresource/serializers.py +++ b/dbm-ui/backend/db_services/dbresource/serializers.py @@ -336,7 +336,7 @@ class Meta: class FilterClusterSpecSerializer(QueryQPSRangeSerializer): - qps = serializers.JSONField(help_text=_("qps范围")) + qps = serializers.JSONField(help_text=_("qps范围"), required=False) class FilterClusterSpecResponseSerializer(QueryQPSRangeSerializer): @@ -356,7 +356,6 @@ class Meta: class SpecCountResourceSerializer(serializers.Serializer): bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) - resource_type = serializers.CharField(help_text=_("所属DB资源类型")) bk_cloud_id = serializers.IntegerField(help_text=_("云区域ID")) spec_ids = serializers.ListField(help_text=_("规格ID列表"), child=serializers.IntegerField()) diff --git a/dbm-ui/backend/db_services/group/views.py b/dbm-ui/backend/db_services/group/views.py index e45223fc2f..73c8e58b53 100644 --- a/dbm-ui/backend/db_services/group/views.py +++ b/dbm-ui/backend/db_services/group/views.py @@ -40,7 +40,7 @@ class GroupViewSet(viewsets.AuditedModelViewSet): def _get_custom_permissions(self): bk_biz_id = self.request.query_params.get("bk_biz_id", 0) or self.request.data.get("bk_biz_id", 0) - if bk_biz_id: + if int(bk_biz_id): return [DBManageIAMPermission()] return [GlobalManageIAMPermission()] diff --git a/dbm-ui/backend/db_services/ipchooser/constants.py b/dbm-ui/backend/db_services/ipchooser/constants.py index 3e7982200a..ea8ab93686 100644 --- a/dbm-ui/backend/db_services/ipchooser/constants.py +++ b/dbm-ui/backend/db_services/ipchooser/constants.py @@ -116,6 +116,3 @@ def _get_member__alias_map(cls) -> Dict[Enum, str]: DB_MANAGE_SET = "db.manage.set" RESOURCE_MODULE = "resource.idle.module" DIRTY_MODULE = "dirty.module" - -# 磁盘类型,目前固定写死 -DEVICE_CLASS = ["SSD", "HDD", "ALL"] diff --git a/dbm-ui/backend/db_services/ipchooser/handlers/topo_handler.py b/dbm-ui/backend/db_services/ipchooser/handlers/topo_handler.py index 91f956f962..bc77c6d286 100644 --- a/dbm-ui/backend/db_services/ipchooser/handlers/topo_handler.py +++ b/dbm-ui/backend/db_services/ipchooser/handlers/topo_handler.py @@ -10,7 +10,9 @@ """ import logging import typing +from collections import defaultdict +from backend.components import CCApi from backend.utils.batch_request import batch_decorator from .. import constants, types @@ -185,3 +187,20 @@ def query_host_topo_infos( bk_biz_id, filter_conditions, start=start, limit=page_size ) return {"total": len(hosts_topo_info), "hosts_topo_info": hosts_topo_info} + + @classmethod + def query_host_set_module(cls, bk_biz_id: int, bk_host_ids: typing.List) -> typing.Dict: + """ + 根据过滤条件查询主机的集群ID和模块ID(不支持自定义拓扑主机的查询) + """ + host_topos = CCApi.find_host_biz_relations({"bk_biz_id": bk_biz_id, "bk_host_id": bk_host_ids}) + host_id__host_topos = defaultdict(lambda: defaultdict(list)) + for host_info in host_topos: + host_id__host_topos[host_info["bk_host_id"]]["bk_set_ids"].append(host_info["bk_set_id"]) + host_id__host_topos[host_info["bk_host_id"]]["bk_module_ids"].append(host_info["bk_module_id"]) + + hosts_topo_info = [] + for host_id, topo in host_id__host_topos.items(): + hosts_topo_info.append({"bk_host_id": host_id, **topo}) + + return {"total": len(hosts_topo_info), "hosts_topo_info": hosts_topo_info} diff --git a/dbm-ui/backend/db_services/ipchooser/query/resource.py b/dbm-ui/backend/db_services/ipchooser/query/resource.py index 44a9dc5e62..3050f38c46 100644 --- a/dbm-ui/backend/db_services/ipchooser/query/resource.py +++ b/dbm-ui/backend/db_services/ipchooser/query/resource.py @@ -283,7 +283,7 @@ def query_host_topo_infos( :param limit: 获取数量 """ - def _get_host_topo(_host_topo: List[Dict[str, Any]]) -> List[str]: + def _get_host_topo(_host_topo: List[Dict[str, Any]], key: str = "name") -> List[str]: """ 根据拓扑字典平铺获取平铺拓扑信息列表 :param _host_topo: 主机拓扑信息 @@ -294,8 +294,8 @@ def _get_host_topo(_host_topo: List[Dict[str, Any]]) -> List[str]: _host_topo_info_list = [] for topo in _host_topo: - level_name = topo["inst"]["name"] - children_topo = _get_host_topo(topo["children"]) + level_name = topo["inst"][key] + children_topo = _get_host_topo(topo["children"], key=key) _host_topo_info_list.extend([f"{level_name}/{child_topo}" for child_topo in children_topo]) return _host_topo_info_list @@ -365,11 +365,12 @@ def _parse_host_filter(_host: str) -> Dict: list_host_total_mainline_topo_filter = { "bk_biz_id": bk_biz_id, "fields": fields, - "host_property_filter": host_property_filter, "page": {"start": start, "limit": limit}, } if module_property_filter: list_host_total_mainline_topo_filter["module_property_filter"] = module_property_filter + if host_property_filter["rules"]: + list_host_total_mainline_topo_filter["host_property_filter"] = host_property_filter resp = CCApi.list_host_total_mainline_topo(list_host_total_mainline_topo_filter) @@ -378,7 +379,13 @@ def _parse_host_filter(_host: str) -> Dict: for host_topo in resp["info"]: host_topo_info = host_topo["host"] host_topo_info["ip"] = host_topo_info.pop("bk_host_innerip") - host_topo_info.update({"topo": _get_host_topo(_host_topo=host_topo["topo"])}) + host_topo_info.update( + { + # 获取拓扑信息和拓扑ID信息 + "topo": _get_host_topo(_host_topo=host_topo["topo"], key="name"), + "topo_id": _get_host_topo(_host_topo=host_topo["topo"], key="id"), + } + ) host_topo_info_list.append(host_topo_info) return host_topo_info_list diff --git a/dbm-ui/backend/db_services/ipchooser/views.py b/dbm-ui/backend/db_services/ipchooser/views.py index 390736b4a0..bba387aab0 100644 --- a/dbm-ui/backend/db_services/ipchooser/views.py +++ b/dbm-ui/backend/db_services/ipchooser/views.py @@ -16,8 +16,9 @@ from backend.bk_web import viewsets +from ...configuration.constants import DISK_CLASSES from ...configuration.models import Profile -from .constants import DEVICE_CLASS, ModeType +from .constants import ModeType from .handlers import host_handler, topo_handler from .query.resource import ResourceQueryHelper from .serializers import host_sers, topo_sers @@ -205,4 +206,4 @@ def search_cloud_area(self, request, *args, **kwargs): ) @action(methods=["GET"], detail=False) def search_device_class(self, request, *args, **kwargs): - return Response(DEVICE_CLASS) + return Response(DISK_CLASSES) diff --git a/dbm-ui/backend/db_services/meta_import/__init__.py b/dbm-ui/backend/db_services/meta_import/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/db_services/meta_import/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/db_services/meta_import/constants.py b/dbm-ui/backend/db_services/meta_import/constants.py new file mode 100644 index 0000000000..7251fcf35d --- /dev/null +++ b/dbm-ui/backend/db_services/meta_import/constants.py @@ -0,0 +1,14 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from blue_krill.data_types.enum import EnumField, StructuredEnum +from django.utils.translation import ugettext_lazy as _ + +SWAGGER_TAG = _("元数据迁移") diff --git a/dbm-ui/backend/db_services/meta_import/serializers.py b/dbm-ui/backend/db_services/meta_import/serializers.py new file mode 100644 index 0000000000..29b31f649b --- /dev/null +++ b/dbm-ui/backend/db_services/meta_import/serializers.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import ugettext as _ +from rest_framework import serializers + +from backend.db_meta.enums import ClusterType, MachineType +from backend.db_meta.models import DBModule, Spec + + +class MetadataImportDBModuleField(serializers.ChoiceField): + model = DBModule + + def __init__(self, cluster_type, **kwargs): + choices = self.model.get_choices_with_filter(cluster_type=cluster_type) + super().__init__(choices, **kwargs) + self._choices_label_to_value = {value: key for key, value in self.choices.items()} + + def to_representation(self, value): + return self._choices[value] + + def to_internal_value(self, data): + return self._choices_label_to_value[data] + + +class MetadataImportSpecField(serializers.ChoiceField): + model = Spec + + def __init__(self, cluster_type, machine_type, **kwargs): + choices = self.model.get_choices_with_filter(cluster_type=cluster_type, machine_type=machine_type) + super().__init__(choices, **kwargs) + self._choices_label_to_value = {value: key for key, value in self.choices.items()} + + def to_representation(self, value): + return self._choices[value] + + def to_internal_value(self, data): + return self._choices_label_to_value[data] + + +class MySQLHaMetadataImportSerializer(serializers.Serializer): + file = serializers.FileField(help_text=_("元数据json文件")) + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + db_module_id = MetadataImportDBModuleField(help_text=_("模块ID"), cluster_type=ClusterType.TenDBHA.value) + proxy_spec_id = MetadataImportSpecField( + help_text=_("代理层规格ID"), cluster_type=ClusterType.TenDBHA.value, machine_type=MachineType.PROXY.value + ) + storage_spec_id = MetadataImportSpecField( + help_text=_("存储层规格ID"), cluster_type=ClusterType.TenDBHA.value, machine_type=MachineType.BACKEND.value + ) + + def validate(self, attrs): + return attrs diff --git a/dbm-ui/backend/db_services/meta_import/urls.py b/dbm-ui/backend/db_services/meta_import/urls.py new file mode 100644 index 0000000000..0db1904a6f --- /dev/null +++ b/dbm-ui/backend/db_services/meta_import/urls.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from rest_framework.routers import DefaultRouter + +from backend.db_services.meta_import.views import DBMetadataImportViewSet + +routers = DefaultRouter(trailing_slash=True) +routers.register("", DBMetadataImportViewSet, basename="partition") + +urlpatterns = routers.urls diff --git a/dbm-ui/backend/db_services/meta_import/views.py b/dbm-ui/backend/db_services/meta_import/views.py new file mode 100644 index 0000000000..479bcd0e61 --- /dev/null +++ b/dbm-ui/backend/db_services/meta_import/views.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import json + +from django.utils.translation import ugettext_lazy as _ +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.parsers import MultiPartParser +from rest_framework.response import Response + +from backend.bk_web import viewsets +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.db_services.meta_import.constants import SWAGGER_TAG +from backend.db_services.meta_import.serializers import MySQLHaMetadataImportSerializer +from backend.iam_app.handlers.drf_perm import RejectPermission +from backend.ticket.builders.mysql.mysql_ha_metadata_import import MySQLHaMetadataImportDetailSerializer +from backend.ticket.constants import TicketType +from backend.ticket.models import Ticket + + +class DBMetadataImportViewSet(viewsets.SystemViewSet): + + pagination_class = None + + def _get_custom_permissions(self): + if not self.request.user.is_superuser: + return [RejectPermission()] + return [] + + @common_swagger_auto_schema( + operation_summary=_("tendbha元数据导入"), + tags=[SWAGGER_TAG], + ) + @action( + methods=["POST"], + detail=False, + serializer_class=MySQLHaMetadataImportSerializer, + parser_classes=[MultiPartParser], + ) + def tendbha_metadata_import(self, request, *args, **kwargs): + data = self.params_validate(self.get_serializer_class()) + # 解析json文件 + data["json_content"] = json.loads(data.pop("file").read().decode("utf-8")) + # 自动创建ticket + MySQLHaMetadataImportDetailSerializer(data=data).is_valid(raise_exception=True) + Ticket.create_ticket( + ticket_type=TicketType.MYSQL_HA_METADATA_IMPORT, + creator=request.user.username, + bk_biz_id=data["bk_biz_id"], + remark=self.tendbha_metadata_import.__name__, + details=data, + ) + return Response(data) diff --git a/dbm-ui/backend/db_services/mysql/constants.py b/dbm-ui/backend/db_services/mysql/constants.py index 8eaa334716..4b66a4d54b 100644 --- a/dbm-ui/backend/db_services/mysql/constants.py +++ b/dbm-ui/backend/db_services/mysql/constants.py @@ -17,7 +17,7 @@ DEFAULT_ORIGIN_PROXY_PORT = 10000 DEFAULT_ORIGIN_MYSQL_PORT = 20000 -# 查询库表sql语句 +# 闪回查询库表sql语句 QUERY_SCHEMA_DBS_SQL = ( "SELECT SCHEMA_NAME from information_schema.SCHEMATA WHERE {db_sts} and SCHEMA_NAME not in {sys_db_list}" ) @@ -25,3 +25,6 @@ "SELECT TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES " "WHERE TABLE_TYPE='BASE TABLE' AND (TABLE_SCHEMA IN {db_list}) AND {table_sts}" ) + +# 根据库名查询表名的sql语句 +QUERY_TABLES_FROM_DB_SQL = "select table_schema, table_name from information_schema.tables where {db_sts}" diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py index d1342e22b6..f1e4043e20 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py @@ -201,13 +201,12 @@ def aggregate_backup_log_by_id(self, backup_logs: List[Dict[str, Any]]) -> List[ for field in delete_fields: backup_id__backup_logs_map[backup_id].pop(field) - backup_id__backup_logs_map[backup_id]["file_list"].append(file_name) - backup_id__backup_logs_map[backup_id]["file_list_details"].append( - {"file_name": file_name, "size": log["file_size"], "task_id": log["task_id"]} - ) + file_info = {"file_name": file_name, "size": log["file_size"], "task_id": log["task_id"]} + backup_id__backup_logs_map[backup_id]["file_list"].append(file_info["file_name"]) + backup_id__backup_logs_map[backup_id]["file_list_details"].append(file_info) if log["file_type"] in ["index", "priv"]: - backup_id__backup_logs_map[log["backup_id"]][log["file_type"]] = file_name + backup_id__backup_logs_map[log["backup_id"]][log["file_type"]] = file_info return list(backup_id__backup_logs_map.values()) @@ -272,8 +271,8 @@ def insert_log_into_node(_backup_node, _log): backup_id__backup_logs_map = defaultdict(dict) for log in backup_logs: - # 如果存在单据号,证明不是例行备份,需排除 - if log["bill_id"]: + # 如果存在单据号,证明不是例行备份; 如果task_id为-1,说明来自旧备份系统; + if log["bill_id"] or log["task_id"] == -1: continue backup_id, log["backup_time"] = log["backup_id"], log["consistent_backup_time"] @@ -328,6 +327,10 @@ def insert_log_into_node(_backup_node, _log): if sorted(shard_value_list) != list(range(0, cluster_shard_num)): continue + # 如果不存在spider master记录,则忽略 + if not backup_log["spider_node"]: + continue + # 如果存在多条完整的backup记录,则保留最接近rollback time的记录 if backup_id not in backup_id__valid_backup_logs or ( backup_id__valid_backup_logs[backup_id]["backup_time"] < backup_log["backup_time"] diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py index c465d9b715..e582e32033 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py @@ -19,6 +19,7 @@ from backend.bk_web import viewsets from backend.bk_web.swagger import common_swagger_auto_schema from backend.db_meta.enums import ClusterStatus, ClusterType +from backend.db_meta.enums.comm import SystemTagEnum from backend.db_meta.models import Cluster from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler from backend.db_services.mysql.fixpoint_rollback.serializers import ( @@ -118,7 +119,9 @@ def query_fixpoint_log(self, requests, *args, **kwargs): limit, offset = validated_data["limit"], validated_data["offset"] # 查询目前定点回档临时集群 - temp_clusters = Cluster.objects.filter(cluster_type=ClusterType.TenDBCluster, status=ClusterStatus.TEMPORARY) + temp_clusters = Cluster.objects.filter( + cluster_type=ClusterType.TenDBCluster, tag__name=SystemTagEnum.TEMPORARY + ) temp_clusters_count = temp_clusters.count() # 查询定点回档记录 temp_clusters = temp_clusters[offset : limit + offset] @@ -130,6 +133,7 @@ def query_fixpoint_log(self, requests, *args, **kwargs): fixpoint_logs: List[Dict[str, Any]] = [] for record in records: ticket_data = record.ticket.details + target_cluster = Cluster.objects.get(id=record.cluster_id) fixpoint_logs.append( { "databases": ticket_data["databases"], @@ -140,6 +144,8 @@ def query_fixpoint_log(self, requests, *args, **kwargs): "target_cluster": { "cluster_id": record.cluster_id, "nodes": ticket_data["nodes"], + "status": target_cluster.status, + "phase": target_cluster.phase, "operations": ClusterOperateRecord.objects.get_cluster_operations(record.cluster_id), }, "ticket_id": record.ticket.id, diff --git a/dbm-ui/backend/db_services/mysql/open_area/__init__.py b/dbm-ui/backend/db_services/mysql/open_area/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/db_services/mysql/open_area/admin.py b/dbm-ui/backend/db_services/mysql/open_area/admin.py new file mode 100644 index 0000000000..8c1ebeadbd --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/admin.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.contrib import admin + +from . import models + + +@admin.register(models.TendbOpenAreaConfig) +class TendbOpenAreaConfigAdmin(admin.ModelAdmin): + list_display = ("bk_biz_id", "config_name", "updater", "update_at") + list_filter = ("bk_biz_id", "config_name") + search_fields = ("bk_biz_id", "config_name") diff --git a/dbm-ui/backend/db_services/mysql/open_area/apps.py b/dbm-ui/backend/db_services/mysql/open_area/apps.py new file mode 100644 index 0000000000..c442565377 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/apps.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.apps import AppConfig + + +class OpenAreaConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "backend.db_services.mysql.open_area" diff --git a/dbm-ui/backend/db_services/mysql/open_area/exceptions.py b/dbm-ui/backend/db_services/mysql/open_area/exceptions.py new file mode 100644 index 0000000000..fc7c147fba --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/exceptions.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import functools +import types + +from django.utils.translation import ugettext_lazy as _ + +from backend.exceptions import AppBaseException, ErrorCode + + +class TendbOpenAreaBaseException(AppBaseException): + MODULE_CODE = ErrorCode.TENDB_OPEN_AREA_CODE + MESSAGE = _("Tendb开区通用异常") diff --git a/dbm-ui/backend/db_services/mysql/open_area/filters.py b/dbm-ui/backend/db_services/mysql/open_area/filters.py new file mode 100644 index 0000000000..cb8de03dfe --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/filters.py @@ -0,0 +1,25 @@ +# -*- coding:utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import ugettext_lazy as _ +from django_filters import rest_framework as filters + +from backend.db_meta.models.spec import Spec +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig + + +class TendbOpenAreaConfigListFilter(filters.FilterSet): + config_name = filters.CharFilter(field_name="config_name", lookup_expr="icontains", label=_("模板名称")) + bk_biz_id = filters.NumberFilter(field_name="bk_biz_id", label=_("业务ID")) + + class Meta: + model = TendbOpenAreaConfig + fields = ["config_name"] diff --git a/dbm-ui/backend/db_services/mysql/open_area/handlers.py b/dbm-ui/backend/db_services/mysql/open_area/handlers.py new file mode 100644 index 0000000000..bf0067ae25 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/handlers.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import itertools +from collections import defaultdict +from typing import Any, Dict, List, Union + +from django.utils.translation import ugettext as _ + +from backend.components import MySQLPrivManagerApi +from backend.db_meta.models import Cluster +from backend.db_services.mysql.open_area.exceptions import TendbOpenAreaBaseException +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig + + +class OpenAreaHandler: + """封装开区的一些处理函数""" + + @classmethod + def validate_only_openarea(cls, bk_biz_id, config_name, config_id: int = -1) -> bool: + """校验同一业务下的开区模板名称唯一""" + config = TendbOpenAreaConfig.objects.filter(bk_biz_id=bk_biz_id, config_name=config_name) + is_duplicated = config.exists() and (config.first().id != config_id) + return not is_duplicated + + @classmethod + def openarea_result_preview( + cls, operator: str, config_id: int, config_data: List[Dict[str, Union[int, str, Dict]]] + ) -> Dict[str, List[Dict[str, Any]]]: + config = TendbOpenAreaConfig.objects.get(id=config_id) + clusters = Cluster.objects.filter(id__in=[info["cluster_id"] for info in config_data]) + cluster_id__cluster = {cluster.id: cluster for cluster in clusters} + + # 获取开区执行数据 + openarea_results: List[Dict[str, Any]] = [] + for data in config_data: + try: + execute_objects = [ + { + "source_db": config_rule["source_db"], + "target_db": config_rule["target_db_pattern"].format(**data["vars"]), + "schema_tblist": config_rule["schema_tblist"], + "data_tblist": config_rule["data_tblist"], + } + for config_rule in config.config_rules + ] + except KeyError: + raise TendbOpenAreaBaseException(_("范式渲染缺少变量")) + + openarea_results.append( + { + "cluster_id": data["cluster_id"], + "target_cluster_name": cluster_id__cluster[data["cluster_id"]].name, + "execute_objects": execute_objects, + } + ) + + # 获取开区授权规则 + cluster_type = clusters.first().cluster_type + priv_ids = list(itertools.chain(*[rule["priv_data"] for rule in config.config_rules])) + authorize_rules = MySQLPrivManagerApi.list_account_rules({"bk_biz_id": config.bk_biz_id, "ids": priv_ids}) + # 根据用户名和db将授权规则分批 + user__dbs_rules: Dict[str, List[str]] = defaultdict(list) + for rule_data in authorize_rules["items"]: + user__dbs_rules[rule_data["account"]["user"]].extend([r["dbname"] for r in rule_data["rules"]]) + # 根据当前的规则生成授权数据 + authorize_details: List[Dict[str, Any]] = [ + { + "bk_biz_id": config.bk_biz_id, + "operator": operator, + "user": user, + "source_ips": data["authorize_ips"], + "target_instances": [cluster_id__cluster[data["cluster_id"]].immute_domain], + "account_rules": [ + {"bk_biz_id": config.bk_biz_id, "dbname": dbname} for dbname in user__dbs_rules[user] + ], + "cluster_type": cluster_type, + } + for data in config_data + for user in user__dbs_rules.keys() + ] + + return {"config_data": openarea_results, "rules_set": authorize_details} diff --git a/dbm-ui/backend/db_services/mysql/open_area/migrations/0001_initial.py b/dbm-ui/backend/db_services/mysql/open_area/migrations/0001_initial.py new file mode 100644 index 0000000000..e32fdb80b3 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/migrations/0001_initial.py @@ -0,0 +1,47 @@ +# Generated by Django 3.2.19 on 2023-09-07 11:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="TendbOpenAreaConfigLog", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("creator", models.CharField(max_length=64, verbose_name="创建人")), + ("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), + ("updater", models.CharField(max_length=64, verbose_name="修改人")), + ("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), + ("bk_biz_id", models.IntegerField(default=0)), + ("config_name", models.CharField(default="", max_length=256)), + ("config_change_log", models.JSONField(help_text="开区配置修改记录数据")), + ], + options={ + "abstract": False, + }, + ), + migrations.CreateModel( + name="TendbOpenAreaConfig", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("creator", models.CharField(max_length=64, verbose_name="创建人")), + ("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), + ("updater", models.CharField(max_length=64, verbose_name="修改人")), + ("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), + ("bk_biz_id", models.IntegerField(default=0, help_text="业务ID")), + ("config_name", models.CharField(help_text="开区模板名", max_length=256)), + ("source_cluster_id", models.BigIntegerField(help_text="源集群ID")), + ("config_rules", models.JSONField(help_text="模板克隆规则列表")), + ("related_authorize", models.JSONField(help_text="关联的规则列表(目前用于级联规则的修改删除)")), + ], + options={ + "unique_together": {("bk_biz_id", "config_name")}, + }, + ), + ] diff --git a/dbm-ui/backend/db_services/mysql/open_area/migrations/__init__.py b/dbm-ui/backend/db_services/mysql/open_area/migrations/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/migrations/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/db_services/mysql/open_area/mock_data.py b/dbm-ui/backend/db_services/mysql/open_area/mock_data.py new file mode 100644 index 0000000000..e6d7d864c2 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/mock_data.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +OPENAREA_TEMPLATE_DATA = { + "config_rules": [ + { + "source_db": "test6", + "schema_tblist": ["tb1", "tb2"], + "data_tblist": ["tb1", "tb2"], + "target_db_pattern": "DB_{APP}", + "priv_data": [1, 2, 3], + } + ], + "bk_biz_id": 3, + "config_name": "test——config7", + "source_cluster_id": 63, +} + +OPENAREA_PREVIEW_DATA = { + "config_data": [ + { + "target_cluster": 63, + "target_cluster_name": "test-lucky", + "execute_objects": [ + { + "source_db": "testdb", + "target_db": "O_3_TEST", + "schema_tblist": ["test1", "test2"], + "data_tblist": ["test1", "test2"], + } + ], + } + ], + "rules_set": [ + { + "user": "admin", + "source_ips": ["127.0.0.1"], + "target_instances": ["spider.test-lucky.dba.db"], + "dbname": ["ddddd", "test"], + "cluster_type": "tendbcluster", + }, + { + "user": "dwq", + "source_ips": ["127.0.0.1"], + "target_instances": ["spider.test-lucky.dba.db"], + "dbname": ["llo"], + "cluster_type": "tendbcluster", + }, + ], +} diff --git a/dbm-ui/backend/db_services/mysql/open_area/models.py b/dbm-ui/backend/db_services/mysql/open_area/models.py new file mode 100644 index 0000000000..f7b4d61add --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/models.py @@ -0,0 +1,37 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from backend.bk_web.models import AuditedModel +from backend.constants import DEFAULT_BK_CLOUD_ID + + +class TendbOpenAreaConfig(AuditedModel): + """开区模板表""" + + bk_biz_id = models.IntegerField(default=0, help_text=_("业务ID")) + config_name = models.CharField(max_length=256, help_text=_("开区模板名")) + source_cluster_id = models.BigIntegerField(help_text=_("源集群ID")) + config_rules = models.JSONField(help_text=_("模板克隆规则列表")) + related_authorize = models.JSONField(help_text=_("关联的规则列表(目前用于级联规则的修改删除)")) + + class Meta: + # 不允许同个业务下出现同名模板配置 + unique_together = ("bk_biz_id", "config_name") + + +class TendbOpenAreaConfigLog(AuditedModel): + """开区配置表的修改记录表,用于DBA日常回顾""" + + bk_biz_id = models.IntegerField(default=0) + config_name = models.CharField(max_length=256, default="") + config_change_log = models.JSONField(help_text=_("开区配置修改记录数据")) diff --git a/dbm-ui/backend/db_services/mysql/open_area/serializers.py b/dbm-ui/backend/db_services/mysql/open_area/serializers.py new file mode 100644 index 0000000000..3394587ab1 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/serializers.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import itertools + +from django.utils.translation import ugettext_lazy as _ +from rest_framework import serializers + +from backend.bk_web.serializers import AuditedSerializer +from backend.db_meta.models import Cluster +from backend.db_services.mysql.open_area import mock_data +from backend.db_services.mysql.open_area.handlers import OpenAreaHandler +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig + + +class TendbOpenAreaSubConfigSerializer(serializers.Serializer): + source_db = serializers.CharField(help_text=_("获取库表结构的源db")) + # json字段,直接存储待克隆表结构列表,克隆所有表时为空列表 + schema_tblist = serializers.JSONField(help_text=_("获取表结构的源tb列表"), default=list) + data_tblist = serializers.JSONField(help_text=_("获取表数据的源tb列表"), default=list) + target_db_pattern = serializers.CharField(help_text=_("目标db范式")) + # json字段,存储权限模板列表 + priv_data = serializers.JSONField(help_text=_("权限关联模板数据"), default=list) + + +class TendbOpenAreaConfigSerializer(AuditedSerializer, serializers.ModelSerializer): + config_rules = serializers.ListSerializer(child=TendbOpenAreaSubConfigSerializer(), help_text=_("模板克隆规则列表")) + + class Meta: + model = TendbOpenAreaConfig + exclude = ("related_authorize",) + swagger_schema_fields = {"example": mock_data.OPENAREA_TEMPLATE_DATA} + + def validate(self, attrs): + # 校验集群是否存在 + if not Cluster.objects.filter(id=attrs["source_cluster_id"]).exists(): + raise serializers.ValidationError(_("源集群不存在,请选择合法集群")) + + # 校验分区名称是否唯一 + if not OpenAreaHandler.validate_only_openarea( + bk_biz_id=attrs["bk_biz_id"], config_name=attrs["config_name"], config_id=getattr(self.instance, "id", 0) + ): + raise serializers.ValidationError(_("请保证同一业务下的开区模板命名不重复")) + + # (产品暂定)校验模板克隆规则的克隆DB不要重复 + source_dbs = [info["source_db"] for info in attrs["config_rules"]] + if len(set(source_dbs)) != len(source_dbs): + raise serializers.ValidationError(_("请保证校验模板克隆规则的克隆DB不要重复")) + + return attrs + + def to_internal_value(self, data): + data = super().to_internal_value(data) + data["related_authorize"] = list(set(itertools.chain(*[_data["priv_data"] for _data in data["config_rules"]]))) + return data + + +class TendbOpenAreaResultPreviewSerializer(serializers.Serializer): + class ConfigDataSerializer(serializers.Serializer): + cluster_id = serializers.IntegerField(help_text=_("目标集群")) + vars = serializers.JSONField(help_text=_("变量表")) + authorize_ips = serializers.JSONField(help_text=_("授权IP")) + + config_id = serializers.IntegerField(help_text=_("开区模板ID")) + config_data = serializers.ListSerializer(help_text=_("开区数据列表"), child=ConfigDataSerializer()) + + +class TendbOpenAreaResultPreviewResponseSerializer(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": mock_data.OPENAREA_PREVIEW_DATA} diff --git a/dbm-ui/backend/db_services/mysql/open_area/urls.py b/dbm-ui/backend/db_services/mysql/open_area/urls.py new file mode 100644 index 0000000000..3fc280fa0e --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/urls.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from rest_framework.routers import DefaultRouter + +from .views import OpenAreaViewSet + +router = DefaultRouter(trailing_slash=True) + +router.register(r"openarea", OpenAreaViewSet, basename="openarea") + +urlpatterns = [] +urlpatterns += router.urls diff --git a/dbm-ui/backend/db_services/mysql/open_area/views.py b/dbm-ui/backend/db_services/mysql/open_area/views.py new file mode 100644 index 0000000000..b3ec268ea6 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/open_area/views.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import ugettext as _ +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.response import Response + +from backend.bk_web import viewsets +from backend.bk_web.pagination import AuditedLimitOffsetPagination +from backend.bk_web.swagger import ( + PaginatedResponseSwaggerAutoSchema, + ResponseSwaggerAutoSchema, + common_swagger_auto_schema, +) +from backend.db_meta.models import Cluster +from backend.db_services.mysql.open_area.filters import TendbOpenAreaConfigListFilter +from backend.db_services.mysql.open_area.handlers import OpenAreaHandler +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig +from backend.db_services.mysql.open_area.serializers import ( + TendbOpenAreaConfigSerializer, + TendbOpenAreaResultPreviewResponseSerializer, + TendbOpenAreaResultPreviewSerializer, +) +from backend.iam_app.handlers.drf_perm import DBManageIAMPermission + +SWAGGER_TAG = "db_services/openarea" + + +class OpenAreaViewSet(viewsets.AuditedModelViewSet): + """开区操作的视图集""" + + queryset = TendbOpenAreaConfig.objects.all() + serializer_class = TendbOpenAreaConfigSerializer + pagination_class = AuditedLimitOffsetPagination + filter_class = TendbOpenAreaConfigListFilter + + def _get_custom_permissions(self): + return [DBManageIAMPermission()] + + def get_queryset(self): + # 过滤业务下的集群模板 + bk_biz_id = self.request.parser_context["kwargs"].get("bk_biz_id") + return self.queryset.filter(bk_biz_id=bk_biz_id) + + @common_swagger_auto_schema( + operation_summary=_("创建开区模板"), + auto_schema=ResponseSwaggerAutoSchema, + responses={status.HTTP_200_OK: TendbOpenAreaConfigSerializer(label=_("创建开区模板"))}, + tags=[SWAGGER_TAG], + ) + def create(self, request, *args, **kwargs): + return super().create(request, *args, **kwargs) + + @common_swagger_auto_schema( + operation_summary=_("开区模板列表"), + auto_schema=PaginatedResponseSwaggerAutoSchema, + tags=[SWAGGER_TAG], + ) + def list(self, request, *args, **kwargs): + resp = super().list(request, *args, **kwargs) + # 填充集群信息 + source_cluster_ids = [data["source_cluster_id"] for data in resp.data["results"]] + cluster_id__info = { + cluster.id: cluster.simple_desc for cluster in Cluster.objects.filter(id__in=source_cluster_ids) + } + for data in resp.data["results"]: + data["source_cluster"] = cluster_id__info[data["source_cluster_id"]] + + return resp + + @common_swagger_auto_schema( + operation_summary=_("开区模板详情"), + auto_schema=PaginatedResponseSwaggerAutoSchema, + responses={status.HTTP_200_OK: TendbOpenAreaConfigSerializer(label=_("开区模板详情"))}, + tags=[SWAGGER_TAG], + ) + def retrieve(self, request, *args, **kwargs): + return super().retrieve(request, *args, **kwargs) + + @common_swagger_auto_schema( + operation_summary=_("更新开区模板"), + auto_schema=ResponseSwaggerAutoSchema, + responses={status.HTTP_200_OK: TendbOpenAreaConfigSerializer(label=_("更新开区模板"))}, + tags=[SWAGGER_TAG], + ) + def update(self, request, *args, **kwargs): + return super().update(request, *args, **kwargs) + + @common_swagger_auto_schema( + operation_summary=_("删除开区模板"), + auto_schema=ResponseSwaggerAutoSchema, + tags=[SWAGGER_TAG], + ) + def destroy(self, request, *args, **kwargs): + return super().destroy(request, *args, **kwargs) + + @common_swagger_auto_schema( + operation_summary=_("获取开区结果预览"), + request_body=TendbOpenAreaResultPreviewSerializer(), + responses={status.HTTP_200_OK: TendbOpenAreaResultPreviewResponseSerializer()}, + auto_schema=ResponseSwaggerAutoSchema, + tags=[SWAGGER_TAG], + ) + @action(methods=["POST"], detail=False, serializer_class=TendbOpenAreaResultPreviewSerializer) + def preview(self, request, *args, **kwargs): + validated_data = self.params_validate(self.get_serializer_class()) + validated_data["operator"] = request.user.username + return Response(OpenAreaHandler.openarea_result_preview(**validated_data)) diff --git a/dbm-ui/backend/db_services/mysql/permission/db_account/dataclass.py b/dbm-ui/backend/db_services/mysql/permission/db_account/dataclass.py index 8fdea0929e..29ca4be18a 100644 --- a/dbm-ui/backend/db_services/mysql/permission/db_account/dataclass.py +++ b/dbm-ui/backend/db_services/mysql/permission/db_account/dataclass.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from dataclasses import asdict, dataclass -from typing import Dict, Union +from typing import Dict, List, Union from backend.db_services.mysql.permission.constants import AccountType @@ -36,6 +36,7 @@ class AccountRuleMeta(AccountMeta): """账号规则元信息的数据模型""" rule_id: int = None + rule_ids: List[int] = None privilege: Dict[str, Union[list, str]] = None access_db: Union[list, str] = None @@ -43,6 +44,9 @@ class AccountRuleMeta(AccountMeta): access_dbs: list = None def __post_init__(self): + if self.rule_ids and isinstance(self.rule_ids, str): + self.rule_ids = list(map(int, self.rule_ids.split(","))) + if not isinstance(self.privilege, dict): return diff --git a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py index 3b927354f2..f5e85273ec 100644 --- a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py +++ b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py @@ -12,14 +12,18 @@ import logging from typing import Any, Dict, List, Optional, Tuple +from django.utils.translation import ugettext as _ + from backend.components.mysql_priv_manager.client import MySQLPrivManagerApi from backend.configuration.handlers.password import DBPasswordHandler from backend.configuration.models.password_policy import PasswordPolicy from backend.core.encrypt.constants import AsymmetricCipherConfigType from backend.core.encrypt.handlers import AsymmetricHandler +from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig from backend.db_services.mysql.permission.constants import AccountType from backend.db_services.mysql.permission.db_account.dataclass import AccountMeta, AccountRuleMeta from backend.db_services.mysql.permission.db_account.policy import DBPasswordPolicy +from backend.db_services.mysql.permission.exceptions import DBPermissionBaseException logger = logging.getLogger("root") @@ -182,11 +186,17 @@ def query_account_rules(self, account_rule: AccountRuleMeta): def list_account_rules(self, rule_filter: AccountRuleMeta) -> Dict: """列举规则清单""" - account_rules_list = MySQLPrivManagerApi.list_account_rules( - {"bk_biz_id": self.bk_biz_id, "cluster_type": self.account_type} - ) - account_rules_list = self._format_account_rules(account_rules_list) - + # 如果是通过id过滤的,则不管集群类型 + if rule_filter.rule_ids: + rules_list = MySQLPrivManagerApi.list_account_rules( + {"bk_biz_id": self.bk_biz_id, "ids": rule_filter.rule_ids} + ) + else: + rules_list = MySQLPrivManagerApi.list_account_rules( + {"bk_biz_id": self.bk_biz_id, "cluster_type": self.account_type} + ) + + account_rules_list = self._format_account_rules(rules_list) # 不存在过滤条件则直接返回 if not (rule_filter.user or rule_filter.access_db or rule_filter.privilege): return {"count": len(account_rules_list["items"]), "results": account_rules_list["items"]} @@ -241,6 +251,9 @@ def delete_account_rule(self, account_rule: AccountRuleMeta) -> Optional[Any]: - 删除账号规则 :param account_rule: 账号规则元信息 """ + config = TendbOpenAreaConfig.objects.filter(related_authorize__contains=[account_rule.rule_id]) + if config.exists(): + raise DBPermissionBaseException(_("当前授权规则已被开区模板{}引用,不允许删除").format(config.first().name)) resp = MySQLPrivManagerApi.delete_account_rule( { diff --git a/dbm-ui/backend/db_services/mysql/permission/db_account/serializers.py b/dbm-ui/backend/db_services/mysql/permission/db_account/serializers.py index 506c04a4d5..3dc9df2535 100644 --- a/dbm-ui/backend/db_services/mysql/permission/db_account/serializers.py +++ b/dbm-ui/backend/db_services/mysql/permission/db_account/serializers.py @@ -109,6 +109,7 @@ class MySQLAccountRulesInfoSerializer(serializers.Serializer): class FilterMySQLAccountRulesSerializer(serializers.Serializer): + rule_ids = serializers.CharField(help_text=_("规则ID列表(通过,分割)"), required=False) user = serializers.CharField(help_text=_("账号名称"), required=False) access_db = serializers.CharField(help_text=_("访问DB"), required=False) privilege = serializers.CharField(help_text=_("规则列表"), required=False) diff --git a/dbm-ui/backend/db_services/mysql/remote_service/handlers.py b/dbm-ui/backend/db_services/mysql/remote_service/handlers.py index e6f84aa978..0aa9ed30a7 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/handlers.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/handlers.py @@ -8,6 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import itertools from collections import defaultdict from itertools import chain from typing import Any, Dict, List, Union @@ -15,10 +16,8 @@ from django.utils.translation import ugettext as _ from backend.components import DRSApi -from backend.constants import IP_PORT_DIVIDER from backend.db_meta.api.cluster.base.handler import ClusterHandler -from backend.db_services.mysql.constants import QUERY_SCHEMA_DBS_SQL, QUERY_SCHEMA_TABLES_SQL -from backend.db_services.mysql.remote_service.exceptions import RemoteServiceBaseException +from backend.db_services.mysql.constants import QUERY_SCHEMA_DBS_SQL, QUERY_SCHEMA_TABLES_SQL, QUERY_TABLES_FROM_DB_SQL from backend.flow.consts import SYSTEM_DBS @@ -79,6 +78,36 @@ def show_databases( ) return cluster_databases + def show_tables( + self, cluster_db_infos: List[Dict], cluster_id__role_map: Dict[int, str] = None + ) -> List[Dict[str, Union[str, List]]]: + """ + 批量查询集群的数据库列表 + @param cluster_db_infos: 集群DB信息 + @param cluster_id__role_map: (可选)集群ID和对应查询库表角色的映射表 + """ + cluster_id__role_map = cluster_id__role_map or {} + + cluster_table_infos: List[Dict[str, Union[str, List]]] = [] + for info in cluster_db_infos: + cluster_handler, address = self._get_cluster_address(cluster_id__role_map, info["cluster_id"]) + + # 构造数据表查询语句 + db_sts = " or ".join([f"table_schema='{db}'" for db in info["dbs"]]) + query_table_sql = QUERY_TABLES_FROM_DB_SQL.format(db_sts=db_sts) + + # 执行DRS,并聚合库所包含的表数据 + bk_cloud_id = cluster_handler.cluster.bk_cloud_id + rpc_results = DRSApi.rpc({"bk_cloud_id": bk_cloud_id, "addresses": [address], "cmds": [query_table_sql]}) + table_data = rpc_results[0]["cmd_results"][0]["table_data"] + aggregate_table_data: Dict[str, List[str]] = {db: [] for db in info["dbs"]} + for data in table_data: + aggregate_table_data[data["table_schema"]].append(data["table_name"]) + + cluster_table_infos.append({"cluster_id": cluster_handler.cluster_id, "table_data": aggregate_table_data}) + + return cluster_table_infos + def check_cluster_database(self, check_infos: List[Dict[str, Any]]) -> List[Dict[str, Dict]]: """ 批量校验集群下的DB是否存在 @@ -112,8 +141,15 @@ def check_flashback_database(self, flashback_infos: List[Dict[str, Any]]): ] """ - def _get_db_tb_sts(_databases, key, default): - _sts = "(" + " or ".join([f"{key} like '{db}'" for db in _databases]) + ")" + def _format_db_tb_name(_data_names): + for index in range(len(_data_names)): + # mysql模糊匹配单个字符,用_,原本字符串里带的_,要\_转义,如果是*,则转为%表示like % --> 永真 + _data_names[index] = _data_names[index].replace("_", "\_").replace("?", "_").replace("*", "%") + return _data_names + + def _get_db_tb_sts(_data_names, key, default): + _data_names = _format_db_tb_name(_data_names) + _sts = "(" + " or ".join([f"{key} like '{name}'" for name in _data_names]) + ")" _sts = f"({default})" if _sts == "()" else _sts return _sts @@ -147,7 +183,8 @@ def _get_db_table_list(_bk_cloud_id, _address, _cmds, key): ) databases = set(query_dbs_list[query_schema_dbs_sql]) - set(query_dbs_list[query_ignore_schema_dbs_sql]) if not databases: - raise RemoteServiceBaseException(_("不存在可用于闪回的库")) + info.update(message=_("不存在可用于闪回的库")) + continue # 构造查询表的sql语句 db_list = "(" + ",".join([f"'{db}'" for db in databases]) + ")" @@ -170,4 +207,9 @@ def _get_db_table_list(_bk_cloud_id, _address, _cmds, key): query_tbs_list[query_ignore_schema_tables_sql] ) if not databases: - raise RemoteServiceBaseException(_("不存在可用于闪回的表")) + info.update(message=_("不存在可用于闪回的表")) + continue + + info.update(message="") + + return flashback_infos diff --git a/dbm-ui/backend/db_services/mysql/remote_service/mock_data.py b/dbm-ui/backend/db_services/mysql/remote_service/mock_data.py index 58d5fb89a9..48264d0343 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/mock_data.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/mock_data.py @@ -16,8 +16,30 @@ {"cluster_id": 2, "databases": ["db2", "db3"]}, ] +SHOW_TABLES_RESPONSE_DATA = [{"cluster_id": 1, "table_data": {"db1": [], "db2": [], "db3": ["test1"]}}] + CHECK_CLUSTER_DATABASE_REQUEST_DATA = {"infos": [{"cluster_id": 1, "db_names": ["test1", "test2"]}]} CHECK_CLUSTER_DATABASE_RESPONSE_DATA = [ {"cluster_id": 63, "db_names": ["db1", "db2"], "check_info": {"db1": False, "db2": True}} ] + +FLASHBACK_CHECK_DATA = [ + { + "cluster_id": 63, + "databases": ["kkjj"], + "databases_ignore": [], + "tables": [], + "tables_ignore": [], + "message": "this is a error message", + }, + { + "cluster_id": 63, + "databases": [], + "databases_ignore": [], + "tables": ["iijkk"], + "tables_ignore": [], + "message": "this is a error message", + }, + {"cluster_id": 63, "databases": [], "databases_ignore": [], "tables": [], "tables_ignore": [], "message": ""}, +] diff --git a/dbm-ui/backend/db_services/mysql/remote_service/serializers.py b/dbm-ui/backend/db_services/mysql/remote_service/serializers.py index ca91aab95d..b1a0eae218 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/serializers.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/serializers.py @@ -15,10 +15,13 @@ from backend.db_services.mysql.remote_service.mock_data import ( CHECK_CLUSTER_DATABASE_REQUEST_DATA, CHECK_CLUSTER_DATABASE_RESPONSE_DATA, + FLASHBACK_CHECK_DATA, SHOW_DATABASES_REQUEST_DATA, SHOW_DATABASES_RESPONSE_DATA, + SHOW_TABLES_RESPONSE_DATA, ) from backend.flow.consts import TenDBBackUpLocation +from backend.ticket.builders.mysql.base import DBTableField class ShowDatabasesRequestSerializer(serializers.Serializer): @@ -38,6 +41,19 @@ class Meta: swagger_schema_fields = {"example": SHOW_DATABASES_REQUEST_DATA} +class ShowTablesRequestSerializer(serializers.Serializer): + class DbInfoSerializer(serializers.Serializer): + cluster_id = serializers.IntegerField(help_text=_("集群ID列表")) + dbs = serializers.ListField(help_text=_("查询的DB列表"), child=DBTableField(db_field=True)) + + cluster_db_infos = serializers.ListSerializer(help_text=_("集群数据库信息"), child=DbInfoSerializer()) + + +class ShowTablesResponseSerializer(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": SHOW_TABLES_RESPONSE_DATA} + + class ShowDatabasesResponseSerializer(serializers.Serializer): class Meta: swagger_schema_fields = {"example": SHOW_DATABASES_RESPONSE_DATA} @@ -62,9 +78,14 @@ class Meta: class CheckFlashbackInfoSerializer(serializers.Serializer): class FlashbackSerializer(serializers.Serializer): cluster_id = serializers.IntegerField(help_text=_("集群ID")) - databases = serializers.ListField(help_text=_("目标库列表"), child=serializers.CharField()) - databases_ignore = serializers.ListField(help_text=_("忽略库列表"), child=serializers.CharField()) - tables = serializers.ListField(help_text=_("目标table列表"), child=serializers.CharField()) - tables_ignore = serializers.ListField(help_text=_("忽略table列表"), child=serializers.CharField()) + databases = serializers.ListField(help_text=_("目标库列表"), child=DBTableField(db_field=True)) + databases_ignore = serializers.ListField(help_text=_("忽略库列表"), child=DBTableField(db_field=True)) + tables = serializers.ListField(help_text=_("目标table列表"), child=DBTableField()) + tables_ignore = serializers.ListField(help_text=_("忽略table列表"), child=DBTableField()) infos = serializers.ListSerializer(help_text=_("flashback信息"), child=FlashbackSerializer(), allow_empty=False) + + +class CheckFlashbackInfoResponseSerializer(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": FLASHBACK_CHECK_DATA} diff --git a/dbm-ui/backend/db_services/mysql/remote_service/views.py b/dbm-ui/backend/db_services/mysql/remote_service/views.py index d1a13b1e77..db51bf726c 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/views.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/views.py @@ -19,9 +19,12 @@ from backend.db_services.mysql.remote_service.serializers import ( CheckClusterDatabaseResponseSerializer, CheckClusterDatabaseSerializer, + CheckFlashbackInfoResponseSerializer, CheckFlashbackInfoSerializer, ShowDatabasesRequestSerializer, ShowDatabasesResponseSerializer, + ShowTablesRequestSerializer, + ShowTablesResponseSerializer, ) from backend.iam_app.handlers.drf_perm import DBManageIAMPermission @@ -58,6 +61,19 @@ def show_cluster_databases(self, request, bk_biz_id): ), ) + @common_swagger_auto_schema( + operation_summary=_("查询集群数据表列表"), + request_body=ShowTablesRequestSerializer(), + tags=[SWAGGER_TAG], + responses={status.HTTP_200_OK: ShowTablesResponseSerializer()}, + ) + @action(methods=["POST"], detail=False, serializer_class=ShowTablesRequestSerializer) + def show_cluster_tables(self, request, bk_biz_id): + validated_data = self.params_validate(self.get_serializer_class()) + return Response( + RemoteServiceHandler(bk_biz_id=bk_biz_id).show_tables(cluster_db_infos=validated_data["cluster_db_infos"]) + ) + @common_swagger_auto_schema( operation_summary=_("校验DB是否在集群内"), request_body=CheckClusterDatabaseSerializer(), @@ -74,6 +90,7 @@ def check_cluster_database(self, request, bk_biz_id): @common_swagger_auto_schema( operation_summary=_("校验flashback信息是否合法"), request_body=CheckFlashbackInfoSerializer(), + responses={status.HTTP_200_OK: CheckFlashbackInfoResponseSerializer()}, tags=[SWAGGER_TAG], ) @action(methods=["POST"], detail=False, serializer_class=CheckFlashbackInfoSerializer) diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py index 58c6bb6a8c..df6ba71f8a 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py @@ -9,14 +9,14 @@ specific language governing permissions and limitations under the License. """ -from typing import Any, Dict +from typing import Any, Dict, List from django.db.models import F, Q, QuerySet, Value from django.forms import model_to_dict from django.utils.translation import ugettext_lazy as _ from backend.db_meta.api.cluster.tendbcluster.detail import scan_cluster -from backend.db_meta.enums import InstanceInnerRole, TenDBClusterSpiderRole +from backend.db_meta.enums import InstanceInnerRole, InstanceStatus, TenDBClusterSpiderRole from backend.db_meta.enums.cluster_type import ClusterType from backend.db_meta.models import AppCache, Machine, Spec from backend.db_meta.models.cluster import Cluster @@ -67,22 +67,22 @@ def _list( def _to_cluster_representation( cluster: Cluster, db_module_names: Dict[int, str], cluster_entry_map: Dict[int, Dict[str, str]] ) -> Dict[str, Any]: - def get_remote_infos(insts: QuerySet): + def get_remote_infos(insts: List[StorageInstance]): """获取remote信息,并补充分片信息""" - remote_db_infos, remote_dr_infos = [], [] + remote_infos = {InstanceInnerRole.MASTER.value: [], InstanceInnerRole.SLAVE.value: []} for inst in insts: - info = inst.simple_desc - if inst.instance_inner_role == InstanceInnerRole.MASTER: - info.update(shard_id=inst.as_ejector.first().tendbclusterstorageset.shard_id) - remote_db_infos.append(info) - elif inst.instance_inner_role == InstanceInnerRole.SLAVE: - info.update(shard_id=inst.as_receiver.first().tendbclusterstorageset.shard_id) - remote_dr_infos.append(info) - - remote_db_infos.sort(key=lambda x: x.get("shard_id", -1)) - remote_dr_infos.sort(key=lambda x: x.get("shard_id", -1)) - - return remote_db_infos, remote_dr_infos + try: + related = "as_ejector" if inst.instance_inner_role == InstanceInnerRole.MASTER else "as_receiver" + shard_id = getattr(inst, related).first().tendbclusterstorageset.shard_id + except Exception: + # 如果无法找到shard_id,则默认为-1。有可能实例处于restoring状态(比如集群容量变更时) + shard_id = -1 + + remote_infos[inst.instance_inner_role].append({**inst.simple_desc, "shard_id": shard_id}) + + remote_infos[InstanceInnerRole.MASTER.value].sort(key=lambda x: x.get("shard_id", -1)) + remote_infos[InstanceInnerRole.SLAVE.value].sort(key=lambda x: x.get("shard_id", -1)) + return remote_infos[InstanceInnerRole.MASTER.value], remote_infos[InstanceInnerRole.SLAVE.value] """将集群对象转为可序列化的 dict 结构""" spider = { diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py index 3bd5e5a560..65acc63ca1 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py @@ -67,6 +67,9 @@ def list_clusters(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: i proxy_inst_qset = ProxyInstance.objects.filter(proxy_query) storage_inst_qset = StorageInstance.objects.filter(storage_query) + if query_params.get("name"): + cluster_query &= Q(name__icontains=query_params["name"]) + if query_params.get("version"): cluster_query &= Q(major_version=query_params["version"]) @@ -74,7 +77,9 @@ def list_clusters(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: i cluster_query &= Q(region=query_params["region"]) if query_params.get("domain"): - cluster_query &= Q(immute_domain__icontains=query_params["domain"]) + # 考虑从域名的筛选 + cluster_entry_set = ClusterEntry.objects.filter(entry__icontains=query_params["domain"]) + cluster_query &= Q(clusterentry__in=cluster_entry_set) if query_params.get("cluster_ids"): cluster_query &= Q(id__in=query_params["cluster_ids"]) @@ -82,7 +87,6 @@ def list_clusters(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: i if query_params.get("creator"): cluster_query &= Q(creator__icontains=query_params["creator"]) - cluster_query &= ~Q(status=ClusterStatus.TEMPORARY) cluster_qset = Cluster.objects.filter(cluster_query) if query_params.get("ip"): @@ -133,7 +137,6 @@ def _filter_instance_qs(query_conditions, query_params): @classmethod def list_instances(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: int) -> query.ResourceList: query_conditions = Q(bk_biz_id=bk_biz_id, cluster_type=cls.cluster_type) - query_conditions &= ~Q(cluster__status=ClusterStatus.TEMPORARY) if query_params.get("ip"): filter_ip = query_params.get("ip").split(",") diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py index 0c98385bdd..5630152101 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py @@ -54,7 +54,6 @@ def list_clusters(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: i :param offset: 分页查询, 当前页的偏移数 """ query_filters = Q(bk_biz_id=bk_biz_id, cluster_type=cls.cluster_type) - query_filters &= ~Q(status=ClusterStatus.TEMPORARY) if query_params.get("db_module_id"): query_filters &= Q(db_module_id=query_params["db_module_id"]) @@ -92,7 +91,6 @@ def list_clusters(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: i @classmethod def list_instances(cls, bk_biz_id: int, query_params: Dict, limit: int, offset: int) -> query.ResourceList: instance_filters = Q(bk_biz_id=bk_biz_id, cluster_type=cls.cluster_type) - instance_filters &= ~Q(cluster__status=ClusterStatus.TEMPORARY) if query_params.get("ip"): instance_filters &= Q(machine__ip=query_params["ip"]) diff --git a/dbm-ui/backend/db_services/mysql/sql_import/serializers.py b/dbm-ui/backend/db_services/mysql/sql_import/serializers.py index 5acf789a7e..cab598663c 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/serializers.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/serializers.py @@ -33,6 +33,9 @@ class SQLGrammarCheckSerializer(serializers.Serializer): sql_files = serializers.ListField( help_text=_("sql文件列表"), child=serializers.FileField(help_text=_("sql文件"), required=False), required=False ) + cluster_type = serializers.ChoiceField( + help_text=_("集群类型"), choices=DBType.get_choices(), required=False, default=DBType.MySQL + ) class Meta: swagger_schema_fields = {"example": mock_data.SQL_GRAMMAR_CHECK_REQUEST_DATA} @@ -119,14 +122,18 @@ class Meta: class SQLUserConfigSerializer(serializers.Serializer): root_id = serializers.CharField(help_text=_("流程id")) - is_auto_commit = serializers.BooleanField(help_text=_("是否自动创建单据"), required=False, default=False) - is_skip_pause = serializers.BooleanField(help_text=_("是否自动跳过确认"), required=False, default=False) + is_auto_commit = serializers.BooleanField(help_text=_("是否自动创建单据")) + is_skip_pause = serializers.BooleanField(help_text=_("是否自动跳过确认")) class Meta: swagger_schema_fields = {"example": mock_data.SQL_TICKET_AUTO_COMMIT_REQUEST_DATA} class QuerySQLUserConfigSerializer(serializers.Serializer): + root_id = serializers.CharField(help_text=_("流程id")) + + +class QuerySQLUserConfigResponseSerializer(serializers.Serializer): is_auto_commit = serializers.BooleanField(help_text=_("是否自动创建单据")) is_skip_pause = serializers.BooleanField(help_text=_("是否自动跳过确认")) diff --git a/dbm-ui/backend/db_services/mysql/sql_import/views.py b/dbm-ui/backend/db_services/mysql/sql_import/views.py index 7c1234776d..a1f161df60 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/views.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/views.py @@ -26,6 +26,7 @@ GetUserSemanticListSerializer, QuerySemanticDataResponseSerializer, QuerySemanticDataSerializer, + QuerySQLUserConfigResponseSerializer, QuerySQLUserConfigSerializer, RevokeSemanticCheckResponseSerializer, RevokeSemanticCheckSerializer, @@ -97,11 +98,11 @@ def deploy_user_config(self, request, bk_biz_id): @common_swagger_auto_schema( operation_summary=_("查询流程配置"), - query_serializer=SQLUserConfigSerializer(), - responses={status.HTTP_200_OK: QuerySQLUserConfigSerializer()}, + query_serializer=QuerySQLUserConfigSerializer(), + responses={status.HTTP_200_OK: QuerySQLUserConfigResponseSerializer()}, tags=[SWAGGER_TAG], ) - @action(methods=["GET"], detail=False, serializer_class=SQLUserConfigSerializer) + @action(methods=["GET"], detail=False, serializer_class=QuerySQLUserConfigSerializer) def query_user_config(self, request, bk_biz_id): return self._view_common_handler( request, bk_biz_id, SemanticOperateMeta, SQLHandler.query_user_config.__name__ diff --git a/dbm-ui/backend/db_services/mysql/urls.py b/dbm-ui/backend/db_services/mysql/urls.py index 3133f217bc..416d0322fa 100644 --- a/dbm-ui/backend/db_services/mysql/urls.py +++ b/dbm-ui/backend/db_services/mysql/urls.py @@ -18,4 +18,5 @@ path("bizs//", include("backend.db_services.mysql.cluster.urls")), path("bizs//", include("backend.db_services.mysql.instance.urls")), path("bizs//", include("backend.db_services.mysql.fixpoint_rollback.urls")), + path("bizs//", include("backend.db_services.mysql.open_area.urls")), ] diff --git a/dbm-ui/backend/db_services/plugin/nameservice/clb.py b/dbm-ui/backend/db_services/plugin/nameservice/clb.py index 8c0a0e9af1..d83450df65 100644 --- a/dbm-ui/backend/db_services/plugin/nameservice/clb.py +++ b/dbm-ui/backend/db_services/plugin/nameservice/clb.py @@ -17,26 +17,131 @@ from backend.configuration.models import DBAdministrator from backend.db_meta import api from backend.db_meta.enums import ClusterEntryType -from backend.db_meta.models import Cluster +from backend.db_meta.models import Cluster, ClusterEntry +from backend.env import CLB_DOMAIN +from backend.flow.utils import dns_manage -def create_lb_and_register_target(cluster_id: int, creator: str) -> Dict[str, Any]: - """创建clb并绑定后端主机""" +@transaction.atomic +def tendis_add_clb_domain(immute_domain: str, bk_cloud_id: int, created_by: str): + """ 增加CLB 域名 """ + cluster = Cluster.objects.get(bk_cloud_id=bk_cloud_id, immute_domain=immute_domain) + clb = cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.CLB.value).first() + ClusterEntry.objects.create( + cluster=cluster, + cluster_entry_type=ClusterEntryType.CLBDNS, + entry="clb.{}".format(cluster.immute_domain), + creator=created_by, + forward_to_id=clb.id, + ) + + +@transaction.atomic +def tendis_bind_clb_domain(immute_domain: str, bk_cloud_id: int, created_by: str): + """ 主域名直接指向CLB """ + cluster = Cluster.objects.get(bk_cloud_id=bk_cloud_id, immute_domain=immute_domain) + immute_entry = cluster.clusterentry_set.filter( + cluster_entry_type=ClusterEntryType.DNS.value, entry=cluster.immute_domain + ).first() + clb_entry = cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.CLB.value).first() + immute_entry.forward_to_id = clb_entry.id + immute_entry.creator = created_by + immute_entry.save(update_fields=["forward_to_id", "creator"]) + + +@transaction.atomic +def tendis_unbind_clb_domain(immute_domain: str, bk_cloud_id: int, created_by: str): + """ 主域名解绑CLB """ + cluster = Cluster.objects.get(bk_cloud_id=bk_cloud_id, immute_domain=immute_domain) + immute_entry = cluster.clusterentry_set.filter( + cluster_entry_type=ClusterEntryType.DNS.value, entry=cluster.immute_domain + ).first() + immute_entry.forward_to_id = None + immute_entry.creator = created_by + immute_entry.save(update_fields=["forward_to_id", "creator"]) + + +@transaction.atomic +def delete_clb(domain: str): + """删除db中clb数据""" + + cluster = Cluster.objects.filter(immute_domain=domain).get() + cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.CLB).delete() + + +@transaction.atomic +def delete_clb_dns(domain: str): + """删除db中clbDns""" + + cluster = Cluster.objects.filter(immute_domain=domain).get() + cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.CLBDNS).delete() + + +def tendis_domain_bind_clb_status(immute_domain: str, bk_cloud_id: int) -> bool: + """判断主域名是否绑定了clb ip""" + + cluster = Cluster.objects.get(bk_cloud_id=bk_cloud_id, immute_domain=immute_domain) + immute_entry = cluster.clusterentry_set.filter( + cluster_entry_type=ClusterEntryType.DNS.value, entry=cluster.immute_domain + ).first() + return immute_entry.forward_to_id is not None + + +def get_cluster_info(cluster_id: int) -> Dict[str, Any]: + """获取集群信息""" # 获取集群信息 - result = api.cluster.nosqlcomm.other.get_cluster_detail(cluster_id) + result = api.cluster.nosqlcomm.other.get_cluster_detail(cluster_id=cluster_id) cluster = result[0] - domain = cluster["immute_domain"] + return cluster + + +def get_dns_status_by_domain(bk_biz_id: int, bk_cloud_id: int, domain: str) -> bool: + """判断域名是否存在""" + + result = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).get_domain(get_domain_name=domain) + return len(result) > 0 + + +def get_dns_status_by_ip(bk_biz_id: int, bk_cloud_id: int, domain: str, ip: str) -> bool: + """判断ip是否在域名映射中""" + + results = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).get_domain(get_domain_name=domain) + for result in results: + if result["ip"] == ip: + return True + return False + + +def response_ok() -> Dict[str, Any]: + """成功返回""" + + return {"code": 0, "message": "ok"} + + +def response_fail(code: int, message: str) -> Dict[str, Any]: + """失败返回""" + + return {"code": code, "message": message} + + +def create_lb_and_register_target(cluster_id: int) -> Dict[str, Any]: + """创建clb并绑定后端主机""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) + immute_domain = cluster["immute_domain"] # 判断clb是否已经存在 - if "clb" in cluster["clusterentry_set"]: - return {"status": 3, "message": "clb of cluster:%s has been existed" % domain} + if ClusterEntryType.CLB.value in cluster["clusterentry_set"]: + message = "clb of cluster:{} has existed".format(immute_domain) + return response_fail(code=3, message=message) region = cluster["region"] ips = cluster["twemproxy_set"] bk_biz_id = cluster["bk_biz_id"] # 通过bk_biz_id获取manager,backupmanager,去除admin - users = DBAdministrator().get_biz_db_type_admins(bk_biz_id, DBType.Redis) + users = DBAdministrator().get_biz_db_type_admins(bk_biz_id=bk_biz_id, db_type=DBType.Redis) users = [user for user in users if user != "admin"] manager = users[0] backupmanager = users[1] if len(users) > 1 else users[0] @@ -45,8 +150,8 @@ def create_lb_and_register_target(cluster_id: int, creator: str) -> Dict[str, An output = NameServiceApi.clb_create_lb_and_register_target( { "region": region, - "loadbalancername": domain, - "listenername": domain, + "loadbalancername": immute_domain, + "listenername": immute_domain, "manager": manager, "backupmanager": backupmanager, "protocol": "TCP", @@ -54,35 +159,124 @@ def create_lb_and_register_target(cluster_id: int, creator: str) -> Dict[str, An }, raw=True, ) + return output + + +def add_clb_info_to_meta(output: Dict[str, Any], cluster_id: int, creator: str) -> Dict[str, Any]: + """clb信息写入meta""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) # 进行判断请求结果,请求结果正确,写入数据库 - if output["status"] == 0: - api.entry.clb.create( - [ - { - "domain": domain, - "clb_ip": output["loadbalancerip"], - "clb_id": output["loadbalancerid"], - "clb_listener_id": output["listenerid"], - "clb_region": region, - } - ], - creator, - ) - return output + if output["code"] == 0 and ClusterEntryType.CLB.value not in cluster["clusterentry_set"]: + clb_ip = output["data"]["loadbalancerip"] + try: + api.entry.clb.create( + [ + { + "domain": cluster["immute_domain"], + "clb_ip": clb_ip, + "clb_id": output["data"]["loadbalancerid"], + "clb_listener_id": output["data"]["listenerid"], + "clb_region": cluster["region"], + } + ], + creator, + ) + except Exception as e: + message = "add clb info to meta fail, error:{}".format(str(e)) + return response_fail(code=3, message=message) + return response_ok() + + +def delete_clb_info_from_meta(output: Dict[str, Any], cluster_id: int) -> Dict[str, Any]: + """在meta中删除clb信息""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) + # 进行判断请求结果,如果为0操作删除db数据 + if output["code"] == 0 and ClusterEntryType.CLB.value in cluster["clusterentry_set"]: + loadbalancerid = cluster["clusterentry_set"]["clb"][0]["clb_id"] + try: + delete_clb(cluster["immute_domain"]) + except Exception as e: + message = "delete clb:{} info in db fail, error:{}".format(loadbalancerid, str(e)) + return response_fail(code=1, message=message) + return response_ok() + + +def add_clb_domain_to_dns(cluster_id: int, creator: str) -> Dict[str, Any]: + """添加clb域名到dns""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) + immute_domain = cluster["immute_domain"] + port = cluster["twemproxy_ports"][0] + bk_cloud_id = cluster["bk_cloud_id"] + bk_biz_id = cluster["bk_biz_id"] + clb_ip = cluster["clusterentry_set"]["clb"][0]["clb_ip"] + # 添加clb域名以及dns + if CLB_DOMAIN: + # 添加clb域名dns + if not get_dns_status_by_domain( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain="clb.{}".format(immute_domain) + ): + result = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).create_domain( + instance_list=["{}#{}".format(clb_ip, str(port))], add_domain_name="clb.{}".format(immute_domain) + ) + if not result: + return {"code": 3, "message": "add clb domain to dns fail"} + try: + if ClusterEntryType.CLBDNS.value not in cluster["clusterentry_set"]: + tendis_add_clb_domain(immute_domain=immute_domain, bk_cloud_id=bk_cloud_id, created_by=creator) + except Exception as e: + message = "cluster:{} add clb domain fail, error:{}".format(immute_domain, str(e)) + return response_fail(code=3, message=message) + return response_ok() + + +def delete_clb_domain_from_dns(cluster_id: int) -> Dict[str, Any]: + """从dns中删除clb域名""" + + cluster = get_cluster_info(cluster_id=cluster_id) + clb_dns = cluster["clusterentry_set"]["clbDns"] + immute_domain = cluster["immute_domain"] + clb_ip = cluster["clusterentry_set"]["clb"][0]["clb_ip"] + port = cluster["twemproxy_ports"][0] + bk_cloud_id = cluster["bk_cloud_id"] + bk_biz_id = cluster["bk_biz_id"] + # 如果存在clb域名指向clb ip,则删除 + if clb_dns: + # 删除dns:clb域名绑定clb ip + if get_dns_status_by_domain( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain="clb.{}".format(immute_domain) + ): + result = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).remove_domain_ip( + domain="clb.{}".format(immute_domain), del_instance_list=["{}#{}".format(clb_ip, str(port))] + ) + if not result: + message = "delete clb.{} dns info fail".format(immute_domain) + return response_fail(code=1, message=message) + # 删除元数据clbDns信息 + try: + delete_clb_dns(domain=immute_domain) + except Exception as e: + message = "delete clb domain of cluster:{} fail, error:{}".format(immute_domain, str(e)) + return response_fail(code=1, message=message) + return response_ok() def deregister_target_and_delete_lb(cluster_id: int) -> Dict[str, Any]: """解绑后端主机并删除clb""" # 获取集群信息 - result = api.cluster.nosqlcomm.other.get_cluster_detail(cluster_id) - cluster = result[0] - domain = cluster["immute_domain"] + cluster = get_cluster_info(cluster_id=cluster_id) + immute_domain = cluster["immute_domain"] # 判断clb是否存在 - if "clb" not in cluster["clusterentry_set"]: - return {"status": 3, "message": "clb of cluster:%s is not existed" % domain} + if ClusterEntryType.CLB.value not in cluster["clusterentry_set"]: + return {"code": 3, "message": "clb of cluster:%s does not exist, can not delete clb" % immute_domain} region = cluster["clusterentry_set"]["clb"][0]["clb_region"] loadbalancerid = cluster["clusterentry_set"]["clb"][0]["clb_id"] listenerid = cluster["clusterentry_set"]["clb"][0]["listener_id"] @@ -96,22 +290,97 @@ def deregister_target_and_delete_lb(cluster_id: int) -> Dict[str, Any]: }, raw=True, ) - - # 进行判断请求结果,如果为0操作删除db数据 - if output["status"] == 0: - try: - delete_clb(domain) - except Exception as e: - output["status"] = 1 - output["message"] = "delete clb sucessfully, delete clb:{} info in db fail, error:{}".format( - loadbalancerid, str(e) - ) return output -@transaction.atomic -def delete_clb(domain: str): - """删除db中clb数据""" +def immute_domain_clb_ip(cluster_id: int, creator: str, bind: bool) -> Dict[str, Any]: + """主域名指向clb ip或者解绑""" - cluster = Cluster.objects.filter(immute_domain=domain).get() - cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.CLB).delete() + # 获取集群信息 + cluster = get_cluster_info(cluster_id=cluster_id) + immute_domain = cluster["immute_domain"] + bk_cloud_id = cluster["bk_cloud_id"] + bk_biz_id = cluster["bk_biz_id"] + clb_ip = cluster["clusterentry_set"]["clb"][0]["clb_ip"] + port = cluster["twemproxy_ports"][0] + proxy_ips = cluster["twemproxy_ips_set"] + clb_ip_port = "{}#{}".format(clb_ip, str(port)) + if ClusterEntryType.CLB.value not in cluster["clusterentry_set"]: + message = "clb of cluster:{} does not exist, can not bind or unbind clb ip".format(immute_domain) + return response_fail(code=3, message=message) + if bind: + if not tendis_domain_bind_clb_status(immute_domain=immute_domain, bk_cloud_id=bk_cloud_id): + # 添加dns:主域名指向clb ip + dns_status_result = get_dns_status_by_ip( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain=immute_domain, ip=clb_ip + ) + if not dns_status_result: + create_dns_result = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).create_domain( + instance_list=[clb_ip_port], add_domain_name=immute_domain + ) + if not create_dns_result: + message = "add immute domain with clb ip to dns fail" + return response_fail(code=3, message=message) + + # 删除老的dns:主域名指向proxy + delete_dns_list = [] + # 判断ip是否在dns中存在 + for ip in proxy_ips: + dns_status_result = get_dns_status_by_ip( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain=immute_domain, ip=ip + ) + if dns_status_result: + delete_dns_list.append("{}#{}".format(ip, str(port))) + if delete_dns_list: + dns_remove_status = dns_manage.DnsManage( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id + ).remove_domain_ip(domain=immute_domain, del_instance_list=delete_dns_list) + if not dns_remove_status: + message = "delete immute domain with proxy ip from dns fail" + return response_fail(code=3, message=message) + # 修改元数据 + try: + tendis_bind_clb_domain(immute_domain=immute_domain, bk_cloud_id=bk_cloud_id, created_by=creator) + except Exception as e: + message = "change meta data about immute domain bind clb ip fail, error:{}".format(str(e)) + return response_fail(code=3, message=message) + return response_ok() + message = "immute domain has bound clb ip" + return response_fail(code=3, message=message) + # 主域名解绑clb ip + if tendis_domain_bind_clb_status(immute_domain=immute_domain, bk_cloud_id=bk_cloud_id): + # 添加dns:主域名指向proxy + add_dns_list = [] + for ip in proxy_ips: + dns_status_result = get_dns_status_by_ip( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain=immute_domain, ip=ip + ) + if not dns_status_result: + add_dns_list.append("{}#{}".format(ip, str(port))) + if add_dns_list: + dns_create_result = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).create_domain( + instance_list=add_dns_list, add_domain_name=immute_domain + ) + if not dns_create_result: + message = "add immute domain with proxy ip from dns fail" + return response_fail(code=3, message=message) + + # 删除老的dns:主域名指向clb ip + dns_status_result = get_dns_status_by_ip( + bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id, domain=immute_domain, ip=clb_ip + ) + if dns_status_result: + dns_remove_status = dns_manage.DnsManage(bk_biz_id=bk_biz_id, bk_cloud_id=bk_cloud_id).remove_domain_ip( + immute_domain, [clb_ip_port] + ) + if not dns_remove_status: + message = "delete immute domain with clb ip from dns fail" + return response_fail(code=3, message=message) + # 修改元数据 + try: + tendis_unbind_clb_domain(immute_domain=immute_domain, bk_cloud_id=bk_cloud_id, created_by=creator) + except Exception as e: + message = "change meta data about immute domain bind clb ip fail, error:{}".format(str(e)) + return response_fail(code=3, message=message) + return response_ok() + return response_ok() diff --git a/dbm-ui/backend/db_services/plugin/nameservice/polaris.py b/dbm-ui/backend/db_services/plugin/nameservice/polaris.py index e44bbb252e..cabde8cdce 100644 --- a/dbm-ui/backend/db_services/plugin/nameservice/polaris.py +++ b/dbm-ui/backend/db_services/plugin/nameservice/polaris.py @@ -19,20 +19,38 @@ from backend.db_meta.enums import ClusterEntryType from backend.db_meta.models import Cluster from backend.db_services.cmdb import biz +from backend.db_services.plugin.nameservice.clb import response_fail, response_ok from backend.env import NAMESERVICE_POLARIS_DEPARTMENT -def create_service_alias_bind_targets(cluster_id: int, creator: str) -> Dict[str, Any]: - """创建polaris并绑定后端主机""" +@transaction.atomic +def delete_polaris(domain: str): + """删除db中polaris数据""" + + cluster = Cluster.objects.filter(immute_domain=domain).get() + cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.POLARIS).delete() + + +def get_cluster_info(cluster_id: int) -> Dict[str, Any]: + """获取集群信息""" # 获取集群信息 result = api.cluster.nosqlcomm.other.get_cluster_detail(cluster_id) cluster = result[0] + return cluster + + +def create_service_alias_bind_targets(cluster_id: int) -> Dict[str, Any]: + """创建polaris并绑定后端主机""" + + # 获取集群信息 + cluster = get_cluster_info(cluster_id=cluster_id) domain = cluster["immute_domain"] - # 判断polaris是否已经存在 - if "polaris" in cluster["clusterentry_set"]: - return {"status": 3, "message": "polaris of cluster:%s has been existed" % domain} + # 判断polaris是否已经存在,如果存在则直接返回 + if ClusterEntryType.POLARIS.value in cluster["clusterentry_set"]: + message = "polaris of cluster:{} has been existed".format(domain) + return response_fail(code=3, message=message) name = "polaris." + domain ips = cluster["twemproxy_set"] department = NAMESERVICE_POLARIS_DEPARTMENT @@ -59,36 +77,64 @@ def create_service_alias_bind_targets(cluster_id: int, creator: str) -> Dict[str }, raw=True, ) + return output + +def add_polaris_info_to_meta(output: Dict[str, Any], cluster_id: int, creator: str) -> Dict[str, Any]: + """添加polaris信息到meta""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) # 进行判断请求结果,请求结果正确,写入数据库 - if output["status"] == 0: - api.entry.polaris.create( - [ - { - "domain": domain, - "polaris_name": output["servicename"], - "polaris_token": output["servicetoken"], - "polaris_l5": output["alias"], - "alias_token": output["aliastoken"], - } - ], - creator, - ) - return output + if output["code"] == 0 and ClusterEntryType.POLARIS.value not in cluster["clusterentry_set"]: + try: + api.entry.polaris.create( + [ + { + "domain": cluster["immute_domain"], + "polaris_name": output["data"]["servicename"], + "polaris_token": output["data"]["servicetoken"], + "polaris_l5": output["data"]["alias"], + "alias_token": output["data"]["aliastoken"], + } + ], + creator, + ) + except Exception as e: + message = "add polaris info to meta fail, error:{}".format(str(e)) + return response_fail(code=3, message=message) + return response_ok() + + +def delete_polaris_info_from_meta(output: Dict[str, Any], cluster_id: int) -> Dict[str, Any]: + """在meta中删除polaris信息""" + + # 获取信息 + cluster = get_cluster_info(cluster_id=cluster_id) + # 进行判断请求结果 + if output["code"] == 0 and ClusterEntryType.POLARIS.value in cluster["clusterentry_set"]: + servicename = cluster["clusterentry_set"]["polaris"][0]["polaris_name"] + try: + delete_polaris(cluster["immute_domain"]) + except Exception as e: + message = "delete polaris sucessfully, delete polaris:{} info in db fail, error:{}".format( + servicename, str(e) + ) + return response_fail(code=1, message=message) + return response_ok() def unbind_targets_delete_alias_service(cluster_id: int) -> Dict[str, Any]: """解绑后端主机并删除polaris""" # 获取集群信息 - result = api.cluster.nosqlcomm.other.get_cluster_detail(cluster_id) - cluster = result[0] + cluster = get_cluster_info(cluster_id=cluster_id) domain = cluster["immute_domain"] # 判断polaris是否存在 - if "polaris" not in cluster["clusterentry_set"]: - return {"status": 3, "message": "polaris of cluster:%s is not existed" % domain} - + if ClusterEntryType.POLARIS.value not in cluster["clusterentry_set"]: + message = "polaris of cluster:{} is not existed".format(domain) + return response_fail(code=3, message=message) servicename = cluster["clusterentry_set"]["polaris"][0]["polaris_name"] servicetoken = cluster["clusterentry_set"]["polaris"][0]["polaris_token"] alias = cluster["clusterentry_set"]["polaris"][0]["polaris_l5"] @@ -104,22 +150,4 @@ def unbind_targets_delete_alias_service(cluster_id: int) -> Dict[str, Any]: }, raw=True, ) - - # 进行判断请求结果 - if output["status"] == 0: - try: - delete_polaris(domain) - except Exception as e: - output["status"] = 1 - output["message"] = "delete polaris sucessfully, delete polaris:{} info in db fail, error:{}".format( - servicename, str(e) - ) return output - - -@transaction.atomic -def delete_polaris(domain: str): - """删除db中polaris数据""" - - cluster = Cluster.objects.filter(immute_domain=domain).get() - cluster.clusterentry_set.filter(cluster_entry_type=ClusterEntryType.POLARIS).delete() diff --git a/dbm-ui/backend/db_services/redis/redis_dts/constants.py b/dbm-ui/backend/db_services/redis/redis_dts/constants.py index e85effd107..a04e88c67a 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/constants.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/constants.py @@ -176,3 +176,56 @@ class DtsOperateType(str, StructuredEnum): done <<< "$lines" """ + +# 添加 /etc/resolv.conf +SERVERS_ADD_RESOLV_CONF = """ +lines="{}" + +while read -r line +do + # skip empty line + if [[ "$line" =~ ^[[:space:]]*$ ]]; then + continue + fi + if ! grep -qF "$line" /etc/resolv.conf; then + sed -i "1i $line" /etc/resolv.conf + echo "Added: $line" + else + echo "Skipped: $line" + fi +done <<< "$lines" +""" + +# 删除 /etc/resolv.conf +SERVERS_DEL_RESOLV_CONF = """ +lines="{}" + +while read -r line +do + # skip empty line + if [[ "$line" =~ ^[[:space:]]*$ ]]; then + continue + fi + sed -i "/$line/d" /etc/resolv.conf +done <<< "$lines" +""" + +# 删除 redis config 文件中 slaveof 配置 +REDIS_CONF_DEL_SLAVEOF = """ +source /etc/profile +ports="{}" + +while read -r port +do + # skip empty line + if [[ "$line" =~ ^[[:space:]]*$ ]]; then + continue + fi + if [[ ! -e $REDIS_DATA_DIR/redis/$port ]] + then + echo "$REDIS_DATA_DIR/redis/$port not exist" + exit -1 + fi + sed -e '/^slaveof/d' $REDIS_DATA_DIR/redis/$port/*.conf +done <<< "$ports" +""" diff --git a/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230831_0936.py b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230831_0936.py new file mode 100644 index 0000000000..128efef604 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230831_0936.py @@ -0,0 +1,35 @@ +# Generated by Django 3.2.19 on 2023-08-31 01:36 + +from django.db import migrations, models + +from backend.db_services.redis.redis_dts.enums import DtsBillType, DtsCopyType + + +class Migration(migrations.Migration): + + dependencies = [ + ("redis_dts", "0011_tbtendisdtsjob_online_switch_flow_id_squashed_0015_auto_20230817_1059"), + ] + + operations = [ + migrations.AlterField( + model_name="tbtendisdtsjob", + name="dts_bill_type", + field=models.CharField( + choices=DtsBillType.get_choices(), + default="", + max_length=64, + verbose_name="DTS单据类型", + ), + ), + migrations.AlterField( + model_name="tbtendisdtsjob", + name="dts_copy_type", + field=models.CharField( + choices=DtsCopyType.get_choices(), + default="", + max_length=64, + verbose_name="DTS数据复制类型", + ), + ), + ] diff --git a/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230921_0952.py b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230921_0952.py new file mode 100644 index 0000000000..6252e2c3b5 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0012_auto_20230921_0952.py @@ -0,0 +1,44 @@ +# Generated by Django 3.2.19 on 2023-09-21 01:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("redis_dts", "0011_tbtendisdtsjob_online_switch_flow_id_squashed_0015_auto_20230817_1059"), + ] + + operations = [ + migrations.AlterField( + model_name="tbtendisdtsjob", + name="dts_bill_type", + field=models.CharField( + choices=[ + ("REDIS_CLUSTER_SHARD_NUM_UPDATE", "集群节点数变更"), + ("REDIS_CLUSTER_TYPE_UPDATE", "集群类型变更"), + ("REDIS_CLUSTER_DATA_COPY", "集群数据复制"), + ("REDIS_CLUSTER_ROLLBACK_DATA_COPY", "集群回档数据回写"), + ], + default="", + max_length=64, + verbose_name="DTS单据类型", + ), + ), + migrations.AlterField( + model_name="tbtendisdtsjob", + name="dts_copy_type", + field=models.CharField( + choices=[ + ("one_app_diff_cluster", "业务内"), + ("diff_app_diff_cluster", "跨业务"), + ("copy_to_other_system", "业务内至第三方"), + ("user_built_to_dbm", "自建集群至业务内"), + ("copy_from_rollback_instance", "构造实例至业务内"), + ], + default="", + max_length=64, + verbose_name="DTS数据复制类型", + ), + ), + ] diff --git a/dbm-ui/backend/db_services/redis/redis_dts/migrations/0013_merge_0012_auto_20230831_0936_0012_auto_20230921_0952.py b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0013_merge_0012_auto_20230831_0936_0012_auto_20230921_0952.py new file mode 100644 index 0000000000..e2006ea8c5 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/redis_dts/migrations/0013_merge_0012_auto_20230831_0936_0012_auto_20230921_0952.py @@ -0,0 +1,13 @@ +# Generated by Django 3.2.19 on 2023-09-21 03:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("redis_dts", "0012_auto_20230831_0936"), + ("redis_dts", "0012_auto_20230921_0952"), + ] + + operations = [] diff --git a/dbm-ui/backend/db_services/redis/redis_dts/util.py b/dbm-ui/backend/db_services/redis/redis_dts/util.py index 267c500b64..84294f06e5 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/util.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/util.py @@ -17,6 +17,7 @@ from typing import Dict, List, Tuple from django.db.models import Q +from django.utils.translation import ugettext as _ from backend.components import DBConfigApi, DRSApi from backend.components.dbconfig.constants import FormatType, LevelName @@ -177,8 +178,67 @@ def get_cluster_info_by_id( } except Exception as e: traceback.print_exc() - logger.error(f"get cluster info by domain failed {e}, cluster_id: {cluster_id}") - raise Exception(f"get cluster info by domain failed {e}, cluster_id: {cluster_id}") + logger.error(f"get cluster info by id failed {e}, cluster_id: {cluster_id}") + raise Exception(f"get cluster info by id failed {e}, cluster_id: {cluster_id}") + + +def common_cluster_precheck(bk_biz_id: int, cluster_id: int): + try: + cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=cluster_id) + except Cluster.DoesNotExist: + raise Exception(_("redis集群 {} 不存在").format(cluster_id)) + + not_running_proxy = cluster.proxyinstance_set.exclude(status=InstanceStatus.RUNNING) + if not_running_proxy.exists(): + raise Exception( + _("redis集群 {} 存在 {} 个状态非 running 的 proxy").format(cluster.immute_domain, len(not_running_proxy)) + ) + + not_running_redis = cluster.storageinstance_set.exclude(status=InstanceStatus.RUNNING) + if not_running_redis.exists(): + raise Exception( + _("redis集群 {} 存在 {} 个状态非 running 的 redis").format(cluster.immute_domain, len(not_running_redis)) + ) + + cluster_info = get_cluster_info_by_id(bk_biz_id=bk_biz_id, cluster_id=cluster_id) + proxy_addrs = [r.ip_port for r in cluster.proxyinstance_set.all()] + try: + DRSApi.redis_rpc( + { + "addresses": proxy_addrs, + "db_num": 0, + "password": cluster_info["cluster_password"], + "command": "ping", + "bk_cloud_id": cluster_info["bk_cloud_id"], + } + ) + except Exception: + raise Exception(_("redis集群:{} proxy:{} ping失败").format(cluster.immute_domain, proxy_addrs)) + + redis_addrs = [r.ip_port for r in cluster.storageinstance_set.all()] + try: + DRSApi.redis_rpc( + { + "addresses": redis_addrs, + "db_num": 0, + "password": cluster_info["redis_password"], + "command": "ping", + "bk_cloud_id": cluster_info["bk_cloud_id"], + } + ) + except Exception: + raise Exception(_("redis集群:{} redis:{} ping失败").format(cluster.immute_domain, redis_addrs)) + master_insts = cluster.storageinstance_set.filter(instance_role=InstanceRole.REDIS_MASTER.value) + if not master_insts: + raise Exception(_("redis集群 {} 没有master??").format(cluster.immute_domain)) + for master_obj in master_insts: + if not master_obj.as_ejector or not master_obj.as_ejector.first(): + raise Exception( + _("redis集群{} master {} 没有 slave").format( + cluster.immute_domain, + master_obj.ip_port, + ) + ) def get_cluster_one_running_master(bk_biz_id: int, cluster_id: int) -> dict: @@ -236,6 +296,11 @@ def get_dbm_cluster_slaves_data(bk_biz_id: int, cluster_id: int) -> Tuple[list, else: kvstore = 1 slave_inst = "{}:{}".format(slave.machine.ip, slave.port) + seg_start = -1 + seg_end = -1 + if slave_inst in slave_segment_info: + seg_start = slave_segment_info[slave_inst]["segment_start"] + seg_end = slave_segment_info[slave_inst]["segment_end"] slave_instances.append( { "ip": slave.machine.ip, @@ -244,8 +309,8 @@ def get_dbm_cluster_slaves_data(bk_biz_id: int, cluster_id: int) -> Tuple[list, "status": slave.status, "data_size": 0, "kvstorecount": kvstore, - "segment_start": slave_segment_info[slave_inst]["segment_start"], - "segment_end": slave_segment_info[slave_inst]["segment_end"], + "segment_start": seg_start, + "segment_end": seg_end, } ) if slave.machine.ip in uniq_hosts: diff --git a/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py b/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py index 6e9db7a541..a395990336 100644 --- a/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py +++ b/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py @@ -174,8 +174,9 @@ def retrieve_cluster(cls, bk_biz_id: int, cluster_id: int) -> dict: cluster.storages = cluster.storageinstance_set.filter(cluster_type=cluster.cluster_type, bk_biz_id=bk_biz_id) cluster.proxies = cluster.proxyinstance_set.filter(cluster_type=cluster.cluster_type, bk_biz_id=bk_biz_id) cluster_entry_map = ClusterEntry.get_cluster_entry_map_by_cluster_ids([cluster.id]) + cluster_stats_map = Cluster.get_cluster_stats() - return cls._to_cluster_detail(cluster, cluster_entry_map) + return cls._to_cluster_list(cluster, cluster_entry_map, cluster_stats_map) @classmethod def get_topo_graph(cls, bk_biz_id: int, cluster_id: int) -> dict: @@ -223,12 +224,15 @@ def _list( list(clusters.values_list("id", flat=True)) ) + cluster_stats_map = Cluster.get_cluster_stats() + return query.ResourceList( - count=count, data=[cls._to_cluster_list(cluster, cluster_entry_map) for cluster in clusters] + count=count, + data=[cls._to_cluster_list(cluster, cluster_entry_map, cluster_stats_map) for cluster in clusters], ) @staticmethod - def _to_cluster_list(cluster, cluster_entry_map: Dict[int, Dict[str, str]]) -> Dict[str, Any]: + def _to_cluster_list(cluster, cluster_entry_map: Dict[int, Dict[str, str]], cluster_stats_map) -> Dict[str, Any]: """ 集群序列化 :param cluster: model Cluster 对象, 增加了 storages 和 proxies 属性 @@ -259,7 +263,7 @@ def _to_cluster_list(cluster, cluster_entry_map: Dict[int, Dict[str, str]]) -> D "cluster_name": cluster.name, "cluster_alias": cluster.alias, "cluster_spec": cluster_spec, - # TODO: 待补充当前集群使用容量,需要监控采集的支持 + "cluster_stats": cluster_stats_map.get(cluster.immute_domain, {}), "cluster_capacity": cluster_capacity, "bk_biz_id": cluster.bk_biz_id, "bk_biz_name": AppCache.objects.get(bk_biz_id=cluster.bk_biz_id).bk_biz_name, @@ -283,20 +287,6 @@ def _to_cluster_list(cluster, cluster_entry_map: Dict[int, Dict[str, str]]) -> D "update_at": datetime2str(cluster.update_at), } - @classmethod - def _to_cluster_detail(cls, cluster, cluster_entry_map: Dict[int, Dict[str, str]]) -> Dict[str, Any]: - """ - 集群序列化 - :param cluster: model Cluster 对象, 增加了 storages 和 proxies 属性 - :param cluster_entry_map: key 是 cluster.id, value 是当前集群对应的 entry 映射 - """ - detail = cls._to_cluster_list(cluster, cluster_entry_map) - - # TODO-monitor: 假数据,待监控完善后补齐 - detail["cap_usage"] = 93 - - return detail - @classmethod def _to_instance_list(cls, instance: dict) -> Dict[str, Any]: """实例序列化""" diff --git a/dbm-ui/backend/db_services/redis/rollback/constants.py b/dbm-ui/backend/db_services/redis/rollback/constants.py index 6abb2136eb..353cb5e706 100644 --- a/dbm-ui/backend/db_services/redis/rollback/constants.py +++ b/dbm-ui/backend/db_services/redis/rollback/constants.py @@ -9,3 +9,6 @@ specific language governing permissions and limitations under the License. """ RESOURCE_TAG = "db_services/redis/rollback" + +# 查询某个特定时间点附近的日志时,默认在3天内 +BACKUP_LOG_ROLLBACK_TIME_RANGE_DAYS = 3 diff --git a/dbm-ui/backend/db_services/redis/rollback/handlers.py b/dbm-ui/backend/db_services/redis/rollback/handlers.py new file mode 100644 index 0000000000..31d47bde70 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/rollback/handlers.py @@ -0,0 +1,340 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import base64 +import copy +import json +import logging.config +import re +from collections import defaultdict +from concurrent.futures import ThreadPoolExecutor, as_completed +from datetime import datetime, timedelta +from typing import Any, Callable, Dict, List, Union + +from django.conf import settings +from django.db.models import Q +from django.utils.translation import ugettext as _ +from jinja2 import Environment + +from backend import env +from backend.components import JobApi +from backend.components.bklog.client import BKLogApi +from backend.constants import DATETIME_PATTERN +from backend.db_meta.enums import ClusterType, InstanceInnerRole +from backend.db_meta.models import StorageInstance +from backend.db_meta.models.cluster import Cluster +from backend.db_services.redis.rollback.constants import BACKUP_LOG_ROLLBACK_TIME_RANGE_DAYS +from backend.exceptions import AppBaseException +from backend.utils.string import pascal_to_snake +from backend.utils.time import datetime2str, find_nearby_time, str2datetime + +logger = logging.getLogger("flow") + + +class DataStructureHandler: + """ + 封装数据构造相关接口 + """ + + def __init__(self, cluster_id: int): + self.cluster = Cluster.objects.get(id=cluster_id) + + def query_latest_backup_log( + self, rollback_time: datetime, host_ip: str, port: int, job_instance_id: int = None + ) -> Dict[str, Any]: + if job_instance_id: + # 本地查询,这里暂时没测试 + backup_logs = self.query_backup_log_from_job(job_instance_id)["backup_logs"] + else: + # 日志平台查询 + end_time = rollback_time + start_time = end_time - timedelta(days=BACKUP_LOG_ROLLBACK_TIME_RANGE_DAYS) + backup_logs = self.redis_query_backup_log_from_bklog( + start_time=datetime2str(start_time), end_time=datetime2str(end_time), host_ip=host_ip, port=port + ) + + if not backup_logs: + raise AppBaseException(_("无法查找到在时间范围内{}-{},主机{}的全备份日志").format(start_time, end_time, host_ip)) + + backup_logs.sort(key=lambda x: x["start_time"]) + time_keys = [log["start_time"] for log in backup_logs] + try: + latest_log = backup_logs[find_nearby_time(time_keys, rollback_time.strftime(DATETIME_PATTERN), 1)] + except IndexError: + raise AppBaseException(_("无法找到小于时间点{}附近的日志记录,请检查时间点的合法性或稍后重试").format(rollback_time)) + # 转化为直接查询备份系统返回的格式 + return self.convert_to_backup_system_format(latest_log) + + def redis_query_backup_log_from_bklog(self, start_time: str, end_time: str, host_ip: str, port: int) -> List[Dict]: + """ + 通过日志平台查询集群的时间范围内的备份记录 + :param start_time: 开始时间 + :param end_time: 结束时间 + :param host_ip: 源机器 + :param port: 实例端口 + """ + + cluster_domain = self.cluster.immute_domain + status = "to_backup_system_success" + backup_logs = self._get_log_from_bklog( + collector="redis_fullbackup_result", + start_time1=start_time, + end_time1=end_time, + # 得到的是上传成功的: to_backup_system_success + query_string=f"domain: {cluster_domain} AND status: {status} server_ip: {host_ip} AND server_port: {port}", + # 得到的是上传系统中的:to_backup_system_start ,这种状态有必要存在吗? + # query_string=f'log: "domain: \\"{cluster_domain}\\""', + ) + return backup_logs + + def _get_log_from_bklog(self, collector, start_time1, end_time1, query_string="*") -> List[Dict]: + """ + 从日志平台获取对应采集项的日志 + @param collector: 采集项名称 + @param start_time: 开始时间 + @param end_time: 结束时间 + @param query_string: 过滤条件 + """ + resp = BKLogApi.esquery_search( + { + "indices": f"{env.DBA_APP_BK_BIZ_ID}_bklog.{collector}", + "start_time": start_time1, + "end_time": end_time1, + # 这里需要精确查询集群域名,所以可以通过log: "key: \"value\""的格式查询 + "query_string": query_string, + "start": 0, + "size": 1000, + "sort_list": [["dtEventTimeStamp", "asc"], ["gseIndex", "asc"], ["iterationIndex", "asc"]], + }, + use_admin=True, + ) + backup_logs = [] + for hit in resp["hits"]["hits"]: + raw_log = json.loads(hit["_source"]["log"]) + backup_logs.append({pascal_to_snake(key): value for key, value in raw_log.items()}) + + return backup_logs + + def query_binlog_from_bklog( + self, + start_time: Union[datetime, str], + end_time: Union[datetime, str], + host_ip: str = None, + port: int = None, + kvstorecount: str = None, + tendis_type: str = None, + minute_range: int = 120, + ) -> Dict: + """ + 通过日志平台查询集群的时间范围内的binlog记录 + :param start_time: 开始时间 + :param end_time: 结束时间 + :param host_ip: 过滤的主机IP + :param port: 端口 + :param kvstorecount: tendisplus kvstore 的值 + :param tendis_type: tendis 类型 + :param minute_range: 放大的前后时间范围 + """ + + start_time, end_time = str2datetime(start_time).replace(tzinfo=None), str2datetime(end_time).replace( + tzinfo=None + ) + if not host_ip: + master = self.cluster.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER) + host_ip, port = master.machine.ip, master.port + status = "to_backup_system_success" + binlogs = self._get_log_from_bklog( + collector="redis_binlog_backup_result", + # 时间范围前后放大避免日志平台上传延迟 + # binlog每隔20分钟做备份上传,上传可能超时,上传超时时间 2小时; 这里的时间是大范围内的 + start_time1=datetime2str(start_time - timedelta(minutes=minute_range)), + end_time1=datetime2str(end_time + timedelta(minutes=minute_range)), + query_string=f"server_ip: {host_ip} AND server_port: {port} AND status:{status}", + ) + + if not binlogs: + raise AppBaseException(_("无法查找到在时间范围内{}-{},主机{}的binlog日志").format(start_time, end_time, host_ip)) + # 指定时间内单个节点的binlog备份文件 + binlog_file_list = [] + for log in binlogs: + # 获取end_time到start_time时间范围内的binlog文件 + if ( + str2datetime(log["start_time"]).replace(tzinfo=None) > end_time + or str2datetime(log["start_time"]).replace(tzinfo=None) < start_time + ): + continue + # 转化为直接查询备份系统返回的格式 + backup_binlog = self.convert_to_backup_system_format(log) + binlog_file_list.append(backup_binlog) + + # tendisplus才有 kvstorecount 的区别 + if kvstorecount is not None: + # 每个节点又分不同kvstore + for i in range(0, int(kvstorecount)): + # 过滤不同kvstore + kvstore_filter = "-".join([str(host_ip), str(port), str(i)]) + + # 过滤后的包含指定kvstore的binlog列表 + kvstore_binlogs = [ + binlog for binlog in binlogs if kvstore_filter in binlog["backup_file"].split("/")[-1] + ] + kvstore_binlogs.sort(key=lambda x: x["start_time"]) + # 时间键的列表,应按升序排序 + time_keys = [log["start_time"] for log in kvstore_binlogs] + try: + # 获取小于且最接近start_time 的一个binlog文件 ;flag为1,则搜索小于或等于start_time的最近时间点 + latest_start_time_binlog = kvstore_binlogs[ + find_nearby_time(time_keys, start_time.strftime(DATETIME_PATTERN), 1) + ] + except IndexError: + raise AppBaseException(_("无法找到小于时间点{}附近的日志记录,请检查时间点的合法性或稍后重试").format(start_time)) + # 转化为直接查询备份系统返回的格式 + backup_binlog = self.convert_to_backup_system_format(latest_start_time_binlog) + binlog_file_list.append(backup_binlog) + + try: + # 获取大于且最接近end_time 的一个binlog文件 ;flag为0,则搜索大于或等于end_time的最近时间点 + latest_end_time_binlog = kvstore_binlogs[ + find_nearby_time(time_keys, end_time.strftime(DATETIME_PATTERN), 0) + ] + except IndexError: + raise AppBaseException(_("无法找到大于时间点{}附近的日志记录,请检查时间点的合法性或稍后重试").format(end_time)) + + # 转化为直接查询备份系统返回的格式 + backup_binlog = self.convert_to_backup_system_format(latest_end_time_binlog) + binlog_file_list.append(backup_binlog) + + # 每个节点又分不同kvstore,校验binlog完整性 + for i in range(0, int(kvstorecount)): + # 过滤不同kvstore + kvstore_filter = "-".join([str(host_ip), str(port), str(i)]) + # 过滤后的包含指定kvstore的binlog列表 + kvstore_binlogs_list = [binlog for binlog in binlog_file_list if kvstore_filter in binlog["file_name"]] + # 至少会包含两个binlog文件,第一个BackupStart小于 start_time, 第二个BackupStart 大于 end_time + if len(kvstore_binlogs_list) < 2: + logger.error(_("binlog全部文件信息:{}".format(binlog_file_list))) + raise AppBaseException( + _("节点{}:{}的kvstore:{}的binlog 数少于2,不符合预期,请检查error日志").format(host_ip, port, i) + ) + + # 检查是否获取到所有binlog + bin_index_list = self.__is_get_all_binlog(kvstore_binlogs_list, tendis_type) + if len(bin_index_list) != 0: + raise AppBaseException( + _("重复/缺失的binlog共{}个,重复/缺失的binlog index是:{},详细信息请查看error日志").format( + len(bin_index_list), bin_index_list + ) + ) + + elif kvstorecount is None: + # 过滤不同kvstore + instance_filter = "-".join([str(host_ip), str(port)]) + # 过滤后的包含指定kvstore的binlog列表 + kvstore_binlogs = [binlog for binlog in binlogs if instance_filter in binlog["backup_file"].split("/")[-1]] + kvstore_binlogs.sort(key=lambda x: x["start_time"]) + # 时间键的列表,应按升序排序 + time_keys = [log["start_time"] for log in kvstore_binlogs] + try: + # 获取小于且最接近start_time 的一个binlog文件 ;flag为1,则搜索小于或等于start_time的最近时间点 + latest_start_time_binlog = kvstore_binlogs[ + find_nearby_time(time_keys, start_time.strftime(DATETIME_PATTERN), 1) + ] + except IndexError: + raise AppBaseException(_("无法找到小于时间点{}附近的日志记录,请检查时间点的合法性或稍后重试").format(start_time)) + # 转化为直接查询备份系统返回的格式 + backup_binlog = self.convert_to_backup_system_format(latest_start_time_binlog) + binlog_file_list.append(backup_binlog) + try: + # 获取大于且最接近end_time 的一个binlog文件 ;flag为0,则搜索大于或等于end_time的最近时间点 + latest_end_time_binlog = kvstore_binlogs[ + find_nearby_time(time_keys, end_time.strftime(DATETIME_PATTERN), 0) + ] + except IndexError: + raise AppBaseException(_("无法找到大于时间点{}附近的日志记录,请检查时间点的合法性或稍后重试").format(end_time)) + + # 转化为直接查询备份系统返回的格式 + backup_binlog = self.convert_to_backup_system_format(latest_end_time_binlog) + binlog_file_list.append(backup_binlog) + + # 校验binlog完整性 + instance_filter = "-".join([str(host_ip), str(port)]) + # 过滤后的包含指定kvstore的binlog列表 + binlogs_list = [binlog for binlog in binlog_file_list if instance_filter in binlog["file_name"]] + # 至少会包含两个binlog文件,第一个BackupStart小于 start_time, 第二个BackupStart 大于 end_time + if len(binlogs_list) < 2: + logger.error(_("binlog全部文件信息:{}".format(binlog_file_list))) + raise AppBaseException(_("节点{}:{}的kvstore:{}的binlog 数少于2,不符合预期,请检查error日志").format(host_ip, port, i)) + + # 检查是否获取到所有binlog + bin_index_list = self.__is_get_all_binlog(binlogs_list, tendis_type) + if len(bin_index_list) != 0: + raise AppBaseException( + _("重复/缺失的binlog共{}个,重复/缺失的binlog index是:{},详细信息请查看error日志").format( + len(bin_index_list), bin_index_list + ) + ) + + return binlog_file_list + + @staticmethod + def __is_get_all_binlog(binlogs_list: List, tendis_type: str): + # 检查是否获取到所有binlog + + # 1. 获取binlog_file_list里每个字典的file_name值组成新的binlog_file_name_list + binlog_file_name_list = [item["file_name"] for item in binlogs_list] + + # 2. 根据binlog_file_name_list如 0002437,0002438来排序 + if tendis_type == ClusterType.TendisplusInstance.value: + # binlog-xxxx-30002-0-0002437-20230911164611.log.zst + sorted_binlog_file_name_list = sorted(binlog_file_name_list, key=lambda x: int(x.split("-")[4])) + elif tendis_type == ClusterType.TendisSSDInstance.value: + # binlog-xxxx-30002-0002500-20230913101206.log.zst + sorted_binlog_file_name_list = sorted(binlog_file_name_list, key=lambda x: int(x.split("-")[3])) + # 3. 判断是否连续重复 + missing_files = [] + duplicate_files = set() + previous_number = None + previous_file_name = None + + for file_name in sorted_binlog_file_name_list: + if tendis_type == ClusterType.TendisplusInstance.value: + current_number = int(file_name.split("-")[4]) + elif tendis_type == ClusterType.TendisSSDInstance.value: + current_number = int(file_name.split("-")[3]) + # 检查是否重复 + if current_number in duplicate_files: + logger.error(_("文件序号重复: {}".format(current_number))) + logger.error(_("文件重复: {}".format(file_name))) + return [current_number] + # 检查是否连续 + if previous_number is not None and current_number - previous_number > 1: + logger.error(_("缺失时打印排序后的当前文件:{}和上一个文件: {}".format(previous_file_name, file_name))) + missing_files.extend(range(previous_number + 1, current_number)) + duplicate_files.add(current_number) + previous_number = current_number + previous_file_name = file_name + # 4. 判断是否连续的结果 + if missing_files: + logger.error(_("缺少的文件序号: {}").format(missing_files)) + return missing_files + + @staticmethod + def convert_to_backup_system_format(bk_binlog): + return { + "file_tag": bk_binlog["backup_tag"], + "status": bk_binlog["status"], + "uptime": bk_binlog["end_time"], + # latest_log["start_time"] 是全备份快照开始的时间-》文件最后写入时间作为binlog查询开始的时间 + "file_last_mtime": bk_binlog["start_time"], + "size": bk_binlog["backup_file_size"], + "source_ip": bk_binlog["server_ip"], + "task_id": bk_binlog["backup_taskid"], + "file_name": bk_binlog["backup_file"].split("/")[-1], + } diff --git a/dbm-ui/backend/db_services/redis/rollback/migrations/0010_alter_tbtendisrollbacktasks_destroyed_status.py b/dbm-ui/backend/db_services/redis/rollback/migrations/0010_alter_tbtendisrollbacktasks_destroyed_status.py new file mode 100644 index 0000000000..0a0c793179 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/rollback/migrations/0010_alter_tbtendisrollbacktasks_destroyed_status.py @@ -0,0 +1,24 @@ +# Generated by Django 3.2.19 on 2023-09-21 01:52 + +from django.db import migrations, models + +import backend.db_meta.enums.destroyed_status + + +class Migration(migrations.Migration): + + dependencies = [ + ("rollback", "0009_rename_temp_password_tbtendisrollbacktasks_temp_proxy_password"), + ] + + operations = [ + migrations.AlterField( + model_name="tbtendisrollbacktasks", + name="destroyed_status", + field=models.IntegerField( + choices=[(0, "Not destroyed"), (1, "Destroying"), (2, "Destroyed")], + default=backend.db_meta.enums.destroyed_status.DestroyedStatus["NOT_DESTROYED"], + verbose_name="销毁状态", + ), + ), + ] diff --git a/dbm-ui/backend/db_services/redis/rollback/migrations/0011_auto_20231008_1938.py b/dbm-ui/backend/db_services/redis/rollback/migrations/0011_auto_20231008_1938.py new file mode 100644 index 0000000000..ad07849b63 --- /dev/null +++ b/dbm-ui/backend/db_services/redis/rollback/migrations/0011_auto_20231008_1938.py @@ -0,0 +1,85 @@ +# Generated by Django 3.2.19 on 2023-10-08 11:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("rollback", "0010_alter_tbtendisrollbacktasks_destroyed_status"), + ] + + operations = [ + migrations.AlterField( + model_name="tbtendisrollbacktasks", + name="prod_cluster_type", + field=models.CharField( + choices=[ + ("tendbsingle", "tendbsingle"), + ("tendbha", "tendbha"), + ("tendbcluster", "tendbcluster"), + ("redis", "Redis集群"), + ("PredixyRedisCluster", "Tendisplus集群"), + ("PredixyTendisplusCluster", "Tendisplus存储版集群"), + ("TwemproxyRedisInstance", "TendisCache集群"), + ("TwemproxyTendisSSDInstance", "TendisSSD集群"), + ("TwemproxyTendisplusInstance", "Tendis存储版集群"), + ("RedisInstance", "RedisCache主从版"), + ("TendisSSDInstance", "TendisSSD主从版"), + ("TendisplusInstance", "Tendisplus主从版"), + ("RedisCluster", "RedisCluster集群"), + ("TendisplusCluster", "TendisplusCluster集群"), + ("TendisplusInstance", "Tendisplus存储版集群 GetTendisType 获取redis类型值"), + ("RedisInstance", "TendisCache集群 GetTendisType 获取redis类型值"), + ("TendisSSDInstance", "TendisSSD集群 GetTendisType 获取redis类型值"), + ("es", "ES集群"), + ("kafka", "Kafka集群"), + ("hdfs", "Hdfs集群"), + ("influxdb", "Influxdb实例"), + ("pulsar", "Pulsar集群"), + ("MongoReplicaSet", "Mongo副本集"), + ("MongoShardedCluster", "Mongo分片集群"), + ("riak", "Riak集群"), + ], + default="", + max_length=64, + verbose_name="构造源集群类型", + ), + ), + migrations.AlterField( + model_name="tbtendisrollbacktasks", + name="temp_cluster_type", + field=models.CharField( + choices=[ + ("tendbsingle", "tendbsingle"), + ("tendbha", "tendbha"), + ("tendbcluster", "tendbcluster"), + ("redis", "Redis集群"), + ("PredixyRedisCluster", "Tendisplus集群"), + ("PredixyTendisplusCluster", "Tendisplus存储版集群"), + ("TwemproxyRedisInstance", "TendisCache集群"), + ("TwemproxyTendisSSDInstance", "TendisSSD集群"), + ("TwemproxyTendisplusInstance", "Tendis存储版集群"), + ("RedisInstance", "RedisCache主从版"), + ("TendisSSDInstance", "TendisSSD主从版"), + ("TendisplusInstance", "Tendisplus主从版"), + ("RedisCluster", "RedisCluster集群"), + ("TendisplusCluster", "TendisplusCluster集群"), + ("TendisplusInstance", "Tendisplus存储版集群 GetTendisType 获取redis类型值"), + ("RedisInstance", "TendisCache集群 GetTendisType 获取redis类型值"), + ("TendisSSDInstance", "TendisSSD集群 GetTendisType 获取redis类型值"), + ("es", "ES集群"), + ("kafka", "Kafka集群"), + ("hdfs", "Hdfs集群"), + ("influxdb", "Influxdb实例"), + ("pulsar", "Pulsar集群"), + ("MongoReplicaSet", "Mongo副本集"), + ("MongoShardedCluster", "Mongo分片集群"), + ("riak", "Riak集群"), + ], + default="", + max_length=64, + verbose_name="临时集群类型", + ), + ), + ] diff --git a/dbm-ui/backend/db_services/taskflow/task.py b/dbm-ui/backend/db_services/taskflow/task.py index 280130942a..adaa758f7c 100644 --- a/dbm-ui/backend/db_services/taskflow/task.py +++ b/dbm-ui/backend/db_services/taskflow/task.py @@ -64,7 +64,7 @@ def send_flow_state(state, _root_id, _node_id, _version_id): try: ticket = Ticket.objects.get(id=flow_node.uid) cluster_ids = get_target_items_from_details(ticket.details, match_keys=["cluster_id", "cluster_ids"]) - Cluster.handle_exclusive_operations(cluster_ids, ticket.ticket_type) + Cluster.handle_exclusive_operations(cluster_ids, ticket.ticket_type, exclude_ticket_ids=[ticket.id]) except ClusterExclusiveOperateException as e: # 互斥下: 手动重试直接报错,自动重试则延迟一定时间后重新执行该任务 flow = Flow.objects.get(flow_obj_id=flow_node.root_id) diff --git a/dbm-ui/backend/db_services/taskflow/views/flow.py b/dbm-ui/backend/db_services/taskflow/views/flow.py index db069ff084..2756e4bb66 100644 --- a/dbm-ui/backend/db_services/taskflow/views/flow.py +++ b/dbm-ui/backend/db_services/taskflow/views/flow.py @@ -79,9 +79,8 @@ def retrieve(self, requests, *args, **kwargs): flow_info = super().retrieve(requests, *args, **kwargs) try: - # 从pipeline的第一个节点获取任务的输入数据 - first_act_node_id = FlowNode.objects.filter(root_id=root_id).first().node_id - details = BambooEngine(root_id=root_id).get_node_input_data(node_id=first_act_node_id).data["global_data"] + # 获取当前flow的参数 + details = Flow.objects.get(flow_obj_id=root_id).details["ticket_data"] # 递归遍历字典,获取主机ID bk_host_ids = get_target_items_from_details( obj=details, match_keys=["host_id", "bk_host_id", "bk_host_ids"] @@ -90,11 +89,12 @@ def retrieve(self, requests, *args, **kwargs): # 如果当前pipeline整在运行中,并且是从资源池拿取的机器,则bk_biz_id设置为DBA_APP_BK_BIZ_ID if flow_info.data["status"] != StateType.FINISHED and details.get("ip_source") == IpSource.RESOURCE_POOL: bk_biz_id = env.DBA_APP_BK_BIZ_ID - except KeyError as e: - # 如果pipeline还未构建,则先忽略 - bk_host_ids, bk_biz_id = [], "" + # 更新flow_info + flow_info.data.update(bk_host_ids=bk_host_ids, bk_biz_id=bk_biz_id) + except Exception as e: + # 如果没找到flow或者相关bk_host_id参数,则忽略 + pass - flow_info.data.update(bk_host_ids=bk_host_ids, bk_biz_id=bk_biz_id) return Response({"flow_info": flow_info.data, **tree_states}) @common_swagger_auto_schema( diff --git a/dbm-ui/backend/dbm_init/apps.py b/dbm-ui/backend/dbm_init/apps.py index 063dd9dc16..433ccb125d 100644 --- a/dbm-ui/backend/dbm_init/apps.py +++ b/dbm-ui/backend/dbm_init/apps.py @@ -8,7 +8,23 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import logging + from django.apps import AppConfig +from django.db.models.signals import post_migrate +from django.utils.translation import ugettext as _ + +logger = logging.getLogger("root") + + +def init_config(sender, **kwargs): + """初始化配置自动执行""" + try: + from backend.dbm_init.services import Services + + Services.init_custom_metric_and_event() + except Exception as e: # pylint: disable=broad-except + logger.error(_("初始化配置异常,错误信息:{}").format(e)) class DbmInitConfig(AppConfig): @@ -17,8 +33,7 @@ class DbmInitConfig(AppConfig): def ready(self): """ - 项目初始化 - 自动生成配置文件和运行相关服务 + 项目初始化,自动生成配置文件和运行相关服务 + 注:这部分目前统一挪到k8s的job进行初始化 """ - pass diff --git a/dbm-ui/backend/dbm_init/json_files/bklog/backup_stm_log.json b/dbm-ui/backend/dbm_init/json_files/bklog/backup_stm_log.json new file mode 100644 index 0000000000..0df9ab3324 --- /dev/null +++ b/dbm-ui/backend/dbm_init/json_files/bklog/backup_stm_log.json @@ -0,0 +1,762 @@ +{ + "bk_biz_id": {{bk_biz_id}}, + "collector_config_name": "backup_stm_log", + "collector_config_name_en": "backup_stm_log", + "collector_scenario_id": "row", + "category_id": "os", + "etl_config": "bk_log_json", + "description": "backup_stm_log", + "environment": "linux", + "params": { + "paths": [ + "/data/backup_stm/register/*.log" + ], + "conditions": { + "type": "match", + "match_type": "include", + "match_content": "" + }, + "encoding": "UTF-8" + }, + "etl_params": { + "es_unique_field_list": [ + "cloudId", + "serverIp", + "path", + "gseIndex", + "iterationIndex", + "bk_host_id" + ], + "separator_node_source": "data", + "separator_node_action": "json", + "separator_node_name": "bk_separator_object", + "retain_original_text": true, + "separator_fields_remove": "", + "etl_flat": false + }, + "fields": [ + { + "field_name": "bk_host_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "主机ID", + "unit": "", + "alias_name": "", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "cloudid", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "云区域ID", + "unit": "", + "alias_name": "cloudId", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "utctime", + "type": "timestamp", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "数据时间", + "unit": "", + "alias_name": "dtEventTimeStamp", + "option": { + "es_type": "date", + "es_format": "epoch_millis", + "time_format": "yyyy-MM-dd HH:mm:ss", + "time_zone": 0 + }, + "is_disabled": false, + "is_built_in": true, + "is_time": true, + "is_dimension": true, + "field_type": "string", + "is_analyzed": false, + "is_delete": false + }, + { + "field_name": "gseindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "gse索引", + "unit": "", + "alias_name": "gseIndex", + "option": { + "es_type": "long" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "iterationindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "迭代ID", + "unit": "", + "alias_name": "iterationIndex", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "data", + "type": "string", + "tag": "metric", + "default_value": null, + "is_config_by_user": true, + "description": "original_text", + "unit": "", + "alias_name": "log", + "option": { + "es_type": "text", + "es_norms": false + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": true, + "is_dimension": false, + "is_delete": false + }, + { + "field_name": "filename", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "日志路径", + "unit": "", + "alias_name": "path", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "ip", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "ip", + "unit": "", + "alias_name": "serverIp", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "time", + "type": "timestamp", + "tag": "timestamp", + "default_value": "", + "is_config_by_user": true, + "description": "数据上报时间", + "unit": "", + "alias_name": "", + "option": { + "es_type": "date", + "es_format": "epoch_millis", + "time_format": "yyyy-MM-dd HH:mm:ss", + "time_zone": 0 + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "ext", + "type": "object", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "额外信息字段", + "unit": "", + "alias_name": "__ext", + "option": { + "es_type": "object" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "object", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "bk_app_id", + "field_name": "bk_biz_id", + "value": {{bk_biz_id}}, + "option": { + "field_index": 1, + "es_type": "integer", + "real_path": "bk_separator_object.bk_biz_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "bk_cloud_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "bkcloud_id", + "option": { + "field_index": 2, + "es_type": "integer", + "real_path": "bk_separator_object.bk_cloud_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "bucket_name", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 3, + "es_type": "keyword", + "real_path": "bk_separator_object.bucket_name" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "chunk_size", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 4, + "es_type": "keyword", + "real_path": "bk_separator_object.chunk_size" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "complete_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 5, + "es_type": "keyword", + "real_path": "bk_separator_object.complete_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "cos_tag", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 6, + "es_type": "keyword", + "real_path": "bk_separator_object.cos_tag" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_last_mtime", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 7, + "es_type": "keyword", + "real_path": "bk_separator_object.file_last_mtime" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_name", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 8, + "es_type": "keyword", + "real_path": "bk_separator_object.file_name" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_path", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 9, + "es_type": "keyword", + "real_path": "bk_separator_object.file_path" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_tag", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 10, + "es_type": "keyword", + "real_path": "bk_separator_object.file_tag" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "md5", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 11, + "es_type": "keyword", + "real_path": "bk_separator_object.md5" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "object_name", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 12, + "es_type": "keyword", + "real_path": "bk_separator_object.object_name" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "object_path", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 13, + "es_type": "keyword", + "real_path": "bk_separator_object.object_path" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "object_type", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 14, + "es_type": "keyword", + "real_path": "bk_separator_object.object_type" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "retry_times", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 15, + "es_type": "integer", + "real_path": "bk_separator_object.retry_times" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "size", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 16, + "es_type": "long", + "real_path": "bk_separator_object.size" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "source_ip", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 17, + "es_type": "keyword", + "real_path": "bk_separator_object.source_ip" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "source_os_type", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 18, + "es_type": "keyword", + "real_path": "bk_separator_object.source_os_type" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "speed", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 19, + "es_type": "keyword", + "real_path": "bk_separator_object.speed" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "start_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 20, + "es_type": "keyword", + "real_path": "bk_separator_object.start_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "status", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 21, + "es_type": "integer", + "real_path": "bk_separator_object.status" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "task_id", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 22, + "es_type": "keyword", + "real_path": "bk_separator_object.task_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "uptime", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 23, + "es_type": "keyword", + "real_path": "bk_separator_object.uptime" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + } + ], + "data_encoding": "UTF-8", + "retention": 7, + "es_shards": 1, + "target_object_type": "HOST", + "target_node_type": "TOPO", + "target_nodes": [ + {% for node in target_nodes %}{{ node }}{% if not loop.last %}, {% endif %} + {% endfor %} + ] +} \ No newline at end of file diff --git a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_backup_result.json b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_backup_result.json index 9e980c46f6..5c927ec55e 100644 --- a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_backup_result.json +++ b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_backup_result.json @@ -4,7 +4,7 @@ "collector_config_name_en": "mysql_backup_result", "collector_scenario_id": "row", "category_id": "host_process", - "etl_config": "bk_log_text", + "etl_config": "bk_log_json", "params": { "paths": ["/home/mysql/dbareport/mysql/dbbackup/result/*.log"], "conditions": { @@ -18,6 +18,738 @@ "ignore_older": 2678400, "max_bytes": 204800 }, + "etl_params": { + "es_unique_field_list": [ + "cloudId", + "serverIp", + "path", + "gseIndex", + "iterationIndex", + "bk_host_id" + ], + "separator_node_source": "data", + "separator_node_action": "json", + "separator_node_name": "bk_separator_object", + "retain_original_text": true, + "separator_fields_remove": "", + "etl_flat": false + }, + "fields": [ + { + "field_name": "bk_host_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "主机ID", + "unit": "", + "alias_name": "", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "cloudid", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "云区域ID", + "unit": "", + "alias_name": "cloudId", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "utctime", + "type": "timestamp", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "数据时间", + "unit": "", + "alias_name": "dtEventTimeStamp", + "option": { + "es_type": "date", + "es_format": "epoch_millis", + "time_format": "yyyy-MM-dd HH:mm:ss", + "time_zone": 0 + }, + "is_disabled": false, + "is_built_in": true, + "is_time": true, + "is_dimension": true, + "field_type": "string", + "is_analyzed": false, + "is_delete": false + }, + { + "field_name": "gseindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "gse索引", + "unit": "", + "alias_name": "gseIndex", + "option": { + "es_type": "long" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "iterationindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "迭代ID", + "unit": "", + "alias_name": "iterationIndex", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "data", + "type": "string", + "tag": "metric", + "default_value": null, + "is_config_by_user": true, + "description": "original_text", + "unit": "", + "alias_name": "log", + "option": { + "es_type": "text", + "es_norms": false + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": true, + "is_dimension": false, + "is_delete": false + }, + { + "field_name": "filename", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "日志路径", + "unit": "", + "alias_name": "path", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "ip", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "ip", + "unit": "", + "alias_name": "serverIp", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "time", + "type": "timestamp", + "tag": "timestamp", + "default_value": "", + "is_config_by_user": true, + "description": "数据上报时间", + "unit": "", + "alias_name": "", + "option": { + "es_type": "date", + "es_format": "epoch_millis", + "time_format": "yyyy-MM-dd HH:mm:ss", + "time_zone": 0 + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "ext", + "type": "object", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "额外信息字段", + "unit": "", + "alias_name": "__ext", + "option": { + "es_type": "object" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "object", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "backup_begin_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 1, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_begin_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "backup_end_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 2, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_end_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "backup_id", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 3, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "backup_type", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 4, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_type" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "bill_id", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 5, + "es_type": "keyword", + "real_path": "bk_separator_object.bill_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "binlog_info", + "type": "object", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 6, + "es_type": "object", + "real_path": "bk_separator_object.binlog_info" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "object", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "bk_app_id", + "field_name": "bk_biz_id", + "value": {{bk_biz_id}}, + "option": { + "field_index": 7, + "es_type": "integer", + "real_path": "bk_separator_object.bk_biz_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "bk_cloud_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "bkcloud_id", + "option": { + "field_index": 8, + "es_type": "integer", + "real_path": "bk_separator_object.bk_cloud_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "cluster_address", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 9, + "es_type": "keyword", + "real_path": "bk_separator_object.cluster_address" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "cluster_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 10, + "es_type": "integer", + "real_path": "bk_separator_object.cluster_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "consistent_backup_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 11, + "es_type": "keyword", + "real_path": "bk_separator_object.consistent_backup_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "data_schema_grant", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 12, + "es_type": "keyword", + "real_path": "bk_separator_object.data_schema_grant" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_name", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 13, + "es_type": "keyword", + "real_path": "bk_separator_object.file_name" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_size", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 14, + "es_type": "long", + "real_path": "bk_separator_object.file_size" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_type", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 15, + "es_type": "keyword", + "real_path": "bk_separator_object.file_type" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "master_host", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 16, + "es_type": "keyword", + "real_path": "bk_separator_object.master_host" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "master_port", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 17, + "es_type": "integer", + "real_path": "bk_separator_object.master_port" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "mysql_host", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 18, + "es_type": "keyword", + "real_path": "bk_separator_object.mysql_host" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "mysql_port", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 19, + "es_type": "integer", + "real_path": "bk_separator_object.mysql_port" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "mysql_role", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 20, + "es_type": "keyword", + "real_path": "bk_separator_object.mysql_role" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "shard_value", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 21, + "es_type": "integer", + "real_path": "bk_separator_object.shard_value" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "task_id", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 22, + "es_type": "keyword", + "real_path": "bk_separator_object.task_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "time_zone", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 23, + "es_type": "keyword", + "real_path": "bk_separator_object.time_zone" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + } + ], "data_encoding": "UTF-8", "retention": 7, "es_shards": 1, diff --git a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_binlog_result.json b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_binlog_result.json index e9480b0e5f..fef3eb1f3c 100644 --- a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_binlog_result.json +++ b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_binlog_result.json @@ -9,240 +9,454 @@ "retain_original_text": true }, "fields": [ - { - "value": 4, - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "bk_host_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "主机ID", + "unit": "", + "alias_name": "", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "", - "field_name": "backup_status", - "field_type": "int", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "int" - }, - { - "value": "", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "cloudid", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "云区域ID", + "unit": "", + "alias_name": "cloudId", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "backup_status_info", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": "15658774404", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "gseindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "gse索引", + "unit": "", + "alias_name": "gseIndex", + "option": { + "es_type": "long" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "", - "field_name": "backup_taskid", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": {{bk_biz_id}}, - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "iterationindex", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "迭代ID", + "unit": "", + "alias_name": "iterationIndex", + "option": { + "es_type": "integer" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "bk_app_id", - "field_name": "bk_biz_id", - "field_type": "int", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "int" - }, - { - "value": 211, - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "data", + "type": "string", + "tag": "metric", + "default_value": null, + "is_config_by_user": true, + "description": "original_text", + "unit": "", + "alias_name": "log", + "option": { + "es_type": "text", + "es_norms": false + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": true, + "is_dimension": false, + "is_delete": false }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "", - "field_name": "cluster_id", - "field_type": "int", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "int" - }, - { - "value": "master", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "filename", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "日志路径", + "unit": "", + "alias_name": "path", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "db_role", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": "2023-04-14 10:50:00", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "ip", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "ip", + "unit": "", + "alias_name": "serverIp", + "option": { + "es_type": "keyword" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "file_mtime", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": "binlog20000.000105", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "ext", + "type": "object", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "额外信息字段", + "unit": "", + "alias_name": "__ext", + "option": { + "es_type": "object" + }, + "is_disabled": false, + "is_built_in": true, + "is_time": false, + "field_type": "object", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "file_name", - "field_name": "filename", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": "127.0.0.1", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "backup_status", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 1, + "es_type": "integer", + "real_path": "bk_separator_object.backup_status" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "host", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": 20000, - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "backup_status_info", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 2, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_status_info" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "", - "field_name": "port", - "field_type": "int", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "int" - }, - { - "value": 199545, - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "backup_taskid", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 3, + "es_type": "keyword", + "real_path": "bk_separator_object.backup_taskid" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": false, - "is_delete": false, - "alias_name": "", - "field_name": "size", - "field_type": "long", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "long" - }, - { - "value": "2023-04-14 10:40:00", - "option": { - "time_zone": 8, - "time_format": "yyyy-MM-dd HH:mm:ss" + { + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "bk_app_id", + "field_name": "bk_biz_id", + "value": {{bk_biz_id}}, + "option": { + "field_index": 4, + "es_type": "integer", + "real_path": "bk_separator_object.bk_biz_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": true, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "start_time", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - }, - { - "value": "2023-04-14 10:50:00", - "option": { - "time_zone": "", - "time_format": "" + { + "field_name": "cluster_id", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 5, + "es_type": "integer", + "real_path": "bk_separator_object.cluster_id" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true }, - "is_time": false, - "verdict": true, - "is_delete": false, - "alias_name": "", - "field_name": "stop_time", - "field_type": "string", - "description": "", - "is_analyzed": false, - "is_built_in": false, - "is_dimension": false, - "previous_type": "string" - } + { + "field_name": "db_role", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 6, + "es_type": "keyword", + "real_path": "bk_separator_object.db_role" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "file_mtime", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 7, + "es_type": "keyword", + "real_path": "bk_separator_object.file_mtime" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "filename", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "file_name", + "option": { + "field_index": 8, + "es_type": "keyword", + "real_path": "bk_separator_object.filename" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "host", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 9, + "es_type": "keyword", + "real_path": "bk_separator_object.host" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "port", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 10, + "es_type": "integer", + "real_path": "bk_separator_object.port" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "int", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "size", + "type": "float", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 11, + "es_type": "long", + "real_path": "bk_separator_object.size" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "long", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + }, + { + "field_name": "start_time", + "type": "string", + "tag": "metric", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "es_type": "keyword", + "real_path": "bk_separator_object.start_time", + "field_index": 12 + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "is_dimension": true, + "field_type": "string", + "is_analyzed": false, + "is_delete": false + }, + { + "field_name": "stop_time", + "type": "string", + "tag": "dimension", + "default_value": null, + "is_config_by_user": true, + "description": "", + "unit": "", + "alias_name": "", + "option": { + "field_index": 13, + "es_type": "keyword", + "real_path": "bk_separator_object.stop_time" + }, + "is_disabled": false, + "is_built_in": false, + "is_time": false, + "field_type": "string", + "is_analyzed": false, + "is_delete": false, + "is_dimension": true + } ], "params": { "paths": ["/home/mysql/dbareport/mysql/binlog/binlog_result.log"], diff --git a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_slowlog.json b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_slowlog.json index 288082a7b9..10540eb70e 100644 --- a/dbm-ui/backend/dbm_init/json_files/bklog/mysql_slowlog.json +++ b/dbm-ui/backend/dbm_init/json_files/bklog/mysql_slowlog.json @@ -185,7 +185,7 @@ } ], "params": { - "paths": ["/data/mysqllog/*/slow-query.log"], + "paths": ["/data/mysqllog/{{ '{{' }} cmdb_instance.service.labels[\"instance_port\"] {{ '}}' }}/slow-query.log"], "conditions": { "separator": "", "separator_filters": [], @@ -196,12 +196,28 @@ "multiline_pattern":"^# User@Host", "multiline_max_lines":50, "multiline_timeout":2, - "encoding":"UTF-8" + "encoding":"UTF-8", + "extra_template_labels": [ + {"key": "$for", "value": "cmdb_instance.scope"}, + {"key": "$body", "value": { + "app": "{{ '{{' }} cmdb_instance.service.labels[\"app\"] {{ '}}' }}", + "app_id": "{{ '{{' }} cmdb_instance.service.labels[\"app_id\"] {{ '}}' }}", + "bk_cloud_id": "{{ '{{' }} cmdb_instance.service.labels[\"bk_cloud_id\"] {{ '}}' }}", + "cluster_name": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_name\"] {{ '}}' }}", + "cluster_type": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_type\"] {{ '}}' }}", + "instance_host": "{{ '{{' }} cmdb_instance.service.labels[\"instance_host\"] {{ '}}' }}", + "instance_port": "{{ '{{' }} cmdb_instance.service.labels[\"instance_port\"] {{ '}}' }}", + "instance_role": "{{ '{{' }} cmdb_instance.service.labels[\"instance_role\"] {{ '}}' }}", + "cluster_domain": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_domain\"] {{ '}}' }}" + } + }, + {"key": "$item", "value": "scope"} + ] }, "data_encoding": "UTF-8", "retention": 7, "es_shards": 1, - "target_object_type": "HOST", + "target_object_type": "SERVICE", "target_node_type": "TOPO", "target_nodes": [ {% for node in target_nodes %}{{ node }}{% if not loop.last %}, {% endif %} diff --git a/dbm-ui/backend/dbm_init/json_files/bklog/redis_slowlog.json b/dbm-ui/backend/dbm_init/json_files/bklog/redis_slowlog.json index 05e5c237b3..f385e87059 100644 --- a/dbm-ui/backend/dbm_init/json_files/bklog/redis_slowlog.json +++ b/dbm-ui/backend/dbm_init/json_files/bklog/redis_slowlog.json @@ -5,15 +5,31 @@ "collector_scenario_id": "redis_slowlog", "category_id": "applications", "params": { - "redis_hosts": ["{{ '{{' }} target.process[\"redis\"].bind_info[0].ip {{ '}}' }}:{{ '{{' }} target.process[\"redis\"].bind_info[0].port {{ '}}' }}"], - "redis_password_file": "/home/mysql/.exporter/{{ '{{' }} target.process[\"redis\"].bind_info[0].port {{ '}}' }}.conf", + "redis_hosts": ["{{ '{{' }} cmdb_instance.service.labels[\"instance_host\"] {{ '}}' }}:{{ '{{' }} cmdb_instance.service.labels[\"instance_port\"] {{ '}}' }}"], + "redis_password_file": "/home/mysql/.exporter/{{ '{{' }} cmdb_instance.service.labels[\"instance_port\"] {{ '}}' }}.conf", "conditions": { "separator": "", "separator_filters": [], "type": "match", "match_type": "include", "match_content": "" - } + }, + "extra_template_labels": [ + {"key": "$for", "value": "cmdb_instance.scope"}, + {"key": "$body", "value": { + "app": "{{ '{{' }} cmdb_instance.service.labels[\"app\"] {{ '}}' }}", + "app_id": "{{ '{{' }} cmdb_instance.service.labels[\"app_id\"] {{ '}}' }}", + "bk_cloud_id": "{{ '{{' }} cmdb_instance.service.labels[\"bk_cloud_id\"] {{ '}}' }}", + "cluster_name": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_name\"] {{ '}}' }}", + "cluster_type": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_type\"] {{ '}}' }}", + "instance_host": "{{ '{{' }} cmdb_instance.service.labels[\"instance_host\"] {{ '}}' }}", + "instance_port": "{{ '{{' }} cmdb_instance.service.labels[\"instance_port\"] {{ '}}' }}", + "instance_role": "{{ '{{' }} cmdb_instance.service.labels[\"instance_role\"] {{ '}}' }}", + "cluster_domain": "{{ '{{' }} cmdb_instance.service.labels[\"cluster_domain\"] {{ '}}' }}" + } + }, + {"key": "$item", "value": "scope"} + ] }, "data_encoding": "UTF-8", "retention": 7, diff --git a/dbm-ui/backend/dbm_init/json_files/format.py b/dbm-ui/backend/dbm_init/json_files/format.py index 8a6bf73105..18c19c4604 100644 --- a/dbm-ui/backend/dbm_init/json_files/format.py +++ b/dbm-ui/backend/dbm_init/json_files/format.py @@ -52,7 +52,8 @@ def format(cls, content: str, format_func_name: str) -> Union[str, Any]: return template.render(getattr(cls, format_func_name)()) @classmethod - def format_dbm_dbactuator(cls): + def format_for_all(cls): + # 如 dbm_dbactuator、backup_stm_log 这类需要对 DBM 管理的所有机器进行日志采集 target_nodes = [json.dumps({"bk_obj_id": "biz", "bk_inst_id": env.DBA_APP_BK_BIZ_ID})] target_nodes.extend( [ @@ -60,9 +61,16 @@ def format_dbm_dbactuator(cls): for topo in AppMonitorTopo.objects.exclude(bk_biz_id=env.DBA_APP_BK_BIZ_ID) ] ) - return {"bk_biz_id": env.DBA_APP_BK_BIZ_ID, "target_nodes": list(set(target_nodes))} + @classmethod + def format_dbm_dbactuator(cls): + return cls.format_for_all() + + @classmethod + def format_backup_stm_log(cls): + return cls.format_for_all() + @classmethod def format_mysql(cls): return cls.get_db_set_ctx(DBType.MySQL.value) diff --git a/dbm-ui/backend/dbm_init/management/commands/download_bkrepo.py b/dbm-ui/backend/dbm_init/management/commands/download_bkrepo.py index d90944381a..213d0b29ca 100644 --- a/dbm-ui/backend/dbm_init/management/commands/download_bkrepo.py +++ b/dbm-ui/backend/dbm_init/management/commands/download_bkrepo.py @@ -10,13 +10,12 @@ """ import logging import os -import subprocess -import zipfile from django.conf import settings from django.core.management.base import BaseCommand from backend.core.storages.storage import get_storage +from backend.dbm_init.medium.handlers import MediumHandler logger = logging.getLogger("root") @@ -34,31 +33,5 @@ def handle(self, *args, **options): path = options["path"] option = options["option"] storage = get_storage() - # 以dbm_init为根目录进行操作 - if not os.path.exists(BKREPO_TMP_DIR): - os.makedirs(BKREPO_TMP_DIR) - os.chdir(BKREPO_TMP_DIR) - - if option in ["download", "all"]: - if path: - subprocess.call(["wget", storage.url(f"/{path}")]) - else: - with open(os.path.join(BKREPO_TMP_DIR, "wget.txt"), "w") as f: - for d in storage.listdir("/")[0]: - f.write(storage.url(d["fullPath"]) + "\n") - subprocess.call(["wget", "-i", "./wget.txt"]) - - if option in ["unzip", "all"]: - for root, dirs, files in os.walk(BKREPO_TMP_DIR): - for file in files: - if "?" not in file: - continue - - if path and path not in file: - continue - - db_type = file.split("?")[0] - with zipfile.ZipFile(os.path.join(root, file)) as zfile: - logger.info("unzip dir: %s", file) - zfile.extractall(os.path.join(BKREPO_TMP_DIR, db_type)) + MediumHandler(storage).download_medium(option, path, BKREPO_TMP_DIR) diff --git a/dbm-ui/backend/dbm_init/management/commands/upload_bkrepo.py b/dbm-ui/backend/dbm_init/management/commands/upload_bkrepo.py index aaaa6f62ad..51d8ff3e2a 100644 --- a/dbm-ui/backend/dbm_init/management/commands/upload_bkrepo.py +++ b/dbm-ui/backend/dbm_init/management/commands/upload_bkrepo.py @@ -15,6 +15,7 @@ from django.core.management.base import BaseCommand from backend.core.storages.storage import get_storage +from backend.dbm_init.medium.handlers import MediumHandler logger = logging.getLogger("root") @@ -30,40 +31,5 @@ def add_arguments(self, parser): def handle(self, *args, **options): path = options["path"] storage = get_storage() - # 以`dbm_init/tmp`为根目录进行操作 - if not os.path.exists(BKREPO_TMP_DIR): - os.makedirs(BKREPO_TMP_DIR) - os.chdir(BKREPO_TMP_DIR) - - for root, dirs, files in os.walk(BKREPO_TMP_DIR): - for file in files: - if "?" in file: - continue - - for suffix in [ - "txt", - "py", - "sql", - "xlsx", - "secret", - "crt", - "key", - "png", - "ppx", - "doc", - "md", - "DS_Store", - ]: - if f".{suffix}" in file: - break - else: - if path and f"/{path}" not in root: - continue - - file_path = os.path.join(root, file) - file_path_bkrep = file_path.split("/tmp")[1] - - logger.info("upload file: %s -> %s", file_path, file_path_bkrep) - with open(file_path, "rb") as f: - storage.save(file_path_bkrep, f) + MediumHandler(storage).upload_medium(path, BKREPO_TMP_DIR) diff --git a/dbm-ui/backend/dbm_init/medium/.dockerignore b/dbm-ui/backend/dbm_init/medium/.dockerignore new file mode 100644 index 0000000000..e056043fc8 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/.dockerignore @@ -0,0 +1,2 @@ +.venv +tmp* \ No newline at end of file diff --git a/dbm-ui/backend/dbm_init/medium/Dockerfile b/dbm-ui/backend/dbm_init/medium/Dockerfile new file mode 100644 index 0000000000..c65771674b --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/Dockerfile @@ -0,0 +1,144 @@ +FROM golang:1.21 as go-builder + +## 标准化时区 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ + echo "Asia/Shanghai" > /etc/timezone + +## 安装go import工具 +RUN go install golang.org/x/tools/cmd/goimports@latest + +FROM go-builder as go-mod-builder + +WORKDIR /blueking-dbm +ADD ./dbm-services ./dbm-services + +## 初始化go依赖 +RUN set -ex && \ + goimports -w . && find . -name go.mod -execdir go mod tidy \; + +FROM go-mod-builder as mysql-medium-builder + +## 构建mysql介质 +RUN set -ex && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/dbactuator && make -j4 && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/mysql-dbbackup && sh build.sh -t txsql && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/mysql-table-checksum && make release-bin VERSION= -j4 && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/mysql-crond && make release-bin VERSION= -j4 && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/mysql-rotatebinlog && make release VERSION= -j4 && \ + cd /blueking-dbm/dbm-services/mysql/db-tools/mysql-monitor && make release-bin VERSION= -j4 + + +FROM go-mod-builder as redis-medium-builder + +## 构建redis介质 +RUN set -ex && \ + echo TODO.... + + +FROM go-mod-builder as bigdata-medium-builder + +## 构建大数据介质 +RUN set -ex && \ + cd /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator && make -j4 + + +FROM go-builder as medium-builder + +WORKDIR /blueking-dbm +COPY --from=mysql-medium-builder /blueking-dbm/dbm-services/mysql ./dbm-services/mysql +COPY --from=redis-medium-builder /blueking-dbm/dbm-services/redis ./dbm-services/redis +COPY --from=bigdata-medium-builder /blueking-dbm/dbm-services/bigdata ./dbm-services/bigdata + + +FROM python:3.6.12-slim-buster AS base + +ENV LC_ALL=C.UTF-8 \ + LANG=C.UTF-8 + +## PYTHON +# Seems to speed things up +ENV PYTHONUNBUFFERED=1 +# Turns off writing .pyc files. Superfluous on an ephemeral container. +ENV PYTHONDONTWRITEBYTECODE=1 + +# Ensures that the python and pip executables used +# in the image will be those from our virtualenv. +ENV PATH="/venv/bin:$PATH" + +RUN set -ex && \ + chmod 1777 /tmp && \ + rm /etc/apt/sources.list && \ + echo "deb https://mirrors.cloud.tencent.com/debian buster main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.cloud.tencent.com/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src https://mirrors.cloud.tencent.com/debian buster main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src https://mirrors.cloud.tencent.com/debian buster-updates main contrib non-free" >> /etc/apt/sources.list + +RUN set -ex && mkdir ~/.pip && printf '[global]\nindex-url = https://mirrors.tencent.com/pypi/simple/' > ~/.pip/pip.conf + +FROM base AS builder + +WORKDIR / + +# Install OS package dependencies. +# Do all of this in one RUN to limit final image size. +RUN set -ex && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc gettext && \ + rm -rf /var/lib/apt/lists/* + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +COPY ./dbm-ui/backend/dbm_init/medium/requirements.txt / + +## 创建 Python 虚拟环境并安装依赖 +RUN set -ex && python -m venv /venv && . /venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt + +FROM base AS base-app + +## 安装运行时依赖 +RUN set -ex && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + gettext curl vim wget git && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app +USER root + +ADD ./dbm-ui/backend/dbm_init/medium/ ./ + +## 拷贝虚拟环境 +COPY --from=builder /venv /venv + +ENV DJANGO_SETTINGS_MODULE=settings +ENV MEDIUM_PATH=dbm-ui/backend/dbm_init/medium + +ARG MEDIUM_BUILDER_BRANCH=master +ARG GITHUB_TOKEN='' +ARG GITHUB_USERNAME='' +ARG GITHUB_USER_EMAIL='' + +## 拷贝第一阶段的文件,构建制品 +COPY --from=medium-builder /blueking-dbm /blueking-dbm + +## 将相关制品移动到指定目录,提交medicum.lock文件 +RUN set -ex && \ + # 克隆线上的dbm仓库 + git config --global user.email ${GITHUB_USER_EMAIL} && \ + git config --global user.name ${GITHUB_USERNAME} && \ + git clone https://${GITHUB_TOKEN}@github.com/TencentBlueKing/blueking-dbm.git && \ + # 注意:这里需要将.git文件复制给前面构建文件夹,用作判断commit是否需要更新 + cp -r blueking-dbm/.git /blueking-dbm && \ + python main.py --type build && \ + rm -rf /blueking-dbm && \ + # 将更新后的medium.lock文件放到clone的dbm仓库 + cd blueking-dbm/ && \ + git checkout -f ${MEDIUM_BUILDER_BRANCH} && \ + cp ../medium.lock ${MEDIUM_PATH} && \ + # 判断有diff才提pr,否则会非正常结束。注意这里也需要删除.git + git add ${MEDIUM_PATH}/medium.lock && \ + git diff-index --quiet HEAD && rm -rf /app/blueking-dbm || \ + git commit -m "minor: [$(date +"%Y-%m-%d %H:%M:%S")]update medium.lock" && \ + git push --set-upstream --force origin ${MEDIUM_BUILDER_BRANCH}:medicum_lock_${MEDIUM_BUILDER_BRANCH} && \ + rm -rf /app/blueking-dbm diff --git a/dbm-ui/backend/dbm_init/medium/handlers.py b/dbm-ui/backend/dbm_init/medium/handlers.py new file mode 100644 index 0000000000..4721737403 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/handlers.py @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making +蓝鲸智云-权限中心Python SDK(iam-python-sdk) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import json +import logging +import os +import subprocess +import zipfile +from datetime import datetime + +import yaml +from bkstorages.backends.bkrepo import TIMEOUT_THRESHOLD, BKGenericRepoClient, BKRepoStorage, urljoin + +logger = logging.getLogger("root") + + +class MediumBKGenericRepoClient(BKGenericRepoClient): + """代码同backend/core/storage一致""" + + def list_dir(self, key_prefix: str): + """ + Lists the contents of the specified path, returning a 2-tuple of lists; + the first item being directories, the second item being files. + """ + cur_page = 0 + directories, files = [], [] + while True: + cur_page += 1 + ds, fs, next_page = self.__list_dir(key_prefix, cur_page=cur_page) + directories.extend(ds) + files.extend(fs) + if not next_page: + break + return directories, files + + def __list_dir(self, key_prefix: str, cur_page: int = 1): + """ + 返回更多文件信息 + """ + directories, files = [], [] + client = self.get_client() + url = urljoin(self.endpoint_url, f"/repository/api/node/page/{self.project}/{self.bucket}/{key_prefix}") + # NOTE: 按分页查询 bkrepo 的文件数, 1000 是一个经验值, 设置仅可能大的数值是避免发送太多次请求到 bk-repo + params = {"pageSize": 1000, "PageNumber": cur_page, "includeFolder": True} + resp = client.get(url, params=params, timeout=TIMEOUT_THRESHOLD) + data = self._validate_resp(resp) + total_pages = data["totalPages"] + for record in data["records"]: + if record["folder"]: + directories.append(record) + else: + # 返回全部文件信息 + files.append(record) + return directories, files, (cur_page < total_pages) + + +class MediumHandler: + def __init__(self, storage=None): + if storage: + self.storage = storage + else: + self.storage = BKRepoStorage( + username=os.getenv("BKREPO_USERNAME"), + password=os.getenv("BKREPO_PASSWORD"), + project_id=os.getenv("BKREPO_PROJECT"), + bucket=os.getenv("BKREPO_PUBLIC_BUCKET"), + endpoint_url=os.getenv("BKREPO_ENDPOINT_URL"), + file_overwrite=os.getenv("FILE_OVERWRITE", False), + ) + self.storage.client = MediumBKGenericRepoClient( + bucket=os.getenv("BKREPO_PUBLIC_BUCKET"), + project=os.getenv("BKREPO_PROJECT"), + username=os.getenv("BKREPO_USERNAME"), + password=os.getenv("BKREPO_PASSWORD"), + endpoint_url=os.getenv("BKREPO_ENDPOINT_URL"), + ) + + def download_medium(self, option, path, bkrepo_tmp_dir): + """从制品库下载文件到本地""" + if not os.path.exists(bkrepo_tmp_dir): + os.makedirs(bkrepo_tmp_dir) + os.chdir(bkrepo_tmp_dir) + + if option in ["download", "all"]: + if path: + subprocess.call(["wget", self.storage.url(f"/{path}")]) + else: + with open(os.path.join(bkrepo_tmp_dir, "wget.txt"), "w") as f: + for d in self.storage.listdir("/")[0]: + f.write(self.storage.url(d["fullPath"]) + "\n") + subprocess.call(["wget", "-i", "./wget.txt"]) + + if option in ["unzip", "all"]: + for root, dirs, files in os.walk(bkrepo_tmp_dir): + for file in files: + if "?" not in file: + continue + + if path and path not in file: + continue + + db_type = file.split("?")[0] + with zipfile.ZipFile(os.path.join(root, file)) as zfile: + logger.info("unzip dir: %s", file) + zfile.extractall(os.path.join(bkrepo_tmp_dir, db_type)) + + os.remove(os.path.join(root, file)) + + def upload_medium(self, path, bkrepo_tmp_dir): + """将本地文件上传到制品库""" + if not os.path.exists(bkrepo_tmp_dir): + os.makedirs(bkrepo_tmp_dir) + os.chdir(bkrepo_tmp_dir) + + for root, dirs, files in os.walk(bkrepo_tmp_dir): + for file in files: + if "?" in file: + continue + + for suffix in [ + "txt", + "py", + "sql", + "xlsx", + "secret", + "crt", + "key", + "png", + "ppx", + "doc", + "md", + "DS_Store", + ]: + if f".{suffix}" in file: + break + else: + if path and f"/{path}" not in root: + continue + # 分割路径,保留制品路径(db_type/name/version/file) + file_path = os.path.join(root, file) + file_path_bkrepo = file_path.split(file_path.rsplit("/", 4)[0])[1] + # 如果文件已存在,则不进行上传更新 + logger.info("upload file: %s -> %s", file_path, file_path_bkrepo) + if not self.storage.listdir(file_path_bkrepo.rsplit("/", 1)[0])[1]: + with open(file_path, "rb") as f: + self.storage.save(file_path_bkrepo, f) + + def sync_from_bkrepo(self, db_type): + """将制品库文件同步到dbm""" + from network import HttpHandler + + http = HttpHandler() + for pkg_type in self.storage.listdir(f"/{db_type}")[0]: + for version in self.storage.listdir(pkg_type["fullPath"])[0]: + for media in self.storage.listdir(version["fullPath"])[1]: + package_params = { + "name": media["name"], + "db_type": db_type, + "pkg_type": pkg_type["name"], + "version": version["name"], + "path": media["fullPath"], + "size": media["size"], + "md5": media["md5"], + "create_at": str(datetime.strptime(media["createdDate"], "%Y-%m-%dT%H:%M:%S.%f")), + } + logger.info("sync info %s", json.dumps(package_params, indent=4)) + http.post(url="apis/packages/update_or_create/", data=package_params) + + @classmethod + def build_medium(cls, bkrepo_tmp_dir): + """同步构建好的介质,并更新.lock文件""" + + def add_version(version): + # TODO: 这里版本号叠加规则是怎样?默认只是小版本+1 + x, y, z = version.split(".") + z = int(z) + 1 + return f"{x}.{y}.{z}" + + if not os.path.exists(bkrepo_tmp_dir): + os.makedirs(bkrepo_tmp_dir) + + # 加载lock文件,获取介质的版本信息 + medium_lock_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "medium.lock") + with open(medium_lock_path, "r") as lock_file: + lock_info = yaml.safe_load(lock_file) + + # 将构建好的介质复制到指定目录,并更新lock info + for db_type, mediums in lock_info.items(): + for medium in mediums: + for medium_type, medium_info in medium.items(): + # 判断commit是否相等,不想等则进行版本号增加 + dir_commit = subprocess.run( + [f"git -C {medium_info['buildPath'].rsplit('/', 2)[0]} log -n 1 --pretty=format:%H ."], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + ).stdout.decode("utf-8") + if dir_commit != medium_info["commitId"]: + medium_info["version"] = add_version(medium_info["version"]) + medium_info["commitId"] = dir_commit + + # 将编译好的介质复制到指定目录 + target_medium_path = f"{bkrepo_tmp_dir}/{db_type}/{medium_type}/{medium_info['version']}" + result = subprocess.run( + [f"mkdir -p {target_medium_path} && cp {medium_info['buildPath']} {target_medium_path}"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + ) + if result.returncode: + logger.error("Error: move medium fail! message: %s", result.stderr) + + # 更新lock文件 + with open(medium_lock_path, "w") as lock_file: + lock_file.write(yaml.safe_dump(lock_info)) diff --git a/dbm-ui/backend/dbm_init/medium/main.py b/dbm-ui/backend/dbm_init/medium/main.py new file mode 100644 index 0000000000..59a093d7fe --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/main.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making +蓝鲸智云-权限中心Python SDK(iam-python-sdk) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import argparse +import logging +import os + +from handlers import MediumHandler + +logger = logging.getLogger("root") + +parser = argparse.ArgumentParser(description="This is a script for automatically synchronizing artifact libraries") +parser.add_argument( + "--type", + type=str, + help="download: Download product library files;\n upload: Upload product library files\n sync: Sync library to DBM", +) +parser.add_argument("--db", type=str, help="Database type", default="") +args = parser.parse_args() + +if __name__ == "__main__": + """版本镜像脚本执行入口""" + path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "medium") + + if args.type == "build": + MediumHandler.build_medium(bkrepo_tmp_dir=path) + elif args.type == "upload": + MediumHandler().upload_medium(path=args.db, bkrepo_tmp_dir=path) + elif args.type == "sync": + MediumHandler().sync_from_bkrepo(db_type=args.db) + else: + raise Exception("Unsupported operation type") diff --git a/dbm-ui/backend/dbm_init/medium/medium.lock b/dbm-ui/backend/dbm_init/medium/medium.lock new file mode 100644 index 0000000000..6cee406150 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/medium.lock @@ -0,0 +1,61 @@ +mysql: +- actuator: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 +- dbbackup: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/mysql-dbbackup/build/dbbackup-go-txsql.tar.gz + commitId: '' + name: dbbackup-go-txsql.tar.gz + version: 1.0.0 +- mysql-checksum: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/mysql-table-checksum/build/mysql-checksum.tar.gz + commitId: '' + name: mysql-checksum.tar.gz + version: 1.0.0 +- mysql-crond: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/mysql-crond/build/mysql-crond.tar.gz + commitId: '' + name: mysql-crond.tar.gz + version: 1.0.0 +- rotate-binlog: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/mysql-rotatebinlog/build/mysql-rotatebinlog.tar.gz + commitId: '' + name: mysql-rotatebinlog.tar.gz + version: 1.0.0 +- mysql-monitor: + buildPath: /blueking-dbm/dbm-services/mysql/db-tools/mysql-monitor/build/mysql-monitor.tar.gz + commitId: '' + name: mysql-monitor.tar.gz + version: 1.0.0 +es: +- actuator: + buildPath: /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 +kafka: +- actuator: + buildPath: /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 +hdfs: +- actuator: + buildPath: /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 +pulsar: +- actuator: + buildPath: /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 +influxdb: +- actuator: + buildPath: /blueking-dbm/dbm-services/bigdata/db-tools/dbactuator/build/dbactuator + commitId: '' + name: dbactuator + version: 1.0.0 \ No newline at end of file diff --git a/dbm-ui/backend/dbm_init/medium/network.py b/dbm-ui/backend/dbm_init/medium/network.py new file mode 100644 index 0000000000..d9408837b1 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/network.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making +蓝鲸智云-权限中心Python SDK(iam-python-sdk) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import json +import logging +import os +from typing import Any + +import curlify +import requests + +logger = logging.getLogger("plugin") + +HTTP_STATUS_OK_CODE = 200 + + +class HttpResponse(object): + result: bool + message: str + data: Any + + def __init__(self, result, message, data): + self.result = result + self.message = message + self.data = data + + +class HttpHandler: + session = requests.Session() + adapter = requests.adapters.HTTPAdapter(pool_connections=20, pool_maxsize=20) + session.mount("https://", adapter) + session.mount("http://", adapter) + + def is_status_ok(self, code): + return 200 <= code <= 299 + + def _gen_header_cookie(self, send_file=False): + headers = { + "Content-Type": "application/json", + "X-Bkapi-Authorization": json.dumps( + {"bk_app_code": os.getenv("APP_CODE"), "bk_app_secret": os.getenv("APP_TOKEN")} + ), + } + cookie = {"bk_app_code": os.getenv("APP_CODE"), "bk_app_secret": os.getenv("APP_TOKEN")} + # 如果是form表单提交,则无需自定义Content-Type,request库会自动填充 + if send_file: + headers.pop("Content-Type") + return headers, cookie + + def _http_request( + self, method, url, headers=None, data=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs + ): + url = f"{os.getenv('DBM_SAAS_URL')}{url}" + resp = requests.Response() + try: + if method == "GET": + resp = self.session.get( + url=url, + headers=headers, + params=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + elif method == "HEAD": + resp = self.session.head( + url=url, headers=headers, verify=verify, cert=cert, timeout=timeout, cookies=cookies, **kwargs + ) + elif method == "POST": + resp = self.session.post( + url=url, + headers=headers, + json=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + elif method == "DELETE": + resp = self.session.delete( + url=url, + headers=headers, + json=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + elif method == "PUT": + resp = self.session.put( + url=url, + headers=headers, + json=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + else: + return False, "invalid http method: %s" % method, None + except Exception as e: + message = "http error! request: [method=`%s`, url=`%s`, data=`%s`] err=`%s`" % (method, url, data, str(e)) + logger.exception(message) + return HttpResponse(result=False, message=message, data=None) + else: + request_id = resp.headers.get("X-Request-Id") + + content = resp.content if resp.content else "" + if not logger.isEnabledFor(logging.DEBUG) and len(content) > 200: + content = content[:200] + b"......" + + message_format = ( + "request: [method=`%s`, url=`%s`, data=`%s`] response: [status_code=`%s`, request_id=`%s`, " + "content=`%s`]" + ) + + if not self.is_status_ok(resp.status_code) or resp.json()["code"]: + message = message_format % (method, url, str(data), resp.status_code, request_id, content) + message = f"{message}, error: {resp.json().get('message')}" + logger.error(message) + return HttpResponse(result=False, message=message, data=None) + + logger.info(message_format % (method, url, str(data), resp.status_code, request_id, content)) + return HttpResponse(result=True, message="ok", data=resp.json()["data"]) + finally: + if resp.request is None: + resp.request = requests.Request(method, url, headers=headers, data=data, cookies=cookies).prepare() + + if logger.isEnabledFor(logging.DEBUG): + logger.debug( + "the request_id: `%s`. curl: `%s`", + resp.headers.get("X-Request-Id", ""), + curlify.to_curl(resp.request, verify=False), + ) + + def get(self, url, data, headers=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs): + if not headers: + headers, cookies = self._gen_header_cookie() + return self._http_request( + method="GET", + url=url, + headers=headers, + data=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + + def post(self, url, data, headers=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs): + if not headers: + headers, cookies = self._gen_header_cookie() + return self._http_request( + method="POST", + url=url, + headers=headers, + data=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + + def put(self, url, data, headers=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs): + if not headers: + headers, cookies = self._gen_header_cookie() + return self._http_request( + method="PUT", + url=url, + headers=headers, + data=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) + + def delete(self, url, data, headers=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs): + if not headers: + headers, cookies = self._gen_header_cookie() + return self._http_request( + method="DELETE", + url=url, + headers=headers, + data=data, + verify=verify, + cert=cert, + timeout=timeout, + cookies=cookies, + **kwargs, + ) diff --git a/dbm-ui/backend/dbm_init/medium/readme.md b/dbm-ui/backend/dbm_init/medium/readme.md new file mode 100644 index 0000000000..21fe7bd92a --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/readme.md @@ -0,0 +1,36 @@ +# 版本文件初始化镜像 + +## 打包 + +在blueking目录下执行 +```shell +docker build -t dbm-sync-medium -f dbm-ui/backend/dbm_init/medium/Dockerfile . \ +--build-arg MEDIUM_BUILDER_BRANCH=master \ +--build-arg GITHUB_TOKEN=token \ +--build-arg GITHUB_USERNAME=user \ +--build-arg GITHUB_USER_EMAIL=example@example.com +``` + +## 脚本用法 + +使用之前需要配置相关环境变量 +```shell +PYTHONUNBUFFERED=1; +APP_CODE=bk_dbm; +APP_ID=bk_dbm; +APP_TOKEN=; +BKREPO_ENDPOINT_URL=http://bkrepo.example.com; +BKREPO_PASSWORD=xxx; +BKREPO_PROJECT=blueking; +BKREPO_PUBLIC_BUCKET=bkdbm; +BKREPO_USERNAME=xxx; +DBM_SAAS_URL=http://dbm.example.com/; +DJANGO_SETTINGS_MODULE=settings +``` + +相关命令 +```shell +python main.py --type build # 打包二进制文件 +python main.py --type upload --db xx # 上传制定dbtype到制品库 +python main.py --type sync --db xx # 同步到Package表 +``` diff --git a/dbm-ui/backend/dbm_init/medium/requirements.txt b/dbm-ui/backend/dbm_init/medium/requirements.txt new file mode 100644 index 0000000000..d604a850c9 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/requirements.txt @@ -0,0 +1,3 @@ +bkstorages==1.0.8 +Django==3.2.21 +PyYAML~=5.4.1 diff --git a/dbm-ui/backend/dbm_init/medium/settings.py b/dbm-ui/backend/dbm_init/medium/settings.py new file mode 100644 index 0000000000..b8638c4259 --- /dev/null +++ b/dbm-ui/backend/dbm_init/medium/settings.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making +蓝鲸智云-权限中心Python SDK(iam-python-sdk) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/dbm_init/services.py b/dbm-ui/backend/dbm_init/services.py index f4ac258ade..131c7a1c62 100644 --- a/dbm-ui/backend/dbm_init/services.py +++ b/dbm-ui/backend/dbm_init/services.py @@ -8,9 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import base64 import datetime -import glob import json import logging import os @@ -27,12 +25,11 @@ from backend.core.storages.file_source import BkJobFileSourceManager from backend.core.storages.storage import get_storage from backend.db_meta.models import AppMonitorTopo -from backend.db_monitor.constants import TPLS_ALARM_DIR, TPLS_COLLECT_DIR -from backend.db_monitor.models import AlertRule, CollectInstance, CollectTemplate, NoticeGroup, RuleTemplate from backend.db_services.ipchooser.constants import DB_MANAGE_SET, DIRTY_MODULE, RESOURCE_MODULE from backend.dbm_init.constants import CC_APP_ABBR_ATTR, CC_HOST_DBM_ATTR from backend.dbm_init.json_files.format import JsonConfigFormat from backend.exceptions import ApiError, ApiRequestError, ApiResultError +from backend.flow.utils.cc_manage import CcManage logger = logging.getLogger("root") @@ -126,9 +123,11 @@ def auto_create_bklog_service() -> bool: func_name = filename.split(".")[0] if hasattr(JsonConfigFormat, f"format_{func_name}"): bklog_json_str = JsonConfigFormat.format(bklog_json_str, f"format_{func_name}") - if "mysql" in filename: + elif "mysql" in filename: bklog_json_str = JsonConfigFormat.format(bklog_json_str, JsonConfigFormat.format_mysql.__name__) - if "redis" in filename: + elif "backup" in filename: + bklog_json_str = JsonConfigFormat.format(bklog_json_str, JsonConfigFormat.format_mysql.__name__) + elif "redis" in filename: bklog_json_str = JsonConfigFormat.format(bklog_json_str, JsonConfigFormat.format_redis.__name__) else: logger.warning(f"格式化函数{func_name}不存在(如果无需格式化json可忽略)") @@ -189,32 +188,25 @@ def auto_create_bkcc_service() -> bool: # 初始化db的管理集群和相关模块 if not SystemSettings.get_setting_value(key=SystemSettingsEnum.MANAGE_TOPO.value): # 创建管理集群 - manage_set = CCApi.create_set( - { - "bk_biz_id": env.DBA_APP_BK_BIZ_ID, - "data": {"bk_parent_id": env.DBA_APP_BK_BIZ_ID, "bk_set_name": DB_MANAGE_SET}, - } + manage_set_id = CcManage.get_or_create_set_with_name( + bk_biz_id=env.DBA_APP_BK_BIZ_ID, bk_set_name=DB_MANAGE_SET ) # 创建资源池模块和污点池模块 manage_modules = [RESOURCE_MODULE, DIRTY_MODULE] - module_name__module_info = {} + module_name__module_id = {} for module in manage_modules: - module_info = CCApi.create_module( - { - "bk_biz_id": env.DBA_APP_BK_BIZ_ID, - "bk_set_id": manage_set["bk_set_id"], - "data": {"bk_parent_id": manage_set["bk_set_id"], "bk_module_name": module}, - } + module_id = CcManage.get_or_create_module_with_name( + bk_biz_id=env.DBA_APP_BK_BIZ_ID, bk_set_id=manage_set_id, bk_module_name=module ) - module_name__module_info[module] = module_info + module_name__module_id[module] = module_id # 插入管理集群的配置 SystemSettings.insert_setting_value( key=SystemSettingsEnum.MANAGE_TOPO.value, value_type="dict", value={ - "set_id": manage_set["bk_set_id"], - "resource_module_id": module_name__module_info[RESOURCE_MODULE]["bk_module_id"], - "dirty_module_id": module_name__module_info[DIRTY_MODULE]["bk_module_id"], + "set_id": manage_set_id, + "resource_module_id": module_name__module_id[RESOURCE_MODULE], + "dirty_module_id": module_name__module_id[DIRTY_MODULE], }, ) @@ -286,183 +278,6 @@ def auto_create_bkcc_service() -> bool: return True - @staticmethod - def init_alarm_strategy(): - """初始化告警策略""" - - bkm_dbm_report = SystemSettings.get_setting_value(key=SystemSettingsEnum.BKM_DBM_REPORT.value) - - now = datetime.datetime.now() - updated_alarms = 0 - logger.warning("[init_alarm_strategy] sync bkmonitor alarm start: %s", now) - - # 未来考虑将模板放到db管理 - # rules = RuleTemplate.objects.filter(is_enabled=True, bk_biz_id=0) - # for rule in rules: - alarm_tpls = os.path.join(TPLS_ALARM_DIR, "*.tpl64") - for alarm_tpl in glob.glob(alarm_tpls): - with open(alarm_tpl, "rb") as f: - template_dict = json.loads(base64.b64decode(f.read())) - rule = RuleTemplate(**template_dict) - - alert_params = rule.details - - # 支持跳过部分db类型的初始化 - if rule.db_type in EXCLUDE_DB_TYPES: - continue - - try: - try: - # 唯一性:db_type+name - alert_rule = AlertRule.objects.get(bk_biz_id=rule.bk_biz_id, db_type=rule.db_type, name=rule.name) - # alert_rule = AlertRule.objects.get(template_id=rule.id) - alert_params["id"] = alert_rule.monitor_strategy_id - logger.warning("[init_alarm_strategy] update bkmonitor alarm: %s " % rule.db_type) - except AlertRule.DoesNotExist: - # 为了能够重复执行,这里也支持下AlertRule被清空的情况 - res = BKMonitorV3Api.search_alarm_strategy_v3( - { - "page": 1, - "page_size": 1, - "conditions": [{"key": "name", "value": alert_params["name"]}], - "bk_biz_id": env.DBA_APP_BK_BIZ_ID, - "with_notice_group": False, - "with_notice_group_detail": False, - }, - use_admin=True, - ) - - # 批量获取策略 - strategy_config_list = res["strategy_config_list"] - - # 业务下存在该策略 - if strategy_config_list: - strategy_config = strategy_config_list[0] - alert_params["id"] = strategy_config["id"] - logger.warning("[init_alarm_strategy] sync bkmonitor alarm: %s " % rule.db_type) - else: - logger.warning("[init_alarm_strategy] create bkmonitor alarm: %s " % rule.db_type) - - # 更新业务id - alert_params["bk_biz_id"] = env.DBA_APP_BK_BIZ_ID - - # 用最新告警组覆盖模板中的 - notice = alert_params["notice"] - notice["user_groups"] = NoticeGroup.get_monitor_groups(db_type=rule.db_type) - - # 自定义事件和指标需要渲染metric_id - # {bk_biz_id}_bkmoinitor_event_{event_data_id} - items = alert_params["items"] - for item in items: - for query_config in item["query_configs"]: - if "custom.event" not in query_config["metric_id"]: - continue - - query_config["metric_id"] = query_config["metric_id"].format( - bk_biz_id=env.DBA_APP_BK_BIZ_ID, event_data_id=bkm_dbm_report["event"]["data_id"] - ) - query_config["result_table_id"] = query_config["result_table_id"].format( - bk_biz_id=env.DBA_APP_BK_BIZ_ID, event_data_id=bkm_dbm_report["event"]["data_id"] - ) - logger.warning(query_config) - # logger.info(query_config["metric_id"], query_config["result_table_id"]) - - res = BKMonitorV3Api.save_alarm_strategy_v3(alert_params, use_admin=True) - - # 实例化Rule - obj, _ = AlertRule.objects.update_or_create( - defaults={"details": alert_params, "monitor_strategy_id": res["id"]}, - bk_biz_id=rule.bk_biz_id, - db_type=rule.db_type, - name=rule.name, - # template_id=rule.id, - ) - - updated_alarms += 1 - except Exception as e: # pylint: disable=wildcard-import - logger.error("[init_alarm_strategy] sync bkmonitor alarm: %s (%s)", rule.db_type, e) - - logger.warning( - "[init_alarm_strategy] finish sync bkmonitor alarm end: %s, update_cnt: %s", - datetime.datetime.now() - now, - updated_alarms, - ) - - @staticmethod - def init_collect_strategy(): - now = datetime.datetime.now() - updated_collectors = 0 - - logger.warning("[init_collect_strategy] start sync bkmonitor collector start: %s", now) - - # 未来考虑将模板放到db管理 - # templates = CollectTemplate.objects.filter(bk_biz_id=0) - # for template in templates: - - collect_tpls = os.path.join(TPLS_COLLECT_DIR, "*.tpl64") - for collect_tpl in glob.glob(collect_tpls): - with open(collect_tpl, "rb") as f: - template_dict = json.loads(base64.b64decode(f.read())) - template = CollectTemplate(**template_dict) - - collect_params = template.details - - # 支持跳过部分db类型的初始化 - if template.db_type in EXCLUDE_DB_TYPES: - continue - - try: - try: - collect_instance = CollectInstance.objects.get( - bk_biz_id=template.bk_biz_id, db_type=template.db_type, plugin_id=template.plugin_id - ) - collect_params["id"] = collect_instance.collect_id - logger.warning("[init_collect_strategy] update bkmonitor collector: %s " % template.db_type) - except CollectInstance.DoesNotExist: - # 为了能够重复执行,这里考虑下CollectInstance被清空的情况 - res = BKMonitorV3Api.query_collect_config( - {"bk_biz_id": env.DBA_APP_BK_BIZ_ID, "search": {"fuzzy": collect_params["name"]}}, - use_admin=True, - ) - - # 业务下存在该策略 - collect_config_list = res["config_list"] - if res["total"] == 1: - collect_config = collect_config_list[0] - collect_params["id"] = collect_config["id"] - logger.warning("[init_collect_strategy] sync bkmonitor collector: %s " % template.db_type) - else: - logger.warning("[init_collect_strategy] create bkmonitor collector: %s " % template.db_type) - - # 其他渲染操作 - collect_params["bk_biz_id"] = env.DBA_APP_BK_BIZ_ID - collect_params["plugin_id"] = template.plugin_id - - collect_params["target_nodes"] = [ - {"bk_inst_id": bk_set_id, "bk_obj_id": "set", "bk_biz_id": bk_biz_id} - for bk_set_id, bk_biz_id in AppMonitorTopo.get_set_by_plugin_id(plugin_id=template.plugin_id) - ] - - res = BKMonitorV3Api.save_collect_config(collect_params, use_admin=True) - - # 实例化Rule - obj, _ = CollectInstance.objects.update_or_create( - defaults={"details": collect_params, "collect_id": res["id"]}, - bk_biz_id=template.bk_biz_id, - db_type=template.db_type, - plugin_id=template.plugin_id, - ) - - updated_collectors += 1 - except Exception as e: # pylint: disable=wildcard-import - logger.error("[init_collect_strategy] sync bkmonitor collector: %s (%s)", template.db_type, e) - - logger.warning( - "[init_collect_strategy] finish sync bkmonitor collector end: %s, update_cnt: %s", - datetime.datetime.now() - now, - updated_collectors, - ) - @staticmethod def init_custom_metric_and_event(): """初始化自定义指标和采集项""" @@ -475,7 +290,7 @@ def init_custom_metric_and_event(): "search_key": custom_name, "page": 1, "page_size": 10, - "bk_biz_id": 3, + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, } ) if res.get("total") > 0: @@ -572,13 +387,16 @@ def init_custom_metric_and_event(): def auto_create_bkmonitor_alarm() -> bool: """初始化bkmonitor配置""" + from backend.db_monitor.models import CollectInstance + from backend.db_periodic_task.local_tasks import sync_plat_monitor_policy + logger.info("auto_create_bkmonitor_service") # 加载采集策略 - Services.init_collect_strategy() + CollectInstance.init_collect_strategy() # 加载告警策略 - # Services.init_alarm_strategy() + sync_plat_monitor_policy() return True diff --git a/dbm-ui/backend/env/__init__.py b/dbm-ui/backend/env/__init__.py index 0230303ea4..7b037bb1ca 100644 --- a/dbm-ui/backend/env/__init__.py +++ b/dbm-ui/backend/env/__init__.py @@ -52,7 +52,7 @@ BK_IAM_SYSTEM_NAME = get_type_env(key="BK_IAM_SYSTEM_NAME", _type=str, default="DB管理平台") BK_IAM_INNER_HOST = get_type_env(key="BK_IAM_V3_INNER_HOST", _type=str, default="https://iam-inner.example.com") BK_IAM_USE_APIGATEWAY = True -BK_IAM_APIGETEWAY = get_type_env(key="BK_IAM_APIGETEWAY", _type=str, default="https://iam-apigw.example.com") +BK_IAM_APIGATEWAY = get_type_env(key="BK_IAM_APIGATEWAY", _type=str, default="https://iam-apigw.example.com") IAM_APP_URL = get_type_env(key="IAM_APP_URL", _type=str, default="https://iam.example.com") BK_IAM_RESOURCE_API_HOST = get_type_env(key="BK_IAM_RESOURCE_API_HOST", _type=str, default="https://bkdbm.example.com") @@ -82,6 +82,7 @@ BK_NODEMAN_URL = get_type_env(key="BK_NODEMAN_URL", _type=str, default="http://apps.example.com/bk--nodeman") BK_SCR_URL = get_type_env(key="BK_SCR_URL", _type=str, default="http://scr.example.com") BK_SOPS_URL = get_type_env(key="BK_SOPS_HOST", _type=str, default=None) +BK_HELPER_URL = get_type_env(key="BK_HELPER_URL", _type=str, default=None) # 北极星服务 POLARIS_URL = get_type_env(key="POLARIS_URL", _type=str, default="http://polaris.example.com") @@ -95,6 +96,8 @@ # 名字服务北极星部门字段 NAMESERVICE_POLARIS_DEPARTMENT = get_type_env(key="NAMESERVICE_POLARIS_DEPARTMENT", _type=str, default="") +# 名字服务添加clb域名 +CLB_DOMAIN = get_type_env(key="CLB_DOMAIN", _type=bool, default=False) # 标准运维SA 空闲检查任务模版ID SA_CHECK_TEMPLATE_ID = get_type_env(key="SA_CHECK_TEMPLATE_ID", _type=int) diff --git a/dbm-ui/backend/exceptions.py b/dbm-ui/backend/exceptions.py index ebeaf3276e..1cb6ceafb4 100644 --- a/dbm-ui/backend/exceptions.py +++ b/dbm-ui/backend/exceptions.py @@ -42,6 +42,8 @@ class ErrorCode(object): REDIS_DTS_CODE = "13" DB_REMOTE_SERVICE_CODE = "14" CONFIGURATION_CODE = "20" + DB_MONITOR_CODE = "15" + TENDB_OPEN_AREA_CODE = "16" class AppBaseException(Exception): @@ -145,7 +147,7 @@ def __init__(self, context=None, data=None, **kwargs): try: permission = kwargs.get("permission") if permission: - client = IAM(env.APP_CODE, env.SECRET_KEY, bk_apigateway_url=env.BK_IAM_APIGETEWAY) + client = IAM(env.APP_CODE, env.SECRET_KEY, bk_apigateway_url=env.BK_IAM_APIGATEWAY) for action in permission.get("actions") or []: action["name"] = action.get("name") or action.get("id") data = { diff --git a/dbm-ui/backend/flow/consts.py b/dbm-ui/backend/flow/consts.py index 9c91f67f4a..bf221d898e 100644 --- a/dbm-ui/backend/flow/consts.py +++ b/dbm-ui/backend/flow/consts.py @@ -231,6 +231,7 @@ class MediumEnum(str, StructuredEnum): Spider = EnumField("spider", _("spider节点名称")) tdbCtl = EnumField("tdbctl", _("spider中控节点名称")) Riak = EnumField("riak", _("riak")) + RiakMonitor = EnumField("riak-monitor", _("riak-monitor")) RedisDts = EnumField("redis-dts", _("redis-dts")) TBinlogDumper = EnumField("tbinlogdumper", _("tbinlogdumper实例")) @@ -266,6 +267,7 @@ class CloudServiceModuleName(str, StructuredEnum): DNS = EnumField("dns.service.module", _("dns服务模块")) DRS = EnumField("drs.service.module", _("drs服务模块")) DBHA = EnumField("dbha.service.module", _("dbha服务模块")) + RedisDTS = EnumField("redis_dts.service.module", _("redis_dts服务模块")) class MediumFileTypeEnum(int, StructuredEnum): @@ -344,6 +346,12 @@ class DBActuatorActionEnum(str, StructuredEnum): TenDBClusterBackendSwitch = EnumField("cluster-backend-switch", _("TenDBCluster集群做后端切换")) TenDBClusterMigrateCutOver = EnumField("cluster-backend-migrate-cutover", _("TenDBCluster集群做后端的成对迁移")) DumpSchema = EnumField("dumpschema", _("为TBinlogDumper实例导出导入源表结构")) + OsCmd = EnumField("oscmd-run", _("执行os命令")) + MysqlOpenAreaDumpSchema = EnumField("open_area_dumpschema", _("Mysql开区导出库表结构")) + MysqlOpenAreaImportSchema = EnumField("open_area_importschema", _("Mysql开区导入库表结构")) + MysqlOpenAreaDumpData = EnumField("open_area_dumpdata", _("Mysql开区导出库表数据")) + MysqlOpenAreaImportData = EnumField("open_area_importdata", _("Mysql开区导入库表数据")) + EnableTokudb = EnumField("enable-tokudb-engine", _("MySQL实例安装tokudb引擎")) class RedisActuatorActionEnum(str, StructuredEnum): @@ -376,6 +384,8 @@ class RedisActuatorActionEnum(str, StructuredEnum): REMOVE_DTS_SERVER = EnumField("remove_dts_server", _("remove_dts_server")) DATA_STRUCTURE = EnumField("data_structure", _("data_structure")) CLUSTER_MEET_CHECK = EnumField("clustermeet_checkfinish", _("clustermeet_checkfinish")) + VERSION_UPDATE = EnumField("version_update", _("version_update")) + CLUSTER_FAILOVER = EnumField("cluster_failover", _("cluster_failover")) class EsActuatorActionEnum(str, StructuredEnum): @@ -476,6 +486,9 @@ class RiakActuatorActionEnum(str, StructuredEnum): UnInstall = EnumField("uninstall", _("uninstall")) Start = EnumField("start", _("start")) Stop = EnumField("stop", _("stop")) + DeployMonitor = EnumField("deploy-monitor", _("deploy-monitor")) + StartMonitor = EnumField("start-monitor", _("start-monitor")) + StopMonitor = EnumField("stop-monitor", _("stop-monitor")) class RiakModuleId(int, StructuredEnum): diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py index 5a9608c098..12988f2412 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py @@ -42,6 +42,7 @@ start_dns_service_template, start_drs_service_template, start_nginx_template, + start_redis_dts_server_template, ) from backend.flow.utils.script_template import privilege_flush_template @@ -285,6 +286,21 @@ def deploy_agent_service_pipeline( ) return pipeline + def deploy_redis_dts_server_service_pipeline( + self, dts_server_host_info: Dict, pipeline: Union[Builder, SubBuilder] + ): + """redis dts_server的部署流程抽象""" + pipeline = self.deploy_service_flow( + pipeline=pipeline, + bk_cloud_id=self.data["bk_cloud_id"], + service_name=CloudServiceName.RedisDTS, + host_info=dts_server_host_info, + get_file_func=GetFileList.redis_add_dts_server.__name__, + script_template=start_redis_dts_server_template, + get_script_payload=CloudServiceActPayload.get_redis_dts_server_apply_payload.__name__, + ) + return pipeline + def add_privilege_act(self, pipeline: Union[Builder, SubBuilder], host_infos: Dict, user: str, pwd: str): """ 增加权限刷新的act diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py index 1ab2b2c766..a4719d9ddc 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py @@ -14,6 +14,7 @@ from bamboo_engine.builder import SubProcess from django.utils.translation import ugettext as _ +from backend import env from backend.flow.consts import CloudDBHATypeEnum, CloudServiceName from backend.flow.engine.bamboo.scene.cloud.base_service_flow import CloudBaseServiceFlow from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder @@ -30,7 +31,10 @@ def _build_gm_apply_flow(self, gm_pipeline: SubBuilder, super_account: Dict) -> """构建gm部署流程""" nginx_internal_domain = self.data["nginx"]["host_infos"][0]["ip"] dbha_kwargs = CloudDBHAKwargs( - dbha_type=CloudDBHATypeEnum.GM, nginx_internal_domain=nginx_internal_domain, **super_account + dbha_type=CloudDBHATypeEnum.GM, + nginx_internal_domain=nginx_internal_domain, + name_service_domain=env.NAMESERVICE_APIGW_DOMAIN, + **super_account ) sub_gm_pipeline_list: List[SubProcess] = [] for host_info in self.data["dbha"]["gm"]: @@ -49,7 +53,10 @@ def _build_agent_apply_flow( """构建agent部署流程""" nginx_internal_domain = self.data["nginx"]["host_infos"][0]["ip"] dbha_kwargs = CloudDBHAKwargs( - dbha_type=CloudDBHATypeEnum.AGENT.value, nginx_internal_domain=nginx_internal_domain, **super_account + dbha_type=CloudDBHATypeEnum.AGENT.value, + nginx_internal_domain=nginx_internal_domain, + name_service_domain=env.NAMESERVICE_APIGW_DOMAIN, + **super_account ) sub_agent_pipeline_list: List[SubProcess] = [] for host_info in self.data["dbha"]["agent"]: diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py new file mode 100644 index 0000000000..bee041b1d0 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging.config +from typing import List, Union + +from bamboo_engine.builder import SubProcess +from django.utils.translation import ugettext as _ + +from backend.flow.engine.bamboo.scene.cloud.base_service_flow import CloudBaseServiceFlow +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.utils.cloud.cloud_act_payload import CloudServiceActPayload +from backend.flow.utils.cloud.cloud_db_proxy import CloudDBProxy +from backend.flow.utils.cloud.script_template import stop_redis_dts_server_template + +logger = logging.getLogger("flow") + + +class CloudRedisDtsServerServiceFlow(CloudBaseServiceFlow): + """云区域部署redis dts服务流程""" + + def build_dts_server_apply_flow(self, dts_pipeline: Union[Builder, SubBuilder]) -> Union[Builder, SubBuilder]: + sub_dts_pipeline = SubBuilder(self.root_id, data=self.data) + sub_dts_pipeline_list: List[SubProcess] = [] + + for host_info in self.data["redis_dts"]["host_infos"]: + dts_deploy_pipeline = SubBuilder(self.root_id, data=self.data) + dts_deploy_pipeline = self.deploy_redis_dts_server_service_pipeline(host_info, dts_deploy_pipeline) + sub_dts_pipeline_list.append( + dts_deploy_pipeline.build_sub_process(sub_name=_("主机{}部署redis dts服务 s").format(host_info["ip"])) + ) + + sub_dts_pipeline.add_parallel_sub_pipeline(sub_dts_pipeline_list) + dts_pipeline.add_sub_pipeline(sub_dts_pipeline.build_sub_process(sub_name=_("部署redis dts服务"))) + return dts_pipeline + + def service_apply_flow(self): + """ + 云区域redis dts服务的部署流程执行 + """ + dts_pipeline = Builder(root_id=self.root_id, data=self.data) + + # 部署 redis dts_server + dts_pipeline = self.build_dts_server_apply_flow(dts_pipeline) + + # 更新dbproxy信息 + dts_pipeline = self.add_dbproxy_act( + pipeline=dts_pipeline, + host_infos=self.data["redis_dts"]["host_infos"], + proxy_func_name=CloudDBProxy.cloud_redis_dts_server_apply.__name__, + ) + dts_pipeline.run_pipeline() + + def service_reload_flow(self): + """ + 云区域redis dts服务的重启/重装流程执行 + """ + # 重启/重装等同于重新部署,不影响其他组件 + dts_pipeline = Builder(root_id=self.root_id, data=self.data) + dts_pipeline = self.build_dts_server_apply_flow(dts_pipeline) + dts_pipeline.run_pipeline() + + def service_add_flow(self): + """ + 云区域redis dts服务的增加流程执行 + """ + dts_pipeline = Builder(root_id=self.root_id, data=self.data) + + dts_pipeline = self.build_dts_server_apply_flow(dts_pipeline) + + # 更新dbproxy信息 + dts_pipeline = self.add_dbproxy_act( + pipeline=dts_pipeline, + host_infos=self.data["redis_dts"]["host_infos"], + proxy_func_name=CloudDBProxy.cloud_redis_dts_server_apply.__name__, + ) + dts_pipeline.run_pipeline() + + def service_reduce_flow(self): + """ + 云区域redis dts服务的下架流程执行 + """ + dts_pipeline = Builder(root_id=self.root_id, data=self.data) + reduce_dts_host_infos = self.data["redis_dts"]["host_infos"] + + # 裁撤旧redis dts服务 + dts_pipeline = self.add_reduce_act( + pipeline=dts_pipeline, + host_infos=reduce_dts_host_infos, + payload_func_name=CloudServiceActPayload.get_redis_dts_server_reduce_payload.__name__, + script_tpl=stop_redis_dts_server_template, + ) + + # 更新proxy机器 + dts_pipeline = self.add_dbproxy_act( + pipeline=dts_pipeline, + host_infos=reduce_dts_host_infos, + proxy_func_name=CloudDBProxy.cloud_redis_dts_server_reduce.__name__, + ) + + dts_pipeline.run_pipeline() + + def service_replace_flow(self): + """ + 云区域redis dts服务的替换流程执行 + """ + + dts_pipeline = Builder(root_id=self.root_id, data=self.data) + new_dts_host_infos = self.data["redis_dts"]["host_infos"] + old_dts_host_infos = self.data["old_redis_dts"]["host_infos"] + + # 部署新的redis dts流程 + deploy_dts_pipeline = SubBuilder(data=self.data, root_id=self.root_id) + deploy_dts_pipeline = self.build_dts_server_apply_flow(deploy_dts_pipeline) + dts_pipeline.add_sub_pipeline(deploy_dts_pipeline.build_sub_process(sub_name=_("部署新redis dts服务流程"))) + + # 更新dbproxy信息 + dts_pipeline = self.add_dbproxy_act( + pipeline=dts_pipeline, + host_infos=new_dts_host_infos, + proxy_func_name=CloudDBProxy.cloud_redis_dts_server_replace.__name__, + extra_kwargs={"old_redis_dts": old_dts_host_infos}, + ) + + # 裁撤旧的redis dts流程 + reduce_dts_pipeline = SubBuilder(data=self.data, root_id=self.root_id) + reduce_dts_pipeline = self.add_reduce_act( + pipeline=reduce_dts_pipeline, + host_infos=old_dts_host_infos, + payload_func_name=CloudServiceActPayload.get_redis_dts_server_reduce_payload.__name__, + script_tpl=stop_redis_dts_server_template, + ) + dts_pipeline.add_sub_pipeline(reduce_dts_pipeline.build_sub_process(sub_name=_("裁撤旧redis dts服务流程"))) + + dts_pipeline.run_pipeline() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/common/get_file_list.py b/dbm-ui/backend/flow/engine/bamboo/scene/common/get_file_list.py index 7f64c20379..7f75002d80 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/common/get_file_list.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/common/get_file_list.py @@ -15,6 +15,7 @@ from backend.db_package.models import Package from backend.db_services.version.constants import PredixyVersion, TwemproxyVersion from backend.flow.consts import CLOUD_SSL_PATH, MediumEnum +from backend.flow.utils.redis.redis_util import get_latest_redis_package_by_version class GetFileList(object): @@ -118,15 +119,15 @@ def riak_install_package(self, db_version: str) -> list: riak安装需要的安装包列表 """ riak_pkg = Package.get_latest_package(version=db_version, pkg_type=MediumEnum.Riak, db_type=DBType.Riak) - # riak_crond_pkg = Package.get_latest_package(version=MediumEnum.Latest, - # pkg_type=MediumEnum.RiakCrond, db_type=DBType.Riak) - # riak_monitor_pkg = Package.get_latest_package(version=MediumEnum.Latest, - # pkg_type=MediumEnum.RiakMonitor, db_type=DBType.Riak) + mysql_crond_pkg = Package.get_latest_package(version=MediumEnum.Latest, pkg_type=MediumEnum.MySQLCrond) + riak_monitor_pkg = Package.get_latest_package( + version=MediumEnum.Latest, pkg_type=MediumEnum.RiakMonitor, db_type=DBType.Riak.value + ) return [ f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{self.actuator_pkg.path}", f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{riak_pkg.path}", - # f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{riak_crond_pkg.path}", - # f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{riak_monitor_pkg.path}", + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{mysql_crond_pkg.path}", + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{riak_monitor_pkg.path}", ] def redis_cluster_apply_proxy(self, cluster_type) -> list: @@ -157,12 +158,7 @@ def redis_cluster_apply_backend(self, db_version: str) -> list: """ 部署redis,所有节点需要的redis pkg包 """ - pkg_type = MediumEnum.Redis - if db_version.startswith("TendisSSD"): - pkg_type = MediumEnum.TendisSsd - if db_version.startswith("Tendisplus"): - pkg_type = MediumEnum.TendisPlus - redis_pkg = Package.get_latest_package(version=db_version, pkg_type=pkg_type, db_type=DBType.Redis) + redis_pkg = get_latest_redis_package_by_version(db_version) redis_tool_pkg = Package.get_latest_package( version=MediumEnum.Latest, pkg_type=MediumEnum.RedisTools, db_type=DBType.Redis ) @@ -176,6 +172,20 @@ def redis_cluster_apply_backend(self, db_version: str) -> list: f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{bkdbmon_pkg.path}", ] + def redis_cluster_version_update(self, db_version: str) -> list: + """ + redis集群版本升级 + """ + redis_pkg = get_latest_redis_package_by_version(db_version) + bkdbmon_pkg = Package.get_latest_package( + version=MediumEnum.Latest, pkg_type=MediumEnum.DbMon, db_type=DBType.Redis + ) + return [ + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{self.actuator_pkg.path}", + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{redis_pkg.path}", + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{bkdbmon_pkg.path}", + ] + def redis_actuator_backend(self) -> list: """ 下发redis actuator @@ -338,15 +348,19 @@ def redis_base(self) -> list: f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{bkdbmon_pkg.path}", ] + @classmethod def redis_add_dts_server(self) -> list: """ redis add dts_server """ + redis_actuator_pkg = Package.get_latest_package( + version=MediumEnum.Latest, pkg_type=MediumEnum.DBActuator, db_type=DBType.Redis + ) redis_dts_pkg = Package.get_latest_package( version=MediumEnum.Latest, pkg_type=MediumEnum.RedisDts, db_type=DBType.Redis ) return [ - f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{self.actuator_pkg.path}", + f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{redis_actuator_pkg.path}", f"{env.BKREPO_PROJECT}/{env.BKREPO_BUCKET}/{redis_dts_pkg.path}", ] diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py new file mode 100644 index 0000000000..452d93549e --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging.config +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.flow.consts import ES_DEFAULT_INSTANCE_NUM, ManagerDefaultPort, ManagerOpType, ManagerServiceType +from backend.flow.engine.bamboo.scene.common.builder import Builder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.engine.bamboo.scene.es.es_flow import EsFlow, get_node_in_ticket_preferred_hot +from backend.flow.plugins.components.collections.common.bigdata_manager_service import BigdataManagerComponent +from backend.flow.plugins.components.collections.es.es_db_meta import EsMetaComponent +from backend.flow.plugins.components.collections.es.get_es_payload import GetEsActPayloadComponent +from backend.flow.plugins.components.collections.es.get_es_resource import GetEsResourceComponent +from backend.flow.plugins.components.collections.es.rewrite_es_config import WriteBackEsConfigComponent +from backend.flow.utils.es.es_context_dataclass import EsActKwargs, EsApplyContext +from backend.flow.utils.extension_manage import BigdataManagerKwargs + +logger = logging.getLogger("flow") + + +class EsFakeApplyFlow(EsFlow): + """ + 构建ES申请流程 + """ + + def __init__(self, root_id: str, data: Optional[Dict]): + """ + :param root_id: 任务流程定义的root_id + :param data: 单据传递过来的参数列表,字典格式 + """ + super().__init__(root_id, data) + self.cluster_alias = data.get("cluster_alias") + + # 定义证书文件分发的目标路径 + self.cer_target_path = "/data/install/" + self.file_list = ["/tmp/es_cerfiles.tar.gz"] + + def __get_flow_data(self) -> dict: + flow_data = self.get_flow_base_data() + flow_data["cluster_alias"] = self.cluster_alias + flow_data["nodes"] = self.nodes + return flow_data + + def fake_deploy_es_flow(self): + """ + 定义部署ES集群 + :return: + """ + + es_deploy_data = self.__get_flow_data() + es_pipeline = Builder(root_id=self.root_id, data=es_deploy_data) + + trans_files = GetFileList(db_type=DBType.Es) + + act_kwargs = EsActKwargs(bk_cloud_id=self.bk_cloud_id) + act_kwargs.set_trans_data_dataclass = EsApplyContext.__name__ + act_kwargs.file_list = trans_files.es_apply(db_version=self.db_version) + es_pipeline.add_act( + act_name=_("获取集群部署配置"), act_component_code=GetEsActPayloadComponent.code, kwargs=asdict(act_kwargs) + ) + + # 获取机器资源 + es_pipeline.add_act( + act_name=_("获取机器信息"), act_component_code=GetEsResourceComponent.code, kwargs=asdict(act_kwargs) + ) + + # 安装kibana + kibana_ip = get_node_in_ticket_preferred_hot(data=es_deploy_data) + + # 插入kibana实例信息 + manager_kwargs = BigdataManagerKwargs( + manager_op_type=ManagerOpType.CREATE, + db_type=DBType.Es, + service_type=ManagerServiceType.KIBANA, + manager_ip=kibana_ip, + manager_port=ManagerDefaultPort.KIBANA, + ) + es_pipeline.add_act( + act_name=_("插入kibana实例信息"), + act_component_code=BigdataManagerComponent.code, + kwargs={**asdict(act_kwargs), **asdict(manager_kwargs)}, + ) + + # 回写DBConfig + es_pipeline.add_act( + act_name=_("回写集群配置信息"), act_component_code=WriteBackEsConfigComponent.code, kwargs=asdict(act_kwargs) + ) + + # 添加到DBMeta并转模块 + es_pipeline.add_act( + act_name=_("添加到DBMeta"), act_component_code=EsMetaComponent.code, kwargs=asdict(act_kwargs) + ) + + es_pipeline.run_pipeline() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py new file mode 100644 index 0000000000..6d5a782a0b --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging.config +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.db_meta.enums import ClusterType +from backend.flow.consts import DEFAULT_FACTOR, DEFAULT_IP, ZK_CONF, KafkaActuatorActionEnum +from backend.flow.engine.bamboo.scene.common.builder import Builder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.plugins.components.collections.kafka.get_kafka_resource import GetKafkaResourceComponent +from backend.flow.plugins.components.collections.kafka.kafka_config import KafkaConfigComponent +from backend.flow.plugins.components.collections.kafka.kafka_db_meta import KafkaDBMetaComponent +from backend.flow.utils.kafka.kafka_act_playload import KafkaActPayload +from backend.flow.utils.kafka.kafka_context_dataclass import ActKwargs, ApplyContext + +logger = logging.getLogger("flow") + + +class KafkaFakeApplyFlow(object): + """ + 构建kafka申请流程的抽象类 + """ + + def __init__(self, root_id: str, data: Optional[Dict]): + """ + @param root_id : 任务流程定义的root_id + @param data : 单据传递过来的参数列表,是dict格式 + """ + self.root_id = root_id + self.data = data + # 写入cluster_type,转模块会使用 + self.data["cluster_type"] = ClusterType.Kafka.value + self.data["zookeeper_conf"] = self.__get_zookeeper_conf() + broker_num = len(self.data["nodes"]["broker"]) + if broker_num >= DEFAULT_FACTOR: + self.data["factor"] = DEFAULT_FACTOR + else: + self.data["factor"] = broker_num + + def __get_zookeeper_ip(self) -> str: + return ",".join([zookeeper["ip"] for zookeeper in self.data["nodes"]["zookeeper"]]) + + def __get_zookeeper_conf(self) -> str: + return "\n".join( + [ZK_CONF.format(i=i, zk_ip=zookeeper["ip"]) for i, zookeeper in enumerate(self.data["nodes"]["zookeeper"])] + ) + + def fake_deploy_kafka_flow(self): + """ + 定义部署kafka集群 + """ + zookeeper_ip = self.__get_zookeeper_ip() + self.data["zookeeper_ip"] = zookeeper_ip + kafka_pipeline = Builder(root_id=self.root_id, data=self.data) + trans_files = GetFileList(db_type=DBType.Kafka) + # 拼接活动节点需要的私有参数 + bk_cloud_id = self.data["bk_cloud_id"] + act_kwargs = ActKwargs(bk_cloud_id=bk_cloud_id) + act_kwargs.set_trans_data_dataclass = ApplyContext.__name__ + act_kwargs.file_list = trans_files.kafka_apply(db_version=self.data["db_version"]) + act_payload = KafkaActPayload(ticket_data=self.data, zookeeper_ip=zookeeper_ip) + act_kwargs.template = act_payload.get_payload(action=KafkaActuatorActionEnum.initKafka.value, host=DEFAULT_IP) + + # 获取机器资源 + kafka_pipeline.add_act( + act_name=_("获取机器信息"), act_component_code=GetKafkaResourceComponent.code, kwargs=asdict(act_kwargs) + ) + + kafka_pipeline.add_act( + act_name=_("更新DBMeta元信息"), act_component_code=KafkaDBMetaComponent.code, kwargs=asdict(act_kwargs) + ) + + kafka_pipeline.add_act( + act_name=_("回写kafka集群配置"), act_component_code=KafkaConfigComponent.code, kwargs=asdict(act_kwargs) + ) + + kafka_pipeline.run_pipeline() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/common_sub_flow.py index ba4a3f1de2..d75edac8e9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/common_sub_flow.py @@ -280,6 +280,7 @@ def build_surrounding_apps_sub_flow( "kwargs": asdict( DownloadBackupClientKwargs( bk_cloud_id=bk_cloud_id, + bk_biz_id=int(parent_global_data["bk_biz_id"]), download_host_list=list( filter(None, list(set(master_ip_list + slave_ip_list + proxy_ip_list))) ), diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py new file mode 100644 index 0000000000..8353701301 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py @@ -0,0 +1,191 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging.config +from dataclasses import asdict + +from django.utils.crypto import get_random_string +from django.utils.translation import ugettext as _ + +from backend.db_meta.enums import ClusterEntryType, InstanceInnerRole +from backend.db_meta.models import Cluster, ClusterEntry +from backend.flow.consts import ACCOUNT_PREFIX, AUTH_ADDRESS_DIVIDER, InstanceStatus +from backend.flow.engine.bamboo.scene.common.builder import SubBuilder +from backend.flow.plugins.components.collections.mysql.add_user_for_cluster_switch import AddSwitchUserComponent +from backend.flow.plugins.components.collections.mysql.clone_user import CloneUserComponent +from backend.flow.plugins.components.collections.mysql.dns_manage import MySQLDnsManageComponent +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.utils.mysql.mysql_act_dataclass import ( + AddSwitchUserKwargs, + CreateDnsKwargs, + ExecActuatorKwargs, + InstanceUserCloneKwargs, + RecycleDnsRecordKwargs, +) +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload +from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext + +logger = logging.getLogger("flow") + + +def master_and_slave_switch(root_id: str, ticket_data: dict, cluster: Cluster, cluster_info: dict): + """ + 定义成对迁移完成,做成对切换的子流程(子流程是已集群维度做成对切换) + 成对切换更多解决一主一从的集群机器裁撤场景;对于一主多从的集群, + 并不实现集群所有节点的替换,剩余的从实例节点需要同步新主的数据,保证集群数据一致性 + @param root_id: root id + @param ticket_data: 单据数据 + @param cluster_info: 输入集群信息 + @param cluster: 集群信息 + """ + + cluster_info["master_port"] = cluster_info["mysql_port"] + cluster_info["slave_port"] = cluster_info["mysql_port"] + cluster_info["slave_ip"] = cluster_info["old_slave_ip"] + cluster_info["master_ip"] = cluster_info["old_master_ip"] + + # 随机生成切换测试账号和密码 + switch_account = f"{ACCOUNT_PREFIX}{get_random_string(length=8)}" + switch_pwd = get_random_string(length=16) + # 拼接子流程需要全局参数 + switch_sub_flow_context = copy.deepcopy(ticket_data) + # 把公共参数拼接到子流程的全局只读上下文 + switch_sub_flow_context["is_safe"] = True + switch_sub_flow_context["is_dead_master"] = False + switch_sub_flow_context["grant_repl"] = True + switch_sub_flow_context["locked_switch"] = True + switch_sub_flow_context["switch_pwd"] = switch_pwd + switch_sub_flow_context["switch_account"] = switch_account + + # 针对集群维度声明子流程 + cluster_switch_sub_pipeline = SubBuilder(root_id=root_id, data=copy.deepcopy(switch_sub_flow_context)) + + # todo ?授权切换账号 + add_sw_user_kwargs = AddSwitchUserKwargs( + bk_cloud_id=cluster.bk_cloud_id, + user=switch_account, + psw=switch_pwd, + hosts=[cluster_info["new_master_ip"]], + ) + acts_list = [] + add_sw_user_kwargs.address = f"{cluster_info['old_master_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}" + acts_list.append( + { + "act_name": _("给master添加切换临时账号"), + "act_component_code": AddSwitchUserComponent.code, + "kwargs": asdict(add_sw_user_kwargs), + } + ) + add_sw_user_kwargs.address = f"{cluster_info['new_slave_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}" + acts_list.append( + { + "act_name": _("给新slave添加切换临时账号"), + "act_component_code": AddSwitchUserComponent.code, + "kwargs": asdict(add_sw_user_kwargs), + } + ) + cluster_switch_sub_pipeline.add_parallel_acts(acts_list=acts_list) + + clone_kwargs = InstanceUserCloneKwargs( + clone_data=[ + { + "source": f"{cluster_info['old_master_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}", + "target": f"{cluster_info['new_master_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}", + "bk_cloud_id": cluster.bk_cloud_id, + }, + { + "source": f"{cluster_info['old_slave_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}", + "target": f"{cluster_info['new_slave_ip']}{AUTH_ADDRESS_DIVIDER}{cluster_info['mysql_port']}", + "bk_cloud_id": cluster.bk_cloud_id, + }, + ] + ) + cluster_switch_sub_pipeline.add_act( + act_name=_("新master克隆旧master权限,新slave克隆旧slave权限"), + act_component_code=CloneUserComponent.code, + kwargs=asdict(clone_kwargs), + ) + + # 代理层、账号等等。 + mysql_proxy = cluster.proxyinstance_set.all() + domain = ClusterEntry.get_cluster_entry_map_by_cluster_ids([cluster.id]) + mysql_storage_slave = cluster.storageinstance_set.filter( + instance_inner_role=InstanceInnerRole.SLAVE.value, status=InstanceStatus.RUNNING.value + ) + cluster_info["other_slave_info"] = [ + y.machine.ip for y in mysql_storage_slave.exclude(machine__ip=cluster_info["old_slave_ip"]) + ] + cluster_info["master_domain"] = domain[cluster.id]["master_domain"] + cluster_info["slave_domain"] = domain[cluster.id]["slave_domain"] + cluster_info["proxy_ip_list"] = [x.machine.ip for x in mysql_proxy] + cluster_info["proxy_port"] = mysql_proxy[0].port + + cluster_sw_kwargs = ExecActuatorKwargs(cluster=cluster_info, bk_cloud_id=cluster.bk_cloud_id) + cluster_sw_kwargs.exec_ip = cluster_info["new_master_ip"] + cluster_sw_kwargs.get_mysql_payload_func = MysqlActPayload.get_set_backend_toward_slave_payload.__name__ + cluster_switch_sub_pipeline.add_act( + act_name=_("执行集群切换"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(cluster_sw_kwargs), + write_payload_var=ClusterInfoContext.get_sync_info_var_name(), + ) + + # 并发change master 的 原子任务,集群所有的slave节点同步new master 的数据 + if cluster_info["other_slave_info"]: + # 如果集群存在其他slave节点,则建立新的你主从关系 + acts_list = [] + for exec_ip in cluster_info["other_slave_info"]: + cluster_sw_kwargs.exec_ip = exec_ip + cluster_sw_kwargs.get_mysql_payload_func = MysqlActPayload.get_change_master_payload.__name__ + acts_list.append( + { + "act_name": _("其余slave节点同步新master数据"), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(cluster_sw_kwargs), + } + ) + cluster_switch_sub_pipeline.add_parallel_acts(acts_list=acts_list) + + # 更改旧slave 和 新slave 的域名映射关系,并发执行 + acts_list = [ + { + "act_name": _("回收旧slave的域名映射"), + "act_component_code": MySQLDnsManageComponent.code, + "kwargs": asdict( + RecycleDnsRecordKwargs( + dns_op_exec_port=cluster_info["mysql_port"], + exec_ip=cluster_info["old_slave_ip"], + bk_cloud_id=cluster_info["bk_cloud_id"], + ) + ), + } + ] + old_slave = cluster.storageinstance_set.get(machine__ip=cluster_info["old_slave_ip"]) + slave_dns_list = old_slave.bind_entry.filter(cluster_entry_type=ClusterEntryType.DNS.value).all() + cluster_info["slave_dns_list"] = [i.entry for i in slave_dns_list] + for slave_domain in cluster_info["slave_dns_list"]: + acts_list.append( + { + "act_name": _("对新slave添加域名映射"), + "act_component_code": MySQLDnsManageComponent.code, + "kwargs": asdict( + CreateDnsKwargs( + bk_cloud_id=cluster_info["bk_cloud_id"], + dns_op_exec_port=cluster_info["mysql_port"], + exec_ip=cluster_info["new_slave_ip"], + add_domain_name=slave_domain, + ) + ), + } + ) + + cluster_switch_sub_pipeline.add_parallel_acts(acts_list=acts_list) + + return cluster_switch_sub_pipeline.build_sub_process(sub_name=_("{}集群执行成对切换").format(cluster_info["cluster_id"])) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py new file mode 100644 index 0000000000..aa0c6ca534 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging +from dataclasses import asdict +from datetime import datetime + +from django.utils.translation import ugettext as _ + +from backend.db_meta.enums import ClusterType +from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler +from backend.flow.consts import MysqlChangeMasterType +from backend.flow.engine.bamboo.scene.common.builder import SubBuilder +from backend.flow.engine.bamboo.scene.spider.common.exceptions import TendbGetBackupInfoFailedException +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_download_backupfile import ( + MySQLDownloadBackupfileComponent, +) +from backend.flow.utils.mysql.mysql_act_dataclass import DownloadBackupFileKwargs, ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload + +logger = logging.getLogger("flow") + + +def slave_recover_sub_flow(root_id: str, ticket_data: dict, cluster_info: dict): + """ + tendb remote slave 节点 恢复。(只做流程,元数据请在主流程控制) + @param root_id: flow流程的root_id + @param ticket_data: 关联单据 ticket对象 + @param cluster_info: 关联的cluster对象 + """ + + sub_pipeline = SubBuilder(root_id=root_id, data=ticket_data) + # 下发dbactor》通过master/slave 获取备份的文件》判断备份文件》恢复数据》change master + cluster = { + "cluster_id": cluster_info["cluster_id"], + "master_ip": cluster_info["master_ip"], + "master_port": cluster_info["master_port"], + "new_slave_ip": cluster_info["new_slave_ip"], + "new_slave_port": cluster_info["new_slave_port"], + "bk_cloud_id": cluster_info["bk_cloud_id"], + "file_target_path": cluster_info["file_target_path"], + "change_master_force": cluster_info["change_master_force"], + "charset": cluster_info["charset"], + "cluster_type": cluster_info["cluster_type"], + } + # 查询备份 + rollback_time = datetime.now() + rollback_handler = FixPointRollbackHandler(cluster_id=cluster["cluster_id"]) + backup_info = rollback_handler.query_latest_backup_log(rollback_time) + if backup_info is None: + logger.error("cluster {} backup info not exists".format(cluster["cluster_id"])) + raise TendbGetBackupInfoFailedException(message=_("获取集群 {} 的备份信息失败".format(cluster["cluster_id"]))) + + # todo 兼容spider。后续需改接口 + if cluster["cluster_type"] == ClusterType.TenDBCluster: + cluster["shard_id"] = cluster_info["shard_id"] + backup_info = backup_info["remote_node"][cluster["shard_id"]] + cluster["backupinfo"] = backup_info + + exec_act_kwargs = ExecActuatorKwargs( + bk_cloud_id=int(cluster["bk_cloud_id"]), + cluster_type=cluster["cluster_type"], + cluster=cluster, + ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.mysql_mkdir_dir.__name__ + exec_act_kwargs.exec_ip = cluster["new_slave_ip"] + sub_pipeline.add_act( + act_name=_("创建目录 {}".format(cluster["file_target_path"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + + # 新从库下载备份介质 下载为异步下载,定时调起接口扫描下载结果 + task_ids = [i["task_id"] for i in backup_info["file_list_details"]] + download_kwargs = DownloadBackupFileKwargs( + bk_cloud_id=cluster["bk_cloud_id"], + task_ids=task_ids, + dest_ip=cluster["new_slave_ip"], + desc_dir=cluster["file_target_path"], + reason="slave recover", + ) + sub_pipeline.add_act( + act_name=_("下载全库备份介质到 {}".format(cluster["new_slave_ip"])), + act_component_code=MySQLDownloadBackupfileComponent.code, + kwargs=asdict(download_kwargs), + ) + + # 阶段4 恢复数据remote主从节点的数据 + cluster["restore_ip"] = cluster["new_slave_ip"] + cluster["restore_port"] = cluster["new_slave_port"] + cluster["source_ip"] = cluster["master_ip"] + cluster["source_port"] = cluster["master_port"] + cluster["change_master"] = False + exec_act_kwargs.cluster = copy.deepcopy(cluster) + exec_act_kwargs.exec_ip = cluster["new_slave_ip"] + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_restore_remotedb_payload.__name__ + sub_pipeline.add_act( + act_name=_("恢复新从节点数据 {}:{}".format(exec_act_kwargs.exec_ip, cluster["restore_port"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + write_payload_var="change_master_info", + ) + + # 阶段5 change master: 新从库指向旧主库 + cluster["target_ip"] = cluster["master_ip"] + cluster["target_port"] = cluster["master_port"] + cluster["repl_ip"] = cluster["new_slave_ip"] + exec_act_kwargs.cluster = copy.deepcopy(cluster) + exec_act_kwargs.exec_ip = cluster["master_ip"] + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_grant_remotedb_repl_user.__name__ + sub_pipeline.add_act( + act_name=_("新增repl帐户{}".format(exec_act_kwargs.exec_ip)), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + + cluster["repl_ip"] = cluster["new_slave_ip"] + cluster["repl_port"] = cluster["new_slave_port"] + cluster["target_ip"] = cluster["master_ip"] + cluster["target_port"] = cluster["master_port"] + cluster["change_master_type"] = MysqlChangeMasterType.BACKUPFILE.value + exec_act_kwargs.cluster = copy.deepcopy(cluster) + exec_act_kwargs.exec_ip = cluster["new_slave_ip"] + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_remotedb_change_master.__name__ + sub_pipeline.add_act( + act_name=_("建立主从关系:新主库指向旧主库 {}:{}".format(exec_act_kwargs.exec_ip, cluster["repl_port"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + return sub_pipeline.build_sub_process(sub_name=_("RemoteDB从节点重建子流程{}".format(exec_act_kwargs.exec_ip))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py new file mode 100644 index 0000000000..8b899b9724 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py @@ -0,0 +1,132 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from dataclasses import asdict + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.constants import IP_PORT_DIVIDER +from backend.db_meta.enums import MachineType +from backend.db_meta.models import Cluster, ClusterEntry +from backend.flow.engine.bamboo.scene.common.builder import SubBuilder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.engine.bamboo.scene.mysql.common.common_sub_flow import check_sub_flow +from backend.flow.plugins.components.collections.mysql.clone_user import CloneUserComponent +from backend.flow.plugins.components.collections.mysql.dns_manage import MySQLDnsManageComponent +from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent +from backend.flow.utils.mysql.mysql_act_dataclass import ( + CreateDnsKwargs, + DownloadMediaKwargs, + InstanceUserCloneKwargs, + RecycleDnsRecordKwargs, +) + +""" +tendb ha 从库恢复切换 +""" + + +def slave_migrate_switch_sub_flow( + root_id: str, + ticket_data: dict, + cluster: Cluster, + old_slave_ip: str, + new_slave_ip: str, +): + """""" + # 默认预检测连接情况、同步延时、checksum校验结果 + domain = ClusterEntry.get_cluster_entry_map_by_cluster_ids([cluster.id]) + master = cluster.main_storage_instances()[0] + old_slave = ("{}{}{}".format(old_slave_ip, IP_PORT_DIVIDER, master.port),) + new_slave = ("{}{}{}".format(new_slave_ip, IP_PORT_DIVIDER, master.port),) + old_master = ("{}{}{}".format(master.machine.ip, IP_PORT_DIVIDER, master.port),) + # cluster["master_domain"] = domain[cluster.id]["master_domain"] + # cluster["slave_domain"] = domain[cluster.id]["slave_domain"] + + sub_pipeline = SubBuilder(root_id=root_id, data=ticket_data) + sub_pipeline.add_act( + act_name=_("下发db-actuator介质"), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=cluster.bk_cloud_id, + exec_ip=[master.machine.ip, new_slave_ip], + file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + ) + ), + ) + + # 切换前做预检测 + verify_checksum_tuples = [] + # for m in migrate_tuples: + # old_master-> new_master ; new_master -> new_slave 都需要检测checksum结果 + verify_checksum_tuples.append({"master": old_master, "slave": new_slave}) + sub_pipeline.add_sub_pipeline( + sub_flow=check_sub_flow( + uid=ticket_data["uid"], + root_id=root_id, + cluster=cluster, + is_check_client_conn=True, + is_verify_checksum=True, + check_client_conn_inst=["{}:{}".format(new_slave_ip, master.port)], + verify_checksum_tuples=verify_checksum_tuples, + ) + ) + + clone_data = [] + clone_data.append( + { + "source": old_master, + "target": new_slave, + # "machine_type": MachineType.REMOTE.value, + "bk_cloud_id": cluster.bk_cloud_id, + } + ) + + clone_data.append( + { + "source": old_slave, + "target": new_slave, + # "machine_type": MachineType.REMOTE.value, + "bk_cloud_id": cluster.bk_cloud_id, + } + ) + + sub_pipeline.add_act( + act_name=_("克隆权限"), + act_component_code=CloneUserComponent.code, + kwargs=asdict(InstanceUserCloneKwargs(clone_data=clone_data)), + ) + + sub_pipeline.add_act( + act_name=_("先添加新从库域名{}").format(new_slave_ip), + act_component_code=MySQLDnsManageComponent.code, + kwargs=asdict( + CreateDnsKwargs( + bk_cloud_id=cluster.bk_cloud_id, + dns_op_exec_port=master.port, + exec_ip=new_slave_ip, + add_domain_name=domain[cluster.id]["slave_domain"], + ) + ), + ) + + sub_pipeline.add_act( + act_name=_("再删除旧从库域名{}").format(new_slave_ip), + act_component_code=MySQLDnsManageComponent.code, + kwargs=asdict( + RecycleDnsRecordKwargs( + dns_op_exec_port=master.port, + exec_ip=old_slave_ip, + bk_cloud_id=cluster.bk_cloud_id, + ) + ), + ) + return sub_pipeline.build_sub_process(sub_name=_("[{}]成对切换".format(cluster.name))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py new file mode 100644 index 0000000000..7460a7afed --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from dataclasses import asdict + +from django.utils.translation import ugettext as _ + +from backend.flow.engine.bamboo.scene.common.builder import SubBuilder +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.utils.mysql.mysql_act_dataclass import ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload +from backend.flow.utils.spider.tendb_cluster_info import get_remotedb_info + + +def uninstall_instance_sub_flow(root_id: str, ticket_data: dict, ip: str, ports: list = None): + """ + 卸载remotedb 指定ip节点下的所有实例 + @param root_id: flow流程的root_id + @param ticket_data: 单据 data 对象 + @param ip: 指定卸载的ip + @param ports: 指定卸载端口,如果None,表明卸载该ip下所有实例 + """ + sub_pipeline = SubBuilder(root_id=root_id, data=ticket_data) + cluster = {"uninstall_ip": ip, "bk_cloud_id": ticket_data["bk_cloud_id"]} + instances = get_remotedb_info(cluster["uninstall_ip"], cluster["bk_cloud_id"]) + sub_pipeline_list = [] + for instance in instances: + if ports is not None and instance["port"] not in ports: + continue + cluster["backend_port"] = instance["port"] + sub_pipeline_list.append( + { + "act_name": _("卸载MySQL实例:{}:{}".format(cluster["uninstall_ip"], cluster["backend_port"])), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict( + ExecActuatorKwargs( + exec_ip=cluster["uninstall_ip"], + bk_cloud_id=cluster["bk_cloud_id"], + cluster=cluster, + get_mysql_payload_func=MysqlActPayload.get_uninstall_mysql_payload.__name__, + ) + ), + } + ) + sub_pipeline.add_parallel_acts(sub_pipeline_list) + return sub_pipeline.build_sub_process(sub_name=_("Remote node {} 卸载整机实例".format(cluster["uninstall_ip"]))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py index 85ece12172..a3ecada412 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py @@ -135,8 +135,9 @@ def sql_semantic_check_flow(self): ) template_cluster = self.__get_master_instance_info(cluster_id=self.data["cluster_ids"][0]) + cluster_type = template_cluster["cluster_type"] template_db_version = self.__get_version_and_charset( - db_module_id=template_cluster["db_module_id"], cluster_type=template_cluster["cluster_type"] + db_module_id=template_cluster["db_module_id"], cluster_type=cluster_type ) backend_ip = template_cluster["backend_ip"] backend_port = template_cluster["port"] @@ -174,7 +175,7 @@ def sql_semantic_check_flow(self): act_component_code=SemanticCheckComponent.code, kwargs={ "cluster": template_cluster, - "" + "cluster_type": cluster_type, "payload": { "uid": self.data["uid"], "mysql_version": template_db_version, diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py new file mode 100644 index 0000000000..77cfe6c13f --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import copy +import logging +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.db_meta.enums import ClusterType +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder, SubProcess +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.plugins.components.collections.common.pause import PauseComponent +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_ha_import_metadata import MySQLHAImportMetadataComponent +from backend.flow.plugins.components.collections.mysql.mysql_ha_modify_cluster_phase import ( + MySQLHAModifyClusterPhaseComponent, +) +from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent +from backend.flow.utils.mysql.mysql_act_dataclass import DownloadMediaKwargs, ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload +from backend.flow.utils.mysql.mysql_context_dataclass import MySQLHAImportMetadataContext + +logger = logging.getLogger("flow") + + +class TenDBHAMetadataImportFlow(object): + def __init__(self, root_id: str, data: Optional[Dict]): + self.root_id = root_id + self.data = data + + def import_meta(self): + """ + 很多检查都前置了, 能走到这里可以认为基本没啥问题 + 尝试无脑导入 + """ + import_pipe = Builder(root_id=self.root_id, data=self.data) + + import_pipe_sub = SubBuilder(root_id=self.root_id, data=self.data) + + import_pipe_sub.add_act( + act_name=_("写入元数据"), + act_component_code=MySQLHAImportMetadataComponent.code, + kwargs={**copy.deepcopy(self.data)}, + ) + + proxy_machines = [] + storage_machines = [] + for cluster_json in self.data["json_content"]: + proxy_machines += [ele["ip"] for ele in cluster_json["proxies"]] + storage_machines.append(cluster_json["master"]["ip"]) + storage_machines += [ele["ip"] for ele in cluster_json["slaves"]] + + proxy_machines = list(set(proxy_machines)) + storage_machines = list(set(storage_machines)) + + # 不做这个, 导入后有独立单据做 + # import_pipe.add_parallel_sub_pipeline( + # sub_flow_list=[ + # self._build_install_dbatool_sub(ips=proxy_machines, is_proxy=True), + # self._build_install_dbatool_sub(ips=storage_machines, is_proxy=False), + # ] + # ) + + import_pipe_sub.add_act(act_name=_("人工确认"), act_component_code=PauseComponent.code, kwargs={}) + + import_pipe_sub.add_act( + act_name=_("修改集群状态"), act_component_code=MySQLHAModifyClusterPhaseComponent.code, kwargs={} + ) + + import_pipe.add_sub_pipeline(sub_flow=import_pipe_sub.build_sub_process(sub_name=_("TenDBHA 元数据导入"))) + + logger.info(_("构建TenDBHA元数据导入流程成功")) + import_pipe.run_pipeline(init_trans_data_class=MySQLHAImportMetadataContext()) + + # def _build_install_dbatool_sub(self, ips: List[str], is_proxy: bool) -> SubProcess: + # bk_cloud_id = 0 + # cluster_type = ClusterType.TenDBHA.value + # + # pipes = [] + # + # for ip in ips: + # pipe = SubBuilder(root_id=self.root_id, data=self.data) + # + # pipe.add_act( + # act_name=_("下发MySQL周边程序介质"), + # act_component_code=TransFileComponent.code, + # kwargs=asdict( + # DownloadMediaKwargs( + # bk_cloud_id=bk_cloud_id, + # exec_ip=ip, + # file_list=GetFileList(db_type=DBType.MySQL).get_mysql_surrounding_apps_package(), + # ) + # ), + # ) + # pipe.add_act( + # act_name=_("下发actuator介质"), + # act_component_code=TransFileComponent.code, + # kwargs=asdict( + # DownloadMediaKwargs( + # bk_cloud_id=bk_cloud_id, + # exec_ip=ip, + # file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + # ) + # ), + # ) + # pipe.add_act( + # act_name=_("部署mysql-crond"), + # act_component_code=ExecuteDBActuatorScriptComponent.code, + # kwargs=asdict( + # ExecActuatorKwargs( + # exec_ip=ip, + # bk_cloud_id=bk_cloud_id, + # get_mysql_payload_func=MysqlActPayload.get_deploy_mysql_crond_payload.__name__, + # cluster_type=cluster_type, + # ) + # ), + # ) + # pipe.add_act( + # act_name=_("部署监控程序"), + # act_component_code=ExecuteDBActuatorScriptComponent.code, + # kwargs=asdict( + # ExecActuatorKwargs( + # exec_ip=ip, + # bk_cloud_id=bk_cloud_id, + # get_mysql_payload_func=MysqlActPayload.get_deploy_mysql_monitor_payload.__name__, + # cluster_type=cluster_type, + # ) + # ), + # ) + # + # if not is_proxy: + # pipe.add_act( + # act_name=_("部署备份程序"), + # act_component_code=ExecuteDBActuatorScriptComponent.code, + # kwargs=asdict( + # ExecActuatorKwargs( + # exec_ip=ip, + # bk_cloud_id=bk_cloud_id, + # get_mysql_payload_func=MysqlActPayload.get_install_db_backup_payload.__name__, + # cluster_type=cluster_type, + # ) + # ), + # ) + # + # pipe.add_act( + # act_name=_("部署rotate binlog"), + # act_component_code=ExecuteDBActuatorScriptComponent.code, + # kwargs=asdict( + # ExecActuatorKwargs( + # exec_ip=ip, + # bk_cloud_id=bk_cloud_id, + # get_mysql_payload_func=MysqlActPayload.get_install_mysql_rotatebinlog_payload.__name__, + # cluster_type=cluster_type, + # ) + # ), + # ) + # + # pipe.add_act( + # act_name=_("部署数据校验程序"), + # act_component_code=ExecuteDBActuatorScriptComponent.code, + # kwargs=asdict( + # ExecActuatorKwargs( + # exec_ip=ip, + # bk_cloud_id=bk_cloud_id, + # get_mysql_payload_func=MysqlActPayload.get_install_mysql_checksum_payload.__name__, + # cluster_type=cluster_type, + # ) + # ), + # ) + # + # pipes.append(pipe.build_sub_process(sub_name=_("{} 部署dba工具".format(ip)))) + # + # p = SubBuilder(root_id=self.root_id, data=self.data) + # p.add_parallel_sub_pipeline(sub_flow_list=pipes) + # return p.build_sub_process(sub_name=_("部署 dba 工具")) + + +# @transaction.atomic +# def clear_trans_stage(cluster_ids: List[int]): +# StorageInstanceTuple.objects.filter( +# Q(ejector__cluster__in=cluster_ids) +# & Q(ejector__phase=InstancePhase.TRANS_STAGE.value) +# & Q(ejector__cluster__phase=ClusterPhase.TRANS_STAGE) +# ).delete() +# +# # 这样其实不对, 因为延迟执行, 等到删除 machine 的时候已经找不到了 +# machines = Machine.objects.filter( +# Q( +# Q(proxyinstance__cluster__in=cluster_ids) +# & Q(proxyinstance__cluster__phase=ClusterPhase.TRANS_STAGE.value) +# & Q(proxyinstance__phase=InstancePhase.TRANS_STAGE.value) +# ) +# | Q( +# Q(storageinstance__cluster__in=cluster_ids) +# & Q(storageinstance__cluster__phase=ClusterPhase.TRANS_STAGE.value) +# & Q(storageinstance__phase=InstancePhase.TRANS_STAGE.value) +# ) +# ) +# +# +# StorageInstance.objects.filter( +# Q(cluster__in=cluster_ids) +# & Q(cluster__phase=ClusterPhase.TRANS_STAGE.value) +# & Q(phase=InstancePhase.TRANS_STAGE.value) +# ).delete() +# +# ProxyInstance.objects.filter( +# Q(cluster__in=cluster_ids) +# & Q(cluster__phase=ClusterPhase.TRANS_STAGE.value) +# & Q(phase=InstancePhase.TRANS_STAGE.value) +# ).delete() +# +# print(machines) +# machines.delete() +# # try: +# # machines.delete() +# # except ProtectedError: +# # pass +# +# ClusterEntry.objects.filter( +# Q(cluster__in=cluster_ids) & Q(cluster__phase=ClusterPhase.TRANS_STAGE.value)).delete() +# Cluster.objects.filter(Q(id__in=cluster_ids) & Q(phase=ClusterPhase.TRANS_STAGE.value)).delete() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py index dcc9419e6a..e4b570b796 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py @@ -77,7 +77,7 @@ def _build_trans_module_sub(self, clusters: List[Cluster]) -> SubProcess: root_id=self.root_id, data={**copy.deepcopy(self.data), "cluster_id": cluster.id} ) cluster_pipe.add_act( - act_name=_(""), act_component_code=ClusterStandardizeTransModuleComponent.code, kwargs={} + act_name=_("模块标准化"), act_component_code=ClusterStandardizeTransModuleComponent.code, kwargs={} ) pipes.append(cluster_pipe.build_sub_process(sub_name=_("{} CC 模块标准化".format(cluster.immute_domain)))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py new file mode 100644 index 0000000000..c74fbb8919 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py @@ -0,0 +1,320 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import copy +import logging.config +from dataclasses import asdict +from datetime import datetime +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.db_meta.enums import ClusterType, InstanceInnerRole +from backend.db_meta.models import Cluster +from backend.db_package.models import Package +from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler +from backend.flow.consts import MediumEnum +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.engine.bamboo.scene.mysql.common.common_sub_flow import ( + build_surrounding_apps_sub_flow, + install_mysql_in_cluster_sub_flow, +) +from backend.flow.engine.bamboo.scene.mysql.common.master_and_slave_switch import master_and_slave_switch +from backend.flow.engine.bamboo.scene.mysql.common.uninstall_instance import uninstall_instance_sub_flow +from backend.flow.engine.bamboo.scene.spider.common.exceptions import TendbGetBackupInfoFailedException +from backend.flow.engine.bamboo.scene.spider.spider_remote_node_migrate import remote_instance_migrate_sub_flow +from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent +from backend.flow.plugins.components.collections.common.pause import PauseComponent +from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent +from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs +from backend.flow.utils.mysql.common.mysql_cluster_info import get_ports, get_version_and_charset +from backend.flow.utils.mysql.mysql_act_dataclass import ClearMachineKwargs, DBMetaOPKwargs, ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload +from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext +from backend.flow.utils.mysql.mysql_db_meta import MySQLDBMeta + +logger = logging.getLogger("flow") + + +class MySQLMigrateClusterRemoteFlow(object): + """ + 构建mysql主从成对迁移抽象类 + 支持多云区域操作 + """ + + def __init__(self, root_id: str, data: Optional[Dict]): + """ + @param root_id : 任务流程定义的root_id + @param data : 单据传递参数 + """ + self.root_id = root_id + self.ticket_data = data + self.data = {} + + # 定义备份文件存放到目标机器目录位置 + self.backup_target_path = f"/data/dbbak/{self.root_id}" + + def migrate_cluster_flow(self): + """ + 成对迁移集群主从节点。 + 元数据信息修改顺序: + 1 mysql_migrate_cluster_add_instance + 2 mysql_migrate_cluster_add_tuple + 3 mysql_migrate_cluster_switch_storage + """ + # 构建流程 + tendb_migrate_pipeline_all = Builder(root_id=self.root_id, data=copy.deepcopy(self.ticket_data)) + # 按照传入的infos信息,循环拼接子流程 + tendb_migrate_pipeline_list = [] + for info in self.ticket_data["infos"]: + self.data = copy.deepcopy(info) + cluster_class = Cluster.objects.get(id=self.data["cluster_ids"][0]) + # 确定要迁移的主节点,从节点. + master = cluster_class.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + slave = cluster_class.storageinstance_set.filter( + instance_inner_role=InstanceInnerRole.SLAVE.value, is_stand_by=True + ).first() + self.data["master_ip"] = master.machine.ip + self.data["cluster_type"] = cluster_class.cluster_type + self.data["slave_ip"] = slave.machine.ip + self.data["mysql_port"] = master.port + self.data["bk_biz_id"] = cluster_class.bk_biz_id + self.data["bk_cloud_id"] = cluster_class.bk_cloud_id + self.data["db_module_id"] = cluster_class.db_module_id + self.data["time_zone"] = cluster_class.time_zone + self.data["created_by"] = self.ticket_data["created_by"] + self.data["module"] = self.ticket_data["module"] + self.data["ticket_type"] = self.ticket_data["ticket_type"] + self.data["uid"] = self.ticket_data["uid"] + self.data["package"] = Package.get_latest_package( + version=cluster_class.major_version, pkg_type=MediumEnum.MySQL, db_type=DBType.MySQL + ) + self.data["ports"] = get_ports(info["cluster_ids"]) + self.data["force"] = info.get("force", False) + self.data["charset"], self.data["db_version"] = get_version_and_charset( + self.data["bk_biz_id"], + db_module_id=self.data["db_module_id"], + cluster_type=self.data["cluster_type"], + ) + tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + # 整机安装数据库 + install_sub_pipeline_list = [] + install_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + install_sub_pipeline.add_sub_pipeline( + sub_flow=install_mysql_in_cluster_sub_flow( + uid=self.data["uid"], + root_id=self.root_id, + cluster=cluster_class, + new_mysql_list=[self.data["new_slave_ip"], self.data["new_master_ip"]], + install_ports=self.data["ports"], + ) + ) + + # 写入元数据 + cluster = { + "cluster_ports": self.data["ports"], + "new_master_ip": self.data["new_master_ip"], + "new_slave_ip": self.data["new_slave_ip"], + "bk_cloud_id": self.data["bk_cloud_id"], + } + install_sub_pipeline.add_act( + act_name=_("安装完毕,写入初始化实例的db_meta元信息"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.migrate_cluster_add_instance.__name__, + cluster=cluster, + is_update_trans_data=True, + ) + ), + ) + install_sub_pipeline.add_act( + act_name=_("安装backup-client工具"), + act_component_code=DownloadBackupClientComponent.code, + kwargs=asdict( + DownloadBackupClientKwargs( + bk_cloud_id=cluster_class.bk_cloud_id, + bk_biz_id=int(cluster_class.bk_biz_id), + download_host_list=[cluster["new_master_ip"], cluster["new_slave_ip"]], + ) + ), + ) + + exec_act_kwargs = ExecActuatorKwargs( + cluster=cluster, + bk_cloud_id=cluster_class.bk_cloud_id, + cluster_type=cluster_class.cluster_type, + get_mysql_payload_func=MysqlActPayload.get_install_tmp_db_backup_payload.__name__, + ) + exec_act_kwargs.exec_ip = [cluster["new_master_ip"], cluster["new_slave_ip"]] + install_sub_pipeline.add_act( + act_name=_("安装临时备份程序"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + install_sub_pipeline_list.append(install_sub_pipeline.build_sub_process(sub_name=_("安装实例"))) + + sync_data_sub_pipeline_list = [] + for cluster_id in self.data["cluster_ids"]: + cluster_model = Cluster.objects.get(id=cluster_id) + master = cluster_model.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + # 查询备份 + rollback_time = datetime.now() + rollback_handler = FixPointRollbackHandler(cluster_id=cluster_model.id) + backup_info = rollback_handler.query_latest_backup_log(rollback_time) + if backup_info is None: + logger.error("cluster {} backup info not exists".format(cluster_model.id)) + raise TendbGetBackupInfoFailedException(message=_("获取集群 {} 的备份信息失败".format(cluster["cluster_id"]))) + cluster["backupinfo"] = backup_info + cluster["new_master_ip"] = self.data["new_master_ip"] + cluster["new_slave_ip"] = self.data["new_slave_ip"] + cluster["new_master_port"] = master.port + cluster["new_slave_port"] = master.port + cluster["master_ip"] = self.data["master_ip"] + cluster["slave_ip"] = self.data["slave_ip"] + cluster["master_port"] = master.port + cluster["slave_port"] = master.port + cluster["file_target_path"] = f"/data/dbbak/{self.root_id}/{master.port}" + cluster["cluster_id"] = cluster_model.id + cluster["bk_cloud_id"] = cluster_model.bk_cloud_id + cluster["change_master_force"] = False + cluster["charset"] = self.data["charset"] + + sync_data_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + sync_data_sub_pipeline.add_sub_pipeline( + sub_flow=remote_instance_migrate_sub_flow( + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=cluster + ) + ) + sync_data_sub_pipeline.add_act( + act_name=_("数据恢复完毕,写入新主节点和旧主节点的关系链元数据"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.migrate_cluster_add_tuple.__name__, + cluster=cluster, + is_update_trans_data=True, + ) + ), + ) + sync_data_sub_pipeline_list.append(sync_data_sub_pipeline.build_sub_process(sub_name=_("恢复实例数据"))) + + # 安装周边 + surrounding_sub_pipeline_list = [] + surrounding_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + surrounding_sub_pipeline.add_sub_pipeline( + sub_flow=build_surrounding_apps_sub_flow( + bk_cloud_id=cluster_class.bk_cloud_id, + master_ip_list=None, + slave_ip_list=[self.data["new_slave_ip"], self.data["new_master_ip"]], + root_id=self.root_id, + parent_global_data=copy.deepcopy(self.data), + is_init=True, + cluster_type=ClusterType.TenDBHA.value, + ) + ) + surrounding_sub_pipeline_list.append(surrounding_sub_pipeline.build_sub_process(sub_name=_("新机器安装周边组件"))) + switch_sub_pipeline_list = [] + for cluster_id in self.data["cluster_ids"]: + switch_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + cluster_model = Cluster.objects.get(id=cluster_id) + cluster = { + "cluster_id": cluster_model.id, + "bk_cloud_id": cluster_model.bk_cloud_id, + "old_master_ip": self.data["master_ip"], + "old_master_port": self.data["mysql_port"], + "old_slave_ip": self.data["slave_ip"], + "old_slave_port": self.data["mysql_port"], + "new_master_ip": self.data["new_master_ip"], + "new_master_port": self.data["mysql_port"], + "new_slave_ip": self.data["new_slave_ip"], + "new_slave_port": self.data["mysql_port"], + "mysql_port": self.data["mysql_port"], + } + switch_sub_pipeline.add_sub_pipeline( + sub_flow=master_and_slave_switch( + root_id=self.root_id, + ticket_data=copy.deepcopy(self.data), + cluster=cluster_model, + cluster_info=cluster, + ) + ) + switch_sub_pipeline.add_act( + act_name=_("集群切换完成,写入 {} 的元信息".format(cluster_model.id)), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.mysql_migrate_cluster_switch_storage.__name__, + cluster=cluster, + is_update_trans_data=True, + ) + ), + ) + switch_sub_pipeline_list.append( + switch_sub_pipeline.build_sub_process(sub_name=_("集群 {} 切换".format(cluster_model.id))) + ) + # 第四步 卸载实例 + uninstall_svr_sub_pipeline_list = [] + for ip in [self.data["slave_ip"], self.data["master_ip"]]: + uninstall_svr_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + uninstall_svr_sub_pipeline.add_sub_pipeline( + sub_flow=uninstall_instance_sub_flow( + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), ip=ip, ports=self.data["ports"] + ) + ) + cluster = {"uninstall_ip": ip, "ports": self.data["ports"], "bk_cloud_id": self.data["bk_cloud_id"]} + uninstall_svr_sub_pipeline.add_act( + act_name=_("整机卸载成功后删除元数据"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.uninstall_instance.__name__, + is_update_trans_data=True, + cluster=cluster, + ) + ), + ) + uninstall_svr_sub_pipeline.add_act( + act_name=_("清理机器配置"), + act_component_code=MySQLClearMachineComponent.code, + kwargs=asdict( + ClearMachineKwargs( + exec_ip=ip, + bk_cloud_id=self.data["bk_cloud_id"], + ) + ), + ) + uninstall_svr_sub_pipeline_list.append( + uninstall_svr_sub_pipeline.build_sub_process(sub_name=_("卸载remote节点{}".format(ip))) + ) + + # 安装实例 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=install_sub_pipeline_list) + # 数据同步 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=sync_data_sub_pipeline_list) + # 新机器安装周边组件 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=surrounding_sub_pipeline_list) + # 人工确认切换迁移实例 + tendb_migrate_pipeline.add_act(act_name=_("人工确认切换"), act_component_code=PauseComponent.code, kwargs={}) + # 切换迁移实例 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=switch_sub_pipeline_list) + # 卸载流程人工确认 + tendb_migrate_pipeline.add_act(act_name=_("人工确认卸载实例"), act_component_code=PauseComponent.code, kwargs={}) + # 卸载remote节点 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=uninstall_svr_sub_pipeline_list) + tendb_migrate_pipeline_list.append( + tendb_migrate_pipeline.build_sub_process(sub_name=_("集群{}开始成对迁移").format(cluster_class.id)) + ) + # 运行流程 + tendb_migrate_pipeline_all.add_parallel_sub_pipeline(tendb_migrate_pipeline_list) + tendb_migrate_pipeline_all.run_pipeline(init_trans_data_class=ClusterInfoContext()) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py new file mode 100644 index 0000000000..65ac22421e --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py @@ -0,0 +1,353 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.core.consts import BK_PKG_INSTALL_PATH +from backend.db_meta.enums import ClusterType, InstanceInnerRole, TenDBClusterSpiderRole +from backend.db_meta.exceptions import ClusterNotExistException, DBMetaException +from backend.db_meta.models import Cluster +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.plugins.components.collections.mysql.authorize_rules import AuthorizeRulesComponent +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent +from backend.flow.utils.mysql.mysql_act_dataclass import DownloadMediaKwargs, ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload + + +class MysqlOpenAreaFlow(object): + def __init__(self, root_id: str, data: Optional[Dict]): + """ + tenDBHA导出导入库表结构、数据都在主db上进行 + tenDBCluster在中控主节点上导出导入库表结构、在spider节点上导出导入数据 + @param root_id : 任务流程定义的root_id + @param data : 单据传递参数 + """ + self.root_id = root_id + self.data = data + self.data["uid"] = self.data.get("uid") or self.root_id + self.uid = self.data["uid"] + + self.work_dir = f"{BK_PKG_INSTALL_PATH}/mysql_open_area" + self.schema_tar_file_name = f"{self.root_id}_schema.tar.gz" + self.schema_md5sum_file_name = f"{self.root_id}_schema.md5sum" + self.data_tar_file_name = f"{self.root_id}_data.tar.gz" + self.data_md5sum_file_name = f"{self.root_id}_data.md5sum" + + def __get_cluster_info(self, cluster_id: int, bk_biz_id: int, data_flag=False) -> dict: + """ + 获取集群基本信息 source与target共用 + @param cluster_id: + @param bk_biz_id: + @param data_flag: tenDBClusterspider节点上导出和导入数据,因此需要的是spider节点的信息 + @return: + """ + try: + # get查询时,结果只能有一个 查到多个结果会报错 + cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) + except Cluster.DoesNotExist: + raise ClusterNotExistException(cluster_id=cluster_id, bk_biz_id=bk_biz_id, message=_("集群不存在")) + # 不同集群类型,下发的ip角色不一样 + # tenDBHA下发主db tenDBCluster库表下发中控主节点 数据下发spider节点 + if cluster.cluster_type == ClusterType.TenDBCluster.value: + if data_flag: + ip_port = ( + cluster.proxyinstance_set.filter( + tendbclusterspiderext__spider_role=TenDBClusterSpiderRole.SPIDER_MASTER + ) + .first() + .ip_port + ) + else: + ip_port = cluster.tendbcluster_ctl_primary_address() + elif cluster.cluster_type == ClusterType.TenDBHA.value: + ip_port = cluster.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER).ip_port + else: + raise DBMetaException(message=_("集群实例类型不适用于开区")) + + return { + "cluster_id": cluster.id, + "bk_cloud_id": cluster.bk_cloud_id, + "cluster_type": cluster.cluster_type, + "ip": ip_port.split(":")[0], + "port": int(ip_port.split(":")[1]), + "root_id": self.root_id, + } + + def __get_source_cluster(self, data_flag=False) -> dict: + """ + 获取源实例的库表结构,可指定表 + 区分tenDBHA与tenDBCluster + @return: + """ + source_cluster = self.__get_cluster_info( + cluster_id=self.data["source_cluster"], bk_biz_id=self.data["bk_biz_id"], data_flag=data_flag + ) + source_cluster["is_upload_bkrepo"] = self.__is_upload_bkrepo( + source_cluster=self.data["source_cluster"], target_clusters=self.data["target_clusters"] + ) + # 表列表只有在导出的时候才需要 导入的时候只需要知道新旧库名 + # 多个目标集群开区,但规则用的是一套相同的,因此取第一个获取库表开区规则 + if data_flag: + source_cluster["open_area_param"] = [ + {"schema": exec_obj["source_db"], "tables": exec_obj["data_tblist"]} + for exec_obj in self.data["target_clusters"][0]["execute_objects"] + if len(exec_obj["data_tblist"]) > 0 + ] + else: + source_cluster["open_area_param"] = [ + {"schema": exec_obj["source_db"], "tables": exec_obj["schema_tblist"]} + for exec_obj in self.data["target_clusters"][0]["execute_objects"] + ] + + return source_cluster + + def __get_target_cluster(self, data_flag=False) -> list: + """ + 获取目标集群相关信息 + 目标集群执行导入库表结构操作,需要知道原库表名称和新库表名称 + @return: + """ + target_clusters = [] + for tc in self.data["target_clusters"]: + target_cluster = self.__get_cluster_info( + cluster_id=tc["target_cluster"], bk_biz_id=self.data["bk_biz_id"], data_flag=data_flag + ) + if data_flag: + target_cluster["open_area_param"] = [ + {"schema": exec_obj["source_db"], "newdb": exec_obj["target_db"]} + for exec_obj in tc["execute_objects"] + if len(exec_obj["data_tblist"]) > 0 + ] + else: + target_cluster["open_area_param"] = [ + {"schema": exec_obj["source_db"], "newdb": exec_obj["target_db"]} + for exec_obj in tc["execute_objects"] + ] + + target_clusters.append(target_cluster) + + return target_clusters + + def __is_upload_bkrepo(self, source_cluster: int, target_clusters: list) -> bool: + """ + 本地开区,不用上传制品库 + 集群维度判断 + tendbcluster集群 库表结构在中控 数据在spider节点 但属于同一集群 + 有上传必然有下发 是否下发文件也用这个来判断 + @param source_cluster: + @param target_clusters: + @return: + """ + for tc in target_clusters: + if int(source_cluster) != int(tc["target_cluster"]): + # 只要存在跟源集群不一样的 就要上传制品库 + return True + + return False + + def __get_exec_ip_list(self, source_cluster: dict, target_clusters: list) -> list: + """ + 过滤需要下发act的IP + @param source_cluster: + @param target_clusters: + @return: + """ + exec_ip_list = [] + exec_ip_list.append(source_cluster["ip"]) + for tc in target_clusters: + if tc["ip"] not in exec_ip_list: + exec_ip_list.append(tc["ip"]) + + return exec_ip_list + + def __get_data_flag(self) -> bool: + """ + 判断是否需要迁移数据 + @return: + """ + execute_objects = self.data["target_clusters"][0]["execute_objects"] + for exe_obj in execute_objects: + if len(exe_obj["data_tblist"]) > 0: + return True + + return False + + def mysql_open_area_flow(self): + source_cluster_schema = self.__get_source_cluster(data_flag=False) + target_clusters_schema = self.__get_target_cluster(data_flag=False) + # 提取要下发act的机器ip(过滤重复) + exec_ip_list = self.__get_exec_ip_list(source_cluster_schema, target_clusters_schema) + + pipeline = Builder(root_id=self.root_id, data=self.data) + + pipeline.add_act( + act_name=_("下发db-actuator介质"), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=source_cluster_schema["bk_cloud_id"], + exec_ip=exec_ip_list, + file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + ) + ), + ) + + pipeline.add_act( + act_name=_("从源实例获取开区所需库表结构"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict( + ExecActuatorKwargs( + bk_cloud_id=source_cluster_schema["bk_cloud_id"], + cluster_type=source_cluster_schema["cluster_type"], + cluster=source_cluster_schema, + exec_ip=source_cluster_schema["ip"], + get_mysql_payload_func=MysqlActPayload.get_open_area_dump_schema_payload.__name__, + ) + ), + ) + + # 本地开区,没有上传制品库,也不用下发 + if source_cluster_schema["is_upload_bkrepo"]: + # 目标集群下发库表文件,源集群不用下发 + exec_ip_list.remove(source_cluster_schema["ip"]) + pipeline.add_act( + act_name=_("下发开区库表文件"), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=0, + exec_ip=exec_ip_list, + file_target_path=self.work_dir, + file_list=GetFileList(db_type=DBType.MySQL).mysql_import_sqlfile( + path="mysql/sqlfile", filelist=[self.schema_tar_file_name, self.schema_md5sum_file_name] + ), + ) + ), + ) + + sub_pipelines = [] + for target_cluster in target_clusters_schema: + sub_pipeline = SubBuilder(root_id=self.root_id, data=self.data) + sub_pipeline.add_act( + act_name=_("向目标实例导入库表结构"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict( + ExecActuatorKwargs( + bk_cloud_id=target_cluster["bk_cloud_id"], + cluster_type=target_cluster["cluster_type"], + cluster=target_cluster, + exec_ip=target_cluster["ip"], + get_mysql_payload_func=MysqlActPayload.get_open_area_import_schema_payload.__name__, + ) + ), + ) + + sub_pipelines.append(sub_pipeline.build_sub_process(sub_name=_("目标集群开区导入表结构流程"))) + pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) + + # 判断是否需要进行数据的迁移 + data_flag = self.__get_data_flag() + if data_flag: + pipeline.add_sub_pipeline(sub_flow=self.open_area_data_flow()) + + # 对开区的新集群进行授权 + pipeline.add_act(act_name=_("添加mysql规则授权"), act_component_code=AuthorizeRulesComponent.code, kwargs=self.data) + + pipeline.run_pipeline() + + def open_area_data_flow(self): + """ + 用于构建导入导出数据的子流程 + 库表信息和导入导出表结构不一样 主要是指定表不一样 + 对于数据来说,空列表表示不导出数据,只有指定的时候才进行操作 + 另外,对于tenDBCluster集群来说,导出导入数据在spider节点上进行,需要单独再下发一次act + @return: + """ + # 获取导入导出数据集群参数 + source_cluster_data = self.__get_source_cluster(data_flag=True) + target_clusters_data = self.__get_target_cluster(data_flag=True) + # 获取之后操作的所有ip,过滤重复值 + exec_ip_list = self.__get_exec_ip_list(source_cluster_data, target_clusters_data) + + sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + + # tenDBCluster集群需要给spider下发act + if source_cluster_data["cluster_type"] == ClusterType.TenDBCluster.value: + sub_pipeline.add_act( + act_name=_("下发db-actuator介质"), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=source_cluster_data["bk_cloud_id"], + exec_ip=exec_ip_list, + file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + ) + ), + ) + sub_pipeline.add_act( + act_name=_("从源实例获取开区所需库表数据"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict( + ExecActuatorKwargs( + bk_cloud_id=source_cluster_data["bk_cloud_id"], + cluster_type=source_cluster_data["cluster_type"], + cluster=source_cluster_data, + exec_ip=source_cluster_data["ip"], + get_mysql_payload_func=MysqlActPayload.get_open_area_dump_data_payload.__name__, + ) + ), + ) + + # 本地开区,没有上传制品库,也不用下发 + if source_cluster_data["is_upload_bkrepo"]: + # 目标集群下发库表文件,源集群不用下发 + exec_ip_list.remove(source_cluster_data["ip"]) + sub_pipeline.add_act( + act_name=_("下发开区库表数据文件"), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=0, + exec_ip=exec_ip_list, + file_target_path=self.work_dir, + file_list=GetFileList(db_type=DBType.MySQL).mysql_import_sqlfile( + path="mysql/sqlfile", filelist=[self.data_tar_file_name, self.data_md5sum_file_name] + ), + ) + ), + ) + + acts_list = [] + for target_cluster in target_clusters_data: + acts_list.append( + { + "act_name": _("向目标实例导入库表数据"), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict( + ExecActuatorKwargs( + bk_cloud_id=target_cluster["bk_cloud_id"], + cluster_type=target_cluster["cluster_type"], + cluster=target_cluster, + exec_ip=target_cluster["ip"], + get_mysql_payload_func=MysqlActPayload.get_open_area_import_data_payload.__name__, + ) + ), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + return sub_pipeline.build_sub_process(sub_name=_("开区数据迁移流程")) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py new file mode 100644 index 0000000000..f3bb9e211b --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py @@ -0,0 +1,424 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging.config +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.db_meta.enums import ClusterType, InstanceInnerRole, InstanceStatus +from backend.db_meta.models import Cluster, ClusterEntry +from backend.db_package.models import Package +from backend.flow.consts import MediumEnum +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.engine.bamboo.scene.mysql.common.common_sub_flow import ( + build_surrounding_apps_sub_flow, + install_mysql_in_cluster_sub_flow, +) +from backend.flow.engine.bamboo.scene.mysql.common.recover_slave_instance import slave_recover_sub_flow +from backend.flow.engine.bamboo.scene.mysql.common.slave_recover_switch import slave_migrate_switch_sub_flow +from backend.flow.engine.bamboo.scene.mysql.common.uninstall_instance import uninstall_instance_sub_flow +from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent +from backend.flow.plugins.components.collections.common.pause import PauseComponent +from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent +from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent +from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs +from backend.flow.utils.mysql.common.mysql_cluster_info import get_ports, get_version_and_charset +from backend.flow.utils.mysql.mysql_act_dataclass import ( + ClearMachineKwargs, + DBMetaOPKwargs, + DownloadMediaKwargs, + ExecActuatorKwargs, +) +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload +from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext +from backend.flow.utils.mysql.mysql_db_meta import MySQLDBMeta + +logger = logging.getLogger("flow") + + +class MySQLRestoreSlaveRemoteFlow(object): + """ + mysql 重建slave流程接入新备份系统 + """ + + def __init__(self, root_id: str, tick_data: Optional[Dict]): + """ + @param root_id : 任务流程定义的root_id + @param tick_data : 单据传递过来的参数列表,是dict格式 + """ + self.root_id = root_id + self.ticket_data = tick_data + self.data = {} + # 仅添加从库。不切换。不复制账号 + self.add_slave_only = self.ticket_data.get("add_slave_only", False) + + def tendb_ha_restore_slave_flow(self): + """ + 机器级别重建slave节点的流程 + 元数据流程: + 1 mysql_restore_slave_add_instance + 2 mysql_add_slave_info + 3 mysql_restore_slave_change_cluster_info + 4 mysql_restore_remove_old_slave + """ + tendb_migrate_pipeline_all = Builder(root_id=self.root_id, data=copy.deepcopy(self.ticket_data)) + tendb_migrate_pipeline_list = [] + for info in self.ticket_data["infos"]: + self.data = copy.deepcopy(info) + cluster_class = Cluster.objects.get(id=self.data["cluster_ids"][0]) + self.data["bk_biz_id"] = cluster_class.bk_biz_id + self.data["bk_cloud_id"] = cluster_class.bk_cloud_id + self.data["db_module_id"] = cluster_class.db_module_id + self.data["time_zone"] = cluster_class.time_zone + self.data["created_by"] = self.ticket_data["created_by"] + self.data["module"] = self.ticket_data["module"] + self.data["ticket_type"] = self.ticket_data["ticket_type"] + self.data["cluster_type"] = cluster_class.cluster_type + self.data["uid"] = self.ticket_data["uid"] + self.data["package"] = Package.get_latest_package( + version=cluster_class.major_version, pkg_type=MediumEnum.MySQL, db_type=DBType.MySQL + ) + # self.data["package"] = "5.7.20" + self.data["ports"] = get_ports(info["cluster_ids"]) + self.data["force"] = info.get("force", False) + self.data["charset"], self.data["db_version"] = get_version_and_charset( + self.data["bk_biz_id"], + db_module_id=self.data["db_module_id"], + cluster_type=self.data["cluster_type"], + ) + tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + # 获取信息 + # 整机安装数据库 + install_sub_pipeline_list = [] + install_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + install_sub_pipeline.add_sub_pipeline( + sub_flow=install_mysql_in_cluster_sub_flow( + uid=self.data["uid"], + root_id=self.root_id, + cluster=cluster_class, + new_mysql_list=[self.data["new_slave_ip"]], + install_ports=self.data["ports"], + ) + ) + + cluster = { + "install_ip": self.data["new_slave_ip"], + "cluster_ids": self.data["cluster_ids"], + "package": self.data["package"], + } + install_sub_pipeline.add_act( + act_name=_("写入初始化实例的db_meta元信息"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.slave_recover_add_instance.__name__, + cluster=copy.deepcopy(cluster), + is_update_trans_data=False, + ) + ), + ) + + install_sub_pipeline.add_act( + act_name=_("安装backup-client工具"), + act_component_code=DownloadBackupClientComponent.code, + kwargs=asdict( + DownloadBackupClientKwargs( + bk_cloud_id=cluster_class.bk_cloud_id, + bk_biz_id=int(cluster_class.bk_biz_id), + download_host_list=[self.data["new_slave_ip"]], + ) + ), + ) + + exec_act_kwargs = ExecActuatorKwargs( + cluster=cluster, + bk_cloud_id=cluster_class.bk_cloud_id, + cluster_type=cluster_class.cluster_type, + get_mysql_payload_func=MysqlActPayload.get_install_tmp_db_backup_payload.__name__, + ) + exec_act_kwargs.exec_ip = [self.data["new_slave_ip"]] + install_sub_pipeline.add_act( + act_name=_("安装临时备份程序"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + + install_sub_pipeline_list.append(install_sub_pipeline.build_sub_process(sub_name=_("安装从节点"))) + + sync_data_sub_pipeline_list = [] + for cluster_id in info["cluster_ids"]: + cluster_model = Cluster.objects.get(id=cluster_id) + master = cluster_model.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + cluster = { + "cluster_id": cluster_model.id, + "master_ip": master.machine.ip, + "master_port": master.port, + "new_slave_ip": self.data["new_slave_ip"], + "new_slave_port": master.port, + "bk_cloud_id": cluster_model.bk_cloud_id, + "file_target_path": f"/data/dbbak/{self.root_id}/{master.port}", + "charset": self.data["charset"], + "change_master_force": True, + } + sync_data_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + sync_data_sub_pipeline.add_sub_pipeline( + sub_flow=slave_recover_sub_flow( + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=cluster + ) + ) + sync_data_sub_pipeline.add_act( + act_name=_("同步数据完毕,写入数据节点的主从关系相关元数据"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.mysql_add_slave_info.__name__, + cluster=cluster, + is_update_trans_data=True, + ) + ), + ) + sync_data_sub_pipeline_list.append(sync_data_sub_pipeline.build_sub_process(sub_name=_("恢复实例数据"))) + + # 安装周边 + surrounding_sub_pipeline_list = [] + surrounding_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + surrounding_sub_pipeline.add_sub_pipeline( + sub_flow=build_surrounding_apps_sub_flow( + bk_cloud_id=cluster_class.bk_cloud_id, + master_ip_list=None, + slave_ip_list=[self.data["new_slave_ip"]], + root_id=self.root_id, + parent_global_data=copy.deepcopy(self.data), + is_init=True, + cluster_type=ClusterType.TenDBHA.value, + ) + ) + surrounding_sub_pipeline_list.append(surrounding_sub_pipeline.build_sub_process(sub_name=_("新机器安装周边组件"))) + + switch_sub_pipeline_list = [] + uninstall_svr_sub_pipeline_list = [] + if not self.add_slave_only: + for cluster_id in self.data["cluster_ids"]: + cluster_model = Cluster.objects.get(id=cluster_id) + domain = ClusterEntry.get_cluster_entry_map_by_cluster_ids([cluster_model.id]) + switch_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + switch_sub_pipeline.add_sub_pipeline( + sub_flow=slave_migrate_switch_sub_flow( + root_id=self.root_id, + ticket_data=copy.deepcopy(self.data), + cluster=cluster_model, + old_slave_ip=self.data["old_slave_ip"], + new_slave_ip=self.data["new_slave_ip"], + ) + ) + cluster = { + "slave_domain": domain[cluster_model.id]["slave_domain"], + "master_domain": domain[cluster_model.id]["master_domain"], + "new_slave_ip": self.data["new_slave_ip"], + "old_slave_ip": self.data["old_slave_ip"], + "cluster_id": cluster_model.id, + } + switch_sub_pipeline.add_act( + act_name=_("slave切换完毕,修改集群 {} 数据".format(cluster_model.id)), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.mysql_restore_slave_change_cluster_info.__name__, + cluster=cluster, + is_update_trans_data=True, + ) + ), + ) + switch_sub_pipeline_list.append(switch_sub_pipeline.build_sub_process(sub_name=_("切换到新从节点"))) + + uninstall_svr_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + uninstall_svr_sub_pipeline.add_sub_pipeline( + sub_flow=uninstall_instance_sub_flow( + root_id=self.root_id, + ticket_data=copy.deepcopy(self.data), + ip=self.data["old_slave_ip"], + ports=self.data["ports"], + ) + ) + cluster = {"uninstall_ip": self.data["old_slave_ip"], "cluster_ids": self.data["cluster_ids"]} + uninstall_svr_sub_pipeline.add_act( + act_name=_("整机卸载成功后删除元数据"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.slave_recover_del_instance.__name__, + is_update_trans_data=True, + cluster=cluster, + ) + ), + ) + uninstall_svr_sub_pipeline.add_act( + act_name=_("清理机器配置"), + act_component_code=MySQLClearMachineComponent.code, + kwargs=asdict( + ClearMachineKwargs( + exec_ip=self.data["old_slave_ip"], + bk_cloud_id=self.data["bk_cloud_id"], + ) + ), + ) + uninstall_svr_sub_pipeline_list.append( + uninstall_svr_sub_pipeline.build_sub_process( + sub_name=_("卸载remote节点{}".format(self.data["old_slave_ip"])) + ) + ) + + # 安装实例 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=install_sub_pipeline_list) + # 数据同步 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=sync_data_sub_pipeline_list) + # 新机器安装周边组件 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=surrounding_sub_pipeline_list) + if not self.add_slave_only: + # 人工确认切换迁移实例 + tendb_migrate_pipeline.add_act(act_name=_("人工确认切换"), act_component_code=PauseComponent.code, kwargs={}) + # 切换迁移实例 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=switch_sub_pipeline_list) + # 卸载流程人工确认 + tendb_migrate_pipeline.add_act( + act_name=_("人工确认卸载实例"), act_component_code=PauseComponent.code, kwargs={} + ) + # # 卸载remote节点 + tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=uninstall_svr_sub_pipeline_list) + tendb_migrate_pipeline_list.append( + tendb_migrate_pipeline.build_sub_process(_("slave重建迁移{}").format(self.data["new_slave_ip"])) + ) + # 运行流程 + tendb_migrate_pipeline_all.add_parallel_sub_pipeline(tendb_migrate_pipeline_list) + tendb_migrate_pipeline_all.run_pipeline(init_trans_data_class=ClusterInfoContext()) + + def restore_local_slave_flow(self): + """ + 原地重建slave + 机器slave数据损坏或者其他原因丢弃实例数据,重新恢复数据。 + 无元数据改动 + """ + tendb_migrate_pipeline_all = Builder(root_id=self.root_id, data=copy.deepcopy(self.ticket_data)) + tendb_migrate_pipeline_list = [] + for info in self.ticket_data["infos"]: + self.data = copy.deepcopy(info) + cluster_model = Cluster.objects.get(id=self.data["clusterid"]) + target_slave = cluster_model.storageinstance_set.get( + machine__bk_cloud_id=cluster_model.bk_cloud_id, + machine__ip=self.data["slave_ip"], + port=self.data["slave_port"], + ) + self.data["bk_biz_id"] = cluster_model.bk_biz_id + self.data["bk_cloud_id"] = cluster_model.bk_cloud_id + self.data["db_module_id"] = cluster_model.db_module_id + self.data["time_zone"] = cluster_model.time_zone + self.data["created_by"] = self.ticket_data["created_by"] + self.data["module"] = self.ticket_data["module"] + self.data["ticket_type"] = self.ticket_data["ticket_type"] + self.data["cluster_type"] = cluster_model.cluster_type + self.data["uid"] = self.ticket_data["uid"] + self.data["charset"], self.data["db_version"] = get_version_and_charset( + self.data["bk_biz_id"], + db_module_id=self.data["db_module_id"], + cluster_type=self.data["cluster_type"], + ) + tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + + tendb_migrate_pipeline.add_act( + act_name=_("下发db-actor到节点{}".format(target_slave.machine.ip)), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=cluster_model.bk_cloud_id, + exec_ip=[target_slave.machine.ip], + file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + ) + ), + ) + + cluster = {"storage_status": InstanceStatus.RESTORING.value, "storage_id": target_slave.id} + tendb_migrate_pipeline.add_act( + act_name=_("写入初始化实例的db_meta元信息"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.tendb_modify_storage_status.__name__, + cluster=cluster, + is_update_trans_data=False, + ) + ), + ) + + cluster = { + "stop_slave": True, + "reset_slave": True, + "restart": False, + "force": self.data["force"], + "drop_database": True, + "new_slave_ip": target_slave.machine.ip, + "new_slave_port": target_slave.port, + } + exec_act_kwargs = ExecActuatorKwargs( + bk_cloud_id=cluster_model.bk_cloud_id, + cluster_type=cluster_model.cluster_type, + cluster=cluster, + exec_ip=target_slave.machine.ip, + ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_clean_mysql_payload.__name__ + tendb_migrate_pipeline.add_act( + act_name=_("slave重建之清理从库{}").format(exec_act_kwargs.exec_ip), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + + master = cluster_model.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + cluster = { + "cluster_id": cluster_model.id, + "master_ip": master.machine.ip, + "master_port": master.port, + "new_slave_ip": target_slave.machine.ip, + "new_slave_port": target_slave.port, + "bk_cloud_id": cluster_model.bk_cloud_id, + "file_target_path": f"/data/dbbak/{self.root_id}/{master.port}", + "charset": self.data["charset"], + "change_master_force": True, + "cluster_type": cluster_model.cluster_type, + } + tendb_migrate_pipeline.add_sub_pipeline( + sub_flow=slave_recover_sub_flow( + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=cluster + ) + ) + + cluster = {"storage_status": InstanceStatus.RUNNING.value, "storage_id": target_slave.id} + tendb_migrate_pipeline.add_act( + act_name=_("写入初始化实例的db_meta元信息"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.tendb_modify_storage_status.__name__, + cluster=cluster, + is_update_trans_data=False, + ) + ), + ) + tendb_migrate_pipeline_list.append( + tendb_migrate_pipeline.build_sub_process(_("slave原地重建{}").format(self.data["slave_ip"])) + ) + + tendb_migrate_pipeline_all.add_parallel_sub_pipeline(sub_flow_list=tendb_migrate_pipeline_list) + tendb_migrate_pipeline_all.run_pipeline(init_trans_data_class=ClusterInfoContext()) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py index 8de883ceef..452336e91e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py @@ -10,28 +10,34 @@ """ import copy import logging.config +from dataclasses import asdict from typing import Dict, Optional from django.utils.translation import ugettext as _ +from backend.db_meta.enums import ClusterType, InstanceInnerRole +from backend.db_meta.models import Cluster from backend.flow.consts import RollbackType from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.engine.bamboo.scene.mysql.common.common_sub_flow import install_mysql_in_cluster_sub_flow from backend.flow.engine.bamboo.scene.mysql.common.exceptions import NormalTenDBFlowException from backend.flow.engine.bamboo.scene.mysql.mysql_rollback_data_sub_flow import ( - install_instance_sub_flow, rollback_local_and_backupid, rollback_local_and_time, rollback_remote_and_backupid, rollback_remote_and_time, uninstall_instance_sub_flow, ) +from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent from backend.flow.plugins.components.collections.common.pause import PauseComponent -from backend.flow.utils.mysql.common.mysql_cluster_info import ( - get_cluster_info, - get_cluster_ports, - get_version_and_charset, -) +from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent +from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs +from backend.flow.utils.mysql.common.mysql_cluster_info import get_cluster_info, get_version_and_charset +from backend.flow.utils.mysql.mysql_act_dataclass import DBMetaOPKwargs, ExecActuatorKwargs +from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext +from backend.flow.utils.mysql.mysql_db_meta import MySQLDBMeta logger = logging.getLogger("flow") @@ -47,7 +53,8 @@ def __init__(self, root_id: str, data: Optional[Dict]): @param data : 单据传递过来的参数列表,是dict格式 """ self.root_id = root_id - self.data = data + self.ticket_data = data + self.data = {} def rollback_data_flow(self): """ @@ -59,54 +66,117 @@ def rollback_data_flow(self): root_id=self.root_id, data=copy.deepcopy(self.data), need_random_pass_cluster_ids=list(set(cluster_ids)) ) sub_pipeline_list = [] - for info in self.data["infos"]: - # 根据ip级别安装mysql实例 - cluster_ports = get_cluster_ports([info["cluster_id"]]) - info.update(cluster_ports) - charset, db_version = get_version_and_charset( + for info in self.ticket_data["infos"]: + self.data = copy.deepcopy(info) + cluster_class = Cluster.objects.get(id=self.data["cluster_id"]) + master = cluster_class.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + self.data["bk_biz_id"] = cluster_class.bk_biz_id + self.data["bk_cloud_id"] = cluster_class.bk_cloud_id + self.data["db_module_id"] = cluster_class.db_module_id + self.data["time_zone"] = cluster_class.time_zone + self.data["created_by"] = self.ticket_data["created_by"] + self.data["module"] = self.ticket_data["module"] + self.data["ticket_type"] = self.ticket_data["ticket_type"] + self.data["cluster_type"] = cluster_class.cluster_type + self.data["uid"] = self.ticket_data["uid"] + # self.data["package"] = Package.get_latest_package( + # version=cluster_class.major_version, pkg_type=MediumEnum.MySQL, db_type=DBType.MySQL + # ) + self.data["package"] = cluster_class.major_version + self.data["db_version"] = cluster_class.major_version + self.data["force"] = info.get("force", False) + self.data["charset"], self.data["db_version"] = get_version_and_charset( self.data["bk_biz_id"], - db_module_id=info["db_module_id"], - cluster_type=info["cluster_type"], + db_module_id=self.data["db_module_id"], + cluster_type=self.data["cluster_type"], ) - ticket_data = copy.deepcopy(self.data) - ticket_data["clusters"] = info["clusters"] - ticket_data["mysql_ports"] = info["cluster_ports"] - ticket_data["charset"] = charset - ticket_data["db_version"] = db_version - - # 用于兼容 restore slave payload - info["new_slave_ip"] = info["rollback_ip"] - info["db_version"] = db_version - sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(ticket_data)) + sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) sub_pipeline.add_sub_pipeline( - sub_flow=install_instance_sub_flow(ticket_data=ticket_data, cluster_info=info) + sub_flow=install_mysql_in_cluster_sub_flow( + uid=self.ticket_data["uid"], + root_id=self.root_id, + cluster=cluster_class, + new_mysql_list=[self.data["rollback_ip"]], + install_ports=[master.port], + ) + ) + cluster = { + "install_ip": self.data["rollback_ip"], + "cluster_ids": [cluster_class.id], + "package": self.data["package"], + } + sub_pipeline.add_act( + act_name=_("写入初始化实例的db_meta元信息"), + act_component_code=MySQLDBMetaComponent.code, + kwargs=asdict( + DBMetaOPKwargs( + db_meta_class_func=MySQLDBMeta.slave_recover_add_instance.__name__, + cluster=copy.deepcopy(cluster), + is_update_trans_data=False, + ) + ), + ) + + sub_pipeline.add_act( + act_name=_("安装backup-client工具"), + act_component_code=DownloadBackupClientComponent.code, + kwargs=asdict( + DownloadBackupClientKwargs( + bk_cloud_id=cluster_class.bk_cloud_id, + bk_biz_id=int(cluster_class.bk_biz_id), + download_host_list=[self.data["rollback_ip"]], + ) + ), ) - one_cluster = get_cluster_info(info["cluster_id"]) - one_cluster["rollback_ip"] = info["rollback_ip"] - one_cluster["databases"] = info["databases"] - one_cluster["tables"] = info["tables"] - one_cluster["databases_ignore"] = info["databases_ignore"] - one_cluster["tables_ignore"] = info["tables_ignore"] + exec_act_kwargs = ExecActuatorKwargs( + cluster=cluster, + bk_cloud_id=cluster_class.bk_cloud_id, + cluster_type=cluster_class.cluster_type, + get_mysql_payload_func=MysqlActPayload.get_install_tmp_db_backup_payload.__name__, + ) + exec_act_kwargs.exec_ip = [self.data["rollback_ip"]] + sub_pipeline.add_act( + act_name=_("安装临时备份程序"), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) + + one_cluster = get_cluster_info(self.data["cluster_id"]) + one_cluster["rollback_ip"] = self.data["rollback_ip"] + one_cluster["databases"] = self.data["databases"] + one_cluster["tables"] = self.data["tables"] + one_cluster["databases_ignore"] = self.data["databases_ignore"] + one_cluster["tables_ignore"] = self.data["tables_ignore"] one_cluster["backend_port"] = one_cluster["master_port"] - one_cluster["charset"] = charset + one_cluster["charset"] = self.data["charset"] one_cluster["change_master"] = False - directory = "/data/dbbak/{}/{}".format(self.root_id, one_cluster["master_port"]) - one_cluster["file_target_path"] = directory + one_cluster["file_target_path"] = "/data/dbbak/{}/{}".format(self.root_id, master.port) one_cluster["skip_local_exists"] = True one_cluster["name_regex"] = "^.+{}\\.\\d+(\\..*)*$".format(one_cluster["master_port"]) - one_cluster["rollback_time"] = info["rollback_time"] - # one_cluster["new_master_ip"] = one_cluster["master_ip"] - # one_cluster["new_slave_ip"] = info["rollback_ip"] - one_cluster["rollback_ip"] = info["rollback_ip"] - one_cluster["rollback_port"] = one_cluster["master_port"] - one_cluster["rollback_time"] = info["rollback_time"] - one_cluster["backupinfo"] = info["backupinfo"] - one_cluster["rollback_type"] = info["rollback_type"] + one_cluster["rollback_time"] = self.data["rollback_time"] + one_cluster["rollback_ip"] = self.data["rollback_ip"] + one_cluster["rollback_port"] = master.port + one_cluster["rollback_time"] = self.data["rollback_time"] + one_cluster["backupinfo"] = self.data["backupinfo"] + one_cluster["rollback_type"] = self.data["rollback_type"] + + exec_act_kwargs = ExecActuatorKwargs( + bk_cloud_id=cluster_class.bk_cloud_id, + cluster_type=ClusterType.TenDBHA, + cluster=one_cluster, + ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.mysql_mkdir_dir.__name__ + exec_act_kwargs.exec_ip = self.data["rollback_ip"] + sub_pipeline.add_act( + act_name=_("创建目录 {}".format(one_cluster["file_target_path"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) # 本地备份+时间 - if info["rollback_type"] == RollbackType.LOCAL_AND_TIME: + if self.data["rollback_type"] == RollbackType.LOCAL_AND_TIME: sub_pipeline.add_sub_pipeline( sub_flow=rollback_local_and_time( root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=one_cluster @@ -114,14 +184,14 @@ def rollback_data_flow(self): ) # 远程备份+时间 - elif info["rollback_type"] == RollbackType.REMOTE_AND_TIME.value: + elif self.data["rollback_type"] == RollbackType.REMOTE_AND_TIME.value: sub_pipeline.add_sub_pipeline( sub_flow=rollback_remote_and_time( root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=one_cluster ) ) # 远程备份+备份ID - elif info["rollback_type"] == RollbackType.REMOTE_AND_BACKUPID.value: + elif self.data["rollback_type"] == RollbackType.REMOTE_AND_BACKUPID.value: sub_pipeline.add_sub_pipeline( sub_flow=rollback_remote_and_backupid( root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=one_cluster @@ -129,7 +199,7 @@ def rollback_data_flow(self): ) # 本地备份+备份ID - elif info["rollback_type"] == RollbackType.LOCAL_AND_BACKUPID: + elif self.data["rollback_type"] == RollbackType.LOCAL_AND_BACKUPID: sub_pipeline.add_sub_pipeline( sub_flow=rollback_local_and_backupid( root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=one_cluster @@ -141,7 +211,9 @@ def rollback_data_flow(self): # 设置暂停。接下来卸载数据库的流程 sub_pipeline.add_act(act_name=_("人工确认"), act_component_code=PauseComponent.code, kwargs={}) sub_pipeline.add_sub_pipeline( - sub_flow=uninstall_instance_sub_flow(ticket_data=ticket_data, cluster_info=one_cluster) + sub_flow=uninstall_instance_sub_flow( + root_id=self.root_id, ticket_data=self.data, cluster_info=one_cluster + ) ) sub_pipeline_list.append(sub_pipeline.build_sub_process(sub_name=_("定点恢复"))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py index 4ee855064a..f6dbdc4974 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py @@ -19,6 +19,7 @@ from backend.flow.engine.bamboo.scene.common.builder import SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList from backend.flow.engine.bamboo.scene.mysql.common.exceptions import TenDBGetBackupInfoFailedException +from backend.flow.engine.bamboo.scene.spider.common.exceptions import TendbGetBackupInfoFailedException from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent @@ -47,79 +48,6 @@ logger = logging.getLogger("flow") -def install_instance_sub_flow(root_id: str, ticket_data: dict, cluster_info: dict): - """ - mysql 定点回档安装实例 - @param root_id: flow 流程root_id - @param ticket_data: 关联单据 ticket对象 - @param cluster_info: 关联的cluster对象 - """ - install_sub_pipeline = SubBuilder(root_id=root_id, data=copy.deepcopy(ticket_data)) - - # 拼接执行原子任务活动节点需要的通用的私有参数结构体, 减少代码重复率,但引用时注意内部参数值传递的问题 - exec_act_kwargs = ExecActuatorKwargs( - exec_ip=cluster_info["rollback_ip"], - cluster_type=cluster_info["cluster_type"], - bk_cloud_id=int(cluster_info["bk_cloud_id"]), - ) - - install_sub_pipeline.add_act( - act_name=_("下发MySQL介质"), - act_component_code=TransFileComponent.code, - kwargs=asdict( - DownloadMediaKwargs( - bk_cloud_id=int(cluster_info["bk_cloud_id"]), - exec_ip=cluster_info["rollback_ip"], - file_list=GetFileList(db_type=DBType.MySQL).mysql_install_package( - db_version=cluster_info["db_version"] - ), - ) - ), - ) - - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_sys_init_payload.__name__ - install_sub_pipeline.add_act( - act_name=_("初始化机器"), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_deploy_mysql_crond_payload.__name__ - install_sub_pipeline.add_act( - act_name=_("部署mysql-crond"), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_install_mysql_payload.__name__ - install_sub_pipeline.add_act( - act_name=_("安装MySQL实例"), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - - # 安装完毕实例,写入元数据 - install_sub_pipeline.add_act( - act_name=_("写入初始化实例的db_meta元信息"), - act_component_code=MySQLDBMetaComponent.code, - kwargs=asdict( - DBMetaOPKwargs( - db_meta_class_func=MySQLDBMeta.mysql_restore_slave_add_instance.__name__, - cluster=cluster_info, - is_update_trans_data=True, - ) - ), - ) - - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_install_restore_backup_payload.__name__ - install_sub_pipeline.add_act( - act_name=_("安装备份程序"), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - return install_sub_pipeline.build_sub_process(sub_name=_("安装实例flow")) - - def uninstall_instance_sub_flow(root_id: str, ticket_data: dict, cluster_info: dict): """ mysql 定点回档卸载实例 @@ -270,6 +198,9 @@ def rollback_remote_and_time(root_id: str, ticket_data: dict, cluster_info: dict rollback_handler = FixPointRollbackHandler(cluster_info["cluster_id"]) # 查询接口 backupinfo = rollback_handler.query_latest_backup_log(rollback_time) + if backupinfo is None: + logger.error("cluster {} backup info not exists".format(cluster_info["cluster_id"])) + raise TendbGetBackupInfoFailedException(message=_("获取集群 {} 的备份信息失败".format(cluster_info["cluster_id"]))) cluster_info["backupinfo"] = copy.deepcopy(backupinfo) cluster_info["backup_time"] = backupinfo["backup_time"] diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py b/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py index 97fdbb6ab7..07decaa484 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py @@ -9,15 +9,14 @@ specific language governing permissions and limitations under the License. """ import logging.config +from dataclasses import asdict from typing import Dict, Optional from django.utils.translation import ugettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder -from backend.flow.plugins.components.collections.name_service.name_service import ( - ExecNameServiceCreateComponent, - ExecNameServiceDeleteComponent, -) +from backend.flow.plugins.components.collections.name_service.name_service import ExecNameServiceOperationComponent +from backend.flow.utils.name_service.name_service_dataclass import ActKwargs, TransDataKwargs logger = logging.getLogger("flow") @@ -33,8 +32,12 @@ def __init__(self, root_id: str, data: Optional[Dict]): """ self.root_id = root_id self.data = data + self.kwargs = ActKwargs() + self.kwargs.set_trans_data_dataclass = TransDataKwargs.__name__ + self.kwargs.cluster_id = self.data["cluster_id"] + self.kwargs.creator = self.data["created_by"] - def name_service_clb_create_flow(self): + def clb_create_flow(self): """ clb create流程 """ @@ -42,17 +45,28 @@ def name_service_clb_create_flow(self): # 创建流程实例 pipeline = Builder(root_id=self.root_id, data=self.data) - # 定义私有变量 - kwargs = self.data - kwargs["name_service_type"] = "clb" - - # 添加活动节点 - pipeline.add_act(act_name=_("创建clb"), act_component_code=ExecNameServiceCreateComponent.code, kwargs=kwargs) + # 添加创建clb活动节点 + self.kwargs.name_service_operation_type = "create_clb" + pipeline.add_act( + act_name=_("创建clb"), act_component_code=ExecNameServiceOperationComponent.code, kwargs=asdict(self.kwargs) + ) + self.kwargs.name_service_operation_type = "add_clb_info_to_meta" + pipeline.add_act( + act_name=_("clb信息写入meta"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + self.kwargs.name_service_operation_type = "add_clb_domain_to_dns" + pipeline.add_act( + act_name=_("clb域名添加到dns,clb域名信息写入meta"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) # 运行流程 pipeline.run_pipeline() - def name_service_clb_delete_flow(self): + def clb_delete_flow(self): """ clb delete流程 """ @@ -60,17 +74,34 @@ def name_service_clb_delete_flow(self): # 创建流程实例 pipeline = Builder(root_id=self.root_id, data=self.data) - # 定义私有变量 - kwargs = self.data - kwargs["name_service_type"] = "clb" - # 添加活动节点 - pipeline.add_act(act_name=_("删除clb"), act_component_code=ExecNameServiceDeleteComponent.code, kwargs=kwargs) + self.kwargs.name_service_operation_type = "domain_unbind_clb_ip" + pipeline.add_act( + act_name=_("主域名解绑clb ip"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + self.kwargs.name_service_operation_type = "delete_clb_domain_from_dns" + pipeline.add_act( + act_name=_("dns删除clb域名,从meta删除clb域名信息"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + self.kwargs.name_service_operation_type = "delete_clb" + pipeline.add_act( + act_name=_("删除clb"), act_component_code=ExecNameServiceOperationComponent.code, kwargs=asdict(self.kwargs) + ) + self.kwargs.name_service_operation_type = "delete_clb_info_from_meta" + pipeline.add_act( + act_name=_("从meta删除clb信息"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) # 运行流程 pipeline.run_pipeline() - def name_service_polaris_create_flow(self): + def polaris_create_flow(self): """ polaris create流程 """ @@ -78,19 +109,24 @@ def name_service_polaris_create_flow(self): # 创建流程实例 pipeline = Builder(root_id=self.root_id, data=self.data) - # 定义私有变量 - kwargs = self.data - kwargs["name_service_type"] = "polaris" - # 添加活动节点 + self.kwargs.name_service_operation_type = "create_polaris" pipeline.add_act( - act_name=_("创建polaris"), act_component_code=ExecNameServiceCreateComponent.code, kwargs=kwargs + act_name=_("创建polaris"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + self.kwargs.name_service_operation_type = "add_polaris_info_to_meta" + pipeline.add_act( + act_name=_("polaris信息写入meta"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), ) # 运行流程 pipeline.run_pipeline() - def name_service_polaris_delete_flow(self): + def polaris_delete_flow(self): """ polaris delete流程 """ @@ -98,13 +134,56 @@ def name_service_polaris_delete_flow(self): # 创建流程实例 pipeline = Builder(root_id=self.root_id, data=self.data) - # 定义私有变量 - kwargs = self.data - kwargs["name_service_type"] = "polaris" + # 添加活动节点 + self.kwargs.name_service_operation_type = "delete_polaris" + pipeline.add_act( + act_name=_("删除polaris"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + self.kwargs.name_service_operation_type = "delete_polaris_info_from_meta" + pipeline.add_act( + act_name=_("从meta删除polaris信息"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + + # 运行流程 + pipeline.run_pipeline() + + def immute_domain_bind_clb_ip(self): + """ + 主域名绑定clb ip流程 + """ + + # 创建流程实例 + pipeline = Builder(root_id=self.root_id, data=self.data) + + # 添加活动节点 + self.kwargs.name_service_operation_type = "domain_bind_clb_ip" + pipeline.add_act( + act_name=_("主域名绑定clb ip"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), + ) + + # 运行流程 + pipeline.run_pipeline() + + def immute_domain_unbind_clb_ip(self): + """ + 主域名绑定clb ip流程 + """ + + # 创建流程实例 + pipeline = Builder(root_id=self.root_id, data=self.data) # 添加活动节点 + self.kwargs.name_service_operation_type = "domain_unbind_clb_ip" pipeline.add_act( - act_name=_("删除polaris"), act_component_code=ExecNameServiceDeleteComponent.code, kwargs=kwargs + act_name=_("主域名解绑clb ip"), + act_component_code=ExecNameServiceOperationComponent.code, + kwargs=asdict(self.kwargs), ) # 运行流程 diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py index 576c02ab5a..53be2d95da 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py @@ -193,7 +193,7 @@ def deploy_pulsar_flow(self): act_component_code=ExecutePulsarActuatorScriptComponent.code, kwargs=asdict(act_kwargs), ) - # 插入haproxy实例信息 + # 插入pulsar manager实例信息 manager_kwargs = BigdataManagerKwargs( manager_op_type=ManagerOpType.CREATE, db_type=DBType.Pulsar, diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py new file mode 100644 index 0000000000..aeeb264c35 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging.config +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.configuration.constants import DBType +from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType +from backend.flow.engine.bamboo.scene.common.builder import Builder +from backend.flow.engine.bamboo.scene.pulsar.pulsar_base_flow import PulsarBaseFlow +from backend.flow.plugins.components.collections.common.bigdata_manager_service import BigdataManagerComponent +from backend.flow.plugins.components.collections.pulsar.pulsar_db_meta import PulsarDBMetaComponent +from backend.flow.plugins.components.collections.pulsar.pulsar_set_token import PulsarSetTokenContextComponent +from backend.flow.plugins.components.collections.pulsar.pulsar_zk_dns_manage import PulsarZkDnsManageComponent +from backend.flow.plugins.components.collections.pulsar.rewrite_pulsar_config import WriteBackPulsarConfigComponent +from backend.flow.utils.extension_manage import BigdataManagerKwargs +from backend.flow.utils.pulsar.consts import PULSAR_ZOOKEEPER_SERVICE_PORT +from backend.flow.utils.pulsar.pulsar_context_dataclass import PulsarActKwargs, PulsarApplyContext, ZkDnsKwargs + +logger = logging.getLogger("flow") + + +class PulsarFakeApplyFlow(PulsarBaseFlow): + """ + 构建Pulsar虚假申请流程的抽象类 + """ + + def __init__(self, root_id: str, data: Optional[Dict]): + """ + @param root_id : 任务流程定义的root_id + @param data : 单据传递过来的参数列表,是dict格式 + """ + super().__init__(root_id, data) + + self.data = data + + def fake_deploy_pulsar_flow(self): + """ + 定义部署Pulsar集群 + """ + pulsar_flow_data = self.__get_apply_flow_data(self.data) + + pulsar_pipeline = Builder(root_id=self.root_id, data=pulsar_flow_data) + + # 拼接活动节点需要的私有参数 + act_kwargs = PulsarActKwargs(bk_cloud_id=self.base_flow_data["bk_cloud_id"]) + act_kwargs.set_trans_data_dataclass = PulsarApplyContext.__name__ + + # 绑定域名与ZK_IP + zk_dns_kwargs = ZkDnsKwargs( + bk_cloud_id=pulsar_flow_data["bk_cloud_id"], + dns_op_type=DnsOpType.CREATE, + domain_name=pulsar_flow_data["domain"], + dns_op_exec_port=PULSAR_ZOOKEEPER_SERVICE_PORT, + zk_host_map=pulsar_flow_data["zk_host_map"], + ) + pulsar_pipeline.add_act( + act_name=_("添加ZK域名"), + act_component_code=PulsarZkDnsManageComponent.code, + kwargs={**asdict(act_kwargs), **asdict(zk_dns_kwargs)}, + ) + + # 插入pulsar manager实例信息 + manager_kwargs = BigdataManagerKwargs( + manager_op_type=ManagerOpType.CREATE, + db_type=DBType.Pulsar, + service_type=ManagerServiceType.PULSAR_MANAGER, + manager_ip=pulsar_flow_data["manager_ip"], + manager_port=pulsar_flow_data["manager_port"], + ) + pulsar_pipeline.add_act( + act_name=_("插入pulsar manager实例信息"), + act_component_code=BigdataManagerComponent.code, + kwargs={**asdict(act_kwargs), **asdict(manager_kwargs)}, + ) + + # 写入token + pulsar_pipeline.add_act( + act_name=_("写入token"), act_component_code=PulsarSetTokenContextComponent.code, kwargs=asdict(act_kwargs) + ) + + # 写入元数据 + pulsar_pipeline.add_act( + act_name=_("添加元数据到DBMeta"), act_component_code=PulsarDBMetaComponent.code, kwargs=asdict(act_kwargs) + ) + + # 回写配置 + pulsar_pipeline.add_act( + act_name=_("回写集群配置信息"), act_component_code=WriteBackPulsarConfigComponent.code, kwargs=asdict(act_kwargs) + ) + + pulsar_pipeline.run_pipeline() + + def __get_apply_flow_data(self, data) -> dict: + flow_data = copy.deepcopy(data) + # 写入配置 数据保留时间 单位为 分钟 + flow_data["retention_time"] = data["retention_minutes"] + + zk_host_map = self.make_zk_host_map() + flow_data["zk_host_map"] = zk_host_map + # 定义zk_host字符串 + flow_data["zk_hosts_str"] = ",".join(zk_host_map.values()) + return flow_data diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py index 3fb519d9f1..e7905037c5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py @@ -86,7 +86,11 @@ def ProxyBatchInstallAtomJob(root_id, ticket_data, act_kwargs: ActKwargs, param: act_name=_("Proxy-002-{}-安装backup-client工具").format(exec_ip), act_component_code=DownloadBackupClientComponent.code, kwargs=asdict( - DownloadBackupClientKwargs(bk_cloud_id=act_kwargs.cluster["bk_cloud_id"], download_host_list=[exec_ip]), + DownloadBackupClientKwargs( + bk_cloud_id=act_kwargs.cluster["bk_cloud_id"], + bk_biz_id=int(act_kwargs.cluster["bk_biz_id"]), + download_host_list=[exec_ip], + ), ), ) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py index a02028c6f8..5885c2ef1e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py @@ -28,6 +28,7 @@ from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode, get_twemproxy_cluster_server_shards from .redis_cluster_slave_rep import RedisClusterSlaveReplaceJob from .redis_install import RedisBatchInstallAtomJob @@ -73,6 +74,10 @@ def TwemproxyClusterMasterReplaceJob( """ act_kwargs = deepcopy(sub_kwargs) redis_pipeline = SubBuilder(root_id=root_id, data=ticket_data) + twemproxy_server_shards = get_twemproxy_cluster_server_shards( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"], act_kwargs.cluster["slave_ins_map"] + ) + # ## 部署实例 ############################################################################# sub_pipelines = [] master_replace_detail = master_replace_info["redis_master"] @@ -89,6 +94,10 @@ def TwemproxyClusterMasterReplaceJob( "instance_numb": len(act_kwargs.cluster["master_ports"][old_master]), "spec_id": master_replace_info["master_spec"].get("id", 0), "spec_config": master_replace_info["master_spec"], + "server_shards": twemproxy_server_shards.get(new_host_master, {}), + "cache_backup_mode": get_cache_backup_mode( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"] + ), } sub_pipelines.append(RedisBatchInstallAtomJob(root_id, ticket_data, act_kwargs, params)) @@ -97,6 +106,7 @@ def TwemproxyClusterMasterReplaceJob( params["meta_role"] = InstanceRole.REDIS_SLAVE.value params["spec_id"] = master_replace_info["slave_spec"].get("id", 0) params["spec_config"] = master_replace_info["slave_spec"] + params["server_shards"] = twemproxy_server_shards.get(new_host_slave, {}) sub_pipelines.append(RedisBatchInstallAtomJob(root_id, ticket_data, act_kwargs, params)) redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) # ### 部署实例 ####################################################################### 完毕 ### @@ -129,6 +139,10 @@ def TwemproxyClusterMasterReplaceJob( "origin_2": old_slave_ins.split(IP_PORT_DIVIDER)[1], "sync_dst1": new_ins_port, "sync_dst2": new_ins_port, + "server_shards": twemproxy_server_shards.get(new_host_master, {}), + "cache_backup_mode": get_cache_backup_mode( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"] + ), } ) new_ins_port = new_ins_port + 1 diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py index aecaa7a9b7..8adc169c12 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py @@ -27,6 +27,7 @@ from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode, get_twemproxy_cluster_server_shards from .redis_install import RedisBatchInstallAtomJob from .redis_makesync import RedisMakeSyncAtomJob @@ -46,6 +47,9 @@ def RedisClusterSlaveReplaceJob(root_id, ticket_data, sub_kwargs: ActKwargs, sla # ### 部署实例 ############################################################################### sub_pipelines = [] slave_replace_detail = slave_replace_info["redis_slave"] + twemproxy_server_shards = get_twemproxy_cluster_server_shards( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"], act_kwargs.cluster["slave_ins_map"] + ) for replace_link in slave_replace_detail: # {"ip": "1.1.1.a","spec_id": 17,"target": {"bk_cloud_id": 0,"bk_host_id": 216,"status": 1,"ip": "2.2.2.b"}} old_slave = replace_link["ip"] @@ -58,6 +62,10 @@ def RedisClusterSlaveReplaceJob(root_id, ticket_data, sub_kwargs: ActKwargs, sla "instance_numb": len(act_kwargs.cluster["slave_ports"][old_slave]), "spec_id": slave_replace_info["slave_spec"].get("id", 0), "spec_config": slave_replace_info["slave_spec"], + "server_shards": twemproxy_server_shards.get(new_slave, {}), + "cache_backup_mode": get_cache_backup_mode( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"] + ), } sub_builder = RedisBatchInstallAtomJob(root_id, ticket_data, act_kwargs, params) sub_pipelines.append(sub_builder) @@ -76,6 +84,10 @@ def RedisClusterSlaveReplaceJob(root_id, ticket_data, sub_kwargs: ActKwargs, sla "origin_2": old_slave, "sync_dst1": new_slave, "ins_link": [], + "server_shards": twemproxy_server_shards.get(new_slave, {}), + "cache_backup_mode": get_cache_backup_mode( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"] + ), } for slave_port in act_kwargs.cluster["slave_ports"][old_slave]: old_ins = "{}{}{}".format(old_slave, IP_PORT_DIVIDER, slave_port) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py index df7721ea8c..882a506224 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py @@ -90,7 +90,11 @@ def RedisBatchInstallAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, param: act_name=_("Redis-{}-安装backup-client工具").format(exec_ip), act_component_code=DownloadBackupClientComponent.code, kwargs=asdict( - DownloadBackupClientKwargs(bk_cloud_id=act_kwargs.cluster["bk_cloud_id"], download_host_list=[exec_ip]), + DownloadBackupClientKwargs( + bk_cloud_id=act_kwargs.cluster["bk_cloud_id"], + bk_biz_id=int(act_kwargs.cluster["bk_biz_id"]), + download_host_list=[exec_ip], + ), ), ) @@ -144,6 +148,8 @@ def RedisBatchInstallAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, param: "cluster_name": act_kwargs.cluster["cluster_name"], "cluster_type": act_kwargs.cluster["cluster_type"], "cluster_domain": act_kwargs.cluster["immute_domain"], + "server_shards": param.get("server_shards", {}), + "cache_backup_mode": param.get("cache_backup_mode", ""), } ] act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py index 623aef17d8..69a8025f1f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py @@ -40,6 +40,8 @@ def RedisMakeSyncAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, params: Di "sync_dst1":"1.1.1.x", # new_master "sync_dst2":"2.2.x.1", # new_slave "ins_link":[{"origin_1":"port","origin_2":"port","sync_dst1":"port","sync_dst2":"port"}], + "server_shards":{}, + "cache_backup_mode":"", } """ act_kwargs = deepcopy(sub_kwargs) @@ -70,6 +72,7 @@ def RedisMakeSyncAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, params: Di "bk_biz_id": str(act_kwargs.cluster["bk_biz_id"]), "bk_cloud_id": int(act_kwargs.cluster["bk_cloud_id"]), "server_ports": [], + "server_shards": {}, "cluster_domain": act_kwargs.cluster["immute_domain"], } ] @@ -108,6 +111,8 @@ def RedisMakeSyncAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, params: Di "meta_role": InstanceRole.REDIS_SLAVE.value, # 可能是master/slave 角色 "server_ip": params["sync_dst1"], "server_ports": server_ports, + "server_shards": params.get("server_shards", {}), + "cache_backup_mode": params.get("cache_backup_mode", ""), "cluster_name": act_kwargs.cluster["cluster_name"], "cluster_type": act_kwargs.cluster["cluster_type"], "cluster_domain": act_kwargs.cluster["immute_domain"], diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py index 02f4cc9ff9..45c7366ca0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py @@ -47,6 +47,15 @@ def RedisBatchShutdownAtomJob(root_id, ticket_data, sub_kwargs: ActKwargs, shutd exec_ip = shutdown_param["ip"] act_kwargs = deepcopy(sub_kwargs) + trans_files = GetFileList(db_type=DBType.Redis) + act_kwargs.file_list = trans_files.redis_dbmon() + act_kwargs.exec_ip = exec_ip + sub_pipeline.add_act( + act_name=_("{}-下发介质包").format(exec_ip), + act_component_code=TransFileComponent.code, + kwargs=asdict(act_kwargs), + ) + # 监听请求。集群是先关闭再下架,所以理论上这里是没请求才对 act_kwargs.exec_ip = exec_ip act_kwargs.cluster["exec_ip"] = exec_ip diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/__init__.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py new file mode 100644 index 0000000000..5ab9236971 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py @@ -0,0 +1,35 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.translation import ugettext as _ + +from backend.exceptions import AppBaseException, ErrorCode + + +class TendisFlowBaseException(AppBaseException): + MODULE_CODE = ErrorCode.FLOW_CODE + MESSAGE = _("Flow模块Tendis 异常") + + +class NormalTendisFlowException(TendisFlowBaseException): + ERROR_CODE = "001" + MESSAGE = _("通用异常") + MESSAGE_TPL = _("{message}") + + +class TendisGetBackupInfoFailedException(TendisFlowBaseException): + ERROR_CODE = "006" + MESSAGE = _("获取备份失败") + MESSAGE_TPL = _("{message}") + + +class TendisGetBinlogFailedException(TendisFlowBaseException): + ERROR_CODE = "007" + MESSAGE = _("获取binlog失败") + MESSAGE_TPL = _("{message}") diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py index dbe74c62a4..f2186e103b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py @@ -26,6 +26,7 @@ from backend.flow.plugins.components.collections.redis.get_redis_payload import GetRedisActPayloadComponent from backend.flow.plugins.components.collections.redis.redis_dts_server_meta import RedisDtsServerMetaComponent from backend.flow.plugins.components.collections.redis.trans_flies import TransFileComponent +from backend.flow.utils.cloud.cloud_act_payload import CloudServiceActPayload from backend.flow.utils.redis.redis_act_playload import RedisActPayload from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext @@ -57,7 +58,7 @@ def redis_add_dts_server_flow(self): info: {"ip": "3.3.3.1", "bk_cloud_id": 0, "bk_host_id": 2,"bk_city_name":"上海"} """ logger.info("redis_add_dts_server_flow info:{}".format(info)) - nginx_url = self.__get_cloud_nginx_url(info["bk_cloud_id"]) + nginx_url = CloudServiceActPayload.get_cloud_nginx_url(info["bk_cloud_id"]) cloud_token = self.__get_cloud_token(info["bk_cloud_id"]) system_user_info = self.__get_system_user_info(self.data["bk_biz_id"]) @@ -100,13 +101,6 @@ def redis_add_dts_server_flow(self): redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) redis_pipeline.run_pipeline() - def __get_cloud_nginx_url(self, bk_cloud_id): - """ - 获取云区域nginx地址 - """ - nginx = DBCloudProxy.objects.filter(bk_cloud_id=bk_cloud_id).last() - return "http://{}".format(nginx.internal_address) - def __get_cloud_token(self, bk_cloud_id) -> str: """ 获取云区域token diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py index a8b8c4f24a..77cdeeffbd 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py @@ -30,6 +30,7 @@ from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode, get_twemproxy_cluster_server_shards logger = logging.getLogger("flow") @@ -121,6 +122,19 @@ def add_slave_flow(self): cluster_kwargs.cluster.update(cluster_info) cluster_kwargs.cluster["created_by"] = self.data["created_by"] + newslave_to_master = {} + for host_pair in input_item["pairs"]: + master_ip = host_pair["redis_master"]["ip"] + for new_slave_item in host_pair["redis_slave"]: + for port in cluster_info["master_ports"][master_ip]: + newslave_to_master[ + "{}{}{}".format(new_slave_item["ip"], IP_PORT_DIVIDER, port) + ] = "{}{}{}".format(master_ip, IP_PORT_DIVIDER, port) + + twemproxy_server_shards = get_twemproxy_cluster_server_shards( + bk_biz_id, input_item["cluster_id"], newslave_to_master + ) + sub_pipeline.add_act( act_name=_("初始化配置-{}".format(cluster_info["immute_domain"])), act_component_code=GetRedisActPayloadComponent.code, @@ -142,6 +156,8 @@ def add_slave_flow(self): "instance_numb": len(cluster_info["master_ports"][master_ip]), "spec_id": input_item["resource_spec"][master_ip].get("id", 0), "spec_config": input_item["resource_spec"][master_ip], + "server_shards": twemproxy_server_shards.get(new_slave_item["ip"], {}), + "cache_backup_mode": get_cache_backup_mode(bk_biz_id, input_item["cluster_id"]), }, ) child_pipelines.append(install_builder) @@ -156,6 +172,8 @@ def add_slave_flow(self): "origin_1": master_ip, "sync_dst1": new_slave_item["ip"], "ins_link": [], + "server_shards": twemproxy_server_shards.get(new_slave_item["ip"], {}), + "cache_backup_mode": get_cache_backup_mode(bk_biz_id, input_item["cluster_id"]), } for port in cluster_info["master_ports"][master_ip]: sync_param["ins_link"].append({"origin_1": str(port), "sync_dst1": str(port)}) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_apply_flow.py index b404ad366b..98fb474887 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_apply_flow.py @@ -11,6 +11,7 @@ import copy import json import logging.config +from collections import defaultdict from dataclasses import asdict from typing import Dict, Optional @@ -30,6 +31,7 @@ from backend.flow.utils.redis.redis_act_playload import RedisActPayload from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext, DnsKwargs from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode from backend.flow.utils.redis.redis_util import check_domain logger = logging.getLogger("flow") @@ -87,7 +89,7 @@ def __pre_check(self, proxy_ips, master_ips, slave_ips, group_num, shard_num, se if len(m) != 0: raise Exception("[{}] is used.".format(m)) - def cal_twemproxy_serveres(self, master_ips, shard_num, inst_num, name) -> list: + def cal_twemproxy_serveres(self, master_ips, slave_ips, shard_num, inst_num, name): """ 计算twemproxy的servers 列表 - redisip:redisport:1 app beginSeg-endSeg 1 @@ -98,7 +100,9 @@ def cal_twemproxy_serveres(self, master_ips, shard_num, inst_num, name) -> list: # 计算分片 servers = [] - for _index, ip in enumerate(master_ips): + twemproxy_server_shards = defaultdict(dict) + for _index, master_ip in enumerate(master_ips): + slave_ip = slave_ips[_index] for inst_no in range(0, inst_num): port = DEFAULT_REDIS_START_PORT + inst_no begin_seg = seg_no * seg_num @@ -109,8 +113,12 @@ def cal_twemproxy_serveres(self, master_ips, shard_num, inst_num, name) -> list: if begin_seg >= DEFAULT_TWEMPROXY_SEG_TOTOL_NUM or end_seg >= DEFAULT_TWEMPROXY_SEG_TOTOL_NUM: raise Exception("cal_twemproxy_serveres error. pleace check params") seg_no = seg_no + 1 - servers.append("{}:{} {} {}-{} {}".format(ip, port, name, begin_seg, end_seg, 1)) - return servers + servers.append("{}:{} {} {}-{} {}".format(master_ip, port, name, begin_seg, end_seg, 1)) + master_inst = "{}:{}".format(master_ip, port) + slave_inst = "{}:{}".format(slave_ip, port) + twemproxy_server_shards[master_ip][master_inst] = "{}-{}".format(begin_seg, end_seg) + twemproxy_server_shards[slave_ip][slave_inst] = "{}-{}".format(begin_seg, end_seg) + return servers, twemproxy_server_shards def deploy_redis_cluster_flow(self): """ @@ -128,7 +136,9 @@ def deploy_redis_cluster_flow(self): ins_num = self.data["shard_num"] // self.data["group_num"] ports = list(map(lambda i: i + DEFAULT_REDIS_START_PORT, range(ins_num))) - servers = self.cal_twemproxy_serveres(master_ips, self.data["shard_num"], ins_num, self.data["cluster_name"]) + servers, twemproxy_server_shards = self.cal_twemproxy_serveres( + master_ips, slave_ips, self.data["shard_num"], ins_num, self.data["cluster_name"] + ) self.__pre_check( proxy_ips, @@ -170,6 +180,8 @@ def deploy_redis_cluster_flow(self): params["spec_id"] = int(self.data["resource_spec"]["master"]["id"]) params["spec_config"] = self.data["resource_spec"]["master"] params["meta_role"] = InstanceRole.REDIS_MASTER.value + params["server_shards"] = twemproxy_server_shards[ip] + params["cache_backup_mode"] = get_cache_backup_mode(self.data["bk_biz_id"], 0) sub_builder = RedisBatchInstallAtomJob(self.root_id, self.data, act_kwargs, params) sub_pipelines.append(sub_builder) for ip in slave_ips: @@ -180,6 +192,8 @@ def deploy_redis_cluster_flow(self): params["spec_id"] = int(self.data["resource_spec"]["slave"]["id"]) params["spec_config"] = self.data["resource_spec"]["slave"] params["meta_role"] = InstanceRole.REDIS_SLAVE.value + params["server_shards"] = twemproxy_server_shards[ip] + params["cache_backup_mode"] = get_cache_backup_mode(self.data["bk_biz_id"], 0) sub_builder = RedisBatchInstallAtomJob(self.root_id, self.data, act_kwargs, params) sub_pipelines.append(sub_builder) redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py index 20258045b4..52478ac8de 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py @@ -22,12 +22,13 @@ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import InstanceRole, InstanceStatus from backend.db_meta.models import AppCache, Cluster -from backend.db_package.models import Package +from backend.db_proxy.constants import ExtensionType +from backend.db_proxy.models import DBExtension from backend.db_services.redis.redis_dts.constants import ( DTS_SWITCH_PREDIXY_PRECHECK, DTS_SWITCH_TWEMPROXY_PRECHECK, - SERVERS_ADD_ETC_HOSTS, - SERVERS_DEL_ETC_HOSTS, + SERVERS_ADD_RESOLV_CONF, + SERVERS_DEL_RESOLV_CONF, ) from backend.db_services.redis.redis_dts.enums import ( DtsBillType, @@ -41,6 +42,7 @@ ) from backend.db_services.redis.redis_dts.models import TbTendisDTSJob, TbTendisDtsTask from backend.db_services.redis.redis_dts.util import ( + common_cluster_precheck, complete_redis_dts_kwargs_dst_data, complete_redis_dts_kwargs_src_data, get_cluster_info_by_id, @@ -55,7 +57,7 @@ is_tendisssd_instance_type, is_twemproxy_proxy_type, ) -from backend.flow.consts import ConfigFileEnum, MediumEnum, StateType, WriteContextOpType +from backend.flow.consts import ConfigFileEnum, StateType, WriteContextOpType from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList from backend.flow.engine.bamboo.scene.redis.atom_jobs.redis_dts import ( @@ -81,7 +83,12 @@ from backend.flow.utils.redis.redis_act_playload import RedisActPayload from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, RedisDtsContext, RedisDtsOnlineSwitchContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta -from backend.flow.utils.redis.redis_proxy_util import check_cluster_proxy_backends_consistent +from backend.flow.utils.redis.redis_proxy_util import ( + check_cluster_proxy_backends_consistent, + get_cache_backup_mode, + get_db_versions_by_cluster_type, + get_twemproxy_cluster_server_shards, +) from backend.utils.time import datetime2str logger = logging.getLogger("flow") @@ -105,7 +112,7 @@ def redis_cluster_data_copy_flow(self): write_mode = self.data["write_mode"] dts_copy_type = self.__get_dts_copy_type() sub_pipelines = [] - # redis_pipeline.add_act(act_name=_("Redis-人工确认"), act_component_code=PauseComponent.code, kwargs={}) + redis_pipeline.add_act(act_name=_("Redis-人工确认"), act_component_code=PauseComponent.code, kwargs={}) if self.data["ticket_type"] == DtsBillType.REDIS_CLUSTER_ROLLBACK_DATA_COPY.value: self.data["sync_disconnect_setting"] = {} self.data["sync_disconnect_setting"]["type"] = "" @@ -129,6 +136,9 @@ def redis_cluster_data_copy_flow(self): complete_redis_dts_kwargs_src_data(bk_biz_id, dts_copy_type, info, act_kwargs) complete_redis_dts_kwargs_dst_data(self.__get_dts_biz_id(info), dts_copy_type, "", info, act_kwargs) + # 获取云区域的dns nameserver + dns_nameserver = self.__get_dns_nameserver(act_kwargs.cluster["src"]["bk_cloud_id"]) + if ( dts_copy_type != DtsCopyType.COPY_TO_OTHER_SYSTEM and write_mode == DtsWriteMode.FLUSHALL_AND_WRITE_TO_REDIS @@ -137,12 +147,12 @@ def redis_cluster_data_copy_flow(self): etc_hosts_param = get_etc_hosts_lines_and_ips(bk_biz_id, dts_copy_type, info, None) - # 添加/etc/hosts + # 添加/etc/resolv.conf act_kwargs.exec_ip = etc_hosts_param["ip_list"] act_kwargs.write_op = WriteContextOpType.APPEND.value - act_kwargs.cluster["shell_command"] = SERVERS_ADD_ETC_HOSTS.format(etc_hosts_param["etc_hosts_lines"]) + act_kwargs.cluster["shell_command"] = SERVERS_ADD_RESOLV_CONF.format(dns_nameserver) sub_pipeline.add_act( - act_name=_("{}等添加etc_hosts").format(etc_hosts_param["ip_list"][0]), + act_name=_("{}等添加域名解析").format(etc_hosts_param["ip_list"][0]), act_component_code=ExecuteShellScriptComponent.code, kwargs=asdict(act_kwargs), ) @@ -160,15 +170,15 @@ def redis_cluster_data_copy_flow(self): kwargs=asdict(act_kwargs), ) - # 删除/etc/hosts - act_kwargs.exec_ip = etc_hosts_param["ip_list"] - act_kwargs.write_op = WriteContextOpType.APPEND.value - act_kwargs.cluster["shell_command"] = SERVERS_DEL_ETC_HOSTS.format(etc_hosts_param["etc_hosts_lines"]) - sub_pipeline.add_act( - act_name=_("{}等删除etc_hosts").format(etc_hosts_param["ip_list"][0]), - act_component_code=ExecuteShellScriptComponent.code, - kwargs=asdict(act_kwargs), - ) + # 剔除/etc/resolv.conf + # act_kwargs.exec_ip = etc_hosts_param["ip_list"] + # act_kwargs.write_op = WriteContextOpType.APPEND.value + # act_kwargs.cluster["shell_command"] = SERVERS_DEL_RESOLV_CONF.format(dns_nameserver) + # sub_pipeline.add_act( + # act_name=_("{}等剔除域名解析").format(etc_hosts_param["ip_list"][0]), + # act_component_code=ExecuteShellScriptComponent.code, + # kwargs=asdict(act_kwargs), + # ) sub_pipelines.append( sub_pipeline.build_sub_process( @@ -198,6 +208,15 @@ def __get_dts_biz_id(self, info: dict) -> int: else: return self.data["bk_biz_id"] + def __get_dns_nameserver(self, bk_cloud_id: int) -> str: + dns_rows = DBExtension.get_extension_in_cloud(bk_cloud_id, ExtensionType.DNS) + if len(dns_rows) == 0: + raise Exception(_("bk_cloud_id:{} 未找到DNS nameserver").format(bk_cloud_id)) + dns_row = dns_rows[0] + if not dns_row.details["ip"]: + raise Exception(_("bk_cloud_id:{} DNS nameserver ip 为空").format(bk_cloud_id)) + return "nameserver {}".format(dns_row.details["ip"]) + def data_copy_precheck(self): src_cluster_set: set = set() bk_biz_id = self.data["bk_biz_id"] @@ -218,20 +237,20 @@ def data_copy_precheck(self): src_cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=int(info["src_cluster"])) except Cluster.DoesNotExist: raise Exception("src_cluster {} does not exist".format(info["src_cluster"])) - # 源集群是否每个running的master都有slave - running_masters = src_cluster.storageinstance_set.filter( - status=InstanceStatus.RUNNING.value, instance_role=InstanceRole.REDIS_MASTER.value - ) - for master in running_masters: - if not master.as_ejector or not master.as_ejector.first(): - master_inst = "{}:{}".format(master.machine.ip, master.port) - raise Exception(_("源集群{}存在master:{}没有slave").format(info["src_cluster"], master_inst)) + common_cluster_precheck(bk_biz_id, src_cluster.id) + + # 检查源集群 bk_cloud_id 是否有dns nameserver + self.__get_dns_nameserver(src_cluster.bk_cloud_id) if dts_copy_type != DtsCopyType.COPY_TO_OTHER_SYSTEM.value: try: dst_cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=int(info["dst_cluster"])) except Cluster.DoesNotExist: - raise Exception("dst_cluster {} does not exist".format(info["dst_cluster"])) + raise Exception(_("目标集群 {} 不存在").format(info["dst_cluster"])) + + common_cluster_precheck(bk_biz_id, dst_cluster.id) + # 检查目标集群 bk_cloud_id 是否有dns nameserver + self.__get_dns_nameserver(dst_cluster.bk_cloud_id) if dts_copy_type == DtsCopyType.COPY_FROM_ROLLBACK_INSTANCE.value: # 数据构造任务是否存在 @@ -244,10 +263,10 @@ def data_copy_precheck(self): ) except TbTendisRollbackTasks.DoesNotExist: raise Exception( - "rollback task(src_cluster:{} recovery_time_point:{} \ - destroyed_status:0) does not exist".format( - info["src_cluster"], info["recovery_time_point"] - ) + _( + "回档任务(src_cluster:{} recovery_time_point:{} \ + destroyed_status:0) 不存在?" + ).format(info["src_cluster"], info["recovery_time_point"]) ) # 数据构造临时集群是否可访问 proxy_password_bytes = ast.literal_eval(rollback_task.temp_proxy_password) @@ -264,9 +283,7 @@ def data_copy_precheck(self): ) except Exception as e: raise Exception( - "rollback task(temp_cluster_proxy:{}) redis ping failed".format( - rollback_task.temp_cluster_proxy - ) + _("回档临时环境如何(temp_cluster_proxy:{}) ping 失败").format(rollback_task.temp_cluster_proxy) ) try: DRSApi.redis_rpc( @@ -324,24 +341,6 @@ def get_dst_cluster_install_param(self, info: dict) -> dict: install_param["resource_spec"] = info["resource_spec"] return install_param - def get_db_versions_by_cluster_type(self, cluster_type: str) -> list: - if is_redis_instance_type(cluster_type): - ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.Redis.value).values_list( - "version", flat=True - ) - return list(ret) - elif is_tendisplus_instance_type(cluster_type): - ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.TendisPlus.value).values_list( - "version", flat=True - ) - return list(ret) - elif is_tendisssd_instance_type(cluster_type): - ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.TendisSsd.value).values_list( - "version", flat=True - ) - return list(ret) - raise Exception("cluster_type:{} not a redis cluster type?".format(cluster_type)) - def shard_num_or_cluster_type_update_precheck(self): src_cluster_set: set = set() bk_biz_id = self.data["bk_biz_id"] @@ -350,60 +349,56 @@ def shard_num_or_cluster_type_update_precheck(self): raise Exception(_("源集群{}重复了").format(info["src_cluster"])) src_cluster_set.add(info["src_cluster"]) - src_cluster: Cluster = None - try: - src_cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=int(info["src_cluster"])) - except Cluster.DoesNotExist: - raise Exception("src_cluster {} does not exist".format(info["src_cluster"])) + common_cluster_precheck(bk_biz_id, int(info["src_cluster"])) + src_cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=int(info["src_cluster"])) + + # 检查源集群 bk_cloud_id 是否有dns nameserver + self.__get_dns_nameserver(src_cluster.bk_cloud_id) if self.data["ticket_type"] == DtsBillType.REDIS_CLUSTER_SHARD_NUM_UPDATE.value: if info["current_shard_num"] == info["cluster_shard_num"]: raise Exception( - "current_shard_num:{} == cluster_shard_num:{}".format( - info["current_shard_num"], info["cluster_shard_num"] - ), + _("集群当前分片数:{} 等于 目标分片数:{}").format(info["current_shard_num"], info["cluster_shard_num"]), ) running_masters = src_cluster.storageinstance_set.filter( status=InstanceStatus.RUNNING.value, instance_role=InstanceRole.REDIS_MASTER.value ) if running_masters.count() == info["cluster_shard_num"]: raise Exception( - "src_cluster:{} running_masters:{} == cluster_shard_num:{}".format( + _("集群:{} 当前running_master个数:{} 等于 目标分片数:{}").format( src_cluster.immute_domain, running_masters.count(), info["cluster_shard_num"] ), ) if info.get("db_version", "") != "": - if info["db_version"] not in self.get_db_versions_by_cluster_type(src_cluster.cluster_type): + if info["db_version"] not in get_db_versions_by_cluster_type(src_cluster.cluster_type): raise Exception( - "src_cluster:{} db_version:{} not in src_cluster_type:{} db_versions:{}".format( + _("集群:{} 目标版本:{} 不在 集群类型:{} 版本列表:{}中").format( src_cluster.immute_domain, info["db_version"], src_cluster.cluster_type, - self.get_db_versions_by_cluster_type(src_cluster.cluster_type), + get_db_versions_by_cluster_type(src_cluster.cluster_type), ) ) elif self.data["ticket_type"] == DtsBillType.REDIS_CLUSTER_TYPE_UPDATE.value: if info["current_cluster_type"] == info["target_cluster_type"]: raise Exception( - "current_cluster_type:{} == target_cluster_type:{}".format( - info["current_cluster_type"], info["target_cluster_type"] - ), + _("当前集群类型:{} == 目标集群类型:{}").format(info["current_cluster_type"], info["target_cluster_type"]), ) if info["target_cluster_type"] == src_cluster.cluster_type: raise Exception( - "target_cluster_type:{} == src_cluster:{} cluster_type:{}".format( + _("目标集群类型:{} == 集群:{} 当前类型:{}").format( info["target_cluster_type"], src_cluster.immute_domain, src_cluster.cluster_type ), ) if info.get("db_version", "") == "": - raise Exception("src_cluster:{} db_version is empty".format(info["src_cluster"])) - if info["db_version"] not in self.get_db_versions_by_cluster_type(info["target_cluster_type"]): + raise Exception(_("集群:{} 目标版本为空").format(info["src_cluster"])) + if info["db_version"] not in get_db_versions_by_cluster_type(info["target_cluster_type"]): raise Exception( - "src_cluster:{} db_version:{} not in target_cluster_type:{} db_versions:{}".format( + _("集群:{} 目标版本:{} 不在 集群类型:{} 版本列表:{}中").format( info["src_cluster"], info["db_version"], info["target_cluster_type"], - self.get_db_versions_by_cluster_type(info["target_cluster_type"]), + get_db_versions_by_cluster_type(info["target_cluster_type"]), ) ) # 检查所有 src proxys backends 一致 @@ -493,6 +488,9 @@ def shard_num_or_cluster_type_update_flow(self): data_copy_info, act_kwargs, ) + # 获取云区域的dns nameserver + dns_nameserver = self.__get_dns_nameserver(act_kwargs.cluster["src"]["bk_cloud_id"]) + redis_pipeline.add_act( act_name=_("初始化配置"), act_component_code=GetRedisActPayloadComponent.code, kwargs=asdict(act_kwargs) ) @@ -516,12 +514,12 @@ def shard_num_or_cluster_type_update_flow(self): kwargs=asdict(act_kwargs), ) - # 添加/etc/hosts + # 添加/etc/resolv.conf act_kwargs.exec_ip = etc_hosts_param["ip_list"] act_kwargs.write_op = WriteContextOpType.APPEND.value - act_kwargs.cluster["shell_command"] = SERVERS_ADD_ETC_HOSTS.format(etc_hosts_param["etc_hosts_lines"]) + act_kwargs.cluster["shell_command"] = SERVERS_ADD_RESOLV_CONF.format(dns_nameserver) redis_pipeline.add_act( - act_name=_("{}等添加etc_hosts").format(etc_hosts_param["ip_list"][0]), + act_name=_("{}等添加域名解析").format(etc_hosts_param["ip_list"][0]), act_component_code=ExecuteShellScriptComponent.code, kwargs=asdict(act_kwargs), ) @@ -548,15 +546,15 @@ def shard_num_or_cluster_type_update_flow(self): kwargs=asdict(act_kwargs), ) - # 删除/etc/hosts - act_kwargs.exec_ip = etc_hosts_param["ip_list"] - act_kwargs.write_op = WriteContextOpType.APPEND.value - act_kwargs.cluster["shell_command"] = SERVERS_DEL_ETC_HOSTS.format(etc_hosts_param["etc_hosts_lines"]) - redis_pipeline.add_act( - act_name=_("{}等删除etc_hosts").format(etc_hosts_param["ip_list"][0]), - act_component_code=ExecuteShellScriptComponent.code, - kwargs=asdict(act_kwargs), - ) + # 剔除/etc/resolv.conf + # act_kwargs.exec_ip = etc_hosts_param["ip_list"] + # act_kwargs.write_op = WriteContextOpType.APPEND.value + # act_kwargs.cluster["shell_command"] = SERVERS_DEL_RESOLV_CONF.format(dns_nameserver) + # redis_pipeline.add_act( + # act_name=_("{}等剔除域名解析").format(etc_hosts_param["ip_list"][0]), + # act_component_code=ExecuteShellScriptComponent.code, + # kwargs=asdict(act_kwargs), + # ) redis_pipeline.run_pipeline() def __online_switch_precheck(self): @@ -660,6 +658,17 @@ def __get_cluster_master_slave_ports(self, bk_biz_id: int, cluster_id: int) -> d "slave_ports": slave_ports, } + def __get_cluster_master_slave_ips(self, bk_biz_id: int, cluster_id: int) -> list: + cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) + ips = set() + + for master_obj in cluster.storageinstance_set.filter(instance_role=InstanceRole.REDIS_MASTER.value): + ips.add(master_obj.machine.ip) + if master_obj.as_ejector and master_obj.as_ejector.first(): + my_slave_obj = master_obj.as_ejector.get().receiver + ips.add(my_slave_obj.machine.ip) + return list(ips) + def online_switch_flow(self): self.__online_switch_precheck() redis_pipeline = Builder(root_id=self.root_id, data=self.data) @@ -746,7 +755,7 @@ def online_switch_flow(self): act_kwargs.exec_ip = src_cluster_info["proxy_ips"] acts_list.append( { - "act_name": _("{} proxys下发介质").format(src_cluster_info["cluster_domain"]), + "act_name": _("{} proxys下发介质").format(src_cluster_info["cluster_name"]), "act_component_code": TransFileComponent.code, "kwargs": asdict(act_kwargs), } @@ -756,7 +765,28 @@ def online_switch_flow(self): act_kwargs.exec_ip = dst_cluster_info["proxy_ips"] acts_list.append( { - "act_name": _("{} proxys下发介质").format(dst_cluster_info["cluster_domain"]), + "act_name": _("{} proxys下发介质").format(dst_cluster_info["cluster_name"]), + "act_component_code": TransFileComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + + # backend 下发actuator和 dbmon介质 + act_kwargs.file_list = trans_files.redis_dbmon() + act_kwargs.exec_ip = self.__get_cluster_master_slave_ips(int(job_row.app), job_row.src_cluster_id) + acts_list.append( + { + "act_name": _("{} backend下发介质").format(src_cluster_info["cluster_name"]), + "act_component_code": TransFileComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + + act_kwargs.file_list = trans_files.redis_dbmon() + act_kwargs.exec_ip = self.__get_cluster_master_slave_ips(int(job_row.app), job_row.dst_cluster_id) + acts_list.append( + { + "act_name": _("{} backend下发介质").format(dst_cluster_info["cluster_name"]), "act_component_code": TransFileComponent.code, "kwargs": asdict(act_kwargs), } @@ -899,11 +929,18 @@ def online_switch_flow(self): # 但是在确定flow 流程静态信息时,这些 master/slave 依然属于 dst_cluster # 所以这里获取的是 dst_cluster的 master/slave ip ports src_master_slave_ports = self.__get_cluster_master_slave_ports(int(job_row.app), job_row.dst_cluster_id) + src_twemproxy_server_shards = get_twemproxy_cluster_server_shards( + int(job_row.app), job_row.dst_cluster_id, {} + ) acts_list = [] for ip, ports in src_master_slave_ports["master_ports"].items(): act_kwargs.cluster["servers"][0]["server_ip"] = ip act_kwargs.cluster["servers"][0]["server_ports"] = ports act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_MASTER.value + act_kwargs.cluster["servers"][0]["server_shards"] = src_twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + int(job_row.app), job_row.dst_cluster_id + ) act_kwargs.exec_ip = ip act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ acts_list.append( @@ -917,6 +954,10 @@ def online_switch_flow(self): act_kwargs.cluster["servers"][0]["server_ip"] = ip act_kwargs.cluster["servers"][0]["server_ports"] = ports act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_SLAVE.value + act_kwargs.cluster["servers"][0]["server_shards"] = src_twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + int(job_row.app), job_row.dst_cluster_id + ) act_kwargs.exec_ip = ip act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ acts_list.append( @@ -945,11 +986,18 @@ def online_switch_flow(self): # 但是在确定flow 流程静态信息时,这些 master/slave 依然属于 src_cluster # 所以这里获取的是 src_cluster的 master/slave ip ports dst_master_slave_ports = self.__get_cluster_master_slave_ports(int(job_row.app), job_row.src_cluster_id) + dst_twemproxy_server_shards = get_twemproxy_cluster_server_shards( + int(job_row.app), job_row.src_cluster_id, {} + ) acts_list = [] for ip, ports in dst_master_slave_ports["master_ports"].items(): act_kwargs.cluster["servers"][0]["server_ip"] = ip act_kwargs.cluster["servers"][0]["server_ports"] = ports act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_MASTER.value + act_kwargs.cluster["servers"][0]["server_shards"] = dst_twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + int(job_row.app), job_row.src_cluster_id + ) act_kwargs.exec_ip = ip act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ acts_list.append( @@ -963,6 +1011,10 @@ def online_switch_flow(self): act_kwargs.cluster["servers"][0]["server_ip"] = ip act_kwargs.cluster["servers"][0]["server_ports"] = ports act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_SLAVE.value + act_kwargs.cluster["servers"][0]["server_shards"] = dst_twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + int(job_row.app), job_row.src_cluster_id + ) act_kwargs.exec_ip = ip act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ acts_list.append( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py index bbbfc8a14e..3ae0a66617 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py @@ -45,6 +45,7 @@ from backend.flow.plugins.components.collections.redis.redis_ticket import RedisTicketComponent from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext, DnsKwargs from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode, get_twemproxy_cluster_server_shards from backend.ticket.constants import TicketStatus, TicketType logger = logging.getLogger("flow") @@ -322,6 +323,9 @@ def proxy_fix(self, flow_data, act_kwargs, proxy_fix_info): def slave_fix(self, flow_data, sub_kwargs, slave_fix_info): sub_pipeline = SubBuilder(root_id=self.root_id, data=flow_data) + twemproxy_server_shards = get_twemproxy_cluster_server_shards( + sub_kwargs.cluster["bk_biz_id"], sub_kwargs.cluster["cluster_id"], sub_kwargs.cluster["slave_ins_map"] + ) # ### 部署实例 ############################################################################### sub_pipelines = [] slave_fix_detail = slave_fix_info["redis_slave"] @@ -336,6 +340,10 @@ def slave_fix(self, flow_data, sub_kwargs, slave_fix_info): "instance_numb": len(sub_kwargs.cluster["slave_ports"][old_slave]), "spec_id": slave_fix_info["slave_spec"].get("id", 0), "spec_config": slave_fix_info["slave_spec"], + "server_shards": twemproxy_server_shards.get(new_slave, {}), + "cache_backup_mode": get_cache_backup_mode( + sub_kwargs.cluster["bk_biz_id"], sub_kwargs.cluster["cluster_id"] + ), } sub_builder = RedisBatchInstallAtomJob(self.root_id, flow_data, sub_kwargs, params) sub_pipelines.append(sub_builder) @@ -354,6 +362,10 @@ def slave_fix(self, flow_data, sub_kwargs, slave_fix_info): "origin_2": old_slave, "sync_dst1": new_slave, "ins_link": [], + "server_shards": twemproxy_server_shards.get(new_slave, {}), + "cache_backup_mode": get_cache_backup_mode( + sub_kwargs.cluster["bk_biz_id"], sub_kwargs.cluster["cluster_id"] + ), } for slave_port in sub_kwargs.cluster["slave_ports"][old_slave]: old_ins = "{}{}{}".format(old_slave, IP_PORT_DIVIDER, slave_port) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py index 1c7bffa552..ed6b679aab 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py @@ -34,6 +34,7 @@ from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import get_cache_backup_mode, get_twemproxy_cluster_server_shards logger = logging.getLogger("flow") @@ -79,7 +80,12 @@ def __get_cluster_info(bk_biz_id: int, cluster_id: int) -> dict: 2. master 上的端口列表 3. 实例对应关系:{master:port:slave:port} """ - master_pair_map, master_slave_map, master_ports = defaultdict(), defaultdict(), defaultdict(list) + slave_ins_map, master_pair_map, master_slave_map, master_ports = ( + defaultdict(), + defaultdict(), + defaultdict(), + defaultdict(list), + ) cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) for master_obj in cluster.storageinstance_set.filter(instance_role=InstanceRole.REDIS_MASTER.value): @@ -95,6 +101,9 @@ def __get_cluster_info(bk_biz_id: int, cluster_id: int) -> dict: "unsupport mutil slave with cluster {} 4:{}".format(cluster.immute_domain, master_obj.machine.ip) ) + slave_ins_map["{}{}{}".format(slave_obj.machine.ip, IP_PORT_DIVIDER, slave_obj.port)] = "{}{}{}".format( + master_obj.machine.ip, IP_PORT_DIVIDER, master_obj.port + ) master_slave_map[master_obj.machine.ip] = slave_obj.machine.ip return { @@ -105,6 +114,7 @@ def __get_cluster_info(bk_biz_id: int, cluster_id: int) -> dict: "cluster_name": cluster.name, "cluster_id": cluster.id, "master_ports": dict(master_ports), + "slave_ins_map": dict(slave_ins_map), "master_pair_map": dict(master_pair_map), "master_slave_map": dict(master_slave_map), "proxy_port": cluster.proxyinstance_set.first().port, @@ -162,6 +172,9 @@ def generate_ms_switch_flow(self, flow_data, act_kwargs, ms_switch, force=False) # {"redis_master": "1.1.2.3", "redis_slave": "1.1.2.4"} # ] redis_pipeline = SubBuilder(root_id=self.root_id, data=flow_data) + twemproxy_server_shards = get_twemproxy_cluster_server_shards( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"], act_kwargs.cluster["slave_ins_map"] + ) # 执行切换 ##################################################################################### sync_relations, master_ips, slave_ips = [], [], [] for ms_pair in ms_switch["pairs"]: @@ -205,7 +218,7 @@ def generate_ms_switch_flow(self, flow_data, act_kwargs, ms_switch, force=False) for master_ip in master_ips: sub_kwargs = deepcopy(act_kwargs) sub_kwargs.cluster["meta_update_ip"] = master_ip - sub_kwargs.cluster["meta_udpate_ports"] = act_kwargs.cluster["master_ports"][master_ip] + sub_kwargs.cluster["meta_update_ports"] = act_kwargs.cluster["master_ports"][master_ip] sub_kwargs.cluster["meta_update_status"] = InstanceStatus.UNAVAILABLE.value sub_kwargs.cluster["meta_func_name"] = RedisDBMeta.instances_failover_4_scene.__name__ sub_acts.append( @@ -238,6 +251,10 @@ def generate_ms_switch_flow(self, flow_data, act_kwargs, ms_switch, force=False) "cluster_name": act_kwargs.cluster["cluster_name"], "cluster_type": act_kwargs.cluster["cluster_type"], "cluster_domain": act_kwargs.cluster["immute_domain"], + "server_shards": twemproxy_server_shards.get(slave_ip, {}), + "cache_backup_mode": get_cache_backup_mode( + act_kwargs.cluster["bk_biz_id"], act_kwargs.cluster["cluster_id"] + ), } ] sub_acts.append( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py new file mode 100644 index 0000000000..8c1f3e6e0b --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py @@ -0,0 +1,544 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging.config +import re +from collections import defaultdict +from dataclasses import asdict +from typing import Dict, Optional + +from django.utils.translation import ugettext as _ + +from backend.components import DRSApi +from backend.configuration.constants import DBType +from backend.db_meta.api.cluster import nosqlcomm +from backend.db_meta.enums import InstanceRole, InstanceStatus +from backend.db_meta.models import AppCache, Cluster +from backend.db_package.models import Package +from backend.db_services.redis.redis_dts.constants import REDIS_CONF_DEL_SLAVEOF +from backend.db_services.redis.redis_dts.util import common_cluster_precheck, get_cluster_info_by_id +from backend.db_services.redis.util import is_redis_cluster_protocal, is_twemproxy_proxy_type +from backend.flow.consts import ( + DEFAULT_LAST_IO_SECOND_AGO, + DEFAULT_MASTER_DIFF_TIME, + MediumEnum, + SyncType, + WriteContextOpType, +) +from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder +from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.engine.bamboo.scene.redis.atom_jobs.redis_makesync import RedisMakeSyncAtomJob +from backend.flow.plugins.components.collections.redis.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.redis.exec_shell_script import ExecuteShellScriptComponent +from backend.flow.plugins.components.collections.redis.get_redis_payload import GetRedisActPayloadComponent +from backend.flow.plugins.components.collections.redis.redis_config import RedisConfigComponent +from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent +from backend.flow.plugins.components.collections.redis.trans_flies import TransFileComponent +from backend.flow.utils.redis.redis_act_playload import RedisActPayload +from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext +from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.flow.utils.redis.redis_proxy_util import ( + get_cache_backup_mode, + get_db_versions_by_cluster_type, + get_twemproxy_cluster_server_shards, +) +from backend.flow.utils.redis.redis_util import get_latest_redis_package_by_version, version_equal + +logger = logging.getLogger("flow") + + +class RedisClusterVersionUpdateOnline(object): + """ + redis集群在线版本升级 + """ + + def __init__(self, root_id: str, data: Optional[Dict]): + """ + @param root_id : 任务流程定义的root_id + @param data : 单据传递过来的参数列表,是dict格式 + """ + self.root_id = root_id + self.data = data + self.precheck() + + def precheck(self): + """ + 1. 集群是否存在 + 2. 版本信息是否变化 + 3. 是否存在非 running 状态的 proxy; + 4. 是否存在非 running 状态的 redis; + 5. 连接 proxy 是否正常; + 6. 连接 redis 是否正常; + 7. 是否所有master 都有 slave; + """ + bk_biz_id = self.data["bk_biz_id"] + for input_item in self.data["infos"]: + if not input_item["target_version"]: + raise Exception(_("redis集群 {} 目标版本为空?").format(input_item["cluster_id"])) + common_cluster_precheck(bk_biz_id, input_item["cluster_id"]) + cluster = Cluster.objects.get(bk_biz_id=bk_biz_id, id=input_item["cluster_id"]) + + # 检查版本是否合法 + valid_versions = get_db_versions_by_cluster_type(cluster.cluster_type) + if input_item["target_version"] not in valid_versions: + raise Exception( + _("redis集群 {}目标版本 {} 不合法,合法的版本:{}").format( + cluster.immute_domain, + input_item["target_version"], + valid_versions, + ) + ) + + if cluster.major_version == input_item["target_version"]: + cluster_info = get_cluster_info_by_id(bk_biz_id=bk_biz_id, cluster_id=cluster.id) + self.is_minor_version_update(cluster, cluster_info["redis_password"], input_item["target_version"]) + + # 是否大版本相同情况下,小版本升级 + # 1. 获取一个running_master, 进而获取到 master_addr; + # 2. 通过 redis_rpc 函数执行 info server, 进而获取到当前 current_redis_version; + # 3. 通过 Package包获取当前 target_version 最新包的最新版本 package_latest_version; + # 4. 对比 current_redis_version 和 package_latest_version, 相同则 raise Exception; + def is_minor_version_update(self, cluster: Cluster, redis_password: str, target_version: str): + one_running_master = cluster.storageinstance_set.filter( + instance_role=InstanceRole.REDIS_MASTER.value, status=InstanceStatus.RUNNING + ).first() + if not one_running_master: + raise Exception(_("redis集群 {} 没有running_master??").format(cluster.immute_domain)) + master_addr = one_running_master.ip_port + resp = DRSApi.redis_rpc( + { + "addresses": [master_addr], + "db_num": 0, + "password": redis_password, + "command": "ping", + "bk_cloud_id": cluster.bk_cloud_id, + } + ) + current_redis_version = re.search(r"redis_version:(.*)\r\n", resp[0]["result"]).group(1) + redis_pkg = get_latest_redis_package_by_version(target_version) + if not redis_pkg: + raise Exception(_("目标版本:{} 没有找到其最新的Package信息?").format(target_version)) + package_redis_version = redis_pkg.name + is_equal, err = version_equal(current_redis_version, package_redis_version) + if err: + raise Exception( + _("redis当前版本:{} 与 package版本:{} 比较失败: {}").format( + current_redis_version, package_redis_version, cluster.immute_domain, err + ) + ) + if is_equal: + raise Exception( + _("redis集群: redis当前版本:{} 与 package版本:{} 相同,无需升级").format( + cluster.immute_domain, current_redis_version, package_redis_version + ) + ) + + def get_cluster_meta_data(self, bk_biz_id: int, cluster_id: int): + cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) + + master_ports, slave_ports = defaultdict(list), defaultdict(list) + master_slave_pairs = [] + masterip_to_slaveip = {} + + for master_obj in cluster.storageinstance_set.filter(instance_role=InstanceRole.REDIS_MASTER.value): + master_ports[master_obj.machine.ip].append(master_obj.port) + if master_obj.as_ejector and master_obj.as_ejector.first(): + my_slave_obj = master_obj.as_ejector.get().receiver + slave_ports[my_slave_obj.machine.ip].append(my_slave_obj.port) + masterip_to_slaveip[master_obj.machine.ip] = my_slave_obj.machine.ip + master_slave_pairs.append( + { + "master": {"ip": master_obj.machine.ip, "port": master_obj.port}, + "slave": {"ip": my_slave_obj.machine.ip, "port": my_slave_obj.port}, + } + ) + return { + "immute_domain": cluster.immute_domain, + "bk_biz_id": str(cluster.bk_biz_id), + "bk_cloud_id": cluster.bk_cloud_id, + "cluster_type": cluster.cluster_type, + "cluster_name": cluster.name, + "cluster_version": cluster.major_version, + "slave_ports": dict(slave_ports), + "master_ports": dict(master_ports), + "masterip_to_slaveip": masterip_to_slaveip, + "master_slave_pairs": master_slave_pairs, + } + + def version_update_flow(self): + redis_pipeline = Builder(root_id=self.root_id, data=self.data) + trans_files = GetFileList(db_type=DBType.Redis) + sub_pipelines = [] + bk_biz_id = self.data["bk_biz_id"] + + redis_pipeline = Builder(root_id=self.root_id, data=self.data) + sub_pipelines = [] + for input_item in self.data["infos"]: + act_kwargs = ActKwargs() + act_kwargs.set_trans_data_dataclass = CommonContext.__name__ + act_kwargs.is_update_trans_data = True + cluster_meta_data = self.get_cluster_meta_data(bk_biz_id, int(input_item["cluster_id"])) + cluster_info = get_cluster_info_by_id(bk_biz_id=bk_biz_id, cluster_id=input_item["cluster_id"]) + act_kwargs.bk_cloud_id = cluster_meta_data["bk_cloud_id"] + act_kwargs.cluster.update(cluster_info) + + sub_pipeline = SubBuilder(root_id=self.root_id, data=self.data) + sub_pipeline.add_act( + act_name=_("初始化配置"), act_component_code=GetRedisActPayloadComponent.code, kwargs=asdict(act_kwargs) + ) + all_ips = [] + all_ips.extend(list(cluster_meta_data["master_ports"].keys())) + all_ips.extend(list(cluster_meta_data["slave_ports"].keys())) + all_ips = list(set(all_ips)) + + act_kwargs.exec_ip = all_ips + act_kwargs.file_list = trans_files.redis_cluster_version_update(input_item["target_version"]) + sub_pipeline.add_act( + act_name=_("主从所有IP 下发介质包"), act_component_code=TransFileComponent.code, kwargs=asdict(act_kwargs) + ) + + act_kwargs.cluster = {} + acts_list = [] + for ip, ports in cluster_meta_data["slave_ports"].items(): + act_kwargs.exec_ip = ip + act_kwargs.cluster["ip"] = ip + act_kwargs.cluster["ports"] = ports + act_kwargs.cluster["password"] = cluster_info["redis_password"] + act_kwargs.cluster["target_version"] = input_item["target_version"] + act_kwargs.cluster["role"] = InstanceRole.REDIS_SLAVE.value + act_kwargs.get_redis_payload_func = ( + RedisActPayload.redis_cluster_version_update_online_payload.__name__ + ) + acts_list.append( + { + "act_name": _("old_slave:{} 版本升级").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + twemproxy_server_shards = get_twemproxy_cluster_server_shards(bk_biz_id, int(input_item["cluster_id"]), {}) + + if is_redis_cluster_protocal(cluster_meta_data["cluster_type"]): + first_master_ip = list(cluster_meta_data["master_ports"].keys())[0] + act_kwargs.exec_ip = first_master_ip + act_kwargs.cluster = { + "redis_password": cluster_info["redis_password"], + "redis_master_slave_pairs": cluster_meta_data["master_slave_pairs"], + "force": False, + } + act_kwargs.get_redis_payload_func = RedisActPayload.redis_cluster_failover.__name__ + sub_pipeline.add_act( + act_name=_("{} 集群:{}执行 cluster failover").format( + first_master_ip, cluster_meta_data["cluster_name"] + ), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(act_kwargs), + ) + # old_master 升级 + act_kwargs.cluster = {} + acts_list = [] + for ip, ports in cluster_meta_data["master_ports"].items(): + act_kwargs.exec_ip = ip + act_kwargs.cluster["ip"] = ip + act_kwargs.cluster["ports"] = ports + act_kwargs.cluster["password"] = cluster_info["redis_password"] + act_kwargs.cluster["target_version"] = input_item["target_version"] + act_kwargs.cluster["role"] = InstanceRole.REDIS_SLAVE.value + act_kwargs.get_redis_payload_func = ( + RedisActPayload.redis_cluster_version_update_online_payload.__name__ + ) + acts_list.append( + { + "act_name": _("new slave:{} 版本升级").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + elif is_twemproxy_proxy_type(cluster_meta_data["cluster_type"]): + first_master_ip = list(cluster_meta_data["master_ports"].keys())[0] + act_kwargs.exec_ip = first_master_ip + act_kwargs.cluster = {} + act_kwargs.cluster["cluster_id"] = int(input_item["cluster_id"]) + act_kwargs.cluster["immute_domain"] = cluster_meta_data["immute_domain"] + act_kwargs.cluster["cluster_type"] = cluster_meta_data["cluster_type"] + act_kwargs.cluster["switch_condition"] = { + "is_check_sync": True, # 不强制切换 + "slave_master_diff_time": DEFAULT_MASTER_DIFF_TIME, + "last_io_second_ago": DEFAULT_LAST_IO_SECOND_AGO, + "can_write_before_switch": True, + "sync_type": SyncType.SYNC_MS.value, + } + # 先将 old_slave 切换成 new_master + act_kwargs.cluster["switch_info"] = cluster_meta_data["master_slave_pairs"] + act_kwargs.get_redis_payload_func = RedisActPayload.redis_twemproxy_arch_switch_4_scene.__name__ + sub_pipeline.add_act( + act_name=_("集群:{} 主从切换").format(cluster_meta_data["cluster_name"]), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(act_kwargs), + ) + + act_kwargs.cluster["instances"] = nosqlcomm.other.get_cluster_proxies( + cluster_id=act_kwargs.cluster["cluster_id"] + ) + act_kwargs.get_redis_payload_func = RedisActPayload.redis_twemproxy_backends_4_scene.__name__ + sub_pipeline.add_act( + act_name=_("Redis-{}-检查切换状态").format(first_master_ip), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(act_kwargs), + ) + + # 将 master & slave 配置中 slaveof 配置清理 + acts_list = [] + act_kwargs.cluster = {} + for master_ip, master_ports in cluster_meta_data["master_ports"].items(): + slave_ip = cluster_meta_data["masterip_to_slaveip"][master_ip] + slave_ports = cluster_meta_data["slave_ports"][slave_ip] + + act_kwargs.exec_ip = master_ip + act_kwargs.write_op = WriteContextOpType.APPEND.value + ports_str = "\n".join(str(port) for port in master_ports) + act_kwargs.cluster["shell_command"] = REDIS_CONF_DEL_SLAVEOF.format(ports_str) + acts_list.append( + { + "act_name": _("old_master:{} 删除slaveof配置").format(master_ip), + "act_component_code": ExecuteShellScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + + act_kwargs.exec_ip = slave_ip + act_kwargs.write_op = WriteContextOpType.APPEND.value + ports_str = "\n".join(str(port) for port in slave_ports) + act_kwargs.cluster["shell_command"] = REDIS_CONF_DEL_SLAVEOF.format(ports_str) + acts_list.append( + { + "act_name": _("old_slave:{} 删除slaveof配置").format(master_ip), + "act_component_code": ExecuteShellScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + # old_master 升级 + act_kwargs.cluster = {} + act_kwargs.write_op = None + acts_list = [] + for ip, ports in cluster_meta_data["master_ports"].items(): + act_kwargs.exec_ip = ip + act_kwargs.cluster["ip"] = ip + act_kwargs.cluster["ports"] = ports + act_kwargs.cluster["password"] = cluster_info["redis_password"] + act_kwargs.cluster["target_version"] = input_item["target_version"] + act_kwargs.cluster["role"] = InstanceRole.REDIS_MASTER.value + act_kwargs.get_redis_payload_func = ( + RedisActPayload.redis_cluster_version_update_online_payload.__name__ + ) + acts_list.append( + { + "act_name": _("new slave:{} 版本升级").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + # 清档old_master + acts_list = [] + for ip, ports in cluster_meta_data["master_ports"].items(): + act_kwargs.exec_ip = ip + act_kwargs.cluster = {} + act_kwargs.cluster["domain_name"] = cluster_meta_data["immute_domain"] + act_kwargs.cluster["db_version"] = cluster_meta_data["cluster_version"] + act_kwargs.cluster["cluster_type"] = cluster_meta_data["cluster_type"] + act_kwargs.cluster["ip"] = ip + act_kwargs.cluster["ports"] = ports + act_kwargs.cluster["force"] = False + act_kwargs.cluster["db_list"] = [0] + act_kwargs.cluster["flushall"] = True + act_kwargs.get_redis_payload_func = RedisActPayload.redis_flush_data_payload.__name__ + acts_list.append( + { + "act_name": _("old_master:{} 清档").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + # old_master 做 new_slave + child_pipelines = [] + act_kwargs.cluster = {} + act_kwargs.cluster["bk_biz_id"] = bk_biz_id + act_kwargs.cluster["bk_cloud_id"] = cluster_meta_data["bk_cloud_id"] + act_kwargs.cluster["immute_domain"] = cluster_meta_data["immute_domain"] + act_kwargs.cluster["cluster_type"] = cluster_meta_data["cluster_type"] + act_kwargs.cluster["cluster_name"] = cluster_meta_data["cluster_name"] + masterip_to_slaveip = cluster_meta_data["masterip_to_slaveip"] + for master_ip, ports in cluster_meta_data["master_ports"].items(): + master_ports = cluster_meta_data["master_ports"][master_ip] + slave_ip = masterip_to_slaveip[master_ip] + slave_ports = cluster_meta_data["slave_ports"][slave_ip] + sync_param = { + "sync_type": SyncType.SYNC_MS, + "origin_1": slave_ip, + "sync_dst1": master_ip, + "ins_link": [], + "server_shards": twemproxy_server_shards.get(slave_ip, {}), + "cache_backup_mode": get_cache_backup_mode(bk_biz_id, input_item["cluster_id"]), + } + for idx, port in enumerate(master_ports): + sync_param["ins_link"].append( + { + "origin_1": str(slave_ports[idx]), + "sync_dst1": str(port), + } + ) + sync_builder = RedisMakeSyncAtomJob( + root_id=self.root_id, ticket_data=self.data, sub_kwargs=act_kwargs, params=sync_param + ) + child_pipelines.append(sync_builder) + sub_pipeline.add_parallel_sub_pipeline(child_pipelines) + + # 修改元数据指向,并娜动CC模块 + act_kwargs.cluster = {} + act_kwargs.cluster["bk_biz_id"] = bk_biz_id + act_kwargs.cluster["bk_cloud_id"] = cluster_meta_data["bk_cloud_id"] + act_kwargs.cluster["immute_domain"] = cluster_meta_data["immute_domain"] + act_kwargs.cluster["cluster_type"] = cluster_meta_data["cluster_type"] + act_kwargs.cluster["cluster_name"] = cluster_meta_data["cluster_name"] + act_kwargs.cluster["switch_condition"] = { + "is_check_sync": True, # 不强制切换 + "slave_master_diff_time": DEFAULT_MASTER_DIFF_TIME, + "last_io_second_ago": DEFAULT_LAST_IO_SECOND_AGO, + "can_write_before_switch": True, + "sync_type": SyncType.SYNC_MS.value, + } + act_kwargs.cluster["sync_relation"] = [] + masterip_to_slaveip = cluster_meta_data["masterip_to_slaveip"] + for master_ip, ports in cluster_meta_data["master_ports"].items(): + master_ports = cluster_meta_data["master_ports"][master_ip] + slave_ip = masterip_to_slaveip[master_ip] + slave_ports = cluster_meta_data["slave_ports"][slave_ip] + for idx, port in enumerate(master_ports): + act_kwargs.cluster["sync_relation"].append( + { + "ejector": { + "ip": master_ip, + "port": int(port), + }, + "receiver": { + "ip": slave_ip, + "port": int(slave_ports[idx]), + }, + } + ) + act_kwargs.cluster["meta_func_name"] = RedisDBMeta.tendis_switch_4_scene.__name__ + sub_pipeline.add_act( + act_name=_("Redis-元数据切换"), act_component_code=RedisDBMetaComponent.code, kwargs=asdict(act_kwargs) + ) + + acts_list = [] + for master_ip, master_ports in cluster_meta_data["master_ports"].items(): + act_kwargs.cluster["meta_update_ip"] = master_ip + slave_ip = masterip_to_slaveip[master_ip] + act_kwargs.cluster["meta_update_ports"] = master_ports + act_kwargs.cluster["meta_update_status"] = InstanceStatus.RUNNING.value + act_kwargs.cluster["meta_func_name"] = RedisDBMeta.instances_failover_4_scene.__name__ + acts_list.append( + { + "act_name": _("master:{}-slave:{}-元数据交换".format(master_ip, slave_ip)), + "act_component_code": RedisDBMetaComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + # 更新元数据中集群版本 + act_kwargs.cluster["bk_biz_id"] = bk_biz_id + act_kwargs.cluster["bk_cloud_id"] = cluster_meta_data["bk_cloud_id"] + act_kwargs.cluster["immute_domain"] = cluster_meta_data["immute_domain"] + act_kwargs.cluster["target_version"] = input_item["target_version"] + act_kwargs.cluster["meta_func_name"] = RedisDBMeta.redis_cluster_version_update.__name__ + sub_pipeline.add_act( + act_name=_("Redis-元数据更新集群版本"), act_component_code=RedisDBMetaComponent.code, kwargs=asdict(act_kwargs) + ) + + # 更新 dbconfig 中版本信息 + act_kwargs.cluster = { + "bk_biz_id": bk_biz_id, + "cluster_domain": cluster_meta_data["immute_domain"], + "current_version": cluster_meta_data["cluster_version"], + "target_version": input_item["target_version"], + "cluster_type": cluster_meta_data["cluster_type"], + } + act_kwargs.get_redis_payload_func = RedisActPayload.redis_cluster_version_update_dbconfig.__name__ + sub_pipeline.add_act( + act_name=_("Redis-更新dbconfig中集群版本"), + act_component_code=RedisConfigComponent.code, + kwargs=asdict(act_kwargs), + ) + + # 重装 dbmon + acts_list = [] + act_kwargs.cluster = {} + act_kwargs.cluster["servers"] = [ + { + "app": AppCache.get_app_attr(bk_biz_id, "db_app_abbr"), + "app_name": AppCache.get_app_attr(bk_biz_id, "bk_biz_name"), + "bk_biz_id": str(bk_biz_id), + "bk_cloud_id": int(cluster_meta_data["bk_cloud_id"]), + "cluster_name": cluster_meta_data["cluster_name"], + "cluster_type": cluster_meta_data["cluster_type"], + "cluster_domain": cluster_info["cluster_domain"], + } + ] + for ip, ports in cluster_meta_data["slave_ports"].items(): + act_kwargs.cluster["servers"][0]["server_ip"] = ip + act_kwargs.cluster["servers"][0]["server_ports"] = ports + act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_MASTER.value + act_kwargs.cluster["servers"][0]["server_shards"] = twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + bk_biz_id, int(input_item["cluster_id"]) + ) + act_kwargs.exec_ip = ip + act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ + acts_list.append( + { + "act_name": _("new_master {} 重装 dbmon").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + for ip, ports in cluster_meta_data["master_ports"].items(): + act_kwargs.cluster["servers"][0]["server_ip"] = ip + act_kwargs.cluster["servers"][0]["server_ports"] = ports + act_kwargs.cluster["servers"][0]["meta_role"] = InstanceRole.REDIS_SLAVE.value + act_kwargs.cluster["servers"][0]["server_shards"] = twemproxy_server_shards.get(ip, {}) + act_kwargs.cluster["servers"][0]["cache_backup_mode"] = get_cache_backup_mode( + bk_biz_id, int(input_item["cluster_id"]) + ) + act_kwargs.exec_ip = ip + act_kwargs.get_redis_payload_func = RedisActPayload.bkdbmon_install.__name__ + acts_list.append( + { + "act_name": _("new_slave {} 重装 dbmon").format(ip), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(act_kwargs), + } + ) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + + sub_pipelines.append( + sub_pipeline.build_sub_process(sub_name=_("集群{}版本在线升级".format(cluster_meta_data["cluster_name"]))) + ) + redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) + redis_pipeline.run_pipeline() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py index d634a64f87..d8c09c7ad1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py @@ -25,17 +25,37 @@ from backend.db_meta.enums import DBCCModule, InstanceInnerRole, InstanceRole, InstanceStatus, SyncType from backend.db_meta.enums.cluster_type import ClusterType from backend.db_meta.models import Cluster, StorageInstance, StorageInstanceTuple -from backend.flow.consts import DEFAULT_DB_MODULE_ID, DEFAULT_REDIS_START_PORT, DEFAULT_TWEMPROXY_SEG_TOTOL_NUM +from backend.db_services.redis.rollback.handlers import DataStructureHandler +from backend.flow.consts import ( + DEFAULT_DB_MODULE_ID, + DEFAULT_REDIS_START_PORT, + DEFAULT_TWEMPROXY_SEG_TOTOL_NUM, + ConfigTypeEnum, + OperateTypeEnum, + WriteContextOpType, +) from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList from backend.flow.engine.bamboo.scene.redis.atom_jobs import RedisBatchInstallAtomJob +from backend.flow.engine.bamboo.scene.redis.common.exceptions import TendisGetBinlogFailedException +from backend.flow.engine.bamboo.scene.redis.redis_data_structure_sub import redis_backupfile_download +from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent from backend.flow.plugins.components.collections.redis.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.redis.exec_data_structure_actuator_script import ( + ExecuteDataStructureActuatorScriptComponent, +) +from backend.flow.plugins.components.collections.redis.exec_shell_script import ( + ExecuteShellScriptComponent, + RedisDataStructurePrecheckComponent, +) from backend.flow.plugins.components.collections.redis.get_redis_payload import GetRedisActPayloadComponent from backend.flow.plugins.components.collections.redis.redis_db_meta import RedisDBMetaComponent from backend.flow.plugins.components.collections.redis.trans_flies import TransFileComponent +from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs from backend.flow.utils.redis.redis_act_playload import RedisActPayload from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, CommonContext, RedisDataStructureContext from backend.flow.utils.redis.redis_db_meta import RedisDBMeta +from backend.utils import time logger = logging.getLogger("flow") @@ -86,6 +106,18 @@ def redis_data_structure_flow(self): """""" logger.info("redis_data_structure_flow info:{}".format(info)) redis_pipeline, act_kwargs = self.__init_builder(_("REDIS_DATA_STRUCTURE"), info) + # 获取 kvstorecount + redis_config = self.__get_cluster_config( + act_kwargs.cluster["domain_name"], + act_kwargs.cluster["db_version"], + ConfigTypeEnum.DBConf, + act_kwargs.cluster["cluster_type"], + ) + + if act_kwargs.cluster["cluster_type"] == ClusterType.TendisPredixyTendisplusCluster.value: + act_kwargs.cluster["kvstorecount"] = redis_config["kvstorecount"] + act_kwargs.cluster["ticket_type"] = self.data["ticket_type"] + cluster_kwargs = deepcopy(act_kwargs) # 源节点列表 cluster_src_instance = [] @@ -104,7 +136,7 @@ def redis_data_structure_flow(self): logger.info("redis_data_structure_flow cluster_src_instance: {}".format(cluster_src_instance)) # ### 部署redis ############################################################ - sub_pipelines = [] + sub_pipelines_install = [] cluster_dst_instance = [] cluster_type = act_kwargs.cluster["cluster_type"] resource_spec = info["resource_spec"]["redis"] @@ -125,7 +157,7 @@ def redis_data_structure_flow(self): "spec_config": resource_spec, }, ) - sub_pipelines.append(sub_builder) + sub_pipelines_install.append(sub_builder) # 将部署信息存入cluster_dst_instance for inst_no in range(0, instance_numb): @@ -172,6 +204,51 @@ def redis_data_structure_flow(self): redis_pipeline.add_parallel_acts(acts_list=acts_lists) # ### 初始化机器完成############################################################ + # ###安装备份环境########################################################################## + new_master_list = [] + + for index, new_master in enumerate([host["ip"] for host in info["redis"]]): + # 将new_master添加到列表中 + new_master_list.append(new_master) + redis_pipeline.add_act( + act_name=_("Redis-安装backup-client工具-{}").format(new_master_list), + act_component_code=DownloadBackupClientComponent.code, + kwargs=asdict( + DownloadBackupClientKwargs( + bk_cloud_id=act_kwargs.cluster["bk_cloud_id"], + bk_biz_id=int(act_kwargs.cluster["bk_biz_id"]), + download_host_list=new_master_list, + ), + ), + ) + # ### 安装备份环境结束########################################################################## + + # # ### 获取机器磁盘备份目录信息 ########################################################## + + first_act_kwargs = deepcopy(act_kwargs) + ip_list = [host["ip"] for host in info["redis"]] + first_act_kwargs.exec_ip = ip_list + + first_act_kwargs.write_op = WriteContextOpType.APPEND.value + first_act_kwargs.cluster[ + "shell_command" + ] = """ + REDIS_DATA_DIR_DATA=`df -k $REDIS_DATA_DIR | grep -iv Filesystem` + REDIS_BACKUP_DIR_DATA=`df -k $REDIS_BACKUP_DIR | grep -iv Filesystem` + BACKUP_DIR=`echo $REDIS_BACKUP_DIR` + mkdir -p $BACKUP_DIR/dbbak/recover_redis/ + echo "{\\\"redis_data_dir_data\\\":\\\"${REDIS_DATA_DIR_DATA}\\\", \\ + \\\"backup_dir\\\":\\\"${BACKUP_DIR}\\\",\\\"redis_backup_dir_data\\\":\\\"${REDIS_BACKUP_DIR_DATA}\\\"}" + """ + redis_pipeline.add_act( + act_name=_("获取磁盘使用情况: {}").format(ip_list), + act_component_code=ExecuteShellScriptComponent.code, + kwargs=asdict(first_act_kwargs), + write_payload_var="disk_used", + ) + + # ### 获取机器磁盘备份目录信息结束############################################################ + # ### 数据构造下发actuator 检查备份文件是否存在,新机器磁盘空间是否够############################################## # GetTendisType 获取redis类型 if cluster_type == ClusterType.TendisTwemproxyRedisInstance.value: @@ -182,12 +259,76 @@ def redis_data_structure_flow(self): tendis_type = ClusterType.TendisSSDInstance.value else: raise NotImplementedError("Not supported tendis type: %s" % cluster_type) - # 整理数据构造下发actuator 源节点和临时集群节点之间的对应关系, - acts_list = self.get_prod_temp_instance_pairs(act_kwargs, node_pairs, info, True, tendis_type) - redis_pipeline.add_parallel_acts(acts_list=acts_list) - # 检查备份信息存在,机器磁盘是否够,再部署redis 节点 + + # 目录设置为空,根据获取到的机器备份目录来设置 + dest_dir = "" + # 整理数据构造下发actuator 源节点和临时集群节点之间的对应关系,# 获取备份信息,用于磁盘空间是否足够的前置检查 + acts_list = self.get_prod_temp_instance_pairs(act_kwargs, node_pairs, info, tendis_type, dest_dir) + + # ### 检查新机器磁盘空间和内存是否够############################################## + acts_list_disk_check = [] + for index, new_master in enumerate([host["ip"] for host in info["redis"]]): + + # 计算待下载的备份文件大小和获取对应机器磁盘大小,这里是单个任务的时候,还有多个任务的时候 + multi_total_size = 0 + for act in acts_list: + data_params = act["kwargs"]["cluster"]["data_params"] + full_size = 0 + all_binlog_size = 0 + for full in data_params["full_file_list"]: + full_size += full["size"] + # ssd和tendisplus才有binlog文件 + if cluster_type in [ + ClusterType.TendisTwemproxyRedisInstance.value, + ClusterType.TwemproxyTendisSSDInstance.value, + ]: + for binlog in data_params["binlog_file_list"]: + all_binlog_size += binlog["size"] + total_size = full_size + all_binlog_size + if data_params["new_temp_ip"] == new_master: + multi_total_size += total_size + first_act_kwargs.cluster["multi_total_size"] = multi_total_size + first_act_kwargs.exec_ip = new_master + acts_list_disk_check.append( + { + "act_name": _("redis 数据构造前置磁盘检查").format(first_act_kwargs.exec_ip), + "act_component_code": RedisDataStructurePrecheckComponent.code, + "kwargs": asdict(first_act_kwargs), + "splice_payload_var": "disk_used", + } + ) + redis_pipeline.add_parallel_acts(acts_list=acts_list_disk_check) + + # 并发下载 节点维度的备份文件 + sub_pipelines = [] + for act in acts_list: + data_params = act["kwargs"]["cluster"]["data_params"] + source_ports = data_params["source_ports"] + + # for source_port in source_ports: + # 这里可以一次下载,不用按端口分批下载 + sub_builder = redis_backupfile_download( + self.root_id, + self.data, + info, + act_kwargs, + { + "source_ip": data_params["source_ip"], + # "source_port": source_port, + "new_temp_ip": data_params["new_temp_ip"], + "full_file_list": data_params["full_file_list"], + "binlog_file_list": data_params["binlog_file_list"], + "dest_dir": data_params["dest_dir"], + "tendis_type": data_params["tendis_type"], + }, + ) + sub_pipelines.append(sub_builder) + # 并发下载 redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines) + # 检查备份信息存在,机器磁盘是否够,然后下载到临时机器,这里最后再部署redis 节点,免得做无用步骤 + redis_pipeline.add_parallel_sub_pipeline(sub_flow_list=sub_pipelines_install) + # # ###cc 转移机器模块 ################################################################ # 直接挪机器 cluster_kwargs.cluster["meta_func_name"] = RedisDBMeta.redis_rollback_host_transfer.__name__ @@ -242,15 +383,6 @@ def redis_data_structure_flow(self): act_component_code=TransFileComponent.code, kwargs=asdict(act_kwargs), ) - act_kwargs.get_redis_payload_func = RedisActPayload.get_sys_init_payload.__name__ - redis_pipeline.add_act( - act_name=_("初始化机器"), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(act_kwargs), - ) - redis_pipeline.add_act( - act_name=_("初始化配置"), act_component_code=GetRedisActPayloadComponent.code, kwargs=asdict(act_kwargs) - ) # 构造proxy server信息 if cluster_type in [ClusterType.TendisTwemproxyRedisInstance, ClusterType.TwemproxyTendisSSDInstance]: @@ -271,8 +403,6 @@ def redis_data_structure_flow(self): ) # ### 数据构造下发actuator ############################################################################# - # 整理数据构造下发actuator 源节点和临时集群节点之间的对应关系, - acts_list = self.get_prod_temp_instance_pairs(act_kwargs, node_pairs, info, False, tendis_type) redis_pipeline.add_parallel_acts(acts_list=acts_list) # # ### # ### 如果是tendisplus,需要重新构建 cluster关系,因为tendisplus数据构造需要reset集群关系 ############## @@ -433,8 +563,8 @@ def get_prod_temp_instance_pairs( sub_kwargs: ActKwargs, node_pairs: list, info: dict, - is_precheck: bool, tendis_type: str, + dest_dir: str, ) -> list: # ### 整理 数据构造源节点和临时集群节点之间的对应关系 ###################################################### """ @@ -451,14 +581,67 @@ def get_prod_temp_instance_pairs( 即,源主机只能有一个(备份系统按主机查询的,而且咱们的部署方式也是主机维度的),临时的IP,即下发actuator的IP也只能有一个(这个决定了后面节点下发对应关系) todo 源主机可以是多台,传入形式改为ip:port ? """ + + """ + 新增 2、找对应关系时就决定了,那些ip需要下发那些文件: + 2.1 还是按照ip+port 的方式查询 + { + "source_ip":"127.0.0.1", + "source_ports":[ + 30000, + 30001, + 30002 + ], + "new_temp_ip":"127.0.0.2", + "new_temp_ports":[ + 13000, + 13001, + 13002 + ], + "recovery_time_point":"2023-05-09 22:44:53", + "tendis_type":"RedisInstance", + "dest_dir":"$REDIS_BACKUP_DIR/dbbak/recover_redis", + "full_file_list":[ + { + "file_tag":"REDIS_FULL", + "status":"success", + "uptime":"2023-08-24 01:46:53", + "file_last_mtime":"2023-08-24 01:43:30", + "size":178635, + "source_ip":"xxxx", + "task_id":"1692870412566863699-0514017472-22072-0", + "file_name":"3-redis-slave-xxx-xxx-20230824-174325.aof.zst" + } + ], + "binlog_file_list":[ + { + "file_tag":"REDIS_BINLOG", + "status":"to_backup_system_success", + "uptime":"2023-10-07 05:58:47", + "file_last_mtime":"2023-10-07 05:37:51", + "size":5734, + "source_ip":"xxxx", + "task_id":"1696629732091541786-0160215607-30893-0", + "file_name":"binlog-xxxx-30000-0004173-20231007053751.log.zst" + } + ] + } + """ + # 并发执行redis数据构造 act_kwargs = deepcopy(sub_kwargs) acts_list = [] - for new_temp_ip in [host["ip"] for host in info["redis"]]: + rollback_time = time.strptime(info["recovery_time_point"], "%Y-%m-%d %H:%M:%S") + rollback_handler = DataStructureHandler(info["cluster_id"]) + kvstorecount = None + if tendis_type == ClusterType.TendisplusInstance.value: + kvstorecount = act_kwargs.cluster["kvstorecount"] + for new_temp_ip in [host["ip"] for host in info["redis"]]: source_ports = [] new_temp_ports = [] - + full_backupinfo = [] + binlog_backupinfo = [] # 遍历所有 new_temp_node_pairs = [] source_ip_map = set() @@ -483,32 +666,89 @@ def get_prod_temp_instance_pairs( source_ports.append(int(temp_pair[0].split(IP_PORT_DIVIDER)[1])) new_temp_ports.append(int(temp_pair[1].split(IP_PORT_DIVIDER)[1])) source_ip = source_temp_ip + # TODO-MY: 重复代码片段 + for source_port in source_ports: + backupinfo = rollback_handler.query_latest_backup_log(rollback_time, source_ip, source_port) + if backupinfo is not None: + # 拼接多个节点的全备份文件 + full_backupinfo.append(backupinfo) + # 全备份的开始时间 + backup_time = time.strptime(backupinfo["file_last_mtime"], "%Y-%m-%d %H:%M:%S") + # ssd 和tendisplus才有binlog + if tendis_type in [ClusterType.TendisplusInstance.value, ClusterType.TendisSSDInstance.value]: + # 查询binlog + backup_binlog = rollback_handler.query_binlog_from_bklog( + start_time=backup_time, + end_time=rollback_time, + minute_range=120, + host_ip=source_ip, + port=source_port, + kvstorecount=kvstorecount, + tendis_type=tendis_type, + ) + if backup_binlog is None: + raise TendisGetBinlogFailedException( + message=_("获取实例 {}:{} 的binlog备份信息失败".format(source_ip, source_port)) + ) + else: + # print(f"backup_binlog:{backup_binlog}") + # # 拼接多个节点的binlog备份文件 + binlog_backupinfo.extend(backup_binlog) act_kwargs.cluster["data_params"] = { "source_ip": source_ip, "source_ports": source_ports, "new_temp_ip": new_temp_ip, "new_temp_ports": new_temp_ports, "recovery_time_point": info["recovery_time_point"], - "is_precheck": is_precheck, "tendis_type": tendis_type, + "dest_dir": dest_dir, + "full_file_list": full_backupinfo, + "binlog_file_list": binlog_backupinfo, } logger.info("Data structure delivery data_params:{}".format(act_kwargs.cluster["data_params"])) act_kwargs.exec_ip = new_temp_ip act_kwargs.get_redis_payload_func = RedisActPayload.redis_data_structure.__name__ - if is_precheck: - act_kwargs.act_name = _("检查{}备份临时机{}").format(source_ip, act_kwargs.exec_ip) - else: - act_kwargs.act_name = _("源{}构造到临时机{}").format(source_ip, act_kwargs.exec_ip) + act_kwargs.act_name = _("源{}构造到临时机{}").format(source_ip, act_kwargs.exec_ip) acts_list.append( { "act_name": act_kwargs.act_name, - "act_component_code": ExecuteDBActuatorScriptComponent.code, + "act_component_code": ExecuteDataStructureActuatorScriptComponent.code, "kwargs": asdict(act_kwargs), } ) elif len(source_ip_map) == 1: source_ip = next(iter(source_ip_map)) + for source_port in source_ports: + # 查询全备份日志 + backupinfo = rollback_handler.query_latest_backup_log(rollback_time, source_ip, source_port) + if backupinfo is not None: + # 拼接多个节点的备份文件 + full_backupinfo.append(backupinfo) + # 全备份的开始时间 + backup_time = time.strptime(backupinfo["file_last_mtime"], "%Y-%m-%d %H:%M:%S") + # ssd 和tendisplus才有binlog + if tendis_type in [ClusterType.TendisplusInstance.value, ClusterType.TendisSSDInstance.value]: + # 查询binlog + backup_binlog = rollback_handler.query_binlog_from_bklog( + start_time=backup_time, + end_time=rollback_time, + minute_range=120, + host_ip=source_ip, + port=source_port, + kvstorecount=kvstorecount, + tendis_type=tendis_type, + ) + + if backup_binlog is None: + raise TendisGetBinlogFailedException( + message=_("获取实例 {}:{} 的binlog备份信息失败".format(source_ip, source_port)) + ) + else: + # print(f"backup_binlog:{backup_binlog}") + # # 拼接多个节点的binlog备份文件 + binlog_backupinfo.extend(backup_binlog) + # TODO-MY: 重复代码片段 data_params = { "source_ip": source_ip, @@ -516,21 +756,20 @@ def get_prod_temp_instance_pairs( "new_temp_ip": new_temp_ip, "new_temp_ports": new_temp_ports, "recovery_time_point": info["recovery_time_point"], - "is_precheck": is_precheck, "tendis_type": tendis_type, + "dest_dir": dest_dir, + "full_file_list": full_backupinfo, + "binlog_file_list": binlog_backupinfo, } act_kwargs.cluster["data_params"] = data_params logger.info("Data structure delivery data_params:{}".format(act_kwargs.cluster["data_params"])) act_kwargs.exec_ip = new_temp_ip act_kwargs.get_redis_payload_func = RedisActPayload.redis_data_structure.__name__ - if is_precheck: - act_kwargs.act_name = _("检查{}备份临时机{}").format(source_ip, act_kwargs.exec_ip) - else: - act_kwargs.act_name = _("源{}构造到临时机{}").format(source_ip, act_kwargs.exec_ip) + act_kwargs.act_name = _("源{}构造到临时机{}").format(source_ip, act_kwargs.exec_ip) acts_list.append( { "act_name": act_kwargs.act_name, - "act_component_code": ExecuteDBActuatorScriptComponent.code, + "act_component_code": ExecuteDataStructureActuatorScriptComponent.code, "kwargs": asdict(act_kwargs), } ) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py new file mode 100644 index 0000000000..0549c9db43 --- /dev/null +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging.config +from dataclasses import asdict +from typing import Dict + +from django.utils.translation import ugettext as _ + +from backend.db_meta.enums.cluster_type import ClusterType +from backend.flow.engine.bamboo.scene.common.builder import SubBuilder +from backend.flow.engine.bamboo.scene.redis.common.exceptions import TendisGetBinlogFailedException +from backend.flow.plugins.components.collections.redis.redis_download_backup_files import ( + RedisDownloadBackupfileComponent, +) +from backend.flow.utils.redis.redis_context_dataclass import ( + ActKwargs, + CommonContext, + DownloadBackupFileKwargs, + RedisDataStructureContext, +) + +logger = logging.getLogger("flow") + + +def redis_backupfile_download( + root_id: str, ticket_data: dict, cluster_info: dict, sub_kwargs: ActKwargs, param: Dict +) -> SubBuilder: + """ + redis 指定时间拉取远程备份文件用于后续的数据构造 + @param root_id: flow 流程root_id + @param ticket_data: 关联单据 ticket对象 + @param cluster_info: 关联的cluster对象 + """ + + sub_pipeline = SubBuilder(root_id=root_id, data=copy.deepcopy(ticket_data)) + # 全备份文件下载 + task_ids = [file_info["task_id"] for file_info in param["full_file_list"]] + download_kwargs = DownloadBackupFileKwargs( + bk_cloud_id=cluster_info["bk_cloud_id"], + task_ids=task_ids, + dest_ip=param["new_temp_ip"], + dest_dir=param["dest_dir"], + reason="redis data structure full backup file download", + ) + sub_pipeline.add_act( + act_name=_("下载{}全备文件到{}").format(param["source_ip"], param["new_temp_ip"]), + act_component_code=RedisDownloadBackupfileComponent.code, + kwargs=asdict(download_kwargs), + ) + + # cache类型的情况,只有全备份文件,ssd和tendisplus 必须有binlog文件 + if param["tendis_type"] in [ClusterType.TendisplusInstance.value, ClusterType.TendisSSDInstance.value]: + + if len(param["binlog_file_list"]) == 0: + raise TendisGetBinlogFailedException( + message=_("集群类型为:{},但是下载的binlog备份信息为0,不符合预期,最少有2个binlog".format(param["tendis_type"])) + ) + # binlog文件下载 + task_ids = [file_info["task_id"] for file_info in param["binlog_file_list"]] + download_kwargs = DownloadBackupFileKwargs( + bk_cloud_id=cluster_info["bk_cloud_id"], + task_ids=task_ids, + dest_ip=param["new_temp_ip"], + dest_dir=param["dest_dir"], + reason="redis data structure binlog backup file download", + ) + sub_pipeline.add_act( + act_name=_("下载{}binlog文件到{}").format(param["source_ip"], param["new_temp_ip"]), + act_component_code=RedisDownloadBackupfileComponent.code, + kwargs=asdict(download_kwargs), + ) + + return sub_pipeline.build_sub_process(sub_name=_("下载备份文件到{}".format(param["new_temp_ip"]))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py index 25576cab8d..c7fb7d8022 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py @@ -70,9 +70,9 @@ def deploy_riak_cluster_flow(self): """ riak_pipeline = Builder(root_id=self.root_id, data=self.data) sub_pipeline = SubBuilder(root_id=self.root_id, data=self.data) - # 获取机器资源 done + # 获取机器资源 sub_pipeline.add_act(act_name=_("获取机器信息"), act_component_code=GetRiakResourceComponent.code, kwargs={}) - ips = [ip for ip in self.data["nodes"]] + ips = [node["ip"] for node in self.data["nodes"]] sub_pipeline.add_act( act_name=_("下发actuator以及riak介质"), act_component_code=TransFileComponent.code, @@ -84,6 +84,7 @@ def deploy_riak_cluster_flow(self): ) ), ) + sub_pipeline.add_act( act_name=_("actuator_riak系统配置初始化"), act_component_code=ExecuteRiakActuatorScriptComponent.code, @@ -135,7 +136,6 @@ def deploy_riak_cluster_flow(self): bk_cloud_id=self.data["bk_cloud_id"], run_as_system_user=DBA_ROOT_USER, get_riak_payload_func=RiakActPayload.get_commit_cluster_change_payload.__name__, - cluster=cluster, ) ), ) @@ -149,7 +149,6 @@ def deploy_riak_cluster_flow(self): bk_cloud_id=self.data["bk_cloud_id"], run_as_system_user=DBA_ROOT_USER, get_riak_payload_func=RiakActPayload.get_commit_cluster_change_payload.__name__, - cluster=cluster, ) ), ) @@ -164,6 +163,22 @@ def deploy_riak_cluster_flow(self): ) ), ) + + acts_list = [] + for ip in ips: + monitor_kwargs = RiakActKwargs( + exec_ip=ip, + bk_cloud_id=self.data["bk_cloud_id"], + run_as_system_user=DBA_ROOT_USER, + get_riak_payload_func=RiakActPayload.get_install_monitor_payload.__name__, + ) + act_info = dict() + act_info["act_name"] = (_("actuator_{}部署定时任务和riak监控".format(ip)),) + act_info["act_component_code"] = ExecuteRiakActuatorScriptComponent.code + act_info["kwargs"] = asdict(monitor_kwargs) + acts_list.append(act_info) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + riak_pipeline.add_sub_pipeline(sub_pipeline.build_sub_process(sub_name=_("部署Riak集群"))) riak_pipeline.run_pipeline(init_trans_data_class=ApplyManualContext()) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py index c403d0e427..87b0d11dfe 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py @@ -18,6 +18,7 @@ from backend.flow.consts import DBA_ROOT_USER from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.plugins.components.collections.common.pause import PauseComponent from backend.flow.plugins.components.collections.riak.exec_actuator_script import ExecuteRiakActuatorScriptComponent from backend.flow.plugins.components.collections.riak.get_riak_cluster_node import GetRiakClusterNodeComponent from backend.flow.plugins.components.collections.riak.riak_db_meta import RiakDBMetaComponent @@ -53,8 +54,9 @@ def __init__(self, root_id: str, data: Optional[Dict]): def riak_cluster_destroy_flow(self): """ - Riak集群缩容 + Riak集群下架 """ + riak_pipeline = Builder(root_id=self.root_id, data=self.data) sub_pipeline = SubBuilder(root_id=self.root_id, data=self.data) @@ -72,9 +74,6 @@ def riak_cluster_destroy_flow(self): ), ) - # 运维修改配置后才剔除 - # sub_pipeline.add_act(act_name=_("人工确认"), act_component_code=PauseComponent.code, kwargs={}) - sub_pipeline.add_act( act_name=_("actuator_连接检查"), act_component_code=ExecuteRiakActuatorScriptComponent.code, diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py index 64980ebfa0..036bdef24b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py @@ -85,6 +85,19 @@ def riak_cluster_disable_flow(self): ), ) + sub_pipeline.add_act( + act_name=_("actuator_关闭riak监控"), + act_component_code=ExecuteRiakActuatorScriptComponent.code, + kwargs=asdict( + RiakActKwargs( + get_trans_data_ip_var=NodesContext.get_nodes_var_name(), + bk_cloud_id=self.data["bk_cloud_id"], + run_as_system_user=DBA_ROOT_USER, + get_riak_payload_func=RiakActPayload.get_stop_monitor_payload.__name__, + ) + ), + ) + sub_pipeline.add_act( act_name=_("actuator_关闭riak实例"), act_component_code=ExecuteRiakActuatorScriptComponent.code, diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py index 2089b98d10..1e753c18ae 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py @@ -96,5 +96,18 @@ def riak_cluster_enable_flow(self): ), ) + sub_pipeline.add_act( + act_name=_("actuator_开启riak监控"), + act_component_code=ExecuteRiakActuatorScriptComponent.code, + kwargs=asdict( + RiakActKwargs( + get_trans_data_ip_var=NodesContext.get_nodes_var_name(), + bk_cloud_id=self.data["bk_cloud_id"], + run_as_system_user=DBA_ROOT_USER, + get_riak_payload_func=RiakActPayload.get_start_monitor_payload.__name__, + ) + ), + ) + riak_pipeline.add_sub_pipeline(sub_pipeline.build_sub_process(sub_name=_("Riak集群启用"))) riak_pipeline.run_pipeline(init_trans_data_class=NodesContext()) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py index 9642df6d4a..c31a8c0035 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py @@ -18,6 +18,7 @@ from backend.flow.consts import DBA_ROOT_USER from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList +from backend.flow.plugins.components.collections.common.pause import PauseComponent from backend.flow.plugins.components.collections.riak.exec_actuator_script import ExecuteRiakActuatorScriptComponent from backend.flow.plugins.components.collections.riak.get_riak_cluster_node import GetRiakClusterNodeComponent from backend.flow.plugins.components.collections.riak.get_riak_resource import GetRiakResourceComponent @@ -83,7 +84,7 @@ def riak_cluster_scale_in_flow(self): ) # 运维修改配置后才剔除 - # sub_pipeline.add_act(act_name=_("人工确认"), act_component_code=PauseComponent.code, kwargs={}) + sub_pipeline.add_act(act_name=_("人工确认"), act_component_code=PauseComponent.code, kwargs={}) sub_pipeline.add_act( act_name=_("actuator_连接检查"), @@ -98,6 +99,19 @@ def riak_cluster_scale_in_flow(self): ), ) + sub_pipeline.add_act( + act_name=_("actuator_关闭riak监控"), + act_component_code=ExecuteRiakActuatorScriptComponent.code, + kwargs=asdict( + RiakActKwargs( + get_trans_data_ip_var=ScaleInManualContext.get_operate_nodes_var_name(), + bk_cloud_id=self.data["bk_cloud_id"], + run_as_system_user=DBA_ROOT_USER, + get_riak_payload_func=RiakActPayload.get_stop_monitor_payload.__name__, + ) + ), + ) + sub_pipeline.add_act( act_name=_("actuator_riak集群剔除节点"), act_component_code=ExecuteRiakActuatorScriptComponent.code, diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py index e93851442a..0ec60fdc53 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py @@ -69,6 +69,7 @@ def riak_cluster_scale_out_flow(self): sub_pipeline.add_act(act_name=_("获取机器信息"), act_component_code=GetRiakResourceComponent.code, kwargs={}) sub_pipeline.add_act(act_name=_("获取集群中的节点"), act_component_code=GetRiakClusterNodeComponent.code, kwargs={}) + ips = [node["ip"] for node in self.data["nodes"]] sub_pipeline.add_act( act_name=_("下发actuator以及riak介质"), @@ -172,5 +173,20 @@ def riak_cluster_scale_out_flow(self): ), ) + acts_list = [] + for ip in ips: + monitor_kwargs = RiakActKwargs( + exec_ip=ip, + bk_cloud_id=self.data["bk_cloud_id"], + run_as_system_user=DBA_ROOT_USER, + get_riak_payload_func=RiakActPayload.get_install_monitor_payload.__name__, + ) + act_info = dict() + act_info["act_name"] = (_("actuator_{}部署定时任务和riak监控".format(ip)),) + act_info["act_component_code"] = ExecuteRiakActuatorScriptComponent.code + act_info["kwargs"] = asdict(monitor_kwargs) + acts_list.append(act_info) + sub_pipeline.add_parallel_acts(acts_list=acts_list) + riak_pipeline.add_sub_pipeline(sub_pipeline.build_sub_process(sub_name=_("Riak集群扩容"))) riak_pipeline.run_pipeline(init_trans_data_class=ScaleOutManualContext()) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py index 8c00da6792..454c94de77 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py @@ -431,7 +431,7 @@ def build_apps_for_spider_sub_flow( }, ) # 因为同一台机器的只有会有一个spider实例,所以直接根据ip、bk_cloud_id获取对应实例的spider角色,来判断是否安装备份程序 - if spider_role == TenDBClusterSpiderRole.SPIDER_MASTER: + if spider_role in [TenDBClusterSpiderRole.SPIDER_MASTER, TenDBClusterSpiderRole.SPIDER_MNT]: acts_list.append( { "act_name": _("spider[{}]安装备份程序".format(spider_ip)), @@ -455,6 +455,7 @@ def build_apps_for_spider_sub_flow( "kwargs": asdict( DownloadBackupClientKwargs( bk_cloud_id=bk_cloud_id, + bk_biz_id=int(parent_global_data["bk_biz_id"]), download_host_list=list(filter(None, list(set(spiders)))), ) ), diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py index c4974fbf14..dbccce298b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py @@ -11,28 +11,24 @@ import copy import logging from dataclasses import asdict -from datetime import datetime from typing import Dict, Optional from django.utils.translation import ugettext as _ from backend.configuration.constants import DBType -from backend.constants import IP_PORT_DIVIDER -from backend.db_meta.enums import ClusterType, InstanceStatus -from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler +from backend.db_meta.enums import InstanceStatus +from backend.db_meta.models import Cluster from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.common.get_file_list import GetFileList -from backend.flow.engine.bamboo.scene.spider.common.exceptions import TendbGetBackupInfoFailedException -from backend.flow.engine.bamboo.scene.spider.spider_remote_node_migrate import remote_slave_recover_sub_flow +from backend.flow.engine.bamboo.scene.mysql.common.recover_slave_instance import slave_recover_sub_flow from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent +from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent -from backend.flow.plugins.components.collections.spider.spider_db_meta import SpiderDBMetaComponent from backend.flow.utils.mysql.common.mysql_cluster_info import get_version_and_charset from backend.flow.utils.mysql.mysql_act_dataclass import DBMetaOPKwargs, DownloadMediaKwargs, ExecActuatorKwargs from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext -from backend.flow.utils.spider.spider_db_meta import SpiderDBMeta -from backend.flow.utils.spider.tendb_cluster_info import get_slave_local_recover_info +from backend.flow.utils.mysql.mysql_db_meta import MySQLDBMeta logger = logging.getLogger("flow") @@ -66,138 +62,118 @@ def tendb_remote_slave_local_recover(self): # 阶段1 获取集群所有信息。计算端口,构建数据。 for info in self.ticket_data["infos"]: self.data = copy.deepcopy(info) - self.data["bk_cloud_id"] = self.ticket_data["bk_cloud_id"] + cluster_class = Cluster.objects.get(id=self.data["cluster_id"]) + self.data["bk_cloud_id"] = cluster_class.bk_cloud_id self.data["root_id"] = self.root_id self.data["uid"] = self.ticket_data["uid"] self.data["ticket_type"] = self.ticket_data["ticket_type"] self.data["bk_biz_id"] = self.ticket_data["bk_biz_id"] - self.data["created_by"] = self.ticket_data["created_by"] - # self.data["module"] = info["module"] - # 卸载流程时强制卸载 + self.data["bk_biz_id"] = cluster_class.bk_biz_id + self.data["db_module_id"] = cluster_class.db_module_id + self.data["cluster_type"] = cluster_class.cluster_type self.data["force"] = True - # 先判断备份是否存在 - backup_handler = FixPointRollbackHandler(self.data["cluster_id"]) - restore_time = datetime.now() - # restore_time = datetime.strptime("2023-07-31 17:40:00", "%Y-%m-%d %H:%M:%S") - backup_info = backup_handler.query_latest_backup_log(restore_time) - if backup_info is None: - logger.error("cluster {} backup info not exists".format(self.data["cluster_id"])) - raise TendbGetBackupInfoFailedException(message=_("获取集群 {} 的备份信息失败".format(self.data["cluster_id"]))) - logger.debug(backup_info) - - cluster_info = get_slave_local_recover_info(self.data["cluster_id"], self.data["storage_id"]) - charset, db_version = get_version_and_charset( - bk_biz_id=cluster_info["bk_biz_id"], - db_module_id=cluster_info["db_module_id"], - cluster_type=cluster_info["cluster_type"], + self.data["charset"], self.data["db_version"] = get_version_and_charset( + bk_biz_id=cluster_class.bk_biz_id, + db_module_id=cluster_class.db_module_id, + cluster_type=cluster_class.cluster_type, ) - cluster_info["charset"] = charset - cluster_info["db_version"] = db_version - self.data["target_ip"] = cluster_info["target_ip"] tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) - - cluster_info["ports"] = [] - for shard_id, shard in cluster_info["my_shards"].items(): - slave = { - "ip": self.data["target_ip"], - "port": shard["port"], - "bk_cloud_id": self.data["bk_cloud_id"], - "instance": "{}{}{}".format(self.data["target_ip"], IP_PORT_DIVIDER, shard["port"]), - } - cluster_info["my_shards"][shard_id]["new_slave"] = slave - cluster_info["ports"].append(shard["port"]) - - sync_data_sub_pipeline_list = [] - for shard_id, node in cluster_info["my_shards"].items(): - ins_cluster = copy.deepcopy(cluster_info["cluster"]) - ins_cluster["charset"] = cluster_info["charset"] - ins_cluster["new_slave_ip"] = node["new_slave"]["ip"] - ins_cluster["new_slave_port"] = node["new_slave"]["port"] - ins_cluster["master_ip"] = node["master"]["ip"] - ins_cluster["slave_ip"] = node["slave"]["ip"] - ins_cluster["master_port"] = node["master"]["port"] - ins_cluster["slave_port"] = node["slave"]["port"] - # 设置实例状态 - ins_cluster["storage_id"] = node["slave"]["id"] - ins_cluster["storage_status"] = InstanceStatus.RESTORING.value - # todo 正式环境放开file_target_path,需要备份接口支持自动创建目录 - # ins_cluster["file_target_path"] = "/data/dbbak/{}/{}"\ - # .format(self.root_id, ins_cluster["new_master_port"]) - ins_cluster["file_target_path"] = "/home/mysql/install" - ins_cluster["shard_id"] = shard_id - ins_cluster["change_master_force"] = False - - ins_cluster["backupinfo"] = backup_info["remote_node"].get(shard_id, {}) - # 判断 remote_node 下每个分片的备份信息是否正常 - if ( - len(ins_cluster["backupinfo"]) == 0 - or len(ins_cluster["backupinfo"].get("file_list_details", {})) == 0 - ): - logger.error( - "cluster {} shard {} backup info not exists".format(self.data["cluster_id"], shard_id) - ) - raise TendbGetBackupInfoFailedException( - message=_("获取集群分片 {} shard {} 的备份信息失败".format(self.data["cluster_id"], shard_id)) + tendb_migrate_pipeline.add_act( + act_name=_("下发db-actor到节点{}".format(self.data["slave_ip"])), + act_component_code=TransFileComponent.code, + kwargs=asdict( + DownloadMediaKwargs( + bk_cloud_id=cluster_class.bk_cloud_id, + exec_ip=[self.data["slave_ip"]], + file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), ) + ), + ) + sync_data_sub_pipeline_list = [] + for shard_id in self.data["shard_ids"]: + shard = cluster_class.tendbclusterstorageset_set.get(shard_id=shard_id) + self.data["master"] = shard.storage_instance_tuple.ejector.ip_port + self.data["master_ip"] = shard.storage_instance_tuple.ejector.machine.ip + self.data["master_port"] = shard.storage_instance_tuple.ejector.port + self.data["slave_port"] = shard.storage_instance_tuple.receiver.port + target_slave = cluster_class.storageinstance_set.get(id=shard.storage_instance_tuple.receiver.id) + master = cluster_class.storageinstance_set.get(id=shard.storage_instance_tuple.ejector.id) + cluster = {"storage_status": InstanceStatus.RESTORING.value, "storage_id": target_slave.id} sync_data_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) sync_data_sub_pipeline.add_act( act_name=_("写入初始化实例的db_meta元信息"), - act_component_code=SpiderDBMetaComponent.code, + act_component_code=MySQLDBMetaComponent.code, kwargs=asdict( DBMetaOPKwargs( - db_meta_class_func=SpiderDBMeta.tendb_modify_storage_status.__name__, - cluster=copy.deepcopy(ins_cluster), + db_meta_class_func=MySQLDBMeta.tendb_modify_storage_status.__name__, + cluster=cluster, is_update_trans_data=False, ) ), ) + + cluster = { + "stop_slave": True, + "reset_slave": True, + "restart": False, + "force": self.data["force"], + "drop_database": True, + "new_slave_ip": target_slave.machine.ip, + "new_slave_port": target_slave.port, + } exec_act_kwargs = ExecActuatorKwargs( - bk_cloud_id=int(ins_cluster["bk_cloud_id"]), - cluster_type=ClusterType.TenDBCluster, + bk_cloud_id=cluster_class.bk_cloud_id, + cluster_type=cluster_class.cluster_type, + cluster=cluster, + exec_ip=target_slave.machine.ip, ) - exec_act_kwargs.exec_ip = ins_cluster["new_slave_ip"] exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.get_clean_mysql_payload.__name__ sync_data_sub_pipeline.add_act( - act_name=_("slave重建之清理从库{}").format(exec_act_kwargs.exec_ip), + act_name=_("slave重建之清理从库{}").format(target_slave.ip_port), act_component_code=ExecuteDBActuatorScriptComponent.code, kwargs=asdict(exec_act_kwargs), ) + cluster = { + "cluster_id": cluster_class.id, + "master_ip": master.machine.ip, + "master_port": master.port, + "new_slave_ip": target_slave.machine.ip, + "new_slave_port": target_slave.port, + "bk_cloud_id": cluster_class.bk_cloud_id, + "file_target_path": f"/data/dbbak/{self.root_id}/{master.port}", + "charset": self.data["charset"], + "change_master_force": True, + "cluster_type": cluster_class.cluster_type, + "shard_id": shard_id, + } sync_data_sub_pipeline.add_sub_pipeline( - sub_flow=remote_slave_recover_sub_flow( - root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=ins_cluster + sub_flow=slave_recover_sub_flow( + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=cluster ) ) - ins_cluster["storage_status"] = InstanceStatus.RUNNING.value + + cluster = {"storage_status": InstanceStatus.RUNNING.value, "storage_id": target_slave.id} sync_data_sub_pipeline.add_act( act_name=_("写入初始化实例的db_meta元信息"), - act_component_code=SpiderDBMetaComponent.code, + act_component_code=MySQLDBMetaComponent.code, kwargs=asdict( DBMetaOPKwargs( - db_meta_class_func=SpiderDBMeta.tendb_modify_storage_status.__name__, - cluster=copy.deepcopy(ins_cluster), + db_meta_class_func=MySQLDBMeta.tendb_modify_storage_status.__name__, + cluster=cluster, is_update_trans_data=False, ) ), ) - sync_data_sub_pipeline_list.append(sync_data_sub_pipeline.build_sub_process(sub_name=_("恢复实例数据"))) - - tendb_migrate_pipeline.add_act( - act_name=_("下发工具"), - act_component_code=TransFileComponent.code, - kwargs=asdict( - DownloadMediaKwargs( - bk_cloud_id=cluster_info["bk_cloud_id"], - exec_ip=self.data["target_ip"], - file_list=GetFileList(db_type=DBType.MySQL).get_db_actuator_package(), + sync_data_sub_pipeline_list.append( + sync_data_sub_pipeline.build_sub_process( + _("{} shard {} 原地重建").format(target_slave.ip_port, shard_id) ) - ), - ) + ) tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=sync_data_sub_pipeline_list) tendb_migrate_pipeline_all_list.append( - tendb_migrate_pipeline.build_sub_process(_("集群迁移{}").format(self.data["cluster_id"])) + tendb_migrate_pipeline.build_sub_process(_("slave原地重建{}".format(self.data["slave_ip"]))) ) - # 运行流程 tendb_migrate_pipeline_all.add_parallel_sub_pipeline(tendb_migrate_pipeline_all_list) tendb_migrate_pipeline_all.run_pipeline(init_trans_data_class=ClusterInfoContext(), is_drop_random_user=True) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py index 86eac73d72..2bbbf6b543 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py @@ -11,35 +11,35 @@ import copy import logging from dataclasses import asdict -from datetime import datetime from typing import Dict, Optional +from django.utils.crypto import get_random_string from django.utils.translation import ugettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterType from backend.db_meta.models import Cluster -from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.mysql.common.common_sub_flow import ( build_surrounding_apps_sub_flow, install_mysql_in_cluster_sub_flow, ) -from backend.flow.engine.bamboo.scene.spider.common.exceptions import TendbGetBackupInfoFailedException -from backend.flow.engine.bamboo.scene.spider.spider_remote_node_migrate import ( - remote_node_uninstall_sub_flow, - remote_slave_recover_sub_flow, -) +from backend.flow.engine.bamboo.scene.mysql.common.recover_slave_instance import slave_recover_sub_flow +from backend.flow.engine.bamboo.scene.spider.spider_remote_node_migrate import remote_node_uninstall_sub_flow from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent from backend.flow.plugins.components.collections.common.pause import PauseComponent from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent from backend.flow.plugins.components.collections.spider.spider_db_meta import SpiderDBMetaComponent +from backend.flow.plugins.components.collections.spider.switch_remote_slave_routing import ( + SwitchRemoteSlaveRoutingComponent, +) from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs from backend.flow.utils.mysql.common.mysql_cluster_info import get_version_and_charset from backend.flow.utils.mysql.mysql_act_dataclass import ClearMachineKwargs, DBMetaOPKwargs, ExecActuatorKwargs from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext +from backend.flow.utils.spider.spider_act_dataclass import InstancePairs, SwitchRemoteSlaveRoutingKwargs from backend.flow.utils.spider.spider_db_meta import SpiderDBMeta from backend.flow.utils.spider.tendb_cluster_info import get_slave_recover_info @@ -75,50 +75,35 @@ def tendb_remote_slave_recover(self): # 阶段1 获取集群所有信息。计算端口,构建数据。 for info in self.ticket_data["infos"]: self.data = copy.deepcopy(info) - self.data["bk_cloud_id"] = self.ticket_data["bk_cloud_id"] + cluster_class = Cluster.objects.get(id=self.data["cluster_id"]) + self.data["bk_cloud_id"] = cluster_class.bk_cloud_id self.data["root_id"] = self.root_id - self.data["start_port"] = 20000 self.data["uid"] = self.ticket_data["uid"] - self.data["ticket_type"] = self.ticket_data["ticket_type"] - self.data["bk_biz_id"] = self.ticket_data["bk_biz_id"] self.data["created_by"] = self.ticket_data["created_by"] - # self.data["module"] = info["module"] - self.data["source_ip"] = self.data["source_slave"]["ip"] - self.data["target_ip"] = self.data["target_slave"]["ip"] - # 卸载流程时强制卸载 + self.data["ticket_type"] = self.ticket_data["ticket_type"] + self.data["bk_biz_id"] = cluster_class.bk_biz_id + self.data["db_module_id"] = cluster_class.db_module_id + self.data["cluster_type"] = cluster_class.cluster_type self.data["force"] = True - # 先判断备份是否存在 - backup_handler = FixPointRollbackHandler(self.data["cluster_id"]) - restore_time = datetime.now() - # restore_time = datetime.strptime("2023-07-31 17:40:00", "%Y-%m-%d %H:%M:%S") - backup_info = backup_handler.query_latest_backup_log(restore_time) - if backup_info is None: - logger.error("cluster {} backup info not exists".format(self.data["cluster_id"])) - raise TendbGetBackupInfoFailedException(message=_("获取集群 {} 的备份信息失败".format(self.data["cluster_id"]))) - logger.debug(backup_info) - tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) - - cluster_info = get_slave_recover_info(self.data["cluster_id"], self.data["target_ip"]) - charset, db_version = get_version_and_charset( - bk_biz_id=cluster_info["bk_biz_id"], - db_module_id=cluster_info["db_module_id"], - cluster_type=cluster_info["cluster_type"], + self.data["target_ip"] = self.data["target_slave"]["ip"] + self.data["source_ip"] = self.data["source_slave"]["ip"] + self.data["charset"], self.data["db_version"] = get_version_and_charset( + bk_biz_id=cluster_class.bk_biz_id, + db_module_id=cluster_class.db_module_id, + cluster_type=cluster_class.cluster_type, ) - cluster_info["charset"] = charset - cluster_info["db_version"] = db_version - cluster_class = Cluster.objects.get(id=self.data["cluster_id"]) - - # 构造从节点恢复 + tendb_migrate_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + cluster_info = get_slave_recover_info(self.data["cluster_id"], self.data["source_ip"]) cluster_info["ports"] = [] for shard_id, shard in cluster_info["my_shards"].items(): slave = { "ip": self.data["target_ip"], - "port": shard["port"], + "port": shard["slave"]["port"], "bk_cloud_id": self.data["bk_cloud_id"], - "instance": "{}{}{}".format(self.data["target_ip"], IP_PORT_DIVIDER, shard["port"]), + "instance": "{}{}{}".format(self.data["target_ip"], IP_PORT_DIVIDER, shard["slave"]["port"]), } cluster_info["my_shards"][shard_id]["new_slave"] = slave - cluster_info["ports"].append(shard["port"]) + cluster_info["ports"].append(shard["slave"]["port"]) install_sub_pipeline_list = [] install_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) @@ -133,11 +118,11 @@ def tendb_remote_slave_recover(self): ) cluster = { "new_slave_ip": self.data["target_ip"], - "cluster_id": cluster_info["cluster_id"], - "bk_cloud_id": cluster_info["bk_cloud_id"], - "bk_biz_id": cluster_info["bk_biz_id"], + "cluster_id": cluster_class.id, + "bk_cloud_id": cluster_class.bk_cloud_id, + "bk_biz_id": cluster_class.bk_biz_id, "ports": cluster_info["ports"], - "version": cluster_info["cluster"]["major_version"], + "version": cluster_class.major_version, } install_sub_pipeline.add_act( act_name=_("写入初始化实例的db_meta元信息"), @@ -157,7 +142,7 @@ def tendb_remote_slave_recover(self): kwargs=asdict( DownloadBackupClientKwargs( bk_cloud_id=cluster_class.bk_cloud_id, - download_host_list=[cluster["new_master_ip"], cluster["new_slave_ip"]], + download_host_list=[cluster["new_slave_ip"]], ) ), ) @@ -168,46 +153,33 @@ def tendb_remote_slave_recover(self): cluster_type=cluster_class.cluster_type, get_mysql_payload_func=MysqlActPayload.get_install_tmp_db_backup_payload.__name__, ) - exec_act_kwargs.exec_ip = [cluster["new_master_ip"], cluster["new_slave_ip"]] + exec_act_kwargs.exec_ip = [cluster["new_slave_ip"]] install_sub_pipeline.add_act( act_name=_("安装临时备份程序"), act_component_code=ExecuteDBActuatorScriptComponent.code, kwargs=asdict(exec_act_kwargs), ) - install_sub_pipeline_list.append(install_sub_pipeline.build_sub_process(sub_name=_("安装remote从节点"))) + sync_data_sub_pipeline_list = [] for shard_id, node in cluster_info["my_shards"].items(): - ins_cluster = copy.deepcopy(cluster_info["cluster"]) - ins_cluster["charset"] = cluster_info["charset"] - ins_cluster["new_slave_ip"] = node["new_slave"]["ip"] - ins_cluster["new_slave_port"] = node["new_slave"]["port"] - ins_cluster["master_ip"] = node["master"]["ip"] - ins_cluster["slave_ip"] = node["slave"]["ip"] - ins_cluster["master_port"] = node["master"]["port"] - ins_cluster["slave_port"] = node["slave"]["port"] - # todo 正式环境放开file_target_path,需要备份接口支持自动创建目录 - # ins_cluster["file_target_path"] = "/data/dbbak/{}/{}"\ - # .format(self.root_id, ins_cluster["new_master_port"]) - ins_cluster["file_target_path"] = "/home/mysql/install" - ins_cluster["shard_id"] = shard_id - ins_cluster["change_master_force"] = False + ins_cluster = { + "cluster_id": cluster_class.id, + "master_ip": node["master"]["ip"], + "master_port": node["master"]["port"], + "new_slave_ip": node["new_slave"]["ip"], + "new_slave_port": node["new_slave"]["port"], + "bk_cloud_id": cluster_class.bk_cloud_id, + "file_target_path": f'/data/dbbak/{self.root_id}/{node["master"]["port"]}', + "change_master_force": True, + "charset": self.data["charset"], + "cluster_type": cluster_class.cluster_type, + "shard_id": shard_id, + } - ins_cluster["backupinfo"] = backup_info["remote_node"].get(shard_id, {}) - # 判断 remote_node 下每个分片的备份信息是否正常 - if ( - len(ins_cluster["backupinfo"]) == 0 - or len(ins_cluster["backupinfo"].get("file_list_details", {})) == 0 - ): - logger.error( - "cluster {} shard {} backup info not exists".format(self.data["cluster_id"], shard_id) - ) - raise TendbGetBackupInfoFailedException( - message=_("获取集群分片 {} shard {} 的备份信息失败".format(self.data["cluster_id"], shard_id)) - ) sync_data_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) sync_data_sub_pipeline.add_sub_pipeline( - sub_flow=remote_slave_recover_sub_flow( + sub_flow=slave_recover_sub_flow( root_id=self.root_id, ticket_data=copy.deepcopy(self.data), cluster_info=ins_cluster ) ) @@ -227,6 +199,27 @@ def tendb_remote_slave_recover(self): switch_sub_pipeline_list = [] # 切换后写入元数据 switch_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) + + tdbctl_pass = get_random_string(length=10) + switch_slave_class = SwitchRemoteSlaveRoutingKwargs( + cluster_id=cluster_class.id, switch_remote_instance_pairs=[] + ) + for shard_id, node in cluster_info["my_shards"].items(): + inst_pairs = InstancePairs( + old_ip=node["slave"]["ip"], + old_port=node["slave"]["port"], + new_ip=node["new_slave"]["ip"], + new_port=node["new_slave"]["port"], + tdbctl_pass=tdbctl_pass, + ) + switch_slave_class.switch_remote_instance_pairs.append(inst_pairs) + + switch_sub_pipeline.add_act( + act_name=_("切换到新SLAVE机器"), + act_component_code=SwitchRemoteSlaveRoutingComponent.code, + kwargs=asdict(switch_slave_class), + ) + switch_sub_pipeline.add_act( act_name=_("SLAVE切换完毕后修改元数据指向"), act_component_code=SpiderDBMetaComponent.code, @@ -256,25 +249,13 @@ def tendb_remote_slave_recover(self): ) surrounding_sub_pipeline_list.append(surrounding_sub_pipeline.build_sub_process(sub_name=_("新机器安装周边组件"))) - install_sub_pipeline.add_sub_pipeline( - sub_flow=build_surrounding_apps_sub_flow( - bk_cloud_id=cluster["bk_cloud_id"], - master_ip_list=None, - slave_ip_list=[self.data["target_ip"]], - root_id=self.root_id, - parent_global_data=copy.deepcopy(self.data), - is_init=True, - cluster_type=ClusterType.TenDBCluster.value, - ) - ) - # 阶段6 卸载 uninstall_svr_sub_pipeline_list = [] uninstall_svr_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data)) - ins_cluster = {"uninstall_ip": self.data["target_ip"], "cluster_id": cluster_info["cluster_id"]} + ins_cluster = {"uninstall_ip": self.data["source_ip"], "cluster_id": cluster_info["cluster_id"]} uninstall_svr_sub_pipeline.add_sub_pipeline( sub_flow=remote_node_uninstall_sub_flow( - root_id=self.root_id, ticket_data=copy.deepcopy(self.data), ip=self.data["target_ip"] + root_id=self.root_id, ticket_data=copy.deepcopy(self.data), ip=self.data["source_ip"] ) ) uninstall_svr_sub_pipeline.add_act( @@ -293,13 +274,13 @@ def tendb_remote_slave_recover(self): act_component_code=MySQLClearMachineComponent.code, kwargs=asdict( ClearMachineKwargs( - exec_ip=self.data["target_ip"], + exec_ip=self.data["source_ip"], bk_cloud_id=self.data["bk_cloud_id"], ) ), ) uninstall_svr_sub_pipeline_list.append( - uninstall_svr_sub_pipeline.build_sub_process(sub_name=_("卸载remote节点{}".format(self.data["target_ip"]))) + uninstall_svr_sub_pipeline.build_sub_process(sub_name=_("卸载remote节点{}".format(self.data["source_ip"]))) ) # 安装实例 tendb_migrate_pipeline.add_parallel_sub_pipeline(sub_flow_list=install_sub_pipeline_list) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py index 1f9eaee7ce..a8389e16a1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py @@ -84,6 +84,10 @@ def __init__(self, root_id: str, data: Optional[Dict]): # 声明中控实例的端口 self.data["ctl_port"] = self.data["spider_port"] + 1000 + # 是否升级成tokudb引擎 + if not self.data.__contains__("enable_tokudb"): + self.data["enable_tokudb"] = False + if len(self.data["remote_group"]) * int(self.data["remote_shard_num"]) != int(self.data["cluster_shard_num"]): raise Exception(_("传入参数有异常,请检查!len(remote_group)*remote_shard_num != cluster_shard_num")) @@ -251,6 +255,21 @@ def deploy_cluster(self): ) deploy_pipeline.add_parallel_acts(acts_list=acts_list) + # 给安装好的mysql实例开启tokudb引擎 + if self.data["enable_tokudb"]: + acts_list = [] + for mysql_ip in self.data["mysql_ip_list"]: + exec_act_kwargs.exec_ip = mysql_ip["ip"] + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.enable_tokudb_payload.__name__ + acts_list.append( + { + "act_name": _("安装tokudb引擎"), + "act_component_code": ExecuteDBActuatorScriptComponent.code, + "kwargs": asdict(exec_act_kwargs), + } + ) + deploy_pipeline.add_parallel_acts(acts_list=acts_list) + acts_list = [] # 定义每个spider节点auto_incr_mode_value值,单调递增 auto_incr_value = 1 diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py index bbb2cd8383..d981836a76 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py @@ -56,7 +56,7 @@ def full_backup_flow(self): "file_tag": enum of backend.flow.consts.MySQLBackupFileTagEnum “clusters": [ { - "id": int, + "cluster_id": int, "backup_local": enum TenDBBackupLocation::[REMOTE, SPIDER_MNT], "spider_mnt_address": "x.x.x.x:y" # 如果 backup_local 是 spider_mnt }, @@ -83,13 +83,13 @@ def full_backup_flow(self): try: cluster_obj = Cluster.objects.get( - pk=cluster["id"], + pk=cluster["cluster_id"], bk_biz_id=self.data["bk_biz_id"], cluster_type=ClusterType.TenDBCluster.value, ) except ObjectDoesNotExist: raise ClusterNotExistException( - cluster_type=ClusterType.TenDBCluster.value, cluster_id=cluster["id"], immute_domain="" + cluster_type=ClusterType.TenDBCluster.value, cluster_id=cluster["cluster_id"], immute_domain="" ) backup_id = uuid.uuid1() diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py index 0adc3c95be..eb706b589b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py @@ -92,8 +92,7 @@ def tendb_rollback_data(self): spd_cluster = { "charset": charset, "backupinfo": backup_info["spider_node"], - # "file_target_path": "/data/dbbak/{}/{}".format(self.root_id, spider_node["port"]), - "file_target_path": "/home/mysql/install", + "file_target_path": f"/data/dbbak/{self.root_id}/{spider_node['port']}", "rollback_ip": spider_node["ip"], "rollback_port": spider_node["port"], "instance": spider_node["instance"], @@ -130,8 +129,7 @@ def tendb_rollback_data(self): "slave_port": remote_node["slave"]["port"], "master": remote_node["master"], "slave": remote_node["slave"], - # "file_target_path": "/data/dbbak/{}/{}".format(self.root_id, remote_node["new_master"]["port"]), - "file_target_path": "/home/mysql/install", + "file_target_path": f"/data/dbbak/{self.root_id}/{remote_node['new_master']['port']}", "cluster_id": self.data["source_cluster_id"], "bk_cloud_id": clusters_info["bk_cloud_id"], "backupinfo": backup_info["remote_node"][str(shard_id)], diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py index 2bdfdd7320..65ae659b44 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py @@ -41,8 +41,16 @@ def spider_recover_sub_flow(root_id: str, ticket_data: dict, cluster: dict): exec_act_kwargs = ExecActuatorKwargs( bk_cloud_id=int(cluster["bk_cloud_id"]), cluster_type=ClusterType.TenDBCluster, cluster=cluster ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.mysql_mkdir_dir.__name__ + exec_act_kwargs.exec_ip = cluster["rollback_ip"] + sub_pipeline.add_act( + act_name=_("创建目录 {}".format(cluster["file_target_path"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) # spider 没有主从节点.指定备份的ip:port为主节点。 - cluster["master_ip"], cluster["master_port"] = "", 0 + cluster["master_ip"] = "" + cluster["master_port"] = 0 cluster["change_master"] = False backup_info = cluster["backupinfo"] task_ids = [i["task_id"] for i in backup_info["file_list_details"]] @@ -75,11 +83,11 @@ def spider_recover_sub_flow(root_id: str, ticket_data: dict, cluster: dict): backup_info["backup_time"], cluster["rollback_time"], minute_range=30, - host_ip=cluster["master_ip"], - port=cluster["master_port"], + host_ip=cluster["rollback_ip"], + port=cluster["rollback_port"], ) if backup_binlog is None: - raise TendbGetBinlogFailedException(message=_("获取实例 {} binlog失败".format(cluster["master_ip"]))) + raise TendbGetBinlogFailedException(message=_("获取实例 {} binlog失败".format(cluster["rollback_ip"]))) task_ids = [i["task_id"] for i in backup_binlog["file_list_details"]] binlog_files = [i["file_name"] for i in backup_binlog["file_list_details"]] @@ -128,6 +136,13 @@ def remote_node_rollback(root_id: str, ticket_data: dict, cluster: dict): exec_act_kwargs = ExecActuatorKwargs( bk_cloud_id=int(cluster["bk_cloud_id"]), cluster_type=ClusterType.TenDBCluster, cluster=cluster ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.mysql_mkdir_dir.__name__ + exec_act_kwargs.exec_ip = cluster["rollback_ip"] + sub_pipeline.add_act( + act_name=_("创建目录 {}".format(cluster["file_target_path"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), + ) task_ids = [i["task_id"] for i in backup_info["file_list_details"]] # 是否回档从库? diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py index 8a487eae86..ae3e2fe962 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py @@ -190,9 +190,16 @@ def remote_instance_migrate_sub_flow(root_id: str, ticket_data: dict, cluster_in "charset": cluster_info["charset"], } exec_act_kwargs = ExecActuatorKwargs( - bk_cloud_id=int(cluster["bk_cloud_id"]), - cluster_type=ClusterType.TenDBCluster, + bk_cloud_id=int(cluster["bk_cloud_id"]), cluster_type=ClusterType.TenDBCluster, cluster=cluster + ) + exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.mysql_mkdir_dir.__name__ + exec_act_kwargs.exec_ip = [cluster["new_slave_ip"], cluster["new_master_ip"]] + sub_pipeline.add_act( + act_name=_("创建目录 {}".format(cluster["file_target_path"])), + act_component_code=ExecuteDBActuatorScriptComponent.code, + kwargs=asdict(exec_act_kwargs), ) + backup_info = cluster["backupinfo"] # 主从并发下载备份介质 下载为异步下载,定时调起接口扫描下载结果 task_ids = [i["task_id"] for i in backup_info["file_list_details"]] @@ -341,92 +348,6 @@ def remote_node_uninstall_sub_flow(root_id: str, ticket_data: dict, ip: str): ), } ) - sub_pipeline.add_parallel_acts(sub_pipeline_list) - return sub_pipeline.build_sub_process(sub_name=_("Remote node {} 卸载整机实例".format(cluster["uninstall_ip"]))) - - -def remote_slave_recover_sub_flow(root_id: str, ticket_data: dict, cluster_info: dict): - """ - tendb remote slave 节点 恢复。(只做流程,元数据请在主流程控制) - @param root_id: flow流程的root_id - @param ticket_data: 关联单据 ticket对象 - @param cluster_info: 关联的cluster对象 - """ - sub_pipeline = SubBuilder(root_id=root_id, data=ticket_data) - # 下发dbactor》通过master/slave 获取备份的文件》判断备份文件》恢复数据》change master - cluster = { - "cluster_id": cluster_info["cluster_id"], - "master_ip": cluster_info["master_ip"], - "slave_ip": cluster_info["slave_ip"], - "master_port": cluster_info["master_port"], - "new_slave_ip": cluster_info["new_slave_ip"], - "new_slave_port": cluster_info["new_slave_port"], - "bk_cloud_id": cluster_info["bk_cloud_id"], - "file_target_path": cluster_info["file_target_path"], - "change_master_force": cluster_info["change_master_force"], - "backupinfo": cluster_info["backupinfo"], - "charset": cluster_info["charset"], - } - exec_act_kwargs = ExecActuatorKwargs( - bk_cloud_id=int(cluster["bk_cloud_id"]), - cluster_type=ClusterType.TenDBCluster, - ) - backup_info = cluster["backupinfo"] - # 新从库下载备份介质 下载为异步下载,定时调起接口扫描下载结果 - task_ids = [i["task_id"] for i in backup_info["file_list_details"]] - download_kwargs = DownloadBackupFileKwargs( - bk_cloud_id=cluster["bk_cloud_id"], - task_ids=task_ids, - dest_ip=cluster["new_slave_ip"], - desc_dir=cluster["file_target_path"], - reason="spider remote node sync data", - ) - sub_pipeline.add_act( - act_name=_("下载全库备份介质到 {}".format(cluster["new_slave_ip"])), - act_component_code=MySQLDownloadBackupfileComponent.code, - kwargs=asdict(download_kwargs), - ) - - # 阶段4 恢复数据remote主从节点的数据 - cluster["restore_ip"] = cluster["new_slave_ip"] - cluster["restore_port"] = cluster["new_slave_port"] - cluster["source_ip"] = cluster["master_ip"] - cluster["source_port"] = cluster["master_port"] - cluster["change_master"] = False - exec_act_kwargs.cluster = copy.deepcopy(cluster) - exec_act_kwargs.exec_ip = cluster["new_slave_ip"] - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_restore_remotedb_payload.__name__ - sub_pipeline.add_act( - act_name=_("恢复新从节点数据 {}:{}".format(exec_act_kwargs.exec_ip, cluster["restore_port"])), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - - # 阶段5 change master: 新从库指向旧主库 - cluster["target_ip"] = cluster["master_ip"] - cluster["target_port"] = cluster["master_port"] - cluster["repl_ip"] = cluster["new_slave_ip"] - exec_act_kwargs.cluster = copy.deepcopy(cluster) - exec_act_kwargs.exec_ip = cluster["master_ip"] - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_grant_remotedb_repl_user.__name__ - sub_pipeline.add_act( - act_name=_("新增repl帐户{}".format(exec_act_kwargs.exec_ip)), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - - cluster["repl_ip"] = cluster["new_slave_ip"] - cluster["repl_port"] = cluster["new_slave_port"] - cluster["target_ip"] = cluster["master_ip"] - cluster["target_port"] = cluster["master_port"] - cluster["change_master_type"] = MysqlChangeMasterType.BACKUPFILE.value - exec_act_kwargs.cluster = copy.deepcopy(cluster) - exec_act_kwargs.exec_ip = cluster["new_slave_ip"] - exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_remotedb_change_master.__name__ - sub_pipeline.add_act( - act_name=_("建立主从关系:新主库指向旧主库 {}:{}".format(exec_act_kwargs.exec_ip, cluster["repl_port"])), - act_component_code=ExecuteDBActuatorScriptComponent.code, - kwargs=asdict(exec_act_kwargs), - ) - return sub_pipeline.build_sub_process(sub_name=_("RemoteDB从节点重建子流程{}".format(exec_act_kwargs.exec_ip))) + sub_pipeline.add_parallel_acts(acts_list=sub_pipeline_list) + return sub_pipeline.build_sub_process(sub_name=_("Remote node {} 卸载整机实例".format(cluster["uninstall_ip"]))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py index d96d41ebf5..25c71ed83c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py @@ -175,6 +175,7 @@ def tendb_migrate(self): kwargs=asdict( DownloadBackupClientKwargs( bk_cloud_id=cluster_class.bk_cloud_id, + bk_biz_id=int(cluster_class.bk_biz_id), download_host_list=[cluster["new_master_ip"], cluster["new_slave_ip"]], ) ), @@ -207,13 +208,9 @@ def tendb_migrate(self): ins_cluster["slave_ip"] = node["slave"]["ip"] ins_cluster["master_port"] = node["master"]["port"] ins_cluster["slave_port"] = node["slave"]["port"] - # todo 正式环境放开file_target_path,需要备份接口支持自动创建目录 - # ins_cluster["file_target_path"] = "/data/dbbak/{}/{}"\ - # .format(self.root_id, ins_cluster["new_master_port"]) - ins_cluster["file_target_path"] = "/home/mysql/install" + ins_cluster["file_target_path"] = f"/data/dbbak/{self.root_id}/{ins_cluster['master_port']}" ins_cluster["shard_id"] = shard_id ins_cluster["change_master_force"] = False - ins_cluster["backupinfo"] = backup_info["remote_node"].get(shard_id, {}) # 判断 remote_node 下每个分片的备份信息是否正常 if ( diff --git a/dbm-ui/backend/flow/engine/controller/cloud.py b/dbm-ui/backend/flow/engine/controller/cloud.py index 708e09e8ea..8e67c40184 100644 --- a/dbm-ui/backend/flow/engine/controller/cloud.py +++ b/dbm-ui/backend/flow/engine/controller/cloud.py @@ -14,6 +14,7 @@ from backend.flow.engine.bamboo.scene.cloud.dns_service_flow import CloudDNSServiceFlow from backend.flow.engine.bamboo.scene.cloud.drs_service_flow import CloudDRSServiceFlow from backend.flow.engine.bamboo.scene.cloud.nginx_service_flow import CloudNginxServiceFlow +from backend.flow.engine.bamboo.scene.cloud.redis_dts_server_service_flow import CloudRedisDtsServerServiceFlow from backend.flow.engine.controller.base import BaseController logger = logging.getLogger("Controller") @@ -113,3 +114,28 @@ def drs_replace_scene(self): """drs新增流程""" flow = CloudDRSServiceFlow(root_id=self.root_id, data=self.ticket_data) flow.service_replace_flow() + + def redis_dts_server_apply_scene(self): + """redis dts_server部署流程""" + flow = CloudRedisDtsServerServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.service_apply_flow() + + def redis_dts_server_add_scene(self): + """redis dts_server新增流程""" + flow = CloudRedisDtsServerServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.service_add_flow() + + def redis_dts_server_reduce_scene(self): + """redis dts_server裁撤流程""" + flow = CloudRedisDtsServerServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.service_reduce_flow() + + def redis_dts_server_replace_scene(self): + """redis dts_server替换流程""" + flow = CloudRedisDtsServerServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.service_replace_flow() + + def redis_dts_server_reload_scene(self): + """redis dts_server重装流程""" + flow = CloudRedisDtsServerServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.service_reload_flow() diff --git a/dbm-ui/backend/flow/engine/controller/es.py b/dbm-ui/backend/flow/engine/controller/es.py index d8944c8fcb..b9818865ee 100644 --- a/dbm-ui/backend/flow/engine/controller/es.py +++ b/dbm-ui/backend/flow/engine/controller/es.py @@ -14,6 +14,7 @@ from backend.flow.engine.bamboo.scene.es.es_destroy_flow import EsDestroyFlow from backend.flow.engine.bamboo.scene.es.es_disable_flow import EsDisableFlow from backend.flow.engine.bamboo.scene.es.es_enable_flow import EsEnableFlow +from backend.flow.engine.bamboo.scene.es.es_fake_apply_flow import EsFakeApplyFlow from backend.flow.engine.bamboo.scene.es.es_reboot_flow import EsRebootFlow from backend.flow.engine.bamboo.scene.es.es_replace_flow import EsReplaceFlow from backend.flow.engine.bamboo.scene.es.es_scale_up_flow import EsScaleUpFlow @@ -83,3 +84,10 @@ def es_reboot_scene(self): """ flow = EsRebootFlow(root_id=self.root_id, data=self.ticket_data) flow.reboot_es_flow() + + def es_fake_apply_scene(self): + """ + es录入流程 + """ + flow = EsFakeApplyFlow(root_id=self.root_id, data=self.ticket_data) + flow.fake_deploy_es_flow() diff --git a/dbm-ui/backend/flow/engine/controller/kafka.py b/dbm-ui/backend/flow/engine/controller/kafka.py index 81e4656f8e..6d7f34d3f0 100644 --- a/dbm-ui/backend/flow/engine/controller/kafka.py +++ b/dbm-ui/backend/flow/engine/controller/kafka.py @@ -14,6 +14,7 @@ from backend.flow.engine.bamboo.scene.kafka.kafka_destroy_flow import KafkaDestroyFlow from backend.flow.engine.bamboo.scene.kafka.kafka_disable_flow import KafkaDisableFlow from backend.flow.engine.bamboo.scene.kafka.kafka_enable_flow import KafkaEnableFlow +from backend.flow.engine.bamboo.scene.kafka.kafka_fake_apply_flow import KafkaFakeApplyFlow from backend.flow.engine.bamboo.scene.kafka.kafka_reboot_flow import KafkaRebootFlow from backend.flow.engine.bamboo.scene.kafka.kafka_replace_flow import KafkaReplaceFlow from backend.flow.engine.bamboo.scene.kafka.kafka_scale_up_flow import KafkaScaleUpFlow @@ -81,3 +82,10 @@ def kafka_reboot_scene(self): """ flow = KafkaRebootFlow(root_id=self.root_id, data=self.ticket_data) flow.reboot_kafka_flow() + + def kafka_fake_apply_scene(self): + """ + kafka假部署流程 + """ + flow = KafkaFakeApplyFlow(root_id=self.root_id, data=self.ticket_data) + flow.fake_deploy_kafka_flow() diff --git a/dbm-ui/backend/flow/engine/controller/mysql.py b/dbm-ui/backend/flow/engine/controller/mysql.py index 7ddcf2a670..a03aad9b79 100644 --- a/dbm-ui/backend/flow/engine/controller/mysql.py +++ b/dbm-ui/backend/flow/engine/controller/mysql.py @@ -23,16 +23,20 @@ from backend.flow.engine.bamboo.scene.mysql.mysql_ha_disable_flow import MySQLHADisableFlow from backend.flow.engine.bamboo.scene.mysql.mysql_ha_enable_flow import MySQLHAEnableFlow from backend.flow.engine.bamboo.scene.mysql.mysql_ha_full_backup_flow import MySQLHAFullBackupFlow +from backend.flow.engine.bamboo.scene.mysql.mysql_ha_metadata_import import TenDBHAMetadataImportFlow from backend.flow.engine.bamboo.scene.mysql.mysql_ha_standardize_flow import MySQLHAStandardizeFlow from backend.flow.engine.bamboo.scene.mysql.mysql_master_fail_over import MySQLMasterFailOverFlow from backend.flow.engine.bamboo.scene.mysql.mysql_master_slave_switch import MySQLMasterSlaveSwitchFlow from backend.flow.engine.bamboo.scene.mysql.mysql_migrate_cluster_flow import MySQLMigrateClusterFlow +from backend.flow.engine.bamboo.scene.mysql.mysql_migrate_cluster_remote_flow import MySQLMigrateClusterRemoteFlow +from backend.flow.engine.bamboo.scene.mysql.mysql_open_area_flow import MysqlOpenAreaFlow from backend.flow.engine.bamboo.scene.mysql.mysql_partition import MysqlPartitionFlow from backend.flow.engine.bamboo.scene.mysql.mysql_proxy_cluster_add import MySQLProxyClusterAddFlow from backend.flow.engine.bamboo.scene.mysql.mysql_proxy_cluster_switch import MySQLProxyClusterSwitchFlow from backend.flow.engine.bamboo.scene.mysql.mysql_random_password import MySQLRandomizePassword from backend.flow.engine.bamboo.scene.mysql.mysql_rename_database_flow import MySQLRenameDatabaseFlow from backend.flow.engine.bamboo.scene.mysql.mysql_restore_slave_flow import MySQLRestoreSlaveFlow +from backend.flow.engine.bamboo.scene.mysql.mysql_restore_slave_remote_flow import MySQLRestoreSlaveRemoteFlow from backend.flow.engine.bamboo.scene.mysql.mysql_rollback_data_flow import MySQLRollbackDataFlow from backend.flow.engine.bamboo.scene.mysql.mysql_single_apply_flow import MySQLSingleApplyFlow from backend.flow.engine.bamboo.scene.mysql.mysql_single_destroy_flow import MySQLSingleDestroyFlow @@ -76,6 +80,29 @@ def mysql_restore_local_slave_scene(self): flow = MySQLRestoreSlaveFlow(root_id=self.root_id, data=self.ticket_data) flow.deploy_restore_local_slave_flow() + # mysql 从节点恢复(接入备份系统) + def mysql_restore_slave_remote_scene(self): + """ + tenDB slave 恢复流程编排 + """ + flow = MySQLRestoreSlaveRemoteFlow(root_id=self.root_id, tick_data=self.ticket_data) + flow.tendb_ha_restore_slave_flow() + + def mysql_add_slave_remote_scene(self): + """ + 仅添加 slave 流程编排 + """ + self.ticket_data["add_slave_only"] = True + flow = MySQLRestoreSlaveRemoteFlow(root_id=self.root_id, tick_data=self.ticket_data) + flow.tendb_ha_restore_slave_flow() + + def mysql_restore_local_remote_scene(self): + """ + tenDB slave 原地恢复流程编排 + """ + flow = MySQLRestoreSlaveRemoteFlow(root_id=self.root_id, tick_data=self.ticket_data) + flow.restore_local_slave_flow() + def mysql_ha_apply_scene(self): """ 部署tenDB(mysql) HA集群场景(新flow编排) @@ -192,7 +219,6 @@ def mysql_clone_rules(self): flow.clone_mysql_rules() def mysql_proxy_add_scene(self): - """ 添加mysql_proxy实例场景(新flow编排) ticket_data 参数结构体样例 @@ -344,6 +370,13 @@ def mysql_migrate_cluster_scene(self): flow = MySQLMigrateClusterFlow(root_id=self.root_id, data=self.ticket_data) flow.deploy_migrate_cluster_flow() + def mysql_migrate_remote_scene(self): + """ + 主从成对迁移flow编排 + """ + flow = MySQLMigrateClusterRemoteFlow(root_id=self.root_id, data=self.ticket_data) + flow.migrate_cluster_flow() + def mysql_ha_db_table_backup_scene(self): """ TenDBHA 库表备份 @@ -506,3 +539,10 @@ def mysql_ha_standardize_scene(self): def mysql_randomize_password(self): flow = MySQLRandomizePassword(root_id=self.root_id, data=self.ticket_data) flow.mysql_randomize_password() + def mysql_open_area_scene(self): + flow = MysqlOpenAreaFlow(root_id=self.root_id, data=self.ticket_data) + flow.mysql_open_area_flow() + + def mysql_ha_metadata_import_scene(self): + flow = TenDBHAMetadataImportFlow(root_id=self.root_id, data=self.ticket_data) + flow.import_meta() diff --git a/dbm-ui/backend/flow/engine/controller/name_service.py b/dbm-ui/backend/flow/engine/controller/name_service.py index af89bd6549..ae8d6725ae 100644 --- a/dbm-ui/backend/flow/engine/controller/name_service.py +++ b/dbm-ui/backend/flow/engine/controller/name_service.py @@ -22,25 +22,39 @@ def clb_create(self): 创建clb """ flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) - flow.name_service_clb_create_flow() + flow.clb_create_flow() def clb_delete(self): """ 删除clb """ flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) - flow.name_service_clb_delete_flow() + flow.clb_delete_flow() + + def immute_domain_bind_clb_ip(self): + """ + 主域名绑定clb ip + """ + flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.immute_domain_bind_clb_ip() + + def immute_domain_unbind_clb_ip(self): + """ + 主域名解绑clb ip + """ + flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) + flow.immute_domain_unbind_clb_ip() def polaris_create(self): """ 创建polaris """ flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) - flow.name_service_polaris_create_flow() + flow.polaris_create_flow() def polaris_delete(self): """ 删除polaris """ flow = NameServiceFlow(root_id=self.root_id, data=self.ticket_data) - flow.name_service_polaris_delete_flow() + flow.polaris_delete_flow() diff --git a/dbm-ui/backend/flow/engine/controller/pulsar.py b/dbm-ui/backend/flow/engine/controller/pulsar.py index 6aeef2ec35..aaf58540b2 100644 --- a/dbm-ui/backend/flow/engine/controller/pulsar.py +++ b/dbm-ui/backend/flow/engine/controller/pulsar.py @@ -12,6 +12,7 @@ from backend.flow.engine.bamboo.scene.pulsar.pulsar_destroy_flow import PulsarDestroyFlow from backend.flow.engine.bamboo.scene.pulsar.pulsar_disable_flow import PulsarDisableFlow from backend.flow.engine.bamboo.scene.pulsar.pulsar_enable_flow import PulsarEnableFlow +from backend.flow.engine.bamboo.scene.pulsar.pulsar_fake_apply_flow import PulsarFakeApplyFlow from backend.flow.engine.bamboo.scene.pulsar.pulsar_reboot_flow import PulsarRebootFlow from backend.flow.engine.bamboo.scene.pulsar.pulsar_replace_flow import PulsarReplaceFlow from backend.flow.engine.bamboo.scene.pulsar.pulsar_scale_up_flow import PulsarScaleUpFlow @@ -79,3 +80,10 @@ def pulsar_reboot_scene(self): """ flow = PulsarRebootFlow(root_id=self.root_id, data=self.ticket_data) flow.reboot_pulsar_flow() + + def pulsar_fake_apply_scene(self): + """ + pulsar虚假上架 + """ + flow = PulsarFakeApplyFlow(root_id=self.root_id, data=self.ticket_data) + flow.fake_deploy_pulsar_flow() diff --git a/dbm-ui/backend/flow/engine/controller/redis.py b/dbm-ui/backend/flow/engine/controller/redis.py index 14ac5a8c0b..44bd2abc49 100644 --- a/dbm-ui/backend/flow/engine/controller/redis.py +++ b/dbm-ui/backend/flow/engine/controller/redis.py @@ -23,6 +23,7 @@ from backend.flow.engine.bamboo.scene.redis.redis_cluster_scene_cmr import RedisClusterCMRSceneFlow from backend.flow.engine.bamboo.scene.redis.redis_cluster_scene_mss import RedisClusterMSSSceneFlow from backend.flow.engine.bamboo.scene.redis.redis_cluster_shutdown import RedisClusterShutdownFlow +from backend.flow.engine.bamboo.scene.redis.redis_cluster_version_update_online import RedisClusterVersionUpdateOnline from backend.flow.engine.bamboo.scene.redis.redis_data_structure import RedisDataStructureFlow from backend.flow.engine.bamboo.scene.redis.redis_data_structure_task_delete import RedisDataStructureTaskDeleteFlow from backend.flow.engine.bamboo.scene.redis.redis_dbmon import RedisDbmonSceneFlow @@ -230,3 +231,10 @@ def redis_cluster_add_slave(self): """ flow = RedisClusterAddSlaveFlow(root_id=self.root_id, data=self.ticket_data) flow.add_slave_flow() + + def redis_cluster_version_update_online(self): + """ + redis 集群版本在线升级 + """ + flow = RedisClusterVersionUpdateOnline(root_id=self.root_id, data=self.ticket_data) + flow.version_update_flow() diff --git a/dbm-ui/backend/flow/engine/controller/spider.py b/dbm-ui/backend/flow/engine/controller/spider.py index cc5d95bdcf..99a7ef6c11 100644 --- a/dbm-ui/backend/flow/engine/controller/spider.py +++ b/dbm-ui/backend/flow/engine/controller/spider.py @@ -10,8 +10,10 @@ from backend.db_meta.enums import ClusterType from backend.flow.engine.bamboo.scene.spider.import_sqlfile_flow import ImportSQLFlow +from backend.flow.engine.bamboo.scene.spider.remote_local_slave_recover import TenDBRemoteSlaveLocalRecoverFlow from backend.flow.engine.bamboo.scene.spider.remote_master_fail_over import RemoteMasterFailOverFlow from backend.flow.engine.bamboo.scene.spider.remote_master_slave_swtich import RemoteMasterSlaveSwitchFlow +from backend.flow.engine.bamboo.scene.spider.remote_slave_recover import TenDBRemoteSlaveRecoverFlow from backend.flow.engine.bamboo.scene.spider.spider_add_mnt import TenDBClusterAddSpiderMNTFlow from backend.flow.engine.bamboo.scene.spider.spider_add_nodes import TenDBClusterAddNodesFlow from backend.flow.engine.bamboo.scene.spider.spider_checksum import SpiderChecksumFlow @@ -172,6 +174,20 @@ def tendb_cluster_remote_rebalance(self): flow = TenDBRemoteRebalanceFlow(root_id=self.root_id, ticket_data=self.ticket_data) flow.tendb_migrate() + def tendb_cluster_remote_slave_recover(self): + """ + remote 远程slave节点恢复 + """ + flow = TenDBRemoteSlaveRecoverFlow(root_id=self.root_id, ticket_data=self.ticket_data) + flow.tendb_remote_slave_recover() + + def tendb_cluster_remote_local_recover(self): + """ + remote 本地恢复 + """ + flow = TenDBRemoteSlaveLocalRecoverFlow(root_id=self.root_id, ticket_data=self.ticket_data) + flow.tendb_remote_slave_local_recover() + def tendb_cluster_rollback_data(self): """ tendb cluster 定点回档 diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py index 9277e87889..54338bcffc 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py @@ -251,19 +251,27 @@ def _schedule(self, data, parent_data, callback_data=None) -> bool: self.log_info(_("[{}] 任务正在执行🤔").format(node_name)) return True + # 获取job的状态 job_status = resp["data"]["job_instance"]["status"] + + # 默认dbm调用job是一个步骤,所以统一获取第一个步骤id step_instance_id = resp["data"]["step_instance_list"][0]["step_instance_id"] - ip_dict = {"bk_cloud_id": kwargs["bk_cloud_id"], "ip": exec_ips[0]} if exec_ips else {} + # 获取本次执行的所有ip信息 + # ip_dict = {"bk_cloud_id": kwargs["bk_cloud_id"], "ip": exec_ips[0]} if exec_ips else {} + ip_dicts = [{"bk_cloud_id": kwargs["bk_cloud_id"], "ip": ip} for ip in exec_ips] if exec_ips else [] + + # 判断本次job任务是否异常 if job_status not in SUCCESS_LIST: self.log_info("{} job status: {}".format(node_name, resp)) self.log_info(_("[{}] 任务调度失败😱").format(node_name)) - # 转载job脚本节点报错日志 - if ip_dict: - resp = self.__log__(job_instance_id, step_instance_id, ip_dict) - if resp.get("result"): - self.log_error(resp["data"]["log_content"]) + # 转载job脚本节点报错日志,兼容多IP执行场景的日志输出 + if ip_dicts: + for ip_dict in ip_dicts: + resp = self.__log__(job_instance_id, step_instance_id, ip_dict) + if resp.get("result"): + self.log_error(f"{ip_dict}:{resp['data']['log_content']}") self.finish_schedule() return False @@ -273,19 +281,27 @@ def _schedule(self, data, parent_data, callback_data=None) -> bool: self.finish_schedule() return True - # 写入上下文,目前如果传入的ip_list只支持一组ip,多组ip会存在问题,因为这里只拿第一个执行ip来拼接结果到对应的上下文变量 - self.log_info(_("[{}]该节点需要获取执行后日志,赋值到trans_data").format(node_name)) - self.log_info(exec_ips) - if not self.__get_target_ip_context( - job_instance_id=job_instance_id, - step_instance_id=step_instance_id, - ip_dict=ip_dict, - data=data, - trans_data=trans_data, - write_payload_var=write_payload_var, - write_op=kwargs.get("write_op", WriteContextOpType.REWRITE.value), - ): - self.log_info(_("[{}] 获取执行后日志失败,获取ip[{}]").format(node_name, exec_ips[0])) + # 写入上下文,支持多IP传入上下文捕捉场景 + # 写入上下文的位置是trans_data.{write_payload_var} 属性上,分别执行覆盖写入和追加写入 + # 覆盖写入是会直接赋值给上下文属性上,不管之前有什么值,这是默认写入 WriteContextOpType.REWRITE + # 追加写入是特殊行为,如果想IP日志结果都写入,可以选择追加写入,上下文变成list,每个元素是{"ip":"log"} WriteContextOpType.APPEND + self.log_info(_("[{}]该节点需要获取执行后日志,赋值到流程上下文").format(node_name)) + + is_false = False + for ip_dict in ip_dicts: + if not self.__get_target_ip_context( + job_instance_id=job_instance_id, + step_instance_id=step_instance_id, + ip_dict=ip_dict, + data=data, + trans_data=trans_data, + write_payload_var=write_payload_var, + write_op=kwargs.get("write_op", WriteContextOpType.REWRITE.value), + ): + self.log_error(_("[{}] 获取执行后写入流程上下文失败,ip:[{}]").format(node_name, ip_dict["ip"])) + is_false = True + + if is_false: self.finish_schedule() return False diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/download_backup_client.py b/dbm-ui/backend/flow/plugins/components/collections/common/download_backup_client.py index 3dda6c300e..48908cddf3 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/download_backup_client.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/download_backup_client.py @@ -25,6 +25,7 @@ class DownloadBackupClientService(BaseService): 下载并安装backup_client,kwargs参数结构如下: kwargs:{ "bk_cloud_id":0, + "bk_biz_id":0, "download_host_list": [ip,ip.ip] } """ @@ -38,7 +39,8 @@ def _execute(self, data, parent_data) -> bool: params = { "host_list": [ - {"bk_cloud_id": int(kwargs["bk_cloud_id"]), "ip": ip} for ip in kwargs["download_host_list"] + {"bk_cloud_id": int(kwargs["bk_cloud_id"]), "bk_biz_id": int(kwargs["bk_biz_id"]), "ip": ip} + for ip in kwargs["download_host_list"] ], "file_tag": BACKUP_TAG, "cos_info_render": { diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py index 1b79f7823d..96bc43c23e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py @@ -29,6 +29,25 @@ class AuthorizeRules(BaseService): """根据定义的用户规则模板进行授权""" + def _generate_rule_desc(self, authorize_data): + # 生成当前规则的描述细则 + access_dbs = [account_rule["dbname"] for account_rule in authorize_data["account_rules"]] + rules_product: List[Tuple[Any, ...]] = list( + itertools.product( + [authorize_data["user"]], + access_dbs, + [", ".join(authorize_data["source_ips"])], + authorize_data["target_instances"], + ) + ) + rules_description: str = "\n".join( + [ + _("{}. 账号规则: {}-{}, 来源ip: {}, 目标集群: {}").format(index + 1, rule[0], rule[1], rule[2], rule[3]) + for index, rule in enumerate(rules_product) + ] + ) + return rules_description + def _execute(self, data, parent_data, callback=None) -> bool: # kwargs就是调用授权接口传入的参数 @@ -50,30 +69,15 @@ def _execute(self, data, parent_data, callback=None) -> bool: access_dbs="\n".join(access_dbs), ) - # 生成当前规则的描述细则 - rules_product: List[Tuple[Any, ...]] = list( - itertools.product( - [authorize_data["user"]], - access_dbs, - [", ".join(authorize_data["source_ips"])], - authorize_data["target_instances"], - ) - ) - rules_description: str = "\n".join( - [ - _("{}. 账号规则: {}-{}, 来源ip: {}, 目标集群: {}").format(index + 1, rule[0], rule[1], rule[2], rule[3]) - for index, rule in enumerate(rules_product) - ] - ) + # 生成规则描述 + rules_description = self._generate_rule_desc(authorize_data) + self.log_info(_("授权规则明细:\n{}\n").format(rules_description)) # 进行授权,无论授权是否成功,都需要将message存入record中 - self.log_info(_("授权规则明细:\n{}\n").format(rules_description)) try: resp = MySQLPrivManagerApi.authorize_rules(params=authorize_data, raw=True) - record.status = int(resp["code"]) == 0 authorize_success_count += record.status - record.error = resp["message"] self.log_info(f"{resp['message']}\n") diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_by_flashback_input.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_by_flashback_input.py index bfdc3ccad5..d04e840b64 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_by_flashback_input.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_by_flashback_input.py @@ -32,6 +32,11 @@ def _execute(self, data, parent_data) -> bool: tables = global_data["tables"] tables_ignore = global_data["tables_ignore"] + databases = [ele.replace("_", "\_").replace("*", "%").replace("?", "_") for ele in databases] + databases_ignore = [ele.replace("_", "\_").replace("*", "%").replace("?", "_") for ele in databases_ignore] + tables = [ele.replace("_", "\_").replace("*", "%").replace("?", "_") for ele in tables] + tables_ignore = [ele.replace("_", "\_").replace("*", "%").replace("?", "_") for ele in tables_ignore] + db_filter_sql = "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE ({}) AND ({})".format( " OR ".join(["SCHEMA_NAME LIKE '{}'".format(ele) for ele in databases]), " AND ".join(["SCHEMA_NAME NOT LIKE '{}'".format(ele) for ele in databases_ignore + SYSTEM_DBS]), diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py new file mode 100644 index 0000000000..141a11b452 --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py @@ -0,0 +1,303 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import json +from typing import Dict, List, Optional, Union + +from django.db import transaction +from django.utils.translation import ugettext as _ +from pipeline.component_framework.component import Component + +from backend.db_meta.enums import ( + AccessLayer, + ClusterEntryRole, + ClusterEntryType, + ClusterPhase, + ClusterStatus, + ClusterType, + InstanceInnerRole, + InstancePhase, + InstanceRole, + InstanceStatus, + MachineType, +) +from backend.db_meta.models import ( + BKCity, + Cluster, + ClusterEntry, + Machine, + ProxyInstance, + Spec, + StorageInstance, + StorageInstanceTuple, +) +from backend.flow.plugins.components.collections.common.base_service import BaseService + + +def _get_machine_addition_info(ip: str, cluster_json: Dict) -> Dict: + for ele in cluster_json["machines"]: + if ele["IP"] == ip: + return ele + + +def _setup_standby_slave(cluster_json: Dict): + ins = StorageInstance.objects.get( + machine__ip=cluster_json["stand_by_slave"]["ip"], port=cluster_json["stand_by_slave"]["port"] + ) + ins.is_stand_by = True + ins.save(update_fields=["is_stand_by"]) + + +def _create_entries(cluster_json: Dict, cluster_obj: Cluster): + for entry_json in cluster_json["entries"]: + if entry_json["entry_role"] == ClusterEntryRole.MASTER_ENTRY.value: + entry_role = ClusterEntryRole.MASTER_ENTRY.value + else: + entry_role = ClusterEntryRole.SLAVE_ENTRY.value + + entry_obj = ClusterEntry.objects.create( + cluster=cluster_obj, + cluster_entry_type=ClusterEntryType.DNS.value, + entry=entry_json["domain"], + role=entry_role, + ) + for ij in entry_json["instance"]: + qs = ProxyInstance.objects.filter(machine__ip=ij["ip"], port=ij["port"]) + if qs.exists(): + entry_obj.proxyinstance_set.add(*list(qs)) + else: + entry_obj.storageinstance_set.add( + *list(StorageInstance.objects.filter(machine__ip=ij["ip"], port=ij["port"])) + ) + + +class MySQLHAImportMetadataService(BaseService): + def __init__(self): + super().__init__() + self.bk_biz_id = 0 + self.db_module_id = 0 + self.proxy_spec: Spec = Spec() + self.storage_spec: Spec = Spec() + + @transaction.atomic + def _execute(self, data, parent_data): + kwargs = data.get_one_of_inputs("kwargs") + trans_data = data.get_one_of_inputs("trans_data") + global_data = data.get_one_of_inputs("global_data") + + self.log_info(_("[{}] get trans_data: {}".format(kwargs["node_name"], trans_data))) + + self.bk_biz_id = global_data["bk_biz_id"] + self.db_module_id = global_data["db_module_id"] + proxy_spec_id = global_data["proxy_spec_id"] + storage_spec_id = global_data["storage_spec_id"] + + self.proxy_spec = Spec.objects.get(pk=proxy_spec_id) + self.storage_spec = Spec.objects.get(pk=storage_spec_id) + + json_content = global_data["json_content"] + + cluster_ids = [] + for cluster_json in json_content: + cluster_obj = self._create_cluster( + cluster_json["name"], cluster_json["immute_domain"], cluster_json["master"]["Version"] + ) + + master_obj = self._create_master_instance(cluster_json=cluster_json) + slave_objs = self._create_slave_instances(cluster_json=cluster_json) + proxy_objs = self._create_proxy_instance(cluster_json=cluster_json) + + cluster_obj.storageinstance_set.add(master_obj) + cluster_obj.storageinstance_set.add(*slave_objs) + cluster_obj.proxyinstance_set.add(*proxy_objs) + master_obj.proxyinstance_set.add(*proxy_objs) + + cluster_obj.region = master_obj.machine.bk_city.logical_city.name + cluster_obj.save(update_fields=["region"]) + + _setup_standby_slave(cluster_json=cluster_json) + + StorageInstanceTuple.objects.bulk_create( + [StorageInstanceTuple(ejector=master_obj, receiver=ele) for ele in slave_objs] + ) + + _create_entries(cluster_json=cluster_json, cluster_obj=cluster_obj) + + cluster_ids.append(cluster_obj.id) + + self.log_info(_("[{}] cluster ids = {}".format(kwargs["node_name"], cluster_ids))) + + trans_data.cluster_ids = cluster_ids + data.outputs["trans_data"] = trans_data + self.log_info(_("[{}] 元数据写入完成".format(kwargs["node_name"]))) + return True + + def _create_machine( + self, ip: str, addition_info: Dict, access_layer: AccessLayer, machine_type: MachineType + ) -> Machine: + cc_info = json.loads(addition_info["CCInfo"]) + bk_city_id = addition_info["CityID"] + + if access_layer == AccessLayer.PROXY: + spec_obj = self.proxy_spec + else: + spec_obj = self.storage_spec + + machine, _ = Machine.objects.get_or_create( + ip=ip, + bk_biz_id=self.bk_biz_id, + db_module_id=self.db_module_id, + access_layer=access_layer.value, + machine_type=machine_type.value, + cluster_type=ClusterType.TenDBHA.value, + bk_city=BKCity.objects.get(pk=bk_city_id), + bk_host_id=cc_info["bk_host_id"], + bk_os_name=cc_info["bk_os_name"], + bk_idc_area=cc_info["bk_idc_area"], + bk_idc_area_id=cc_info["bk_idc_area_id"], + bk_sub_zone=cc_info["sub_zone"], + bk_sub_zone_id=cc_info["sub_zone_id"], + bk_rack=cc_info["rack"], + bk_rack_id=cc_info["rack_id"], + bk_svr_device_cls_name=cc_info["bk_svr_device_cls_name"], + bk_idc_name=cc_info["idc_name"], + bk_idc_id=cc_info["idc_id"], + bk_cloud_id=0, # addition_info["bk_cloud_id"], + net_device_id=cc_info["net_device_id"], + spec_id=spec_obj.spec_id, + spec_config=spec_obj.get_spec_info(), + ) + return machine + + def __create_instance( + self, + ip: str, + port: int, + addition_info: Dict, + machine_type: MachineType, + inner_role: Optional[InstanceInnerRole] = None, + version: Optional[str] = None, + ) -> Union[ProxyInstance, StorageInstance]: + if machine_type == MachineType.PROXY: + access_layer = AccessLayer.PROXY + else: + access_layer = AccessLayer.STORAGE + machine = self._create_machine( + ip=ip, addition_info=addition_info, access_layer=access_layer, machine_type=machine_type + ) + + if machine_type == MachineType.PROXY: + return self.__create_proxy_instance(machine=machine, port=port) + else: + return self.__create_storage_instance(machine=machine, port=port, inner_role=inner_role, version=version) + + def __create_proxy_instance(self, machine: Machine, port: int) -> ProxyInstance: + return ProxyInstance.objects.create( + version="", + port=port, + admin_port=port + 1000, + machine=machine, + db_module_id=self.db_module_id, + bk_biz_id=self.bk_biz_id, + access_layer=machine.access_layer, + machine_type=machine.machine_type, + cluster_type=machine.cluster_type, + status=InstanceStatus.RUNNING.value, + phase=InstancePhase.TRANS_STAGE.value, + ) + + def __create_storage_instance( + self, machine: Machine, port: int, inner_role: InstanceInnerRole, version: str + ) -> StorageInstance: + if inner_role == InstanceInnerRole.MASTER: + role = InstanceRole.BACKEND_MASTER + else: + role = InstanceRole.BACKEND_SLAVE + + return StorageInstance.objects.create( + version=version, + port=port, + machine=machine, + db_module_id=self.db_module_id, + bk_biz_id=self.bk_biz_id, + access_layer=machine.access_layer, + machine_type=machine.machine_type, + instance_role=role, + instance_inner_role=inner_role, + cluster_type=machine.cluster_type, + status=InstanceStatus.RUNNING.value, + phase=InstancePhase.TRANS_STAGE.value, + ) + + def _create_cluster(self, name: str, immute_domain: str, version: str) -> Cluster: + return Cluster.objects.create( + name=name, + bk_biz_id=self.bk_biz_id, + cluster_type=ClusterType.TenDBHA.value, + db_module_id=self.db_module_id, + immute_domain=immute_domain, + major_version=version, + phase=ClusterPhase.TRANS_STAGE.value, + status=ClusterStatus.NORMAL.value, + bk_cloud_id=0, + ) + + def _create_master_instance(self, cluster_json: Dict) -> StorageInstance: + ip = cluster_json["master"]["ip"] + port = cluster_json["master"]["port"] + version = cluster_json["master"]["Version"] + + addition_info = _get_machine_addition_info(ip=ip, cluster_json=cluster_json) + return self.__create_instance( + ip=ip, + port=port, + addition_info=addition_info, + machine_type=MachineType.BACKEND, + inner_role=InstanceInnerRole.MASTER, + version=version, + ) + + def _create_slave_instances(self, cluster_json: Dict) -> List[StorageInstance]: + slaves = [] + for ij in cluster_json["slaves"]: + ip = ij["ip"] + port = ij["port"] + version = ij["Version"] + addition_info = _get_machine_addition_info(ip=ip, cluster_json=cluster_json) + slaves.append( + self.__create_instance( + ip=ip, + port=port, + addition_info=addition_info, + machine_type=MachineType.BACKEND, + inner_role=InstanceInnerRole.SLAVE, + version=version, + ) + ) + + return slaves + + def _create_proxy_instance(self, cluster_json: Dict) -> List[ProxyInstance]: + proxies = [] + for ij in cluster_json["proxies"]: + ip = ij["ip"] + port = ij["port"] + addition_info = _get_machine_addition_info(ip=ip, cluster_json=cluster_json) + proxies.append( + self.__create_instance(ip=ip, port=port, addition_info=addition_info, machine_type=MachineType.PROXY) + ) + + return proxies + + +class MySQLHAImportMetadataComponent(Component): + name = __name__ + code = "mysql_ha_import_metadata" + bound_service = MySQLHAImportMetadataService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py new file mode 100644 index 0000000000..96f1dd5eca --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + + +from django.db import transaction +from django.utils.translation import ugettext as _ +from pipeline.component_framework.component import Component + +from backend.db_meta.enums import ClusterPhase, InstancePhase +from backend.db_meta.models import Cluster, ProxyInstance, StorageInstance +from backend.flow.plugins.components.collections.common.base_service import BaseService + + +class MySQLHAModifyClusterPhaseService(BaseService): + @transaction.atomic + def _execute(self, data, parent_data): + kwargs = data.get_one_of_inputs("kwargs") + trans_data = data.get_one_of_inputs("trans_data") + global_data = data.get_one_of_inputs("global_data") + + cluster_ids = trans_data.cluster_ids + + Cluster.objects.filter(id__in=cluster_ids).update(phase=ClusterPhase.ONLINE.value) + ProxyInstance.objects.filter(cluster__in=cluster_ids).update(phase=InstancePhase.ONLINE.value) + StorageInstance.objects.filter(cluster__in=cluster_ids).update(phase=InstancePhase.ONLINE.value) + + self.log_info(_("[{}] 修改集群状态完成".format(kwargs["node_name"]))) + return True + + +class MySQLHAModifyClusterPhaseComponent(Component): + name = __name__ + code = "mysql_ha_modify_cluster_phase" + bound_service = MySQLHAModifyClusterPhaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py index ce1fe04194..02762a5297 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py @@ -108,8 +108,8 @@ def _prepare_for_ticket(self, data, cluster_type): skip_pause_key = CACHE_SEMANTIC_SKIP_PAUSE_FILED.format(bk_biz_id=bk_biz_id, root_id=root_id) # 默认自动创建单据 - is_auto_commit = cache.get(auto_commit_key) or True - is_skip_pause = cache.get(skip_pause_key) or False + is_auto_commit = cache.get(auto_commit_key, True) + is_skip_pause = cache.get(skip_pause_key, False) self.log_info( f"-----------auto_commit_key: {auto_commit_key}-{is_auto_commit}, " f"skip_pause_key: {skip_pause_key}-{is_skip_pause}-------------" diff --git a/dbm-ui/backend/flow/plugins/components/collections/name_service/name_service.py b/dbm-ui/backend/flow/plugins/components/collections/name_service/name_service.py index 809ee526c6..b4eceebf0f 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/name_service/name_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/name_service/name_service.py @@ -14,13 +14,14 @@ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service +import backend.flow.utils.name_service.name_service_dataclass as flow_context from backend.db_services.plugin.nameservice import clb, polaris from backend.flow.plugins.components.collections.common.base_service import BaseService logger = logging.getLogger("json") -class ExecNameServiceCreateService(BaseService): +class ExecNameServiceOperation(BaseService): """ NameServiceCreate服务 """ @@ -34,80 +35,64 @@ def _execute(self, data, parent_data) -> bool: # 从流程节点中获取变量 kwargs = data.get_one_of_inputs("kwargs") - name_service_type = kwargs["name_service_type"] + name_service_operation_type = kwargs["name_service_operation_type"] + trans_data = data.get_one_of_inputs("trans_data") + creator = kwargs["creator"] + cluster_id = kwargs["cluster_id"] - # 执行功能 - if name_service_type == "clb": - res = clb.create_lb_and_register_target(kwargs["cluster_id"], kwargs["created_by"]) - elif name_service_type == "polaris": - res = polaris.create_service_alias_bind_targets(kwargs["cluster_id"], kwargs["created_by"]) - else: - self.log_error("name_service_type %s not support error!" % name_service_type) - return False - - # 定义流程节点输出参数值 - data.outputs.result = res - if res["status"] == 0: - self.log_info("create %s successfully" % name_service_type) - return True - - self.log_error("create %s fail, error:%s" % (name_service_type, res["message"])) - return False - - # 流程节点输入参数 - def inputs_format(self) -> List: - return [ - Service.InputItem(name="kwargs", key="kwargs", type="dict", required=True), - Service.InputItem(name="global_data", key="global_data", type="dict", required=True), - ] - - # 流程节点输出参数 - def outputs_format(self) -> List: - return [Service.OutputItem(name="result", key="result", type="dict")] - - -class ExecNameServiceCreateComponent(Component): - """ - ExecNameServiceCreate组件 - """ - - name = __name__ - code = "name_service_create" - bound_service = ExecNameServiceCreateService - - -class ExecNameServiceDeleteService(BaseService): - """ - NameServiceDelete服务 - """ - - def _execute(self, data, parent_data) -> bool: - """ - 执行删除名字服务功能的函数 - global_data 单据全局变量,格式字典 - kwargs 私有变量 - """ - - # 从流程节点中获取变量 - kwargs = data.get_one_of_inputs("kwargs") - name_service_type = kwargs["name_service_type"] + if trans_data is None or trans_data == "${trans_data}": + # 表示没有加载上下文内容,则在此添加 + trans_data = getattr(flow_context, kwargs["set_trans_data_dataclass"])() # 执行功能 - if name_service_type == "clb": - res = clb.deregister_target_and_delete_lb(kwargs["cluster_id"]) - elif name_service_type == "polaris": + # clb创建 + if name_service_operation_type == "create_clb": + res = clb.create_lb_and_register_target(cluster_id=cluster_id) + # polaris创建 + elif name_service_operation_type == "create_polaris": + res = polaris.create_service_alias_bind_targets(cluster_id=cluster_id) + # clb删除 + elif name_service_operation_type == "delete_clb": + res = clb.deregister_target_and_delete_lb(cluster_id=cluster_id) + # polaris删除 + elif name_service_operation_type == "delete_polaris": res = polaris.unbind_targets_delete_alias_service(kwargs["cluster_id"]) + # clb信息写入meta + elif name_service_operation_type == "add_clb_info_to_meta": + res = clb.add_clb_info_to_meta(output=trans_data, cluster_id=cluster_id, creator=creator) + # 从meta删除clb信息 + elif name_service_operation_type == "delete_clb_info_from_meta": + res = clb.delete_clb_info_from_meta(output=trans_data, cluster_id=cluster_id) + # polaris信息写入meta + elif name_service_operation_type == "add_polaris_info_to_meta": + res = polaris.add_polaris_info_to_meta(output=trans_data, cluster_id=cluster_id, creator=creator) + # 从meta删除polaris信息 + elif name_service_operation_type == "delete_polaris_info_from_meta": + res = polaris.delete_polaris_info_from_meta(output=trans_data, cluster_id=cluster_id) + # 添加clb域名到dns,clb域名信息写入meta + elif name_service_operation_type == "add_clb_domain_to_dns": + res = clb.add_clb_domain_to_dns(cluster_id=cluster_id, creator=creator) + # 从dns删除clb域名,从meta中删除clb域名信息 + elif name_service_operation_type == "delete_clb_domain_from_dns": + res = clb.delete_clb_domain_from_dns(cluster_id=cluster_id) + # 主域名绑定clb ip + elif name_service_operation_type == "domain_bind_clb_ip": + res = clb.immute_domain_clb_ip(cluster_id=cluster_id, creator=creator, bind=True) + # 主域名解绑clb ip + elif name_service_operation_type == "domain_unbind_clb_ip": + res = clb.immute_domain_clb_ip(cluster_id=cluster_id, creator=creator, bind=False) else: - self.log_error("name_service_type %s not support error!" % name_service_type) + self.log_error("{} does not support error!".format(name_service_operation_type)) return False # 定义流程节点输出参数值 - data.outputs.result = res - if res["status"] == 0: - self.log_info("delete %s successfully" % name_service_type) + trans_data = res + if res["code"] == 0: + self.log_info("task:{} execute successfully".format(name_service_operation_type)) + data.outputs["trans_data"] = trans_data return True - self.log_error("delete %s fail, error:%s" % (name_service_type, res["message"])) + self.log_error("task:{} execute fail, error:{}".format(name_service_operation_type, res["message"])) return False # 流程节点输入参数 @@ -117,16 +102,12 @@ def inputs_format(self) -> List: Service.InputItem(name="global_data", key="global_data", type="dict", required=True), ] - # 流程节点输出参数 - def outputs_format(self) -> List: - return [Service.OutputItem(name="result", key="result", type="dict")] - -class ExecNameServiceDeleteComponent(Component): +class ExecNameServiceOperationComponent(Component): """ - ExecNameServiceDelete组件 + ExecNameServiceOperation组件 """ name = __name__ - code = "name_service_delete" - bound_service = ExecNameServiceDeleteService + code = "name_service_operation" + bound_service = ExecNameServiceOperation diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_set_token.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_set_token.py new file mode 100644 index 0000000000..13f5d65ce9 --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_set_token.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +from typing import List + +from pipeline.component_framework.component import Component +from pipeline.core.flow.activity import Service + +import backend.flow.utils.pulsar.pulsar_context_dataclass as flow_context +from backend.flow.plugins.components.collections.common.base_service import BaseService + +logger = logging.getLogger("flow") + + +class PulsarSetTokenContextService(BaseService): + """ + 获取pulsar token,存入到流程上下文中 + """ + + def _execute(self, data, parent_data) -> bool: + kwargs = data.get_one_of_inputs("kwargs") + global_data = data.get_one_of_inputs("global_data") + trans_data = data.get_one_of_inputs("trans_data") + + if trans_data is None or trans_data == "${trans_data}": + # 表示没有加载上下文内容,则在此添加 + trans_data = getattr(flow_context, kwargs["set_trans_data_dataclass"])() + + # 传入调用结果 + setattr(trans_data, flow_context.PulsarApplyContext.get_new_token_var_name(), global_data["token"]) + + self.log_info("successfully set pulsar token context") + data.outputs["trans_data"] = trans_data + return True + + def inputs_format(self) -> List: + return [ + Service.InputItem(name="kwargs", key="kwargs", type="dict", required=True), + Service.InputItem(name="global_data", key="global_data", type="dict", required=True), + ] + + +class PulsarSetTokenContextComponent(Component): + name = __name__ + code = "pulsar_set_token_context" + bound_service = PulsarSetTokenContextService diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py index f65b516a97..b29ce2b6d8 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py @@ -98,7 +98,9 @@ def _execute(self, data, parent_data) -> bool: self.log_info(_("[{}] kwargs['payload'] 是不完整,需要将{}内容加到payload中").format(node_name, kwargs["cluster"])) db_act_template["payload"].update(kwargs["cluster"]) - db_act_template["payload"]["backup_tasks"] = trans_data.tendis_backup_info + # 这里有些场景没有tendis_backup_info,比如key删除 + if getattr(trans_data, "tendis_backup_info"): + db_act_template["payload"]["backup_tasks"] = trans_data.tendis_backup_info db_act_template["payload"] = str( base64.b64encode(json.dumps(db_act_template["payload"]).encode("utf-8")), "utf-8" diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py new file mode 100644 index 0000000000..745bf80fad --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import base64 +import json +import logging +import re +from typing import List + +from django.utils.translation import ugettext as _ +from jinja2 import Environment +from pipeline.component_framework.component import Component +from pipeline.core.flow.activity import Service + +import backend.flow.utils.redis.redis_context_dataclass as flow_context +from backend import env +from backend.components import JobApi +from backend.flow.consts import ConfigDefaultEnum +from backend.flow.models import FlowNode +from backend.flow.plugins.components.collections.common.base_service import BkJobService +from backend.flow.utils.redis.redis_script_template import ( + redis_actuator_template, + redis_fast_execute_script_common_kwargs, +) +from backend.ticket.constants import TicketType + +logger = logging.getLogger("json") +cpl = re.compile("(?P.+?)") # 非贪婪模式,只匹配第一次出现的自定义tag + + +class ExecuteDataStructureActuatorScriptService(BkJobService): + """ + 根据db-actuator组件,绑定fast_execute_script api接口访问。 + """ + + def _execute(self, data, parent_data) -> bool: + """ + 执行fast_execute_script脚本 + global_data 单据全局变量,格式字典 + trans_data 单据上下文 + kwargs 字典传入格式: + { + root_id: db-actuator任务必须参数,做录入日志平台的条件 + node_id: db-actuator任务必须参数,做录入日志平台的条件 + node_name: db-actuator任务必须参数,做录入日志平台的条件 + get_redis_payload_func : 表示获取执行 redis的db-actuator 参数方法名称,对应RedisActPayload类 + exec_ip: 表示执行的ip节点 + get_trans_data_ip_name: 表示从上下文获取到执行ip的变量名,对应单据的获取到上下文dataclass类 + cluster: 操作的集群名称 + extend_attr: 额外的字段数据,需要从RedisApplyContext中获取 + } + """ + kwargs = data.get_one_of_inputs("kwargs") + global_data = data.get_one_of_inputs("global_data") + trans_data = data.get_one_of_inputs("trans_data") + + if trans_data is None or trans_data == "${trans_data}": + # 表示没有加载上下文内容,则在此添加 + trans_data = getattr(flow_context, kwargs["set_trans_data_dataclass"])() + + # 如果是数据构造并且上下文有backup_dir值则对 + if kwargs["cluster"]["ticket_type"] == TicketType.REDIS_DATA_STRUCTURE.value and getattr( + trans_data, "backup_dir" + ): + kwargs["cluster"]["data_params"]["dest_dir"] = trans_data.backup_dir + "/dbbak/recover_redis" + + root_id = kwargs["root_id"] + node_name = kwargs["node_name"] + node_id = kwargs["node_id"] + + # 拼接节点执行ip所需要的信息,ip信息统一用list处理拼接 + if kwargs["get_trans_data_ip_var"]: + exec_ips = self.splice_exec_ips_list( + ticket_ips=kwargs["exec_ip"], pool_ips=getattr(trans_data, kwargs["get_trans_data_ip_var"]) + ) + else: + exec_ips = self.splice_exec_ips_list(ticket_ips=kwargs["exec_ip"]) + + if not exec_ips: + self.log_error(_("该节点获取到执行ip信息为空,请联系系统管理员{}").format(exec_ips)) + return False + + target_ip_info = [{"bk_cloud_id": kwargs["bk_cloud_id"], "ip": ip} for ip in exec_ips] + self.log_info("{} exec {}".format(target_ip_info, kwargs["node_name"])) + + # 获取 actuator 组件所需要执行的参数, + db_act_template = getattr(trans_data.redis_act_payload, kwargs["get_redis_payload_func"])( + ip=exec_ips[0], params=kwargs["cluster"] + ) + db_act_template["root_id"] = root_id + db_act_template["node_id"] = node_id + db_act_template["version_id"] = self._runtime_attrs["version"] + db_act_template["uid"] = global_data["uid"] + + db_act_template["data_dir"] = ConfigDefaultEnum.DATA_DIRS[0] + + if kwargs["is_update_trans_data"]: + self.log_info(_("[{}] kwargs['payload'] 是不完整,需要将{}内容加到payload中").format(node_name, kwargs["cluster"])) + db_act_template["payload"].update(kwargs["cluster"]) + + if getattr(trans_data, "tendis_backup_info"): + db_act_template["payload"]["backup_tasks"] = trans_data.tendis_backup_info + + db_act_template["payload"] = str( + base64.b64encode(json.dumps(db_act_template["payload"]).encode("utf-8")), "utf-8" + ) + + FlowNode.objects.filter(root_id=kwargs["root_id"], node_id=node_id).update(hosts=exec_ips) + + # 脚本内容 + jinja_env = Environment() + template = jinja_env.from_string(redis_actuator_template) + + body = { + "bk_biz_id": env.JOB_BLUEKING_BIZ_ID, + "task_name": f"DBM_{node_name}_{node_id}", + "script_content": str(base64.b64encode(template.render(db_act_template).encode("utf-8")), "utf-8"), + "script_language": 1, + "target_server": {"ip_list": target_ip_info}, + } + + self.log_info( + "[{}] ready start task with body {} {}".format(node_name, redis_fast_execute_script_common_kwargs, body) + ) + resp = JobApi.fast_execute_script({**redis_fast_execute_script_common_kwargs, **body}, raw=True) + + # 传入调用结果,并单调监听任务状态 + data.outputs.ext_result = resp + data.outputs.exec_ips = exec_ips + return True + + def inputs_format(self) -> List: + return [ + Service.InputItem(name="kwargs", key="kwargs", type="dict", required=True), + Service.InputItem(name="global_data", key="global_data", type="dict", required=True), + ] + + def outputs_format(self) -> List: + return [Service.OutputItem(name="exec_ips", key="exec_ips", type="list")] + + +class ExecuteDataStructureActuatorScriptComponent(Component): + name = __name__ + code = "redis_data_structure_actuator_execute" + bound_service = ExecuteDataStructureActuatorScriptService diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py index 61ab476444..fd37d9c3dd 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py @@ -10,6 +10,7 @@ """ import base64 import logging +import traceback from typing import List from django.utils.translation import ugettext as _ @@ -20,8 +21,10 @@ from backend import env from backend.components import JobApi from backend.flow.models import FlowNode -from backend.flow.plugins.components.collections.common.base_service import BkJobService +from backend.flow.plugins.components.collections.common.base_service import BaseService, BkJobService +from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, RedisDataStructureContext from backend.flow.utils.redis.redis_script_template import redis_fast_execute_script_common_kwargs +from backend.ticket.constants import TicketType logger = logging.getLogger("json") @@ -136,3 +139,128 @@ class GetDeleteKeysExeIpComponent(Component): name = __name__ code = "get_delete_keys_exe_ip" bound_service = GetDeleteKeysExeIpService + + +class RedisDataStructurePrecheckService(BaseService): + """ + redis 数据构造 磁盘前置检查 + """ + + def _execute(self, data, parent_data): + kwargs = data.get_one_of_inputs("kwargs") + trans_data = data.get_one_of_inputs("trans_data") + splice_payload_var = data.get_one_of_inputs("splice_payload_var") + + if trans_data is None or trans_data == "${trans_data}": + # 表示没有加载上下文内容,则在此添加 + trans_data = getattr(flow_context, kwargs["set_trans_data_dataclass"])() + + # 打印信息 + self.log_info(" RedisDataStructurePrecheckService start") + self.log_info("kwargs: {}".format(kwargs)) + + try: + # 临时机器磁盘空间是否足够 + if not self.check_src_redis_host_disk(trans_data, kwargs): + return False + + except Exception as e: + traceback.print_exc() + self.log_error("redis datastructure precheck failed:{}".format(e)) + return False + self.log_info("redis datastructure precheck success") + data.outputs["trans_data"] = trans_data + + return True + + @staticmethod + def decode_slave_host_disk_info(disk_line: str) -> dict: + """ + 解析slave磁盘信息 + 如: /dev/vdb 103080888 1788160 96033464 2% /data + """ + l01 = disk_line.split() + ret = {} + ret["filesystem"] = l01[0] + ret["total"] = int(l01[1]) * 1024 + ret["used"] = int(l01[2]) * 1024 + ret["avail"] = int(l01[3]) * 1024 + ret["used_ratio"] = int(l01[4].replace("%", "")) + ret["mount_on"] = l01[5] + return ret + + def log_disk_error(self, exec_ip, disk_info): + error_message = _("源Redis服务器:{} {} 磁盘使用率:{}% > 85%").format( + exec_ip["ip"], disk_info["filesystem"], disk_info["used_ratio"] + ) + self.log_error(error_message) + return False + + def check_disk_usage(self, disk_info, exec_ip, data_size): + if disk_info["used_ratio"] > 85: + return self.log_disk_error(exec_ip, disk_info) + if (disk_info["used"] + data_size) / disk_info["total"] > 0.9: + error_message = _("源Redis服务器:{} 磁盘使用情况:{}+Redis数据大小:{} 将会 >=90%").format( + exec_ip, disk_info["used"], data_size + ) + self.log_error(error_message) + return False + return True + + def check_src_redis_host_disk(self, trans_data: RedisDataStructureContext, kwargs: dict) -> bool: + """ + 检查临时redis 机器磁盘空间是否足够 + """ + + disk_used = trans_data.disk_used + is_same, backup_dir = self.check_backup_dir(disk_used) + if is_same: + self.log_info(_("所有临时Redis服务器的备份目录都相同:{}").format(backup_dir)) + else: + self.log_error(_("备份目录的值不一致:{}").format(backup_dir)) + return False + + # # 当所有机器的备份目录一样时,对backup_dir赋值 + trans_data.backup_dir = backup_dir + self.log_info(_("检查源Redis服务器磁盘使用情况:{}").format(disk_used)) + self.log_info("check_src_redis_host_disk disk_used:{}".format(disk_used)) + + exec_ip = kwargs["exec_ip"] + cluster = kwargs["cluster"] + # 检查备份目录 + redis_backup_dir_data = disk_used.get(exec_ip)["redis_backup_dir_data"] + cluster["backup_dir"] = disk_used.get(exec_ip)["backup_dir"] + disk_info = self.decode_slave_host_disk_info(redis_backup_dir_data) + if not self.check_disk_usage(disk_info, exec_ip, cluster["multi_total_size"]): + return False + + # 检查数据目录 + redis_data_dir_data = disk_used.get(exec_ip)["redis_data_dir_data"] + data_disk_info = self.decode_slave_host_disk_info(redis_data_dir_data) + if not self.check_disk_usage(data_disk_info, exec_ip, cluster["multi_total_size"]): + return False + + self.log_info(_("redis 临时机器:{} 磁盘空间检查通过").format(kwargs["exec_ip"])) + return True + + @staticmethod + def check_backup_dir(disk_used): + """ + 检查是否所有机器的 backup_dir 都一致 + """ + backup_dirs = set() + + for server in disk_used.values(): + backup_dirs.add(server["backup_dir"]) + + if len(backup_dirs) == 1: + backup_dir_value = backup_dirs.pop() + return True, backup_dir_value + else: + return False, backup_dirs + + +class RedisDataStructurePrecheckComponent(Component): + name = __name__ + code = "redis_dataStructure_precheck" + bound_service = RedisDataStructurePrecheckService diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py new file mode 100644 index 0000000000..172b04b166 --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging + +from django.utils.translation import ugettext as _ +from pipeline.component_framework.component import Component +from pipeline.core.flow.activity import StaticIntervalGenerator + +import backend.flow.utils.redis.redis_context_dataclass as flow_context +from backend.components.mysql_backup.client import RedisBackupApi +from backend.flow.plugins.components.collections.common.base_service import BaseService +from backend.flow.utils.redis.redis_context_dataclass import ActKwargs, RedisDataStructureContext + +logger = logging.getLogger("flow") + + +class RedisDownloadBackupfile(BaseService): + """ + Redis下载备份文件 + """ + + __need_schedule__ = True + interval = StaticIntervalGenerator(60) + + def _execute(self, data, parent_data) -> bool: + kwargs = data.get_one_of_inputs("kwargs") + trans_data: RedisDataStructureContext = data.get_one_of_inputs("trans_data") + if trans_data is None or trans_data == "${trans_data}": + # 表示没有加载上下文内容,则在此添加 + trans_data = getattr(flow_context, kwargs["set_trans_data_dataclass"])() + dest_dir = trans_data.backup_dir + "/dbbak/recover_redis" + params = { + "bk_cloud_id": kwargs["bk_cloud_id"], + "taskid_list": kwargs["task_ids"], + "dest_ip": kwargs["dest_ip"], + "login_user": kwargs["login_user"], + "dest_dir": dest_dir, + "reason": kwargs["reason"], + } + logger.debug(params) + response = RedisBackupApi.download(params=params) + backup_bill_id = response.get("bill_id", -1) + if backup_bill_id > 0: + logger.debug(_("调起下载 {}").format(backup_bill_id)) + data.outputs.backup_bill_id = backup_bill_id + return True + else: + return False + + def _schedule(self, data, parent_data, callback_data=None): + # 定义异步扫描 + backup_bill_id = data.get_one_of_outputs("backup_bill_id") + logger.info(_("下载单据ID {}").format(backup_bill_id)) + result_response = RedisBackupApi.download_result({"bill_id": backup_bill_id}) + # 如何判断 + if result_response is not None and "total" in result_response: + if result_response["total"]["todo"] == 0 and result_response["total"]["fail"] == 0: + logger.info(_("{} 下载成功").format(backup_bill_id)) + self.finish_schedule() + return True + elif result_response["total"]["fail"] > 0: + logger.error(_("{} 下载失败").format(backup_bill_id)) + logger.debug(str(result_response)) + self.finish_schedule() + return False + else: + logger.debug(_("{} 下载中: todo {}").format(backup_bill_id, result_response["total"]["todo"])) + else: + logger.debug("result response fail") + self.finish_schedule() + return False + + +class RedisDownloadBackupfileComponent(Component): + name = __name__ + code = "redis_download_backup_file" + bound_service = RedisDownloadBackupfile diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py index 4a3579282b..a663996182 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py @@ -10,7 +10,6 @@ """ import base64 import datetime -import hashlib import logging import re import traceback @@ -162,6 +161,7 @@ def check_all_src_slaves_running(self, src_data: dict) -> bool: self.log_error(_("源redis集群{}存在{}个非running状态的slave".format(src_data["cluster_addr"], unrunning_slave_cnt))) return False slaves_addr = [slave["ip"] + ":" + str(slave["port"]) for slave in src_data["slave_instances"]] + self.log_info("check_all_src_slaves_running slaves_addr:{}".format(slaves_addr)) DRSApi.redis_rpc( { "addresses": slaves_addr, @@ -241,6 +241,9 @@ def check_src_cluster_nodes_ok(self, dts_copy_type: str, src_data: dict) -> List # 获取集群cluster nodes信息 running_master = src_data["one_running_master"] master_addr = running_master["ip"] + ":" + str(running_master["port"]) + self.log_info( + "check src_cluster:{} cluster_nodes is ok,master_addr:{}".format(src_data["cluster_addr"], master_addr) + ) resp = DRSApi.redis_rpc( { "addresses": [master_addr], @@ -301,6 +304,9 @@ def check_src_cluster_state_ok(self, src_data: dict) -> bool: return True running_master = src_data["one_running_master"] master_addr = running_master["ip"] + ":" + str(running_master["port"]) + self.log_info( + "check src_cluster:{} cluster_state is ok,master_addr:{}".format(src_data["cluster_addr"], master_addr) + ) resp = DRSApi.redis_rpc( { "addresses": [master_addr], @@ -351,6 +357,7 @@ def check_dst_cluster_connected(self, bk_biz_id: int, dts_copy_type: str, dst_da cluster = Cluster.objects.get(id=dst_data["cluster_id"]) for proxy in cluster.proxyinstance_set.all(): dst_proxy_addrs.append(proxy.machine.ip + ":" + str(proxy.port)) + self.log_info("check dst_cluster:{} proxy:{} connect".format(dst_domain, dst_proxy_addrs)) DRSApi.redis_rpc( { "addresses": dst_proxy_addrs, @@ -855,7 +862,7 @@ def __new_data_check_repair_job(self, global_data: dict, dts_job: TbTendisDTSJob ], } self.log_info(f"new_data_check_repair_job ticket_data:{ticket_data}") - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") flow = RedisClusterDataCheckRepairFlow(root_id=root_id, data=ticket_data) flow.redis_cluster_data_check_repair_flow() self.log_info(f"new_data_check_repair_job flow_id:{root_id}") @@ -919,7 +926,7 @@ def _execute(self, data, parent_data): "resource_spec": kwargs["cluster"]["dst_install_param"]["resource_spec"], } self.log_info("NewDstClusterInstallJobAndWatchStatus ticket_data==>:{}".format(ticket_data)) - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") if ticket_data["cluster_type"] == ClusterType.TendisPredixyTendisplusCluster.value: flow = TendisPlusApplyFlow(root_id=root_id, data=ticket_data) flow.deploy_tendisplus_cluster_flow() @@ -1021,7 +1028,7 @@ def _execute(self, data, parent_data): ], } self.log_info("NewDstClusterFlushJobAndWatchStatus ticket_data==>:{}".format(ticket_data)) - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") flow = RedisFlushDataFlow(root_id=root_id, data=ticket_data) flow.redis_flush_data_flow() @@ -1115,7 +1122,7 @@ def _execute(self, data, parent_data): self.log_info(f"new_dts_online_switch_job ticket_data:{ticket_data}") from backend.flow.engine.bamboo.scene.redis.redis_cluster_data_copy import RedisClusterDataCopyFlow - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") flow = RedisClusterDataCopyFlow(root_id=root_id, data=ticket_data) flow.online_switch_flow() @@ -1317,7 +1324,7 @@ def _execute(self, data, parent_data): "force": False, } self.log_info(f"redis_cluster_close dst_cluster:{job_row.dst_cluster} ticket_data:{ticket_data}") - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") flow = RedisClusterOpenCloseFlow(root_id=root_id, data=ticket_data) flow.redis_cluster_open_close_flow() @@ -1410,7 +1417,7 @@ def _execute(self, data, parent_data): "cluster_id": job_row.dst_cluster_id, } self.log_info(f"redis_cluster_shutdown ticket_data:{ticket_data}") - root_id = uuid.uuid1().hex + root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "") flow = RedisClusterShutdownFlow(root_id=root_id, data=ticket_data) flow.redis_cluster_shutdown_flow() diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py index 1e4db0d629..5a45203622 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py @@ -51,7 +51,7 @@ def _execute(self, data, parent_data) -> bool: source_ip_list = {} file_list = [] for backup_inst in backup_infos: - file_list.extend(backup_inst["backup_files"]) + file_list.append(backup_inst["backup_file"]) if not source_ip_list.get(backup_inst["server_ip"]): source_ip_list[backup_inst["server_ip"]] = True self.log_info("get backup files {}:{}".format(source_ip_list.keys(), file_list)) diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/__init__.py b/dbm-ui/backend/flow/plugins/components/collections/spider/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py index 3ddf651d11..cbb11f5486 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py @@ -25,9 +25,9 @@ class CtlSwitchToSlaveService(BaseService): """ - 定义spider(tenDB cluster)集群的中控集群做主节点提示,适用于spider裁撤场合调用 - 这里暂时不考虑主从互切场景,仅仅做提升主节点场景,因为互切展示没有需求 - 幂等的内容包括: 预检测、断开同步、选择新的主节点、重新同步新主节点 + 定义spider(tenDB cluster)集群的中控集群提升新主节点,适用于spider-master裁撤场合调用 + 这里暂时不考虑主从互切场景,仅仅做提升主节点场景,因为互切暂时没有需求 + 幂等操作内容包括: 预检测、断开同步、选择新的主节点、重新同步新主节点 私有变量的主要结构体kwargs: { “cluster_id”: id, 待关联的集群id diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/switch_remote_slave_routing.py b/dbm-ui/backend/flow/plugins/components/collections/spider/switch_remote_slave_routing.py new file mode 100644 index 0000000000..520ef94bee --- /dev/null +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/switch_remote_slave_routing.py @@ -0,0 +1,134 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from pipeline.component_framework.component import Component + +from backend.components import DRSApi, MySQLPrivManagerApi +from backend.constants import IP_PORT_DIVIDER +from backend.core.encrypt.handlers import RSAHandler +from backend.db_meta.models import Cluster +from backend.flow.consts import TDBCTL_USER +from backend.flow.plugins.components.collections.common.base_service import BaseService + + +class SwitchRemoteSlaveRoutingService(BaseService): + """ + 定义spider(tenDB cluster)集群的替换remote slave实例的路由关系 + """ + + def _create_tdbctl_user(self, cluster: Cluster, ctl_primary: str, new_ip: str, new_port: int, tdbctl_pass: str): + """ + 再新的实例对中控primary授权 + """ + # 添加临时账号 + encrypt_switch_pwd = RSAHandler.encrypt_password( + MySQLPrivManagerApi.fetch_public_key(), tdbctl_pass, salt=None + ) + + MySQLPrivManagerApi.add_priv_without_account_rule( + params={ + "bk_cloud_id": cluster.bk_cloud_id, + "bk_biz_id": cluster.bk_biz_id, + "operator": "", + "user": TDBCTL_USER, + "psw": encrypt_switch_pwd, + "dbname": "%", + "dml_ddl_priv": "", + "global_priv": "all privileges", + "address": f"{new_ip}{IP_PORT_DIVIDER}{new_port}", + "hosts": [ctl_primary.split(":")[0]], + } + ) + self.log_info(f"add tdbctl user in instance [f'{new_ip}{IP_PORT_DIVIDER}{new_port}'] success") + + def _alter_remote_slave_routing( + self, cluster: Cluster, old_ip: str, old_port: int, new_ip: str, new_port: int, tdbctl_pass: str + ): + """ + 替换实例的路由信息的具体逻辑 + @param cluster: 关联操作的cluster对象 + @param old_ip: 待替换实例的ip + @param old_port: 待替换实例的port + @param new_ip: 新实例的ip + @param new_port: 新实例的port + @param tdbctl_pass: 新实例 + """ + + # 获取最新cluster的中控 primary节点 + ctl_primary = cluster.tendbcluster_ctl_primary_address() + + rpc_params = { + "addresses": [ctl_primary], + "cmds": [ + "set tc_admin=1", + f"select Server_name from mysql.servers where host = '{old_ip}' and port = {old_port}", + ], + "force": False, + "bk_cloud_id": cluster.bk_cloud_id, + } + # drs服务远程请求 + res = DRSApi.rpc(rpc_params) + + if res[0]["error_msg"]: + self.log_error(f"select mysql.servers failed: {res[0]['error_msg']}") + return False + + if not res[0]["cmd_results"][1]["table_data"]: + self.log_error(f"Node [{old_ip}:{old_port}] no longer has routing information") + return False + + # 添加tdbctl账号 + self._create_tdbctl_user( + cluster=cluster, ctl_primary=ctl_primary, new_ip=new_ip, new_port=new_port, tdbctl_pass=tdbctl_pass + ) + + # 获取待切换的分片信息,拼接alter node语句 + server_name = res[0]["cmd_results"][1]["table_data"][0]["Server_name"] + + # 执行替换节点路由信息 + exec_sql = [ + "set tc_admin=1", + f"TDBCTL ALTER NODE " + f"{server_name} OPTIONS(host '{new_ip}', port {new_port}, password '{tdbctl_pass}', user '{TDBCTL_USER}')", + "TDBCTL FLUSH ROUTING", + ] + rpc_params["cmds"] = exec_sql + res = DRSApi.rpc(rpc_params) + if res[0]["error_msg"]: + self.log_error(f"exec TDBCTL-ALTER-NODE failed: {res[0]['error_msg']}") + return False + + self.log_info(f"exec TDBCTL-ALTER-NODE success: [{server_name}->{new_ip}:{new_port}]") + return True + + def _execute(self, data, parent_data): + kwargs = data.get_one_of_inputs("kwargs") + + switch_remote_instance_pairs = kwargs["switch_remote_instance_pairs"] + + # 获取cluster对象,包括中控实例、 spider端口等 + cluster = Cluster.objects.get(id=kwargs["cluster_id"]) + for pairs in switch_remote_instance_pairs: + if not self._alter_remote_slave_routing( + cluster=cluster, + old_ip=pairs["old_ip"], + old_port=pairs["old_port"], + new_ip=pairs["new_ip"], + new_port=pairs["new_port"], + tdbctl_pass=pairs["tdbctl_pass"], + ): + return False + + return True + + +class SwitchRemoteSlaveRoutingComponent(Component): + name = __name__ + code = "switch_remote_slave_routing" + bound_service = SwitchRemoteSlaveRoutingService diff --git a/dbm-ui/backend/flow/urls.py b/dbm-ui/backend/flow/urls.py index e1268983c5..b3e2151f3f 100644 --- a/dbm-ui/backend/flow/urls.py +++ b/dbm-ui/backend/flow/urls.py @@ -14,10 +14,15 @@ from backend.flow.views.cloud_dns_bind_apply import CloudDNSApplySceneApiView from backend.flow.views.cloud_drs_apply import CloudDRSApplySceneApiView from backend.flow.views.cloud_nginx_apply import CloudNginxApplySceneApiView, CloudNginxReplaceSceneApiView +from backend.flow.views.cloud_redis_dts_server_apply import ( + CloudRedisDTSServerApplySceneApiView, + CloudRedisDTSServerReduceSceneApiView, +) from backend.flow.views.es_apply import InstallEsSceneApiView from backend.flow.views.es_destroy import DestroyEsSceneApiView from backend.flow.views.es_disable import DisableEsSceneApiView from backend.flow.views.es_enable import EnableEsSceneApiView +from backend.flow.views.es_fake_apply import FakeInstallEsSceneApiView from backend.flow.views.es_reboot import RebootEsSceneApiView from backend.flow.views.es_replace import ReplaceEsSceneApiView from backend.flow.views.es_scale_up import ScaleUpEsSceneApiView @@ -42,11 +47,13 @@ from backend.flow.views.kafka_destroy import DestroyKafkaSceneApiView from backend.flow.views.kafka_disable import DisableKafkaSceneApiView from backend.flow.views.kafka_enable import EnableKafkaSceneApiView +from backend.flow.views.kafka_fake_apply import FakeInstallKafkaSceneApiView from backend.flow.views.kafka_reboot import RebootKafkaSceneApiView from backend.flow.views.kafka_replace import ReplaceKafkaSceneApiView from backend.flow.views.kafka_scale_up import ScaleUpKafkaSceneApiView from backend.flow.views.kafka_shrink import ShrinkKafkaSceneApiView from backend.flow.views.mysql_add_slave import AddMysqlSlaveSceneApiView +from backend.flow.views.mysql_add_slave_remote import AddMysqlSlaveRemoteSceneApiView from backend.flow.views.mysql_checksum import MysqlChecksumSceneApiView from backend.flow.views.mysql_edit_config import MysqlEditConfigSceneApiView from backend.flow.views.mysql_flashback import MysqlFlashbackSceneApiView @@ -63,12 +70,16 @@ from backend.flow.views.mysql_ha_switch import MySQLHASwitchSceneApiView from backend.flow.views.mysql_ha_truncate_data import MySQLHATruncateDataView from backend.flow.views.mysql_migrate_cluster import MigrateMysqlClusterSceneApiView +from backend.flow.views.mysql_migrate_cluster_remote import MysqlMigrateRemoteSceneApiView +from backend.flow.views.mysql_open_area import MysqlOpenAreaSceneApiView from backend.flow.views.mysql_partition import MysqlPartitionSceneApiView from backend.flow.views.mysql_proxy_add import AddMySQLProxySceneApiView from backend.flow.views.mysql_proxy_switch import SwitchMySQLProxySceneApiView from backend.flow.views.mysql_pt_table_sync import MySQLPtTableSyncApiView +from backend.flow.views.mysql_restore_local_remote import RestoreMysqlLocalRemoteSceneApiView from backend.flow.views.mysql_restore_local_slave import RestoreMysqlLocalSlaveSceneApiView from backend.flow.views.mysql_restore_slave import RestoreMysqlSlaveSceneApiView +from backend.flow.views.mysql_restore_slave_remote import RestoreMysqlSlaveRemoteSceneApiView from backend.flow.views.mysql_rollback_data import MysqlRollbackDataSceneApiView from backend.flow.views.mysql_single_apply import InstallMySQLSingleSceneApiView from backend.flow.views.mysql_single_destroy import ( @@ -79,15 +90,18 @@ from backend.flow.views.mysql_single_rename_database import MySQLSingleRenameDatabaseView from backend.flow.views.mysql_single_truncate_data import MySQLSingleTruncateDataView from backend.flow.views.name_service import ( - NameServiceClbCreateSceneApiView, - NameServiceClbDeleteSceneApiView, - NameServicePolarisCreateSceneApiView, - NameServicePolarisDeleteSceneApiView, + ClbCreateSceneApiView, + ClbDeleteSceneApiView, + DomainBindClbIpSceneApiView, + DomainUnBindClbIpSceneApiView, + PolarisCreateSceneApiView, + PolarisDeleteSceneApiView, ) from backend.flow.views.pulsar_apply import InstallPulsarSceneApiView from backend.flow.views.pulsar_destroy import DestroyPulsarSceneApiView from backend.flow.views.pulsar_disable import DisablePulsarSceneApiView from backend.flow.views.pulsar_enable import EnablePulsarSceneApiView +from backend.flow.views.pulsar_fake_apply import FakeInstallPulsarSceneApiView from backend.flow.views.pulsar_reboot import RebootPulsarSceneApiView from backend.flow.views.pulsar_scale_up import ScaleUpPulsarSceneApiView from backend.flow.views.redis_cluster import ( @@ -103,6 +117,7 @@ RedisClusterShardNumUpdateSceneApiView, RedisClusterShutdownSceneApiView, RedisClusterTypeUpdateSceneApiView, + RedisClusterVersionUpdateOnlineApiView, RedisDataStructureSceneApiView, RedisDataStructureTaskDeleteSceneApiView, RedisFlushDataSceneApiView, @@ -149,7 +164,9 @@ from backend.flow.views.tbinlogdumper_reduce import ReduceTBinlogDumperSceneApiView from backend.flow.views.tbinlogdumper_switch import SwitchTBinlogDumperSceneApiView from backend.flow.views.tendb_cluster_remote_fail_over import RemoteFailOverSceneApiView +from backend.flow.views.tendb_cluster_remote_local_recover import RemoteLocalRecoverSceneApiView from backend.flow.views.tendb_cluster_remote_rebalance import RemoteRebalanceSceneApiView +from backend.flow.views.tendb_cluster_remote_slave_recover import RemoteSlaveRecoverSceneApiView from backend.flow.views.tendb_cluster_remote_switch import RemoteSwitchSceneApiView from backend.flow.views.tendb_cluster_rollback_data import TendbClusterRollbackDataSceneApiView from backend.flow.views.tendb_ha_standardize import TenDBHAStandardizeView @@ -181,14 +198,17 @@ url(r"^scene/redis_data_structure$", RedisDataStructureSceneApiView.as_view()), url(r"^scene/redis_data_structure_task_delete$", RedisDataStructureTaskDeleteSceneApiView.as_view()), url(r"^scene/redis_cluster_add_slave$", RedisClusterAddSlaveApiView.as_view()), + url(r"^scene/redis_cluster_version_update_online$", RedisClusterVersionUpdateOnlineApiView.as_view()), # redis api url end # name_service start # name_service clb - url(r"^scene/nameservice_clb_create$", NameServiceClbCreateSceneApiView.as_view()), - url(r"^scene/nameservice_clb_delete$", NameServiceClbDeleteSceneApiView.as_view()), + url(r"^scene/nameservice_clb_create$", ClbCreateSceneApiView.as_view()), + url(r"^scene/nameservice_clb_delete$", ClbDeleteSceneApiView.as_view()), + url(r"^scene/nameservice_domain_bind_clb_ip$", DomainBindClbIpSceneApiView.as_view()), + url(r"^scene/nameservice_domain_unbind_clb_ip$", DomainUnBindClbIpSceneApiView.as_view()), # name_service polaris - url(r"^scene/nameservice_polaris_create$", NameServicePolarisCreateSceneApiView.as_view()), - url(r"^scene/nameservice_polaris_delete$", NameServicePolarisDeleteSceneApiView.as_view()), + url(r"^scene/nameservice_polaris_create$", PolarisCreateSceneApiView.as_view()), + url(r"^scene/nameservice_polaris_delete$", PolarisDeleteSceneApiView.as_view()), # name_service end url(r"^scene/install_mysql_apply$", InstallMySQLSingleSceneApiView.as_view()), url(r"^scene/install_mysql_ha_apply$", InstallMySQLHASceneApiView.as_view()), @@ -211,6 +231,7 @@ url(r"^scene/reboot_influxdb$", RebootInfluxdbSceneApiView.as_view()), url(r"^scene/replace_influxdb$", ReplaceInfluxdbSceneApiView.as_view()), url(r"^scene/install_kafka$", InstallKafkaSceneApiView.as_view()), + url(r"^scene/fake_install_kafka$", FakeInstallKafkaSceneApiView.as_view()), url(r"^scene/scale_up_kafka$", ScaleUpKafkaSceneApiView.as_view()), url(r"^scene/enable_kafka$", EnableKafkaSceneApiView.as_view()), url(r"^scene/disable_kafka$", DisableKafkaSceneApiView.as_view()), @@ -219,6 +240,7 @@ url(r"^scene/replace_kafka$", ReplaceKafkaSceneApiView.as_view()), url(r"^scene/reboot_kafka$", RebootKafkaSceneApiView.as_view()), url(r"^scene/install_es$", InstallEsSceneApiView.as_view()), + url(r"^scene/fake_install_es$", FakeInstallEsSceneApiView.as_view()), url(r"^scene/scale_up_es$", ScaleUpEsSceneApiView.as_view()), url(r"^scene/shrink_es$", ShrinkEsSceneApiView.as_view()), url(r"^scene/enable_es$", EnableEsSceneApiView.as_view()), @@ -239,6 +261,11 @@ url(r"^scene/restore_slave$", RestoreMysqlSlaveSceneApiView.as_view()), url(r"^scene/add_slave$", AddMysqlSlaveSceneApiView.as_view()), url(r"^scene/restore_local_slave$", RestoreMysqlLocalSlaveSceneApiView.as_view()), + # 从节点数据恢复(接入备份系统) + url(r"^scene/restore_slave_remote$", RestoreMysqlSlaveRemoteSceneApiView.as_view()), + url(r"^scene/add_slave_remote$", AddMysqlSlaveRemoteSceneApiView.as_view()), + url(r"^scene/restore_local_slave_remote$", RestoreMysqlLocalRemoteSceneApiView.as_view()), + url(r"^scene/migrate_cluster_remote$", MysqlMigrateRemoteSceneApiView.as_view()), url(r"^scene/migrate_cluster$", MigrateMysqlClusterSceneApiView.as_view()), url(r"^scene/mysql_rollback_data", MysqlRollbackDataSceneApiView.as_view()), url(r"^scene/install_es$", InstallEsSceneApiView.as_view()), @@ -263,12 +290,15 @@ url(r"^scene/nginx_apply$", CloudNginxApplySceneApiView.as_view()), url(r"^scene/nginx_replace$", CloudNginxReplaceSceneApiView.as_view()), url(r"^scene/drs_apply$", CloudDRSApplySceneApiView.as_view()), + url(r"^scene/redis_dts_server_apply$", CloudRedisDTSServerApplySceneApiView.as_view()), + url(r"^scene/redis_dts_server_reduce$", CloudRedisDTSServerReduceSceneApiView.as_view()), url(r"^scene/install_pulsar$", InstallPulsarSceneApiView.as_view()), url(r"^scene/scale_up_pulsar$", ScaleUpPulsarSceneApiView.as_view()), url(r"^scene/enable_pulsar$", EnablePulsarSceneApiView.as_view()), url(r"^scene/disable_pulsar$", DisablePulsarSceneApiView.as_view()), url(r"^scene/destroy_pulsar$", DestroyPulsarSceneApiView.as_view()), url(r"^scene/reboot_pulsar$", RebootPulsarSceneApiView.as_view()), + url(r"^scene/fake_install_pulsar$", FakeInstallPulsarSceneApiView.as_view()), url(r"^scene/import_resource_init$", ImportResourceInitStepApiView.as_view()), # spider url(r"^scene/add_spider_mnt$", AddSpiderMNTSceneApiView.as_view()), @@ -311,9 +341,12 @@ url(r"^scene/tendb_cluster_rollback_data$", TendbClusterRollbackDataSceneApiView.as_view()), url("^scene/destroy_tendb_slave_cluster$", DestroySpiderSlaveClusterSceneApiView.as_view()), url("^scene/reduce_spider_mnt$", ReduceSpiderMNTSceneApiView.as_view()), + url(r"^scene/tendb_cluster_remote_slave_recover$", RemoteSlaveRecoverSceneApiView.as_view()), + url(r"^scene/tendb_cluster_remote_local_recover$", RemoteLocalRecoverSceneApiView.as_view()), # tbinlogdumper url("^scene/install_tbinlogumper$", InstallTBinlogDumperSceneApiView.as_view()), url("^scene/reduce_tbinlogumper$", ReduceTBinlogDumperSceneApiView.as_view()), url("^scene/switch_tbinlogumper$", SwitchTBinlogDumperSceneApiView.as_view()), url("^scene/tendbha_standardize$", TenDBHAStandardizeView.as_view()), + url("^scene/mysql_open_area$", MysqlOpenAreaSceneApiView.as_view()), ] diff --git a/dbm-ui/backend/flow/utils/base/cc_topo_operate.py b/dbm-ui/backend/flow/utils/base/cc_topo_operate.py index f1ff3e283a..5ebef58467 100644 --- a/dbm-ui/backend/flow/utils/base/cc_topo_operate.py +++ b/dbm-ui/backend/flow/utils/base/cc_topo_operate.py @@ -50,6 +50,7 @@ def __init__(self, cluster: Union[Cluster, List[Cluster]], ticket_data: dict = N if len(bk_biz_ids) != 1: raise ValidationError("different cluster biz is not supporting") self.bk_biz_id = bk_biz_ids[0] + self.hosting_biz_id = SystemSettings.get_exact_hosting_biz(self.bk_biz_id) self.is_bk_module_created = False def create_bk_module(self): @@ -103,7 +104,6 @@ def init_instances_service(self, machine_type, instances=None): """ cluster_module_id_map = {} func_name = INSTANCE_MONITOR_PLUGINS[self.db_type][machine_type]["func_name"] - hosting_biz_id = SystemSettings.get_exact_hosting_biz(self.bk_biz_id) for ins in instances: cluster = ins.cluster.first() # 查询实例对应的模块 ID @@ -111,7 +111,7 @@ def init_instances_service(self, machine_type, instances=None): if not bk_module_id: print(ClusterMonitorTopo.objects.all().values()) bk_module_id = ClusterMonitorTopo.objects.get( - bk_biz_id=hosting_biz_id, cluster_id=cluster.id, machine_type=machine_type + bk_biz_id=self.hosting_biz_id, cluster_id=cluster.id, machine_type=machine_type ).bk_module_id cluster_module_id_map[cluster.id] = bk_module_id @@ -140,7 +140,7 @@ def init_unique_service(self, machine_type): # 若服务实例不存在,则添加 func_name = INSTANCE_MONITOR_PLUGINS[self.db_type][machine_type]["func_name"] bk_module_id = ClusterMonitorTopo.objects.get( - bk_biz_id=cluster.bk_biz_id, cluster_id=cluster.id, machine_type=machine_type + bk_biz_id=self.hosting_biz_id, cluster_id=cluster.id, machine_type=machine_type ).bk_module_id instance = StorageInstance.objects.filter(cluster=cluster, machine_type=machine_type).first() self.init_instance_service( @@ -177,6 +177,7 @@ def generate_ins_labels( instance_role=instance_role, instance_host=ins.machine.ip, instance_port=str(ins.port), + db_module=str(cluster.db_module_id), instance=f"{ins.machine.ip}-{ins.port}", ) ) diff --git a/dbm-ui/backend/flow/utils/cc_manage.py b/dbm-ui/backend/flow/utils/cc_manage.py index b26f5bdaad..090d47ffa7 100644 --- a/dbm-ui/backend/flow/utils/cc_manage.py +++ b/dbm-ui/backend/flow/utils/cc_manage.py @@ -14,12 +14,14 @@ from django.db import transaction +from backend import env from backend.components import CCApi from backend.configuration.models import SystemSettings from backend.db_meta.enums import ClusterTypeMachineTypeDefine from backend.db_meta.models import AppMonitorTopo, Cluster, ClusterMonitorTopo, StorageInstance from backend.db_meta.models.cluster_monitor import INSTANCE_MONITOR_PLUGINS, SET_NAME_TEMPLATE from backend.db_services.ipchooser.constants import IDLE_HOST_MODULE +from backend.db_services.ipchooser.query.resource import ResourceQueryHelper logger = logging.getLogger("flow") @@ -34,6 +36,67 @@ def __init__(self, bk_biz_id: int): # 主机在 cmdb 上实际托管的业务 self.hosting_biz_id = SystemSettings.get_exact_hosting_biz(bk_biz_id) + @classmethod + def get_or_create_set_with_name(cls, bk_biz_id: int, bk_set_name: str) -> int: + """ + 根据名称获取拓扑中的集群id + @param bk_biz_id: 业务ID + @param bk_set_name: 集群名 + """ + res = CCApi.search_set( + params={ + "bk_biz_id": bk_biz_id, + "fields": ["bk_set_name", "bk_set_id"], + "condition": {"bk_set_name": bk_set_name}, + }, + use_admin=True, + ) + + if res["count"] > 0: + return res["info"][0]["bk_set_id"] + + res = CCApi.create_set( + params={ + "bk_biz_id": bk_biz_id, + "data": { + "bk_parent_id": bk_biz_id, + "bk_set_name": bk_set_name, + }, + }, + use_admin=True, + ) + return res["bk_set_id"] + + @classmethod + def get_or_create_module_with_name(cls, bk_biz_id: int, bk_set_id: int, bk_module_name: str) -> int: + """ + 根据名称获取模块id(不同组件属于到不同的模块) + @param bk_biz_id: 业务ID + @param bk_set_id: 集群ID + @param bk_module_name: 模块名字 + """ + res = CCApi.search_module( + { + "bk_biz_id": bk_biz_id, + "bk_set_id": bk_set_id, + "condition": {"bk_module_name": bk_module_name}, + }, + use_admin=True, + ) + + if res["count"] > 0: + return res["info"][0]["bk_module_id"] + + res = CCApi.create_module( + { + "bk_biz_id": env.DBA_APP_BK_BIZ_ID, + "bk_set_id": bk_set_id, + "data": {"bk_parent_id": bk_set_id, "bk_module_name": bk_module_name}, + }, + use_admin=True, + ) + return res["bk_module_id"] + def get_or_create_set_module( self, db_type: str, @@ -114,17 +177,19 @@ def get_or_create_set_module( return machine_topo + def get_biz_internal_module(self, bk_biz_id: int): + """获取业务下的内置模块""" + biz_internal_module = ResourceQueryHelper.get_biz_internal_module(bk_biz_id) + module_type__module = {module["default"]: module for module in biz_internal_module["module"]} + return module_type__module + def transfer_host_to_idlemodule( self, bk_biz_id: int, bk_host_ids: List[int], biz_idle_module: int = None, host_topo: List[Dict] = None ): """将主机转移到当前业务的空闲模块""" # 获取业务的空闲模块和主机拓扑信息 - if not biz_idle_module: - biz_internal_module = CCApi.get_biz_internal_module({"bk_biz_id": bk_biz_id}, use_admin=True) - module_type__module = {module["default"]: module for module in biz_internal_module["module"]} - biz_idle_module = module_type__module[IDLE_HOST_MODULE] - + biz_idle_module = biz_idle_module or self.get_biz_internal_module(bk_biz_id)[IDLE_HOST_MODULE]["bk_module_id"] if not host_topo: host_topo = CCApi.find_host_biz_relations({"bk_host_id": bk_host_ids}) @@ -132,7 +197,6 @@ def transfer_host_to_idlemodule( transfer_host_ids: List[int] = [ host_id for host_id in bk_host_ids if host__idle_module[host_id] != biz_idle_module ] - if transfer_host_ids: CCApi.transfer_host_to_idlemodule({"bk_biz_id": bk_biz_id, "bk_host_id": transfer_host_ids}) diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py b/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py index 1941ce9e5b..9d174f3ffe 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py @@ -8,10 +8,14 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import base64 +import json from django.utils.translation import ugettext as _ from backend import env +from backend.components import DBConfigApi +from backend.components.dbconfig.constants import FormatType, LevelName from backend.configuration.models import SystemSettings from backend.core.encrypt.constants import AsymmetricCipherConfigType from backend.core.encrypt.handlers import AsymmetricHandler @@ -22,6 +26,9 @@ CloudDBHATypeEnum, CloudServiceConfFileEnum, CloudServiceName, + ConfigFileEnum, + ConfigTypeEnum, + NameSpaceEnum, ) from backend.flow.engine.exceptions import ServiceDoesNotApply @@ -112,6 +119,7 @@ def get_dbha_conf_payload(self): "city": self.kwargs["exec_ip"]["bk_city_code"], "campus": self.kwargs["exec_ip"]["bk_city_name"], "nginx_domain": self.kwargs["nginx_internal_domain"], + "name_service_domain": self.kwargs["name_service_domain"], "dbha_user": self.kwargs["plain_user"], "dbha_password": self.kwargs["plain_pwd"], "mysql_crond_metrics_data_id": bkm_dbm_report["metric"]["data_id"], @@ -152,3 +160,66 @@ def get_drs_reduce_payload(self): def privilege_flush_payload(self): return {"access_hosts": self.kwargs["access_hosts"], "user": self.kwargs["user"], "pwd": self.kwargs["pwd"]} + + def __get_redis_os_user_info(self): + data = DBConfigApi.query_conf_item( + params={ + "bk_biz_id": "3", + "level_name": LevelName.APP, + "level_value": "3", + "conf_file": ConfigFileEnum.OS, + "conf_type": ConfigTypeEnum.OSConf, + "namespace": NameSpaceEnum.Common, + "format": FormatType.MAP, + } + ) + return { + "system_user": data["content"]["user"], + "system_password": data["content"]["user_pwd"], + } + + @staticmethod + def get_cloud_nginx_url(bk_cloud_id: int): + nginx = DBExtension.objects.filter( + bk_cloud_id=bk_cloud_id, extension=CloudServiceName.Nginx, status=ExtensionServiceStatus.RUNNING + ).last() + if not nginx: + raise ServiceDoesNotApply(_("Nginx服务未部署,请在Nginx服务部署后再进行该服务的部署")) + return "http://{}".format(nginx.details["ip"]) + + @staticmethod + def get_dns_nameservers(bk_cloud_id): + dns_rows = DBExtension.get_extension_in_cloud(bk_cloud_id=bk_cloud_id, extension_type=CloudServiceName.DNS) + if not dns_rows: + raise ServiceDoesNotApply(_("DNS服务未部署,请在DNS服务部署后再进行该服务的部署")) + dns_nameservers = ["nameserver {}".format(dns.details["ip"]) for dns in dns_rows] + return "\n".join(dns_nameservers) + + def get_redis_dts_server_apply_payload(self): + nginx_url = self.get_cloud_nginx_url(self.cloud_id) + dns_servers = self.get_dns_nameservers(self.cloud_id) + cloud_token = self.__generate_service_token(service_type=CloudServiceName.RedisDTS.value) + redis_os_info = self.__get_redis_os_user_info() + paylod_obj = { + "user": redis_os_info["system_user"], + "password": redis_os_info["system_password"], + } + paylod_json = json.dumps(paylod_obj) + payload_base64 = str(base64.b64encode(paylod_json.encode("utf-8")), "utf-8") + return { + "bk_dbm_nginx_url": nginx_url, + "bk_dbm_cloud_id": self.cloud_id, + "bk_dbm_cloud_token": cloud_token, + "system_user": redis_os_info["system_user"], + "system_password": redis_os_info["system_password"], + "city_name": self.kwargs["exec_ip"]["bk_city_name"], + "warning_msg_notifiers": "xxxxx", + "sys_init_paylod": payload_base64, + "dns_servers": dns_servers, + } + + def get_redis_dts_server_reduce_payload(self): + dns_servers = self.get_dns_nameservers(self.cloud_id) + return { + "dns_servers": dns_servers, + } diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_context_dataclass.py b/dbm-ui/backend/flow/utils/cloud/cloud_context_dataclass.py index 290111c72d..a0710e4b8d 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_context_dataclass.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_context_dataclass.py @@ -80,6 +80,7 @@ class CloudDBHAKwargs: dbha_type: CloudDBHATypeEnum = None # dbha部署的类型:gm/agent nginx_internal_domain: str = None # nginx内网地址 + name_service_domain: str = None # 名字服务的内网地址 user: str = "" # 超级账户的用户名 pwd: str = "" # 超级账户的密码 @@ -161,3 +162,14 @@ class CloudDBHADetail(CloudServiceDetail): bk_city_code: int = None # 部署机器的城市代码 bk_city_name: str = "" # 部署机器的城市信息 dbha_type: str = "" # gm/agent + + +@dataclass() +class CloudRedisDTSDetail(CloudServiceDetail): + """ + Redis DTS服务的detail数据类 + """ + + bk_city_name: str = "" # 部署机器的城市信息 + + pass diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py b/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py index 4945119db4..1805b69f90 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py @@ -23,6 +23,7 @@ CloudDNSDetail, CloudDRSDetail, CloudNginxDetail, + CloudRedisDTSDetail, ) from backend.flow.utils.cloud.cloud_module_operate import CloudModuleHandler @@ -227,3 +228,25 @@ def cloud_drs_replace(self) -> bool: change_module=CloudServiceModuleName.DRS, ) return res + + def cloud_redis_dts_server_apply(self) -> bool: + """redis dts服务部署信息""" + res = self.cloud_base_apply( + host_infos=self.kwargs["host_infos"], + extension_type=ExtensionType.REDIS_DTS, + detail_class=CloudRedisDTSDetail, + transfer_module=CloudServiceModuleName.RedisDTS, + ) + return res + + def cloud_redis_dts_server_reduce(self) -> bool: + res = self.cloud_base_reduce(host_infos=self.kwargs["host_infos"], move_module=CloudServiceModuleName.RedisDTS) + return res + + def cloud_redis_dts_server_replace(self) -> bool: + res = self.cloud_base_replace( + new_host=self.kwargs["host_infos"][0], + old_host=self.kwargs["details"]["old_redis_dts"][0], + change_module=CloudServiceModuleName.RedisDTS, + ) + return res diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py b/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py index a846b64ee9..36f6226bd4 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py @@ -17,6 +17,7 @@ from backend.components import CCApi from backend.db_services.ipchooser.constants import DB_MANAGE_SET from backend.flow.consts import CloudServiceModuleName +from backend.flow.utils.cc_manage import CcManage logger = logging.getLogger("flow") @@ -24,69 +25,6 @@ class CloudModuleHandler: """云区域服务相关机器转模块操作类""" - @classmethod - def get_or_create_set(cls, bk_biz_id: int, bk_set_name: str) -> int: - """ - 获取集群id(默认所有云区域组件管理的的集群名都是一样的,并且集群唯一) - @param bk_biz_id: 业务ID - @param bk_set_name: 集群名 - """ - - res = CCApi.search_set( - params={ - "bk_biz_id": bk_biz_id, - "fields": ["bk_set_name", "bk_set_id"], - "condition": {"bk_set_name": bk_set_name}, - }, - use_admin=True, - ) - - if res["count"] > 0: - return res["info"][0]["bk_set_id"] - - res = CCApi.create_set( - params={ - "bk_biz_id": bk_biz_id, - "data": { - "bk_parent_id": bk_biz_id, - "bk_set_name": bk_set_name, - }, - }, - use_admin=True, - ) - return res["bk_set_id"] - - @classmethod - def get_or_create_module(cls, bk_biz_id: int, bk_set_id: int, bk_module_name: str) -> int: - """ - 获取模块id(不同组件属于到不同的模块) - @param bk_biz_id: 业务ID - @param bk_set_id: 集群ID - @param bk_module_name: 模块名字 - """ - - res = CCApi.search_module( - { - "bk_biz_id": bk_biz_id, - "bk_set_id": bk_set_id, - "condition": {"bk_module_name": bk_module_name}, - }, - use_admin=True, - ) - - if res["count"] > 0: - return res["info"][0]["bk_module_id"] - - res = CCApi.create_module( - { - "bk_biz_id": env.DBA_APP_BK_BIZ_ID, - "bk_set_id": bk_set_id, - "data": {"bk_parent_id": bk_set_id, "bk_module_name": bk_module_name}, - }, - use_admin=True, - ) - return res["bk_module_id"] - @classmethod def find_cloud_module_host_relation(cls, bk_biz_id: int, bk_set_id: int) -> Dict[int, List]: """ @@ -147,8 +85,8 @@ def transfer_hosts_in_cloud_module( @param bk_host_ids: 转移主机的ID列表 """ - bk_set_id = cls.get_or_create_set(bk_biz_id=bk_biz_id, bk_set_name=DB_MANAGE_SET) - transfer_module_id = cls.get_or_create_module( + bk_set_id = CcManage.get_or_create_set_with_name(bk_biz_id=bk_biz_id, bk_set_name=DB_MANAGE_SET) + transfer_module_id = CcManage.get_or_create_module_with_name( bk_biz_id=bk_biz_id, bk_set_id=bk_set_id, bk_module_name=bk_module_name ) # 获取所有主机并集的module_id,这样可以避免模块的转移覆盖(因为有可能A主机即属于DRS服务又属于DBHA服务) @@ -169,9 +107,9 @@ def remove_host_from_origin_module(cls, bk_biz_id: int, bk_module_name: str, bk_ @param bk_module_name: 待删除的模块名 @param bk_host_ids: 转移主机的ID列表 """ - bk_set_id = cls.get_or_create_set(bk_biz_id=bk_biz_id, bk_set_name=DB_MANAGE_SET) + bk_set_id = CcManage.get_or_create_set_with_name(bk_biz_id=bk_biz_id, bk_set_name=DB_MANAGE_SET) host_id__module_ids_map = cls.find_cloud_module_host_relation(bk_biz_id, bk_set_id) - origin_module_id = cls.get_or_create_module( + origin_module_id = CcManage.get_or_create_module_with_name( bk_biz_id=bk_biz_id, bk_set_id=bk_set_id, bk_module_name=bk_module_name ) recycle_host_ids = [] diff --git a/dbm-ui/backend/flow/utils/cloud/script_template/__init__.py b/dbm-ui/backend/flow/utils/cloud/script_template/__init__.py index c1791b530e..007d6d6320 100644 --- a/dbm-ui/backend/flow/utils/cloud/script_template/__init__.py +++ b/dbm-ui/backend/flow/utils/cloud/script_template/__init__.py @@ -13,3 +13,4 @@ from .dns_template import * from .drs_template import * from .nginx_template import * +from .redis_dts_server_template import * diff --git a/dbm-ui/backend/flow/utils/cloud/script_template/dbha_template.py b/dbm-ui/backend/flow/utils/cloud/script_template/dbha_template.py index 824143adb2..dbb9acbf55 100644 --- a/dbm-ui/backend/flow/utils/cloud/script_template/dbha_template.py +++ b/dbm-ui/backend/flow/utils/cloud/script_template/dbha_template.py @@ -20,8 +20,10 @@ log_compress: true agent_conf: active_db_type: [ - "tendbha:backend", - "tendbha:proxy", + "tendbha", + "tendbcluster", + "TwemproxyRedisInstance", + "PredixyTendisplusCluster", ] city: "{{city}}" campus: "{{campus}}" @@ -73,8 +75,8 @@ timeout: 10 redis: timeout: 10 -dns: - bind_conf: +name_services: + dns_conf: host: "{{nginx_domain}}" port: 80 url_pre: "/apis/proxypass" @@ -92,6 +94,21 @@ timeout: 10 bk_conf: bk_token: "{{db_cloud_token}}" + polaris_conf: + host: {{name_service_domain}} + port: 80 + user: "nouser" + pass: "nopasswd" + url_pre: "/api/nameservice/polaris" + timeout: 10 + clb_conf: + host: {{name_service_domain}} + port: 80 + user: "nouser" + pass: "nopasswd" + url_pre: "/api/nameservice/clb" + timeout: 10 + monitor: bk_data_id: {{mysql_crond_metrics_data_id}} access_token: "{{mysql_crond_metrics_data_token}}" @@ -115,12 +132,10 @@ log_compress: true agent_conf: active_db_type: [ - "tendbha:backend", - "tendbha:proxy", - "Rediscache", - "Twemproxy", - "Predixy", - "Tendisplus", + "tendbha", + "tendbcluster", + "TwemproxyRedisInstance", + "PredixyTendisplusCluster", ] city: "{{city}}" campus: "{{campus}}" @@ -172,8 +187,8 @@ timeout: 10 redis: timeout: 10 -dns: - bind_conf: +name_services: + dns_conf: host: "{{nginx_domain}}" port: 80 url_pre: "/apis/proxypass" @@ -187,6 +202,20 @@ timeout: 10 bk_conf: bk_token: "{{db_cloud_token}}" + polaris_conf: + host: {{name_service_domain}} + port: 80 + user: "nouser" + pass: "nopasswd" + url_pre: "/api/nameservice/polaris" + timeout: 10 + clb_conf: + host: {{name_service_domain}} + port: 80 + user: "nouser" + pass: "nopasswd" + url_pre: "/api/nameservice/clb" + timeout: 10 monitor: bk_data_id: {{mysql_crond_metrics_data_id}} access_token: "{{mysql_crond_metrics_data_token}}" diff --git a/dbm-ui/backend/flow/utils/cloud/script_template/redis_dts_server_template.py b/dbm-ui/backend/flow/utils/cloud/script_template/redis_dts_server_template.py new file mode 100644 index 0000000000..128b77dd49 --- /dev/null +++ b/dbm-ui/backend/flow/utils/cloud/script_template/redis_dts_server_template.py @@ -0,0 +1,339 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +# 启用redis dts_server的脚本 +start_redis_dts_server_template = """ +chmod a+x /data/install/dbactuator_redis +cd /data/install && ./dbactuator_redis --uid=1111 --root_id=2222 --node_id=3333 --version_id=v1 \ +--atom-job-list="sysinit" --payload="{{sys_init_paylod}}" + +source /etc/profile + +dns_servers="{{dns_servers}}" +while read -r line +do + # skip empty line + if [[ "$line" =~ ^[[:space:]]*$ ]]; then + continue + fi + if ! grep -qF "$line" /etc/resolv.conf; then + sed -i "1i $line" /etc/resolv.conf + echo "Added: $line" + else + echo "Skipped: $line" + fi +done <<< "$dns_servers" + +bk_dbm_nginx_url="{{bk_dbm_nginx_url}}" +bk_dbm_cloud_id="{{bk_dbm_cloud_id}}" +bk_dbm_cloud_token="{{bk_dbm_cloud_token}}" +system_user="{{system_user}}" +system_password="{{system_password}}" +city_name="{{city_name}}" +warning_msg_notifiers="{{warning_msg_notifiers}}" + +dts_server_tool="redis_dts_server" + +dts_parent_dir="$REDIS_DATA_DIR/dbbak" +dts_server_dir="$dts_parent_dir/redis_dts" + +new_dts_pkg="/data/install/redis_dts.tar.gz" +old_dts_pkg="$dts_parent_dir/redis_dts.tar.gz" + +conf_template_file="$dts_server_dir/config-template.yaml" +conf_tmp_file="$dts_server_dir/tmp_config.yaml" +conf_prod_file="$dts_server_dir/config.yaml" + +# 下面函数中 0 表示成功,1 表示失败 +function is_dts_server_alive() { + processCnt=$(ps -ef|grep $dts_server_tool|grep -ivE "grep|redis-sync|redis-shake|dbactuator"|wc -l) + if [[ $processCnt -gt 0 ]] + then + echo "dts server alive" + return 0 + else + echo "dts server not alive" + return 1 + fi +} + +function is_dts_server_able_to_stop() { + other_process=$(ps aux|grep 'redis_dts'|grep -vE 'dbactuator|grep|./redis_dts_server|redis-sync|redis-shake' || true ) + if [[ -n $other_process ]] + then + echo "other process is running,cannot stop $dts_server_tool,pls check" + echo "$other_process" + return 1 + else + echo "no other process is running,can stop $dts_server_tool" + return 0 + fi +} + +function stop_dts_server() { + is_dts_server_alive + if [[ $? -eq 0 ]] + then + is_dts_server_able_to_stop + if [[ $? -eq 0 ]] + then + chown -R $system_user:$system_user $dts_parent_dir + echo "stop $dts_server_tool" + su - $system_user -c "cd $dts_server_dir && sh stop.sh" + else + echo "stop $dts_server_tool failed" + exit -1 + fi + else + echo "$dts_server_tool not alive" + fi +} + +function start_dts_server() { + is_dts_server_alive + if [[ $? -eq 0 ]] + then + echo "$dts_server_tool already alive" + else + chown -R $system_user:$system_user $dts_parent_dir + echo "start $dts_server_tool" + su - $system_user -c "cd $dts_server_dir && sh start.sh" + fi +} + +function get_file_md5(){ + local file=$1 + if [[ -e $file ]] + then + md5=$(md5sum $file|awk '{print $1}') + echo $md5 + else + echo "" + fi +} + +function generate_tmp_config_file(){ + + if [[ ! -e $conf_template_file ]] + then + echo "config template file($conf_template_file) not exists" + exit -1 + fi + cp $conf_template_file $conf_tmp_file + sed -i -e "s#VAR_bk_dbm_nginx_url#$bk_dbm_nginx_url#g" $conf_tmp_file + sed -i -e "s#VAR_bk_dbm_cloud_id#$bk_dbm_cloud_id#g" $conf_tmp_file + sed -i -e "s#VAR_bk_dbm_cloud_token#$bk_dbm_cloud_token#g" $conf_tmp_file + sed -i -e "s#VAR_system_user#$system_user#g" $conf_tmp_file + sed -i -e "s#VAR_system_password#$system_password#g" $conf_tmp_file + sed -i -e "s#VAR_city_name#$city_name#g" $conf_tmp_file + sed -i -e "s#VAR_warning_msg_notifiers#$warning_msg_notifiers#g" $conf_tmp_file + echo "generate tmp config file:$conf_tmp_file success" +} + +# 0 表示更新,1 表示未更新 +function is_config_file_updated(){ + if [[ -e $conf_template_file ]] + then + generate_tmp_config_file + fi + if [[ ! -e $conf_prod_file ]] + then + echo "config file($conf_prod_file) not exists" + return 0 + fi + + old_md5=$(get_file_md5 $conf_prod_file) + new_md5=$(get_file_md5 $conf_tmp_file) + + if [[ $old_md5 == $new_md5 ]] + then + echo "config file($conf_tmp_file) not updated" + return 1 + else + echo "config file($conf_prod_file) updated" + return 0 + fi +} + +#更新配置文件 +function update_config_file(){ + is_config_file_updated + if [[ $? -eq 0 ]] + then + echo "update config file" + cp $conf_tmp_file $conf_prod_file + else + echo "config file($conf_tmp_file) not updated" + fi +} + +# 0 表示更新,-1 表示未更新 +function is_dts_pkg_updated(){ + if [[ ! -e $dts_server_dir ]] + then + echo "dts server dir($dts_server_dir) not exists" + return 0 + fi + if [[ ! -e $old_dts_pkg ]] + then + echo "old dts pkg not exists" + return 0 + fi + + if [[ ! -e $new_dts_pkg ]] + then + echo "new dts pkg($new_dts_pkg) not exists" + exit -1 + fi + + old_md5=$(get_file_md5 $old_dts_pkg) + new_md5=$(get_file_md5 $new_dts_pkg) + + if [[ $old_md5 == $new_md5 ]] + then + echo "dts pkg($new_dts_pkg) not updated" + return 1 + else + echo "dts pkg($old_dts_pkg) updated" + return 0 + fi +} + +#更新dts包 +function update_dts_pkg(){ + is_dts_pkg_updated + if [[ $? -eq 0 ]] + then + echo "update dts pkg" + cp $new_dts_pkg $old_dts_pkg + cd $dts_parent_dir + tar -zxvf $old_dts_pkg + else + echo "dts pkg($new_dts_pkg) not updated" + fi +} + +# dir 不存在则创建 +if [[ ! -d $dts_parent_dir ]] +then + mkdir -p $dts_parent_dir +fi + +is_dts_pkg_updated +dts_pkg_updated=$? +is_config_file_updated +conf_file_updated=$? + +#如果dts包或者配置文件都没更新,则不需要重启dts server +if [[ $dts_pkg_updated -eq 1 && $conf_file_updated -eq 1 ]] +then + echo "dts pkg($new_dts_pkg) and config file($conf_prod_file) not updated" + is_dts_server_alive + dts_alive=$? + if [[ $dts_alive -eq 0 ]] + then + echo "dts server alive,do nothing" + fi +fi +echo "dts pkg($new_dts_pkg) or config file($conf_prod_file) updated" +stop_dts_server +update_dts_pkg +update_config_file +start_dts_server +sleep 1 +is_dts_server_alive +if [[ $? -eq 0 ]] +then + echo "update dts server success" +else + echo "update dts server failed,dts_server not alive" + exit -1 +fi +""" + +stop_redis_dts_server_template = """ +dns_servers="{{dns_servers}}" + +while read -r line +do + # skip empty line + if [[ "$line" =~ ^[[:space:]]*$ ]]; then + continue + fi + sed -i "/$line/d" /etc/resolv.conf +done <<< "$dns_servers" + +dts_server_tool="redis_dts_server" + +dts_parent_dir="$REDIS_DATA_DIR/dbbak" +dts_server_dir="$dts_parent_dir/redis_dts" + +new_dts_pkg="/data/install/redis_dts.tar.gz" +old_dts_pkg="$dts_parent_dir/redis_dts.tar.gz" + +conf_template_file="$dts_server_dir/config-template.yaml" +conf_tmp_file="$dts_server_dir/tmp_config.yaml" +conf_prod_file="$dts_server_dir/config.yaml" + +# 下面函数中 0 表示成功,1 表示失败 +function is_dts_server_alive() { + processCnt=$(ps -ef|grep $dts_server_tool|grep -ivE "grep|redis-sync|redis-shake|dbactuator"|wc -l) + if [[ $processCnt -gt 0 ]] + then + echo "dts server alive" + return 0 + else + echo "dts server not alive" + return 1 + fi +} + +function is_dts_server_able_to_stop() { + other_process=$(ps aux|grep 'redis_dts'|grep -vE 'dbactuator|grep|./redis_dts_server|redis-sync|redis-shake' || true ) + if [[ -n $other_process ]] + then + echo "other process is running,cannot stop $dts_server_tool,pls check" + echo "$other_process" + return 1 + else + echo "no other process is running,can stop $dts_server_tool" + return 0 + fi +} + +function stop_dts_server() { + is_dts_server_alive + if [[ $? -eq 0 ]] + then + is_dts_server_able_to_stop + if [[ $? -eq 0 ]] + then + chown -R $system_user:$system_user $dts_parent_dir + echo "stop $dts_server_tool" + su - $system_user -c "cd $dts_server_dir && sh stop.sh" + else + echo "stop $dts_server_tool failed.There are some tasks running,pls check" + exit -1 + fi + else + echo "$dts_server_tool not alive" + fi +} + +# 如果 dts server 还在运行,则判断能否停止,如果能停止,则停止,否则退出 +stop_dts_server + +# 如果 prod config 文件存在,则删除 +if [[ -e $conf_prod_file ]] +then + echo "rm -f $conf_prod_file" + rm -f $conf_prod_file +fi +""" diff --git a/dbm-ui/backend/flow/utils/common_act_dataclass.py b/dbm-ui/backend/flow/utils/common_act_dataclass.py index 43061ec4fa..3b5e79fb69 100644 --- a/dbm-ui/backend/flow/utils/common_act_dataclass.py +++ b/dbm-ui/backend/flow/utils/common_act_dataclass.py @@ -21,5 +21,6 @@ class DownloadBackupClientKwargs: """ bk_cloud_id: int + bk_biz_id: int download_host_list: list backup_os_user: str = BACKUP_DEFAULT_OS_USER diff --git a/dbm-ui/backend/flow/utils/influxdb/influxdb_module_operate.py b/dbm-ui/backend/flow/utils/influxdb/influxdb_module_operate.py index 03ad4ca00c..38829b5c93 100644 --- a/dbm-ui/backend/flow/utils/influxdb/influxdb_module_operate.py +++ b/dbm-ui/backend/flow/utils/influxdb/influxdb_module_operate.py @@ -12,6 +12,7 @@ from typing import List from backend.configuration.constants import DBType +from backend.configuration.models import SystemSettings from backend.constants import CommonInstanceLabels from backend.db_meta.enums import ClusterType from backend.db_meta.models import AppCache, ClusterMonitorTopo, StorageInstance @@ -42,6 +43,7 @@ def __init__(self, storages: List[StorageInstance]): if len(bk_biz_ids) != 1: raise ValidationError("different cluster biz is not supporting") self.bk_biz_id = bk_biz_ids[0] + self.hosting_biz_id = SystemSettings.get_exact_hosting_biz(self.bk_biz_id) self.is_bk_module_created = False def create_bk_module(self): @@ -65,7 +67,7 @@ def transfer_host_in_cluster_module(self, machine_type: str, group_name: str): self.create_bk_module() for ins in self.storages: bk_module_id = ClusterMonitorTopo.objects.get( - bk_biz_id=ins.bk_biz_id, instance_id=ins.id, machine_type=machine_type + bk_biz_id=self.hosting_biz_id, instance_id=ins.id, machine_type=machine_type ).bk_module_id CcManage(ins.bk_biz_id).transfer_host_module([ins.machine.bk_host_id], [bk_module_id]) @@ -86,6 +88,7 @@ def transfer_host_in_cluster_module(self, machine_type: str, group_name: str): instance_port=str(ins.port), exporter_port=str(INFLUXDB_EXPORTER_PORT), db_group=group_name, + db_module="default", ) ) diff --git a/dbm-ui/backend/flow/utils/mysql/common/mysql_cluster_info.py b/dbm-ui/backend/flow/utils/mysql/common/mysql_cluster_info.py index f25a1727ce..afb14ba422 100644 --- a/dbm-ui/backend/flow/utils/mysql/common/mysql_cluster_info.py +++ b/dbm-ui/backend/flow/utils/mysql/common/mysql_cluster_info.py @@ -103,3 +103,11 @@ def get_cluster_ports(cluster_ids: list) -> Dict: "time_zone": time_zone, } return cluster_info + + +def get_ports(cluster_ids: list) -> list: + cluster_ports = [] + clusters = Cluster.objects.filter(id__in=cluster_ids).all() + for cluster in clusters: + cluster_ports.append(cluster.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value).port) + return cluster_ports diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index 1961d282e8..ade953e6ec 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -1116,6 +1116,7 @@ def get_install_mysql_checksum_payload(self, **kwargs) -> dict: "role": instance.instance_inner_role, "cluster_id": cluster.id, "immute_domain": cluster.immute_domain, + "db_module_id": instance.db_module_id, } ) @@ -1341,6 +1342,7 @@ def get_deploy_mysql_monitor_payload(self, **kwargs) -> dict: "cluster_id": cluster.id, "immute_domain": cluster.immute_domain, "bk_instance_id": instance.bk_instance_id, + "db_module_id": instance.db_module_id, } ) # 增加对安装spider监控的适配 @@ -1356,6 +1358,7 @@ def get_deploy_mysql_monitor_payload(self, **kwargs) -> dict: "cluster_id": cluster.id, "immute_domain": cluster.immute_domain, "bk_instance_id": instance.bk_instance_id, + "db_module_id": instance.db_module_id, } ) @@ -1372,6 +1375,7 @@ def get_deploy_mysql_monitor_payload(self, **kwargs) -> dict: "cluster_id": cluster.id, "immute_domain": cluster.immute_domain, "bk_instance_id": instance.bk_instance_id, + "db_module_id": instance.db_module_id, } ) else: @@ -1812,3 +1816,175 @@ def get_install_tmp_db_backup_payload(self, **kwargs): }, }, } + + def mysql_mkdir_dir(self, **kwargs) -> dict: + """ + mkdir for backup + """ + return { + "db_type": DBActuatorTypeEnum.MySQL.value, + "action": DBActuatorActionEnum.OsCmd.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "cmds": [ + {"cmd_name": "mkdir", "cmd_args": ["-p", self.cluster["file_target_path"]]}, + {"cmd_name": "chown", "cmd_args": ["mysql.mysql", self.cluster["file_target_path"]]}, + ], + "work_dir": "", + }, + }, + } + + def get_open_area_dump_schema_payload(self, **kwargs): + """ + 开区导出表结构 + @param kwargs: + @return: + """ + fileserver = {} + rsa = RSAHandler.get_or_generate_rsa_in_db(RSAConfigType.PROXYPASS.value) + db_cloud_token = RSAHandler.encrypt_password( + rsa.rsa_public_key.content, f"{self.bk_cloud_id}_dbactuator_token" + ) + + nginx_ip = DBCloudProxy.objects.filter(bk_cloud_id=self.bk_cloud_id).last().internal_address + bkrepo_url = f"http://{nginx_ip}/apis/proxypass" if self.bk_cloud_id else settings.BKREPO_ENDPOINT_URL + + if self.cluster["is_upload_bkrepo"]: + fileserver.update( + { + "url": bkrepo_url, + "bucket": settings.BKREPO_BUCKET, + "username": settings.BKREPO_USERNAME, + "password": settings.BKREPO_PASSWORD, + "project": settings.BKREPO_PROJECT, + "upload_path": BKREPO_SQLFILE_PATH, + } + ) + + return { + "db_type": DBActuatorTypeEnum.MySQL.value, # spider集群也用mysql类型 + "action": DBActuatorActionEnum.MysqlOpenAreaDumpSchema.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "host": kwargs["ip"], + "port": self.cluster["port"], + "charset": "default", + "root_id": self.cluster["root_id"], + "bk_cloud_id": self.bk_cloud_id, + "db_cloud_token": db_cloud_token, + "dump_dir_name": f"{self.cluster['root_id']}_schema", + "fileserver": fileserver, + "open_area_param": self.cluster["open_area_param"], + }, + }, + } + + def get_open_area_import_schema_payload(self, **kwargs): + """ + 开区导入表结构 + @param kwargs: + @return: + """ + return { + "db_type": DBActuatorTypeEnum.MySQL.value, # spider集群也用mysql类型 + "action": DBActuatorActionEnum.MysqlOpenAreaImportSchema.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "host": kwargs["ip"], + "port": self.cluster["port"], + "charset": "default", + "root_id": self.cluster["root_id"], + "bk_cloud_id": self.bk_cloud_id, + "dump_dir_name": f"{self.cluster['root_id']}_schema", + "open_area_param": self.cluster["open_area_param"], + }, + }, + } + + def get_open_area_dump_data_payload(self, **kwargs): + """ + 开区导出表数据 + @param kwargs: + @return: + """ + fileserver = {} + rsa = RSAHandler.get_or_generate_rsa_in_db(RSAConfigType.PROXYPASS.value) + db_cloud_token = RSAHandler.encrypt_password( + rsa.rsa_public_key.content, f"{self.bk_cloud_id}_dbactuator_token" + ) + + nginx_ip = DBCloudProxy.objects.filter(bk_cloud_id=self.bk_cloud_id).last().internal_address + bkrepo_url = f"http://{nginx_ip}/apis/proxypass" if self.bk_cloud_id else settings.BKREPO_ENDPOINT_URL + + if self.cluster["is_upload_bkrepo"]: + fileserver.update( + { + "url": bkrepo_url, + "bucket": settings.BKREPO_BUCKET, + "username": settings.BKREPO_USERNAME, + "password": settings.BKREPO_PASSWORD, + "project": settings.BKREPO_PROJECT, + "upload_path": BKREPO_SQLFILE_PATH, + } + ) + return { + "db_type": DBActuatorTypeEnum.MySQL.value, # spider集群也用mysql类型 + "action": DBActuatorActionEnum.MysqlOpenAreaDumpData.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "host": kwargs["ip"], + "port": self.cluster["port"], + "charset": "default", + "root_id": self.cluster["root_id"], + "bk_cloud_id": self.bk_cloud_id, + "db_cloud_token": db_cloud_token, + "dump_dir_name": f"{self.cluster['root_id']}_data", + "fileserver": fileserver, + "open_area_param": self.cluster["open_area_param"], + }, + }, + } + + def get_open_area_import_data_payload(self, **kwargs): + """ + 开区导入表数据 + @param kwargs: + @return: + """ + return { + "db_type": DBActuatorTypeEnum.MySQL.value, # spider集群也用mysql类型 + "action": DBActuatorActionEnum.MysqlOpenAreaImportData.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "host": kwargs["ip"], + "port": self.cluster["port"], + "charset": "default", + "root_id": self.cluster["root_id"], + "bk_cloud_id": self.bk_cloud_id, + "dump_dir_name": f"{self.cluster['root_id']}_data", + "open_area_param": self.cluster["open_area_param"], + }, + }, + } + + def enable_tokudb_payload(self, **kwargs): + """ + enable Tokudb engine for mysql instance + """ + return { + "db_type": DBActuatorTypeEnum.MySQL.value, + "action": DBActuatorActionEnum.EnableTokudb.value, + "payload": { + "general": {"runtime_account": self.account}, + "extend": { + "host": kwargs["ip"], + "ports": self.ticket_data.get("mysql_ports", []), + }, + }, + } diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_context_dataclass.py b/dbm-ui/backend/flow/utils/mysql/mysql_context_dataclass.py index 6038c7875b..b81b7f8ebd 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_context_dataclass.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_context_dataclass.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from dataclasses import dataclass, field -from typing import Dict +from typing import Dict, List @dataclass() @@ -311,3 +311,8 @@ def get_backup_ip_var_name() -> str: @dataclass() class MySQLFlashBackContext: targets: Dict = None + + +@dataclass() +class MySQLHAImportMetadataContext: + cluster_ids: List = None diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py b/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py index 259a52880b..4ab1cc72b5 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py @@ -475,7 +475,6 @@ def mysql_migrate_cluster_switch_storage(self): 集群成对迁移之三:切换到新实例。修改集群对应的实例, """ with atomic(): - # 先修改映射关系 api.cluster.tendbha.change_proxy_storage_entry( cluster_id=self.cluster["cluster_id"], @@ -632,3 +631,213 @@ def switch_tbinlogdumper(self): TenDBHAClusterHandler( bk_biz_id=self.bk_biz_id, cluster_id=self.ticket_data["cluster_id"] ).switch_tbinlogdumper_for_cluster(switch_ids=self.cluster["switch_ids"]) + + def slave_recover_add_instance(self): + # tendb ha从节点重建 + machines = [ + { + "ip": self.cluster["install_ip"], + "bk_biz_id": int(self.ticket_data["bk_biz_id"]), + "machine_type": MachineType.BACKEND.value, + } + ] + storage_instances = [] + clusters = [] + for cluster_id in self.cluster["cluster_ids"]: + cluster = Cluster.objects.get(id=cluster_id) + port = cluster.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value).port + storage_instances.append( + { + "ip": self.cluster["install_ip"], + "port": int(port), + "instance_role": InstanceRole.BACKEND_SLAVE.value, + "is_stand_by": False, # 添加新建 + "db_version": self.cluster["package"], # 存储真正的版本号信息 + } + ) + clusters.append( + { + "ip": self.cluster["install_ip"], + "port": int(port), + "cluster_id": cluster_id, + } + ) + with atomic(): + api.machine.create( + machines=machines, + bk_cloud_id=int(self.ticket_data["bk_cloud_id"]), + creator=self.ticket_data["created_by"], + ) + storage_objs = api.storage_instance.create( + instances=storage_instances, + creator=self.ticket_data["created_by"], + time_zone=self.ticket_data["time_zone"], + status=InstanceStatus.RESTORING.value, + ) + # 新建的实例处于游离态,关联到每个相对应的集群ID。 + api.cluster.tendbha.cluster_add_storage(clusters) + # ip转移模块,ip底下关联的每个实例注册到服务(即可监控) + MysqlCCTopoOperator( + Cluster.objects.filter(id__in=self.cluster["cluster_ids"]) + ).transfer_instances_to_cluster_module(storage_objs) + + def slave_recover_del_instance(self): + """ + 实例卸载完毕修改元数据 + """ + + with atomic(): + for cluster_id in self.cluster["cluster_ids"]: + cluster = Cluster.objects.get(id=cluster_id) + master = cluster.main_storage_instances()[0] + old_slave = cluster.storageinstance_set.get(machine__ip=self.cluster["uninstall_ip"], port=master.port) + api.cluster.tendbha.remove_storage_tuple( + master_ip=master.machine.ip, + slave_ip=old_slave.machine.ip, + bk_cloud_id=cluster.bk_cloud_id, + port_list=[master.port], + ) + api.cluster.tendbha.remove_slave(cluster_id=cluster.id, target_slave_ip=old_slave.machine.ip) + CcManage(self.bk_biz_id).delete_service_instance(bk_instance_ids=[old_slave.bk_instance_id]) + # 删除实例元数据信息 + api.storage_instance.delete( + [ + { + "ip": old_slave.machine.ip, + "port": old_slave.port, + "bk_cloud_id": cluster.bk_cloud_id, + } + ] + ) + if not StorageInstance.objects.filter( + machine__ip=self.cluster["uninstall_ip"], machine__bk_cloud_id=int(self.ticket_data["bk_cloud_id"]) + ).exists(): + api.machine.delete( + machines=[self.cluster["uninstall_ip"]], bk_cloud_id=int(self.ticket_data["bk_cloud_id"]) + ) + + def tendb_modify_storage_status(self): + storage = StorageInstance.objects.get(id=self.cluster["storage_id"]) + storage.status = self.cluster["storage_status"] + storage.save() + + def migrate_cluster_add_instance(self): + """ + 集群成对迁移之一:安装新节点,添加实例元数据,关联到集群,转移机器模块 + """ + mysql_pkg = Package.get_latest_package( + version=self.ticket_data["db_version"], pkg_type=MediumEnum.MySQL, db_type=DBType.MySQL + ) + + machines = [ + { + "ip": self.cluster["new_master_ip"], + "bk_biz_id": int(self.bk_biz_id), + "machine_type": MachineType.BACKEND.value, + }, + { + "ip": self.cluster["new_slave_ip"], + "bk_biz_id": int(self.bk_biz_id), + "machine_type": MachineType.BACKEND.value, + }, + ] + storage_instances = [] + for storage_port in self.cluster["cluster_ports"]: + storage_instances.append( + { + "ip": self.cluster["new_master_ip"], + "port": int(storage_port), + "instance_role": InstanceRole.BACKEND_REPEATER.value, + "is_stand_by": False, # 添加新建 + "db_version": get_mysql_real_version(mysql_pkg.name), # 存储真正的版本号信息 + } + ) + storage_instances.append( + { + "ip": self.cluster["new_slave_ip"], + "port": int(storage_port), + "instance_role": InstanceRole.BACKEND_SLAVE.value, + "is_stand_by": False, # 添加新建 + "db_version": get_mysql_real_version(mysql_pkg.name), # 存储真正的版本号信息 + } + ) + + cluster_list = [] + clusterid_list = [] + for cluster_id in self.ticket_data["cluster_ids"]: + cluster_model = Cluster.objects.get(id=cluster_id) + master = cluster_model.storageinstance_set.get(instance_inner_role=InstanceInnerRole.MASTER.value) + cluster_list.append( + { + "ip": self.cluster["new_slave_ip"], + "port": master.port, + "cluster_id": cluster_model.id, + } + ) + cluster_list.append( + { + "ip": self.cluster["new_master_ip"], + "port": master.port, + "cluster_id": cluster_model.id, + } + ) + clusterid_list.append(cluster_model.id) + with atomic(): + api.machine.create( + bk_cloud_id=self.ticket_data["bk_cloud_id"], machines=machines, creator=self.ticket_data["created_by"] + ) + storage_objs = api.storage_instance.create( + instances=storage_instances, + creator=self.ticket_data["created_by"], + time_zone=self.ticket_data["time_zone"], + status=InstanceStatus.RESTORING, + ) + api.cluster.tendbha.cluster_add_storage(cluster_list) + # 转移模块,实例ID注册服务 + clusters = Cluster.objects.filter(id__in=clusterid_list) + MysqlCCTopoOperator(clusters).transfer_instances_to_cluster_module(storage_objs) + + api.cluster.tendbha.add_storage_tuple( + master_ip=self.cluster["new_master_ip"], + slave_ip=self.cluster["new_slave_ip"], + bk_cloud_id=self.ticket_data["bk_cloud_id"], + port_list=self.cluster["cluster_ports"], + ) + return True + + def migrate_cluster_add_tuple(self): + """ + 添加主从关系链 + """ + with atomic(): + api.cluster.tendbha.storage_tuple.add_storage_tuple( + master_ip=self.cluster["master_ip"], + slave_ip=self.cluster["new_master_ip"], + bk_cloud_id=self.cluster["bk_cloud_id"], + port_list=[self.cluster["master_port"]], + ) + # 安装时候已经写入 + # api.cluster.tendbha.storage_tuple.add_storage_tuple( + # master_ip=self.cluster["new_master_ip"], + # slave_ip=self.cluster["new_slave_ip"], + # bk_cloud_id=self.cluster["bk_cloud_id"], + # port_list=[self.cluster["master_port"]], + # ) + + def uninstall_instance(self): + """ + 实例卸载完毕修改元数据 + """ + with atomic(): + for port in self.cluster["ports"]: + StorageInstance.objects.get( + machine__ip=self.cluster["uninstall_ip"], + machine__bk_cloud_id=self.cluster["bk_cloud_id"], + port=port, + ).delete() + if not StorageInstance.objects.filter( + machine__ip=self.cluster["uninstall_ip"], machine__bk_cloud_id=int(self.ticket_data["bk_cloud_id"]) + ).exists(): + api.machine.delete( + machines=[self.cluster["uninstall_ip"]], bk_cloud_id=int(self.ticket_data["bk_cloud_id"]) + ) diff --git a/dbm-ui/backend/flow/utils/name_service/__init__.py b/dbm-ui/backend/flow/utils/name_service/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dbm-ui/backend/flow/utils/name_service/name_service_dataclass.py b/dbm-ui/backend/flow/utils/name_service/name_service_dataclass.py new file mode 100644 index 0000000000..394528e0da --- /dev/null +++ b/dbm-ui/backend/flow/utils/name_service/name_service_dataclass.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +# name_service相关单据上下文 +from dataclasses import dataclass +from typing import Any, Optional + + +@dataclass() +class ActKwargs: + """节点私有变量数据类""" + + # 集群id + cluster_id: int = None + # 操作人员 + creator: str = None + # 名字服务类型 + name_service_operation_type: str = None + # 加载到上下文的dataclass类的名称 + set_trans_data_dataclass: str = None + + +@dataclass() +class TransDataKwargs: + """可读写上下文""" + + # 调用第三方接口返回的数据 + output: Optional[Any] = None diff --git a/dbm-ui/backend/flow/utils/pulsar/consts.py b/dbm-ui/backend/flow/utils/pulsar/consts.py index 238b4eeae9..56b2106242 100644 --- a/dbm-ui/backend/flow/utils/pulsar/consts.py +++ b/dbm-ui/backend/flow/utils/pulsar/consts.py @@ -32,7 +32,7 @@ class PulsarConfigEnum(str, StructuredEnum): PULSAR_BOOKKEEPER_SERVICE_PORT = 3181 PULSAR_ZOOKEEPER_METRICS_PORT = 6000 PULSAR_BOOKKEEPER_METRICS_PORT = 8000 -PULSAR_BROKER_METRICS_PORT = 7000 +PULSAR_BROKER_METRICS_PORT = 8080 PULSAR_MANAGER_WEB_PORT = 7750 PULSAR_ROLE_ALL = "all" diff --git a/dbm-ui/backend/flow/utils/pulsar/pulsar_module_operate.py b/dbm-ui/backend/flow/utils/pulsar/pulsar_module_operate.py index f427484d16..dd176b33fd 100644 --- a/dbm-ui/backend/flow/utils/pulsar/pulsar_module_operate.py +++ b/dbm-ui/backend/flow/utils/pulsar/pulsar_module_operate.py @@ -8,9 +8,53 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +from typing import Union + +from backend.components import DBConfigApi +from backend.components.dbconfig.constants import FormatType, LevelName, ReqType from backend.configuration.constants import DBType +from backend.db_meta.enums import InstanceRole +from backend.db_meta.models import ProxyInstance, StorageInstance +from backend.flow.consts import ConfigTypeEnum, NameSpaceEnum, PulsarRoleEnum from backend.flow.utils.base.cc_topo_operate import CCTopoOperator +from backend.flow.utils.pulsar.consts import ( + PULSAR_BOOKKEEPER_METRICS_PORT, + PULSAR_BROKER_METRICS_PORT, + PULSAR_ZOOKEEPER_METRICS_PORT, +) class PulsarCCTopoOperator(CCTopoOperator): db_type = DBType.Pulsar.value + + def generate_custom_labels(self, ins: Union[StorageInstance, ProxyInstance]) -> dict: + """ + 生成自定义标签,即CommonInstanceLabels 不满足的标签 + Pulsar监控端口写入标签 + """ + custom_labels = dict() + data = DBConfigApi.query_conf_item( + { + "bk_biz_id": str(self.bk_biz_id), + "level_name": LevelName.APP, + "level_value": str(self.bk_biz_id), + "conf_file": self.clusters[0].major_version, + "conf_type": ConfigTypeEnum.DBConf, + "namespace": NameSpaceEnum.Pulsar, + "format": FormatType.MAP_LEVEL, + "method": ReqType.GENERATE_AND_PUBLISH, + } + ) + if ins.instance_role == InstanceRole.PULSAR_BROKER: + custom_labels["metrics_port"] = data["content"][PulsarRoleEnum.Broker].get( + "webServicePort", PULSAR_BROKER_METRICS_PORT + ) + elif ins.instance_role == InstanceRole.PULSAR_BOOKKEEPER: + custom_labels["metrics_port"] = data["content"][PulsarRoleEnum.BookKeeper].get( + "prometheusStatsHttpPort", PULSAR_BOOKKEEPER_METRICS_PORT + ) + elif ins.instance_role == InstanceRole.PULSAR_ZOOKEEPER: + custom_labels["metrics_port"] = data["content"][PulsarRoleEnum.ZooKeeper].get( + "metricsProvider.httpPort", PULSAR_ZOOKEEPER_METRICS_PORT + ) + return custom_labels diff --git a/dbm-ui/backend/flow/utils/redis/redis_act_playload.py b/dbm-ui/backend/flow/utils/redis/redis_act_playload.py index fafb7332c4..490ce7535f 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_act_playload.py +++ b/dbm-ui/backend/flow/utils/redis/redis_act_playload.py @@ -47,6 +47,7 @@ NameSpaceEnum, RedisActuatorActionEnum, ) +from backend.flow.utils.redis.redis_util import get_latest_redis_package_by_version from backend.ticket.constants import TicketType logger = logging.getLogger("flow") @@ -191,7 +192,8 @@ def delete_redis_config(self, clusterMap: dict): ) return data - def redis_conf_names_by_cluster_type(self, cluster_type: str) -> list: + @staticmethod + def redis_conf_names_by_cluster_type(cluster_type: str) -> list: conf_names: list = ["requirepass"] if is_redis_instance_type(cluster_type) or is_tendisplus_instance_type(cluster_type): conf_names.append("cluster-enabled") @@ -360,7 +362,7 @@ def set_proxy_config(self, clusterMap: dict) -> Any: def dts_swap_proxy_config_version(self, clusterMap: dict) -> Any: """ - 交换源集群和目标集群 dbconfig 中的proxy版本信息,有可能 twemproxy集群 切换到 predixy集群 s + 交换源集群和目标集群 dbconfig 中的proxy版本信息,有可能 twemproxy集群 切换到 predixy集群 """ proxy_conf_names = ["password", "redis_password", "port"] logger.info(_("交换源集群和目标集群 dbconfig 中的proxy版本信息")) @@ -760,21 +762,27 @@ def redis_flush_data_payload(self, **kwargs) -> dict: redis清档 """ ip = kwargs["ip"] - redis_config = self.__get_cluster_config( - self.cluster["domain_name"], self.cluster["db_version"], ConfigTypeEnum.DBConf - ) - + params = kwargs["params"] + domain_name = params.get("domain_name", self.cluster["domain_name"]) + db_version = params.get("db_version", self.cluster["db_version"]) + cluster_type = params.get("cluster_type", self.cluster["cluster_type"]) + ports = params.get("ports", self.cluster[ip]) + force = params.get("force", self.cluster["force"]) + db_list = params.get("db_list", self.cluster["db_list"]) + flushall = params.get("flushall", self.cluster["flushall"]) + + redis_config = self.__get_cluster_config(domain_name, db_version, ConfigTypeEnum.DBConf) return { "db_type": DBActuatorTypeEnum.Redis.value, "action": DBActuatorTypeEnum.Redis.value + "_" + RedisActuatorActionEnum.FlushData.value, "payload": { "ip": ip, - "db_type": self.cluster["cluster_type"], - "ports": self.cluster[ip], - "is_force": self.cluster["force"], + "db_type": cluster_type, + "ports": ports, + "is_force": force, "password": redis_config["requirepass"], - "db_list": self.cluster["db_list"], - "is_flush_all": self.cluster["flushall"], + "db_list": db_list, + "is_flush_all": flushall, }, } @@ -845,6 +853,7 @@ def bkdbmon_install(self, **kwargs) -> dict: "payload": { "bkdbmonpkg": {"pkg": bkdbmon_pkg.name, "pkg_md5": bkdbmon_pkg.md5}, "dbtoolspkg": {"pkg": self.tools_pkg.name, "pkg_md5": self.tools_pkg.md5}, + "agent_address": env.MYSQL_CROND_AGENT_ADDRESS, "gsepath": DirEnum.GSE_DIR, "redis_fullbackup": fullbackup_config, "redis_binlogbackup": binlogbackup_config, @@ -1341,10 +1350,9 @@ def get_remove_dts_server_payload(self, **kwargs) -> dict: def redis_data_structure(self, **kwargs) -> dict: """ - redis 数据构造 + redis 数据构造 新备份系统 """ params = kwargs["params"] - print("params", params) return { "db_type": DBActuatorTypeEnum.Redis.value, "action": DBActuatorTypeEnum.Redis.value + "_" + RedisActuatorActionEnum.DATA_STRUCTURE.value, @@ -1354,15 +1362,10 @@ def redis_data_structure(self, **kwargs) -> dict: "new_temp_ip": params["data_params"]["new_temp_ip"], "new_temp_ports": params["data_params"]["new_temp_ports"], "recovery_time_point": params["data_params"]["recovery_time_point"], - "is_precheck": params["data_params"]["is_precheck"], "tendis_type": params["data_params"]["tendis_type"], - "user": self.account["user"], - "password": self.account["user_pwd"], - "base_info": { - "url": env.IBS_INFO_URL, - "sys_id": env.IBS_INFO_SYSID, - "key": env.IBS_INFO_KEY, - }, + "dest_dir": params["data_params"]["dest_dir"], + "full_file_list": params["data_params"]["full_file_list"], + "binlog_file_list": params["data_params"]["binlog_file_list"], }, } @@ -1494,3 +1497,106 @@ def redis_cluster_forget_4_scene(self, **kwargs) -> dict: "forget_list": params["forget_instances"], }, } + + # redis 原地升级 + def redis_cluster_version_update_online_payload(self, **kwargs) -> dict: + params = kwargs["params"] + db_version = params["target_version"] + redis_pkg = get_latest_redis_package_by_version(db_version) + return { + "db_type": DBActuatorTypeEnum.Redis.value, + "action": DBActuatorTypeEnum.Redis.value + "_" + RedisActuatorActionEnum.VERSION_UPDATE.value, + "payload": { + "pkg": redis_pkg.name, + "pkg_md5": redis_pkg.md5, + "ip": params["ip"], + "ports": params["ports"], + "password": params["password"], + "role": params["role"], + }, + } + + # redis 原地升级更新dbconfig + def redis_cluster_version_update_dbconfig(self, cluster_map: dict): + # 如果版本没变化,不需要更新 + if cluster_map["current_version"] == cluster_map["target_version"]: + return + src_resp = DBConfigApi.query_conf_item( + params={ + "bk_biz_id": str(cluster_map["bk_biz_id"]), + "level_name": LevelName.CLUSTER, + "level_value": cluster_map["cluster_domain"], + "level_info": {"module": str(DEFAULT_DB_MODULE_ID)}, + "conf_file": cluster_map["current_version"], + "conf_type": ConfigTypeEnum.DBConf, + "namespace": cluster_map["cluster_type"], + "format": FormatType.MAP, + } + ) + conf_names = self.redis_conf_names_by_cluster_type(cluster_map["cluster_type"]) + conf_items = [] + for conf_name in conf_names: + if conf_name in src_resp["content"]: + conf_items.append( + {"conf_name": conf_name, "conf_value": src_resp["content"][conf_name], "op_type": OpType.UPDATE} + ) + remove_items = [{"conf_name": conf_name, "op_type": OpType.REMOVE} for conf_name in conf_names] + upsert_param = { + "conf_file_info": { + "conf_file": "", # 需要替换成真实值 + "conf_type": ConfigTypeEnum.DBConf, + "namespace": "", # 需要替换成真实值 + }, + "conf_items": [], # 需要替换成真实值 + "level_info": {"module": str(DEFAULT_DB_MODULE_ID)}, + "confirm": DEFAULT_CONFIG_CONFIRM, + "req_type": ReqType.SAVE_AND_PUBLISH, + "bk_biz_id": str(cluster_map["bk_biz_id"]), + "level_name": LevelName.CLUSTER, + "level_value": "", # 需要替换成真实值 + } + # 先删除 + upsert_param["conf_file_info"]["namespace"] = cluster_map["cluster_type"] + upsert_param["conf_file_info"]["conf_file"] = cluster_map["current_version"] + upsert_param["conf_items"] = remove_items + upsert_param["level_value"] = cluster_map["cluster_domain"] + logger.info(_("删除集群:{} redis配置,upsert_param:{}".format(cluster_map["cluster_domain"], upsert_param))) + DBConfigApi.upsert_conf_item(upsert_param) + + # 再写入 + upsert_param["conf_file_info"]["namespace"] = cluster_map["cluster_type"] + upsert_param["conf_file_info"]["conf_file"] = cluster_map["target_version"] + upsert_param["conf_items"] = conf_items + upsert_param["level_value"] = cluster_map["cluster_domain"] + logger.info(_("更新集群:{} redis配置 为 目标集群的配置,upsert_param:{}".format(cluster_map["cluster_domain"], upsert_param))) + DBConfigApi.upsert_conf_item(upsert_param) + + # redis cluster failover + def redis_cluster_failover(self, **kwargs) -> dict: + """ + params: + { + "redis_password":"xxxx", + "redis_master_slave_pairs":[ + { + "master": {"ip":"a.a.a.a","port":"30000"}, + "slave": {"ip":"b.b.b.b","port":"30000"} + }, + { + "master": {"ip":"a.a.a.a","port":"30001"}, + "slave": {"ip":"b.b.b.b","port":"30001"} + } + ], + "force":false + } + """ + params = kwargs["params"] + return { + "db_type": DBActuatorTypeEnum.Redis.value, + "action": DBActuatorTypeEnum.Redis.value + "_" + RedisActuatorActionEnum.CLUSTER_FAILOVER.value, + "payload": { + "redis_password": params["redis_password"], + "redis_master_slave_pairs": params["redis_master_slave_pairs"], + "force": False, + }, + } diff --git a/dbm-ui/backend/flow/utils/redis/redis_context_dataclass.py b/dbm-ui/backend/flow/utils/redis/redis_context_dataclass.py index f7e3c0facd..e20840a2f4 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_context_dataclass.py +++ b/dbm-ui/backend/flow/utils/redis/redis_context_dataclass.py @@ -15,6 +15,7 @@ from backend.constants import DEFAULT_BK_CLOUD_ID from backend.db_meta.enums.cluster_type import ClusterType +from backend.env import BACKUP_DOWNLOAD_USER from backend.flow.consts import DEFAULT_REDIS_START_PORT, DEFAULT_TWEMPROXY_SEG_TOTOL_NUM @@ -146,6 +147,8 @@ class RedisDataStructureContext: start_port: int = None cluster_id: str = None redis_act_payload: Optional[Any] = None # 代表获取payload参数的类 + disk_used: dict = field(default_factory=dict) + backup_dir: str = None def cal_twemproxy_serveres(self, name) -> list: """ @@ -181,3 +184,18 @@ def get_redis_master_var_name() -> str: @staticmethod def get_proxy_exec_ip_var_name() -> str: return "new_install_proxy_exec_ip" + + +@dataclass() +class DownloadBackupFileKwargs: + """ + 定义下载redis备份文件的变量结构体 + """ + + bk_cloud_id: int + task_ids: list + dest_ip: str + dest_dir: str + reason: str + login_user: str = BACKUP_DOWNLOAD_USER + cluster: dict = None diff --git a/dbm-ui/backend/flow/utils/redis/redis_db_meta.py b/dbm-ui/backend/flow/utils/redis/redis_db_meta.py index 454cacfc07..4e7a625c56 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_db_meta.py +++ b/dbm-ui/backend/flow/utils/redis/redis_db_meta.py @@ -420,11 +420,11 @@ def instances_status_update(self) -> bool: machine_obj = Machine.objects.get(ip=self.cluster["meta_update_ip"]) if machine_obj.access_layer == AccessLayer.PROXY.value: ProxyInstance.objects.filter( - machine__ip=self.cluster["meta_update_ip"], port__in=self.cluster["meta_udpate_ports"] + machine__ip=self.cluster["meta_update_ip"], port__in=self.cluster["meta_update_ports"] ).update(status=self.cluster["meta_update_status"]) else: StorageInstance.objects.filter( - machine__ip=self.cluster["meta_update_ip"], port__in=self.cluster["meta_udpate_ports"] + machine__ip=self.cluster["meta_update_ip"], port__in=self.cluster["meta_update_ports"] ).update(status=self.cluster["meta_update_status"]) return True @@ -432,7 +432,7 @@ def instances_failover_4_scene(self) -> bool: """1.修改状态、2.切换角色""" self.instances_status_update() with atomic(): - for port in self.cluster["meta_udpate_ports"]: + for port in self.cluster["meta_update_ports"]: old_master = StorageInstance.objects.get(machine__ip=self.cluster["meta_update_ip"], port=port) old_slave = old_master.as_ejector.get().receiver StorageInstanceTuple.objects.get(ejector=old_master, receiver=old_slave).delete(keep_parents=True) @@ -759,3 +759,14 @@ def dts_online_switch_swap_two_cluster_storage(self): RedisCCTopoOperator(dst_cluster).transfer_instances_to_cluster_module(src_storageinstances) return True + + def redis_cluster_version_update(self): + """ + 更新集群版本(major_version) + """ + cluster = Cluster.objects.get( + bk_cloud_id=self.cluster["bk_cloud_id"], immute_domain=self.cluster["immute_domain"] + ) + cluster.major_version = self.cluster["target_version"] + cluster.save(update_fields=["major_version"]) + return True diff --git a/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py b/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py index 96f48a09e6..d94482b602 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py +++ b/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py @@ -10,13 +10,26 @@ """ import hashlib import logging.config +from collections import defaultdict from typing import Dict, List, Tuple +from django.utils.translation import ugettext as _ + from backend.components import DBConfigApi, DRSApi from backend.components.dbconfig.constants import FormatType, LevelName +from backend.configuration.constants import DBType +from backend.constants import IP_PORT_DIVIDER +from backend.db_meta.enums import ClusterType, InstanceRole from backend.db_meta.models import Cluster -from backend.db_services.redis.util import is_predixy_proxy_type, is_twemproxy_proxy_type -from backend.flow.consts import ConfigTypeEnum +from backend.db_package.models import Package +from backend.db_services.redis.util import ( + is_predixy_proxy_type, + is_redis_instance_type, + is_tendisplus_instance_type, + is_tendisssd_instance_type, + is_twemproxy_proxy_type, +) +from backend.flow.consts import DEFAULT_DB_MODULE_ID, ConfigFileEnum, ConfigTypeEnum, MediumEnum logger = logging.getLogger("flow") @@ -219,3 +232,107 @@ def check_cluster_proxy_backends_consistent(cluster_id: int, cluster_password: s raise Exception( "proxy[{}->{}] backends is not same".format(sorted_md5[0]["proxy_addr"], sorted_md5[-1]["proxy_addr"]) ) + + +def get_twemproxy_cluster_server_shards(bk_biz_id: int, cluster_id: int, other_to_master: dict) -> dict: + """ + 获取twemproxy集群的server_shards + :param bk_biz_id: 业务id + :param cluster_id: 集群id + :param other_to_master: other实例 到 master实例的映射关系,格式为{a.a.a.a:30000 : b.b.b.b:30000} + """ + cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) + if not is_twemproxy_proxy_type(cluster.cluster_type): + return {} + twemproxy_server_shards = defaultdict(dict) + ipport_to_segment = {} + for row in cluster.nosqlstoragesetdtl_set.all(): + ipport = row.instance.machine.ip + IP_PORT_DIVIDER + str(row.instance.port) + ipport_to_segment[ipport] = row.seg_range + + for master_obj in cluster.storageinstance_set.filter(instance_role=InstanceRole.REDIS_MASTER.value): + if master_obj.as_ejector and master_obj.as_ejector.first(): + slave_obj = master_obj.as_ejector.get().receiver + master_ipport = master_obj.machine.ip + IP_PORT_DIVIDER + str(master_obj.port) + slave_ipport = slave_obj.machine.ip + IP_PORT_DIVIDER + str(slave_obj.port) + + twemproxy_server_shards[master_obj.machine.ip][master_ipport] = ipport_to_segment[master_ipport] + twemproxy_server_shards[slave_obj.machine.ip][slave_ipport] = ipport_to_segment[master_ipport] + + for other_ipport, master_ipport in other_to_master.items(): + if master_ipport not in ipport_to_segment: + raise Exception( + "master ipport {} not found seg_range, not belong cluster:{}??".format( + master_ipport, cluster.immute_domain + ) + ) + other_list = other_ipport.split(IP_PORT_DIVIDER) + other_ip = other_list[0] + twemproxy_server_shards[other_ip][other_ipport] = ipport_to_segment[master_ipport] + return twemproxy_server_shards + + +def get_cache_backup_mode(bk_biz_id: int, cluster_id: int) -> str: + """ + 获取集群的cache_backup_mode + :param bk_biz_id: 业务id + :param cluster_id: 集群id + """ + query_params = { + "bk_biz_id": str(bk_biz_id), + "level_name": LevelName.CLUSTER.value, + "level_value": "", + "level_info": {"module": str(DEFAULT_DB_MODULE_ID)}, + "conf_file": ConfigFileEnum.FullBackup.value, + "conf_type": ConfigTypeEnum.Config.value, + "namespace": ClusterType.TendisTwemproxyRedisInstance.value, + "format": FormatType.MAP.value, + } + if cluster_id == 0: + # 获取业务级别的配置 + query_params["level_name"] = LevelName.APP.value + query_params["level_value"] = str(bk_biz_id) + resp = DBConfigApi.query_conf_item(params=query_params) + if resp["content"]: + return resp["content"].get("cache_backup_mode", "") + cluster: Cluster = None + try: + cluster = Cluster.objects.get(id=cluster_id, bk_biz_id=bk_biz_id) + except Cluster.DoesNotExist: + # 获取业务级别的配置 + query_params["level_name"] = LevelName.APP.value + query_params["level_value"] = str(bk_biz_id) + resp = DBConfigApi.query_conf_item(params=query_params) + if resp["content"]: + return resp["content"].get("cache_backup_mode", "") + if not is_redis_instance_type(cluster.cluster_type): + return "" + # 获取集群级别的配置 + query_params["level_name"] = LevelName.CLUSTER.value + query_params["level_value"] = cluster.immute_domain + query_params["namespace"] = cluster.cluster_type + try: + resp = DBConfigApi.query_conf_item(params=query_params) + if resp["content"]: + return resp["content"].get("cache_backup_mode", "") + except Exception: + return "aof" + + +def get_db_versions_by_cluster_type(cluster_type: str) -> list: + if is_redis_instance_type(cluster_type): + ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.Redis.value).values_list( + "version", flat=True + ) + return list(ret) + elif is_tendisplus_instance_type(cluster_type): + ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.TendisPlus.value).values_list( + "version", flat=True + ) + return list(ret) + elif is_tendisssd_instance_type(cluster_type): + ret = Package.objects.filter(db_type=DBType.Redis.value, pkg_type=MediumEnum.TendisSsd.value).values_list( + "version", flat=True + ) + return list(ret) + raise Exception(_("集群类型:{} 不是一个 redis 集群类型?").format(cluster_type)) diff --git a/dbm-ui/backend/flow/utils/redis/redis_util.py b/dbm-ui/backend/flow/utils/redis/redis_util.py index d3c951e1fc..d20f2826dc 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_util.py +++ b/dbm-ui/backend/flow/utils/redis/redis_util.py @@ -10,6 +10,10 @@ """ import re +from backend.configuration.constants import DBType +from backend.db_package.models import Package +from backend.flow.consts import MediumEnum + def domain_without_port(domain): end_port_reg = re.compile(r"(\:\d+$)|(#\d+$)") @@ -23,3 +27,85 @@ def check_domain(domain): if match: return True return False + + +def convert_version_to_uint(version): + version = version.strip() + if not version: + return 0, None + list01 = version.split(".") + billion = "" + thousand = "" + single = "" + if len(list01) == 0: + err = ValueError(f"version:{version} format not correct") + return 0, err + billion = list01[0] + thousand = list01[1] if len(list01) >= 2 else "" + single = list01[2] if len(list01) >= 3 else "" + total = 0 + if billion: + try: + b = int(billion) + total += b * 1000000 + except ValueError as e: + err = ValueError(f"convertVersionToUint int() fail, err:{e}, billion:{billion}, version:{version}") + return 0, err + if thousand: + try: + t = int(thousand) + total += t * 1000 + except ValueError as e: + err = ValueError(f"convertVersionToUint int() fail, err:{e}, thousand:{thousand}, version:{version}") + return 0, err + if single: + try: + s = int(single) + total += s + except ValueError as e: + err = ValueError(f"convertVersionToUint int() fail, err:{e}, single:{single}, version:{version}") + return 0, err + return total, None + + +# redis-6.2.7.tar.gz => (6002007, 0, None) +# redis-2.8.17-rocksdb-v1.3.10.tar.gz => (2008017, 1003010, None) +def version_parse(version): + reg01 = re.compile(r"[\d+.]+") + rets = reg01.findall(version) + if len(rets) == 0: + err = ValueError(f"TendisVersionParse version:{version} format not correct") + return 0, 0, err + base_version = 0 + sub_version = 0 + if len(rets) >= 1: + base_version, err = convert_version_to_uint(rets[0]) + if err: + return 0, 0, err + if len(rets) >= 2: + sub_version, err = convert_version_to_uint(rets[1]) + if err: + return 0, 0, err + return base_version, sub_version, None + + +# 判断两个版本是否相等 +def version_equal(version1, version2): + base_version1, sub_version1, err = version_parse(version1) + if err: + return False, err + base_version2, sub_version2, err = version_parse(version2) + if err: + return False, err + return base_version1 == base_version2 and sub_version1 == sub_version2, None + + +# 根据db_version 获取 redis 最新 Package +def get_latest_redis_package_by_version(db_version): + pkg_type = MediumEnum.Redis + if db_version.startswith("TendisSSD"): + pkg_type = MediumEnum.TendisSsd + if db_version.startswith("Tendisplus"): + pkg_type = MediumEnum.TendisPlus + redis_pkg = Package.get_latest_package(version=db_version, pkg_type=pkg_type, db_type=DBType.Redis) + return redis_pkg diff --git a/dbm-ui/backend/flow/utils/riak/riak_act_payload.py b/dbm-ui/backend/flow/utils/riak/riak_act_payload.py index 375afc63a7..0a2112df69 100644 --- a/dbm-ui/backend/flow/utils/riak/riak_act_payload.py +++ b/dbm-ui/backend/flow/utils/riak/riak_act_payload.py @@ -1,8 +1,17 @@ +import logging +import os.path + +from backend import env from backend.configuration.constants import DBType +from backend.configuration.models import SystemSettings +from backend.db_meta.enums import MachineType +from backend.db_meta.models import Cluster, Machine, StorageInstance from backend.db_package.models import Package from backend.flow.consts import DBActuatorTypeEnum, MediumEnum, RiakActuatorActionEnum from backend.ticket.constants import TicketType +logger = logging.getLogger("flow") + class RiakActPayload(object): """ @@ -11,7 +20,8 @@ class RiakActPayload(object): def __init__(self, ticket_data: dict, cluster: dict): self.riak_pkg = None - self.bk_biz_id = str(ticket_data["bk_biz_id"]) + self.mysql_crond_pkg = None # riak使用mysql-crond实现定时任务 + self.riak_monitor_pkg = None self.ticket_data = ticket_data self.cluster = cluster @@ -30,7 +40,7 @@ def get_deploy_payload(self, **kwargs) -> dict: 部署节点 """ self.riak_pkg = Package.get_latest_package( - version=self.ticket_data["db_version"], pkg_type=MediumEnum.Riak, db_type=DBType.Riak + version=self.ticket_data["db_version"], pkg_type=MediumEnum.Riak, db_type=DBType.Riak.value ) return { "db_type": DBActuatorTypeEnum.Riak.value, @@ -56,7 +66,7 @@ def get_deploy_trans_payload(self, **kwargs) -> dict: 部署节点 """ self.riak_pkg = Package.get_latest_package( - version=self.ticket_data["db_version"], pkg_type=MediumEnum.Riak, db_type=DBType.Riak + version=self.ticket_data["db_version"], pkg_type=MediumEnum.Riak, db_type=DBType.Riak.value ) configs = kwargs["trans_data"]["configs"] return { @@ -232,3 +242,162 @@ def get_start_payload(self, **kwargs) -> dict: "extend": {}, }, } + + def get_install_monitor_payload(self, **kwargs) -> dict: + """ + 启用 + """ + self.mysql_crond_pkg = Package.get_latest_package(version=MediumEnum.Latest, pkg_type=MediumEnum.MySQLCrond) + self.riak_monitor_pkg = Package.get_latest_package( + version=MediumEnum.Latest, pkg_type=MediumEnum.RiakMonitor, db_type=DBType.Riak.value + ) + machine = Machine.objects.get(ip=kwargs["ip"]) + if machine.machine_type != MachineType.RIAK.value: + logger.error( + "install monitor error. Machine type is {} not {}".format(machine.machine_type, MachineType.RIAK.value) + ) + storage = StorageInstance.objects.filter(machine__ip=kwargs["ip"])[0] + + # 监控自定义上报配置通过SystemSettings表获取 + bkm_dbm_report = SystemSettings.get_setting_value(key="BKM_DBM_REPORT") + # 设置定时任务和调度计划 + schedules = [ + {"name": "riak-err-notice", "expression": "@every 1m"}, + {"name": "riak-load-health", "expression": "@every 1m"}, + {"name": "riak-ring-status", "expression": "@every 10s"}, + {"name": "riak-monitor-hardcode", "expression": "@every 10s"}, + ] + if self.ticket_data["ticket_type"] == TicketType.RIAK_CLUSTER_SCALE_OUT: + cluster = Cluster.objects.get(id=self.ticket_data["cluster_id"]) + domain = cluster.immute_domain + else: + domain = self.ticket_data["domain"] + + return { + "db_type": DBActuatorTypeEnum.Riak.value, + "action": RiakActuatorActionEnum.DeployMonitor.value, + "payload": { + "general": {}, + "extend": { + "crond_pkg": { + "name": self.mysql_crond_pkg.name, + "md5": self.mysql_crond_pkg.md5, + }, + "monitor_pkg": { + "name": self.riak_monitor_pkg.name, + "md5": self.riak_monitor_pkg.md5, + }, + "crond_config": { + "ip": kwargs["ip"], + "bk_cloud_id": self.ticket_data["bk_cloud_id"], + "event_data_id": bkm_dbm_report["event"]["data_id"], + "event_data_token": bkm_dbm_report["event"]["token"], + "metrics_data_id": bkm_dbm_report["metric"]["data_id"], + "metrics_data_token": bkm_dbm_report["metric"]["token"], + "log_path": "logs", + "beat_path": env.MYSQL_CROND_BEAT_PATH, + "agent_address": env.MYSQL_CROND_AGENT_ADDRESS, + }, + "monitor_config": { + "bk_biz_id": int(self.ticket_data["bk_biz_id"]), + "ip": kwargs["ip"], + "port": storage.port, + "bk_instance_id": storage.bk_instance_id, + "immute_domain": domain, + "machine_type": MachineType.RIAK.value, + "bk_cloud_id": self.ticket_data["bk_cloud_id"], + "log_path": "logs", + "items_config_file": "items-config.yaml", + "interact_timeout": 2, + }, + "monitor_items": create_riak_monitor_items(schedules), + "jobs_config": { + "bk_biz_id": int(self.ticket_data["bk_biz_id"]), + "jobs": create_crond_jobs(schedules), + }, + }, + }, + } + + def get_stop_monitor_payload(self, **kwargs) -> dict: + """ + 关闭定时和监控 + """ + return { + "db_type": DBActuatorTypeEnum.Riak.value, + "action": RiakActuatorActionEnum.StopMonitor.value, + "payload": { + "general": {}, + "extend": {}, + }, + } + + def get_start_monitor_payload(self, **kwargs) -> dict: + """ + 启用定时和监控 + """ + return { + "db_type": DBActuatorTypeEnum.Riak.value, + "action": RiakActuatorActionEnum.StartMonitor.value, + "payload": { + "general": {}, + "extend": {}, + }, + } + + +def create_crond_jobs(self: list) -> list: + monitor_path = "/data/monitor/riak-monitor" + jobs = [] + for schedule in self: + cmd = "run" + items = schedule["name"] + if "hardcode" in schedule["name"]: + cmd = "hardcode-run" + items = "db-up,riak_monitor_heart_beat" + job = { + "name": "{}{}".format(schedule["name"], schedule["expression"]), + "enable": True, + "command": os.path.join(monitor_path, "riak-monitor"), + "args": [ + cmd, + "--items", + items, + "-c", + os.path.join(monitor_path, "runtime.yaml"), + ], + "schedule": schedule["expression"], + "creator": "admin", + "work_dir": "", + } + jobs.append(job) + return jobs + + +def create_riak_monitor_items(self: list) -> list: + items = [] + for schedule in self: + if "hardcode" in schedule["name"]: + item = { + "name": "db-up", + "enable": True, + "schedule": schedule["expression"], + "machine_type": [MachineType.RIAK.value], + } + items.append(item) + item = { + "name": "riak_monitor_heart_beat", + "enable": True, + "schedule": schedule["expression"], + "machine_type": [MachineType.RIAK.value], + } + items.append(item) + continue + item = { + "name": schedule["name"], + "enable": True, + "schedule": schedule["expression"], + "machine_type": [MachineType.RIAK.value], + } + items.append(item) + return items diff --git a/dbm-ui/backend/flow/utils/spider/spider_act_dataclass.py b/dbm-ui/backend/flow/utils/spider/spider_act_dataclass.py index 71df2981fc..81e56fd748 100644 --- a/dbm-ui/backend/flow/utils/spider/spider_act_dataclass.py +++ b/dbm-ui/backend/flow/utils/spider/spider_act_dataclass.py @@ -1,4 +1,5 @@ from dataclasses import dataclass +from typing import List, Optional from backend.db_meta.enums import TenDBClusterSpiderRole @@ -67,3 +68,26 @@ class DropSpiderRoutingKwargs: cluster_id: int reduce_spiders: list # 待下架的spider列表,每个元素的格式是字典 is_safe: bool # 是否做安全检测 + + +@dataclass() +class InstancePairs: + """ + 定义需要替换的实例信息对 + """ + + old_ip: str + new_ip: str + old_port: int + new_port: int + tdbctl_pass: str + + +@dataclass +class SwitchRemoteSlaveRoutingKwargs: + """ + 定义spider节点remote slave替换操作的私有变量结构体 + """ + + cluster_id: int + switch_remote_instance_pairs: Optional[List[InstancePairs]] diff --git a/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py b/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py new file mode 100644 index 0000000000..1eac5df0e1 --- /dev/null +++ b/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.cloud import CloudServiceController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class CloudRedisDTSServerApplySceneApiView(FlowTestView): + def post(self, request): + """ + { + "created_by": "admin", + "bk_biz_id": 2005000194, + "ticket_type": "CLOUD_REDIS_DTS_SERVER_APPLY", + "bk_cloud_id": 0, + "redis_dts":{ + "host_infos": [ + { + "ip": "xxx", + "bk_cloud_id": 0, + "bk_host_id":0, + "bk_city_name":"xxx" + } + ] + } + } + """ + logger.info(_("开始部署redis dts服务场景")) + + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + CloudServiceController(root_id=root_id, ticket_data=request.data).redis_dts_server_apply_scene() + return Response({"root_id": root_id}) + + +class CloudRedisDTSServerReduceSceneApiView(FlowTestView): + def post(self, request): + """ + { + "created_by": "admin", + "bk_biz_id": 2005000194, + "ticket_type": "CLOUD_REDIS_DTS_SERVER_REDUCE", + "bk_cloud_id": 0, + "redis_dts":{ + "host_infos": [ + { + "id": 15, + "bk_host_id":111, + } + ] + } + } + """ + logger.info(_("删除redis dts服务场景")) + + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + CloudServiceController(root_id=root_id, ticket_data=request.data).redis_dts_server_reduce_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/es_fake_apply.py b/dbm-ui/backend/flow/views/es_fake_apply.py new file mode 100644 index 0000000000..041e2bc11a --- /dev/null +++ b/dbm-ui/backend/flow/views/es_fake_apply.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.es import EsController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class FakeInstallEsSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/fake_install_es + params: + { + "bk_biz_id": 2005000002, + "remark": "测试创建es集群", + "ticket_type": "ES_APPLY", + "cluster_name": "viper-cluster", + "cluster_alias": "测试集群", + "ip_source": "manual_input", + "city_code": "深圳", + "db_app_abbr": "blueking", + "db_version": "7.10.2", + "username": "username", + "password": "password", + "http_port": 9200, + "uid":"2111" + "created_by": "rtx", + "domain": "es.viper-cluster.blueking.db", + "nodes": { + "hot": [ + {"ip": "127.0.0.1", "bk_cloud_id": 0, "instance_num": 1} + ], + "cold": [ + {"ip": "127.0.0.2", "bk_cloud_id": 0, "instance_num": 1} + ], + "client": [ + {"ip": "127.0.0.3", "bk_cloud_id": 0} + ], + "master": [ + {"ip": "127.0.0.4", "bk_cloud_id": 0}, + {"ip": "127.0.0.5", "bk_cloud_id": 0}, + {"ip": "127.0.0.6", "bk_cloud_id": 0} + ] + } + } + """ + + def post(self, request): + logger.info(_("开始部署ES场景")) + + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + EsController(root_id=root_id, ticket_data=request.data).es_fake_apply_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/kafka_fake_apply.py b/dbm-ui/backend/flow/views/kafka_fake_apply.py new file mode 100644 index 0000000000..7cf894b66d --- /dev/null +++ b/dbm-ui/backend/flow/views/kafka_fake_apply.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.kafka import KafkaController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class FakeInstallKafkaSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/fake_install_kafka + params: + { + "uid": "2022921034", + "created_by": "admin", + "bk_biz_id": "2005000002", + "ticket_type": "KAFKA_APPLY", + "city_code": "\u6df1\u5733", + "version": "2.4.0", + "port": 9092, + "replication_num": 2, + "partition_num": 2, + "retention_hours": 2, + "username": "username", + "password": "password", + "nodes": { + "zookeeper": [ + { + "ip": "127.0.0.1", + "bk_cloud_id": 0 + }, + { + "ip": "127.0.0.2", + "bk_cloud_id": 0 + }, + { + "ip": "127.0.0.3", + "bk_cloud_id": 0 + } + ], + "broker": [ + { + "ip": "127.0.0.3", + "bk_cloud_id": 0 + }, + { + "ip": "127.0.0.4", + "bk_cloud_id": 0 + } + ] + }, + } + """ + + def post(self, request): + logger.info(_("开始部署kafka场景")) + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + KafkaController(root_id=root_id, ticket_data=request.data).kafka_fake_apply_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_add_slave_remote.py b/dbm-ui/backend/flow/views/mysql_add_slave_remote.py new file mode 100644 index 0000000000..38ef18a195 --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_add_slave_remote.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.mysql import MySQLController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class AddMysqlSlaveRemoteSceneApiView(FlowTestView): + """ + { + "uid":"2022051612120001", + "created_by":"xxxx", + "bk_biz_id":"2005000194", + "module":1, + "ticket_type":"MYSQL_ADD_SLAVE", + "infos":[ + { + "cluster_ids":[ + 6 + ], + "new_slave_ip":"127.0.0.1", + "backup_source":"local" + } + ] + } + """ + + def post(self, request): + logger.info(_("开始添加slave")) + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + mysql_controller_new = MySQLController(root_id, request.data) + mysql_controller_new.mysql_add_slave_remote_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_ha_metadata_import.py b/dbm-ui/backend/flow/views/mysql_ha_metadata_import.py new file mode 100644 index 0000000000..2bfba3e4a4 --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_ha_metadata_import.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +# import json +# import logging +# import uuid +# +# from django.core.files.uploadedfile import InMemoryUploadedFile +# from django.utils.translation import gettext_lazy as _ +# from rest_framework import serializers +# from rest_framework.decorators import action +# from rest_framework.parsers import MultiPartParser +# from rest_framework.permissions import AllowAny +# from rest_framework.response import Response +# +# from backend.bk_web import viewsets +# from backend.bk_web.swagger import common_swagger_auto_schema +# from backend.configuration.constants import DBType +# from backend.flow.engine.controller.mysql import MySQLController +# from backend.iam_app.handlers.drf_perm import GlobalManageIAMPermission +# from backend.ticket import constants +# from backend.ticket.models import Ticket +# +# logger = logging.getLogger("root") +# +# +# class UploadMetadataFileSerializer(serializers.Serializer): +# file = serializers.FileField(help_text=_("元数据文件")) +# bk_biz_id = serializers.IntegerField(help_text=_("bk biz id")) +# db_module_id = serializers.IntegerField(help_text=_("db module id")) +# proxy_spec_id = serializers.IntegerField(help_text=_("proxy spec id")) +# storage_spec_id = serializers.IntegerField(help_text=_("storage spec id")) +# +# +# class TenDBHAMetadataImportViewSet(viewsets.SystemViewSet): +# # permission_classes = [AllowAny] +# serializer_class = UploadMetadataFileSerializer +# http_method_names = ["post"] +# parser_classes = [MultiPartParser] +# +# def _get_custom_permissions(self): +# return [GlobalManageIAMPermission()] +# +# @common_swagger_auto_schema(operation_summary=_("tendbha 元数据迁移")) +# def create(self, request, *args, **kwargs): +# logger.info(_("开始 TenDBHA 元数据导入场景")) +# +# slz = self.get_serializer_class()(data=request.data) +# slz.is_valid(raise_exception=True) +# file: InMemoryUploadedFile = slz.validated_data["file"] +# bk_biz_id = slz.validated_data.get("bk_biz_id") +# db_module_id = slz.validated_data.get("db_module_id") +# proxy_spec_id = slz.validated_data.get("proxy_spec_id") +# storage_spec_id = slz.validated_data.get("storage_spec_id") +# +# with file.open("rb") as upload_file: +# content = json.load(upload_file) +# logger.info("content: {}".format(content)) +# # 这里需要先做些检查 ToDo +# # 1. db module, proxy spec, storage spec 存在 +# # 2. 集群版本和字符集满足 db module 的要求 +# # 3. 集群机器配置符合 spec +# +# root_id = uuid.uuid1().hex +# logger.info("define root_id: {}".format(root_id)) +# +# ticket = Ticket.objects.create( +# bk_biz_id=bk_biz_id, +# ticket_type=constants.TicketType.MYSQL_HA_METADATA_IMPORT, +# group=DBType.MySQL, +# status=constants.TicketStatus.RUNNING, +# remark="", +# details={}, +# is_reviewed=True, +# creator=request.user.username, +# updater=request.user.username, +# ) +# +# c = MySQLController( +# root_id=root_id, +# ticket_data={ +# # **request.data, +# "uid": ticket.id, +# "json_content": content, +# "bk_biz_id": bk_biz_id, +# "proxy_spec_id": proxy_spec_id, +# "storage_spec_id": storage_spec_id, +# "db_module_id": db_module_id, +# "created_by": request.user.username, +# "ticket_type": constants.TicketType.MYSQL_HA_METADATA_IMPORT, +# }, +# ) +# c.mysql_ha_metadata_import_scene() +# +# return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py b/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py new file mode 100644 index 0000000000..7250992832 --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.mysql import MySQLController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class MysqlMigrateRemoteSceneApiView(FlowTestView): + """ + { + "uid":"2022051612120002", + "created_by":"xxxx", + "bk_biz_id":"152", + "module":1, + "ticket_type":"MYSQL_MIGRATE_CLUSTER", + "infos":[ + { + # 必须是同机器的clusterid + "cluster_ids":[ + 1,2,3,4 + ], + "new_master_ip":"xxx", + "new_slave_ip":xxx", + "backup_source":"local" + } + ] + } + """ + + def post(self, request): + logger.info(_("开始重建slave")) + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + mysql_controller_new = MySQLController(root_id, request.data) + mysql_controller_new.mysql_migrate_remote_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_open_area.py b/dbm-ui/backend/flow/views/mysql_open_area.py new file mode 100644 index 0000000000..ed94aed17d --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_open_area.py @@ -0,0 +1,31 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from rest_framework.response import Response + +from backend.flow.engine.controller.mysql import MySQLController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class MysqlOpenAreaSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/mysql_open_area + params: + """ + + def post(self, request): + root_id = uuid.uuid1().hex + test = MySQLController(root_id=root_id, ticket_data=request.data) + test.mysql_open_area_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_restore_local_remote.py b/dbm-ui/backend/flow/views/mysql_restore_local_remote.py new file mode 100644 index 0000000000..584889c3c0 --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_restore_local_remote.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.mysql import MySQLController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class RestoreMysqlLocalRemoteSceneApiView(FlowTestView): + """ + { + "uid":"2022051612120002", + "created_by":"xxxx", + "bk_biz_id":"2005000194", + "module":1, + "ticket_type":"MYSQL_RESTORE_LOCAL_SLAVE", + "slaves":[ + { + "clusterid":3, + "slave_ip":"xxxx", + "slave_port":3306, + "backup_source":"master", + "force":false + } + ] + } + """ + + def post(self, request): + logger.info(_("开始原地重建slave")) + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + mysql_controller_new = MySQLController(root_id, request.data) + mysql_controller_new.mysql_restore_local_remote_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py b/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py new file mode 100644 index 0000000000..540e2ccfa6 --- /dev/null +++ b/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from django.utils.translation import ugettext as _ +from rest_framework.response import Response + +from backend.flow.engine.controller.mysql import MySQLController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class RestoreMysqlSlaveRemoteSceneApiView(FlowTestView): + """ + { + tenDB slave 恢复流程编排 + { + "uid":"2022051612120001", + "created_by":"xxxx", + "bk_biz_id":"152", + "module":1, + "ticket_type":"MYSQL_RESTORE_SLAVE", + "infos":[ + { + "cluster_ids":[ + 1,2,3,4 + ], + # 表示重建后是否强制卸载旧实例 + "force":false, + "old_slave_ip":"xxx", + "new_slave_ip":xxx", + "backup_source":"local" + } + ] + } + """ + + def post(self, request): + logger.info(_("开始重建slave")) + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + request.data["add_slave_only"] = False + mysql_controller_new = MySQLController(root_id, request.data) + mysql_controller_new.mysql_restore_slave_remote_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/name_service.py b/dbm-ui/backend/flow/views/name_service.py index 273c980d56..a320c42ed7 100644 --- a/dbm-ui/backend/flow/views/name_service.py +++ b/dbm-ui/backend/flow/views/name_service.py @@ -19,7 +19,7 @@ logger = logging.getLogger("root") -class NameServiceClbCreateSceneApiView(FlowTestView): +class ClbCreateSceneApiView(FlowTestView): """ 名字服务clb创建api接口 """ @@ -34,7 +34,7 @@ def post(request): return Response({"root_id": root_id}) -class NameServiceClbDeleteSceneApiView(FlowTestView): +class ClbDeleteSceneApiView(FlowTestView): """ 名字服务clb删除api接口 """ @@ -49,7 +49,37 @@ def post(request): return Response({"root_id": root_id}) -class NameServicePolarisCreateSceneApiView(FlowTestView): +class DomainBindClbIpSceneApiView(FlowTestView): + """ + 主域名绑定clb ip api接口 + """ + + @staticmethod + def post(request): + """ + 主域名绑定clb ip + """ + root_id = uuid.uuid1().hex + NameServiceController(root_id=root_id, ticket_data=request.data).immute_domain_bind_clb_ip() + return Response({"root_id": root_id}) + + +class DomainUnBindClbIpSceneApiView(FlowTestView): + """ + 主域名解绑clb ip api接口 + """ + + @staticmethod + def post(request): + """ + 主域名解绑clb ip + """ + root_id = uuid.uuid1().hex + NameServiceController(root_id=root_id, ticket_data=request.data).immute_domain_unbind_clb_ip() + return Response({"root_id": root_id}) + + +class PolarisCreateSceneApiView(FlowTestView): """ 名字服务polaris创建api接口 """ @@ -64,7 +94,7 @@ def post(request): return Response({"root_id": root_id}) -class NameServicePolarisDeleteSceneApiView(FlowTestView): +class PolarisDeleteSceneApiView(FlowTestView): """ 名字服务polaris删除api接口 """ diff --git a/dbm-ui/backend/flow/views/pulsar_fake_apply.py b/dbm-ui/backend/flow/views/pulsar_fake_apply.py new file mode 100644 index 0000000000..7c1d5925ce --- /dev/null +++ b/dbm-ui/backend/flow/views/pulsar_fake_apply.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import logging +import uuid + +from rest_framework.response import Response + +from backend.flow.engine.controller.pulsar import PulsarController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class FakeInstallPulsarSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/fake_install_pulsar + params: + { + "bk_biz_id": 111, + "remark": "部署pulsar集群", + "ticket_type": "PULSAR_APPLY", + "username": "username", + "password": "password", + "ip_source": "manual_input", + "db_version": "2.10.1", + "retention_minutes": 2, + "replication_num": 2, + "ensemble_size": 3, + "ack_quorum": 1, + "port": 6650, + "partition_num": 2, + "cluster_name": "pulsartest", + "cluster_alias": "测试虚拟上架集群", + "city_code": "深圳", + "bk_app_abbr": "xxxx", + "bk_cloud_id": 0, + "domain": "xxxx.test.test.test", + "uid": 111, + "created_by": "someone", + "manager_ip": "127.0.0.1", + "manager_port": 1234, + "token": "xxxxx", + "nodes": { + "zookeeper": [ + { + "ip": "1.1.1.1", + "bk_cloud_id": 0, + "bk_host_id": 1, + "bk_biz_id": 111 + }, + { + "ip": "2.2.2.2", + "bk_cloud_id": 0, + "bk_host_id": 2, + "bk_biz_id": 111 + }, + { + "ip": "3.3.3.3", + "bk_cloud_id": 0, + "bk_host_id": 3, + "bk_biz_id": 111 + } + ], + "broker": [ + { + "ip": "4.4.4.4", + "bk_cloud_id": 0, + "bk_host_id": 4, + "bk_biz_id": 111 + } + ], + "bookkeeper": [ + { + "ip": "5.5.5.5", + "bk_cloud_id": 0, + "bk_host_id": 5, + "bk_biz_id": 111 + }, + { + "ip": "6.6.6.6", + "bk_cloud_id": 0, + "bk_host_id": 6, + "bk_biz_id": 111 + } + ] + } + } + """ + + def post(self, request): + logger.info("Begin fake apply Pulsar scene") + + root_id = uuid.uuid1().hex + logger.info("define root_id: {}".format(root_id)) + PulsarController(root_id=root_id, ticket_data=request.data).pulsar_fake_apply_scene() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/redis_cluster.py b/dbm-ui/backend/flow/views/redis_cluster.py index eeb58ba37d..958b1c4c1f 100644 --- a/dbm-ui/backend/flow/views/redis_cluster.py +++ b/dbm-ui/backend/flow/views/redis_cluster.py @@ -538,3 +538,29 @@ def post(request): root_id = uuid.uuid1().hex RedisController(root_id=root_id, ticket_data=request.data).redis_cluster_add_slave() return Response({"root_id": root_id}) + + +class RedisClusterVersionUpdateOnlineApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/redis_cluster_version_update_online + params: + { + "bk_biz_id": 3, + "ticket_type":"REDIS_CLUSTER_VERSION_UPDATE_ONLINE", + "created_by":"admin", + "uid":"1111", + "infos": [ + { + "cluster_id": 1, + "current_version": "Redis-5", + "target_version": "Redis-6", + } + ] + } + """ + + @staticmethod + def post(request): + root_id = uuid.uuid1().hex + RedisController(root_id=root_id, ticket_data=request.data).redis_cluster_version_update_online() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/tendb_cluster_remote_local_recover.py b/dbm-ui/backend/flow/views/tendb_cluster_remote_local_recover.py new file mode 100644 index 0000000000..5aa90b1081 --- /dev/null +++ b/dbm-ui/backend/flow/views/tendb_cluster_remote_local_recover.py @@ -0,0 +1,32 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import logging +import uuid + +from rest_framework.response import Response + +from backend.flow.engine.controller.spider import SpiderController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class RemoteLocalRecoverSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/tendb_cluster_remote_local_recover + params: + """ + + def post(self, request): + root_id = uuid.uuid1().hex + test = SpiderController(root_id=root_id, ticket_data=request.data) + test.tendb_cluster_remote_local_recover() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/flow/views/tendb_cluster_remote_slave_recover.py b/dbm-ui/backend/flow/views/tendb_cluster_remote_slave_recover.py new file mode 100644 index 0000000000..56e6ffc467 --- /dev/null +++ b/dbm-ui/backend/flow/views/tendb_cluster_remote_slave_recover.py @@ -0,0 +1,32 @@ +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +import logging +import uuid + +from rest_framework.response import Response + +from backend.flow.engine.controller.spider import SpiderController +from backend.flow.views.base import FlowTestView + +logger = logging.getLogger("root") + + +class RemoteSlaveRecoverSceneApiView(FlowTestView): + """ + api: /apis/v1/flow/scene/tendb_cluster_remote_slave_recover + params: + """ + + def post(self, request): + root_id = uuid.uuid1().hex + test = SpiderController(root_id=root_id, ticket_data=request.data) + test.tendb_cluster_remote_slave_recover() + return Response({"root_id": root_id}) diff --git a/dbm-ui/backend/homepage/views.py b/dbm-ui/backend/homepage/views.py index 0fd16990a7..25f5a108bb 100644 --- a/dbm-ui/backend/homepage/views.py +++ b/dbm-ui/backend/homepage/views.py @@ -8,9 +8,11 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +from blueapps.account.decorators import login_exempt from django.conf import settings from django.contrib import auth from django.contrib.auth.decorators import login_required +from django.http import HttpResponse from django.utils.decorators import method_decorator from django.views.decorators.clickjacking import xframe_options_exempt from rest_framework.decorators import action @@ -45,6 +47,11 @@ def get(self, request): ) +@login_exempt +def ping(request): + return HttpResponse("pong") + + class LoginSuccessView(APIView): template_name = "login_success.html" renderer_classes = [TemplateHTMLRenderer] diff --git a/dbm-ui/backend/iam_app/handlers/drf_perm.py b/dbm-ui/backend/iam_app/handlers/drf_perm.py index c8372f8709..7e287e2f64 100644 --- a/dbm-ui/backend/iam_app/handlers/drf_perm.py +++ b/dbm-ui/backend/iam_app/handlers/drf_perm.py @@ -12,8 +12,9 @@ import logging from typing import List -from bkoauth.jwt_client import JWTClient -from django.utils.translation import ugettext as _ +from bk_audit.constants.log import DEFAULT_EMPTY_VALUE, DEFAULT_SENSITIVITY +from bk_audit.contrib.bk_audit.client import bk_audit_client +from bk_audit.log.models import AuditContext, AuditInstance from iam import Resource from rest_framework import permissions @@ -27,6 +28,19 @@ logger = logging.getLogger("root") +class CommonInstance(object): + def __init__(self, data): + self.instance_id = data.get("id", DEFAULT_EMPTY_VALUE) + self.instance_name = data.get("name", DEFAULT_EMPTY_VALUE) + self.instance_sensitivity = data.get("sensitivity", DEFAULT_SENSITIVITY) + self.instance_origin_data = data.get("origin_data", DEFAULT_EMPTY_VALUE) + self.instance_data = data + + @property + def instance(self): + return AuditInstance(self) + + class IAMPermission(permissions.BasePermission): """ 作为drf-iam鉴权的基类 @@ -46,9 +60,22 @@ def has_permission(self, request, view): return True iam = Permission(request=request) - # iam.batch_is_allowed(actions=self.actions, resources=[self.resources], is_raise_exception=True) + context = AuditContext(request=request) for action in self.actions: iam.is_allowed(action=action, resources=self.resources, is_raise_exception=True) + # 查询类请求(简单定义为所有 GET 请求)不审计 + if request.method == "GET": + continue + # 审计操作类请求 + if not self.resources: + bk_audit_client.add_event(action=action, audit_context=context) + for resource in self.resources: + bk_audit_client.add_event( + action=action, + resource_type=resource, + audit_context=context, + instance=CommonInstance(resource.attribute), + ) return True @@ -79,7 +106,7 @@ def _fetch_biz_id(self, request, view): def has_permission(self, request, view): bk_biz_id = self._fetch_biz_id(request, view) - if not bk_biz_id: + if not int(bk_biz_id): return True self.resources = [BusinessResourceMeta.create_instance(str(bk_biz_id))] @@ -97,6 +124,18 @@ def has_object_permission(self, request, view, obj): return self.has_permission(request, view) +class RejectPermission(permissions.BasePermission): + """ + 永假的权限,用于屏蔽那些拒绝访问的接口 + """ + + def has_permission(self, request, view): + return False + + def has_object_permission(self, request, view, obj): + return False + + class ViewBusinessIAMPermission(BusinessIAMPermission): """ 业务查看——鉴权 diff --git a/dbm-ui/backend/iam_app/handlers/permission.py b/dbm-ui/backend/iam_app/handlers/permission.py index a4968b893e..46a5b47fca 100644 --- a/dbm-ui/backend/iam_app/handlers/permission.py +++ b/dbm-ui/backend/iam_app/handlers/permission.py @@ -63,7 +63,7 @@ def get_iam_client(cls): if env.BK_IAM_SKIP: return DummyIAM(env.APP_CODE, env.SECRET_KEY, env.BK_IAM_INNER_HOST, env.BK_COMPONENT_API_URL) - return IAM(env.APP_CODE, env.SECRET_KEY, bk_apigateway_url=env.BK_IAM_APIGETEWAY) + return IAM(env.APP_CODE, env.SECRET_KEY, bk_apigateway_url=env.BK_IAM_APIGATEWAY) def get_system_info(self): """ diff --git a/dbm-ui/backend/tests/db_meta/api/cluster/tendbha/test_handler.py b/dbm-ui/backend/tests/db_meta/api/cluster/tendbha/test_handler.py index 32f7107c35..fc621cb4af 100644 --- a/dbm-ui/backend/tests/db_meta/api/cluster/tendbha/test_handler.py +++ b/dbm-ui/backend/tests/db_meta/api/cluster/tendbha/test_handler.py @@ -22,6 +22,7 @@ from backend.tests.mock_data import constant from backend.tests.mock_data.components import cc from backend.tests.mock_data.components.cc import CCApiMock +from backend.tests.mock_data.db_services.ipchooser import ResourceQueryHelperMock pytestmark = pytest.mark.django_db @@ -31,6 +32,7 @@ class TestHandler: @patch("backend.db_meta.models.app.CCApi", CCApiMock()) @patch("backend.db_meta.api.common.common.CCApi", CCApiMock()) @patch("backend.flow.utils.cc_manage.CCApi", CCApiMock()) + @patch("backend.flow.utils.cc_manage.ResourceQueryHelper", ResourceQueryHelperMock()) def test_create_success(self, init_db_module, create_city): cluster_name = "test" clusters = [ diff --git a/dbm-ui/backend/tests/mock_data/db_services/ipchooser.py b/dbm-ui/backend/tests/mock_data/db_services/ipchooser.py new file mode 100644 index 0000000000..252282b3fa --- /dev/null +++ b/dbm-ui/backend/tests/mock_data/db_services/ipchooser.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from backend.tests.mock_data.components.cc import MOCK_GET_BIZ_INTERNAL_MODULE_RETURN + + +class ResourceQueryHelperMock: + """ResourceQueryHelper相关接口mock""" + + @staticmethod + def get_biz_internal_module(*args, **kwargs): + return MOCK_GET_BIZ_INTERNAL_MODULE_RETURN diff --git a/dbm-ui/backend/ticket/builders/cloud/service_apply.py b/dbm-ui/backend/ticket/builders/cloud/service_apply.py index 0a78644547..ca6c73a4a5 100644 --- a/dbm-ui/backend/ticket/builders/cloud/service_apply.py +++ b/dbm-ui/backend/ticket/builders/cloud/service_apply.py @@ -103,11 +103,6 @@ class CloudServiceApplyFlowBuilder(BaseCloudTicketFlowBuilder): def init_ticket_flows(self): Flow.objects.bulk_create( [ - # Flow( - # ticket=self.ticket, - # flow_type=FlowType.BK_ITSM.value, - # details=CloudServiceApplyItsmParamBuilder(self.ticket).get_params(), - # ), Flow( ticket=self.ticket, flow_type=FlowType.INNER_FLOW.value, diff --git a/dbm-ui/backend/ticket/builders/common/base.py b/dbm-ui/backend/ticket/builders/common/base.py index 5e04c8ff99..110b91d40f 100644 --- a/dbm-ui/backend/ticket/builders/common/base.py +++ b/dbm-ui/backend/ticket/builders/common/base.py @@ -176,7 +176,7 @@ def validate_duplicate_cluster_name(cls, bk_biz_id, ticket_type, cluster_name): @classmethod def _validate_domain_valid(cls, domain): if not cls.domain_pattern.match(domain): - raise serializers.ValidationError(_("[{}]集群无法通过正则性校验{}").format(domain)) + raise serializers.ValidationError(_("[{}]集群无法通过正则性校验{}").format(domain, cls.domain_pattern)) if len(domain) > MAX_DOMAIN_LEN_LIMIT: raise serializers.ValidationError(_("[{}]集群域名长度过长,请不要让域名长度超过{}").format(domain, MAX_DOMAIN_LEN_LIMIT)) @@ -203,7 +203,6 @@ def _validate_single_database_table_selector( ignore_tables: List, cluster_id, dbs_in_cluster_map: Dict[int, List], - is_only_db_operate: bool = False, ) -> Tuple[bool, str]: """校验库表选择器中的单个数据是否合法""" @@ -221,9 +220,7 @@ def _validate_single_database_table_selector( return True, "" @classmethod - def validate_database_table_selector( - cls, bk_biz_id: int, infos: Dict, role_key: None, is_only_db_operate_list: List[bool] = None - ) -> Tuple[bool, str]: + def validate_database_table_selector(cls, bk_biz_id: int, infos: Dict, role_key: None) -> Tuple[bool, str]: """校验库表选择器的数据是否合法""" cluster_ids = [info["cluster_id"] for info in infos] @@ -234,8 +231,6 @@ def validate_database_table_selector( dbs_in_cluster = RemoteServiceHandler(bk_biz_id).show_databases(cluster_ids, cluster_id__role_map) dbs_in_cluster_map = {db["cluster_id"]: db["databases"] for db in dbs_in_cluster} - if not is_only_db_operate_list: - is_only_db_operate_list = [False] * len(infos) for index, info in enumerate(infos): is_valid, message = CommonValidate._validate_single_database_table_selector( @@ -245,7 +240,6 @@ def validate_database_table_selector( ignore_tables=info["ignore_tables"], cluster_id=info["cluster_id"], dbs_in_cluster_map=dbs_in_cluster_map, - is_only_db_operate=is_only_db_operate_list[index], ) if not is_valid: return is_valid, f"line {index}: {message}" diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py b/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py index 283df1ee2e..903ed7d3cf 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py @@ -34,6 +34,7 @@ class KafkaApplyDetailSerializer(BigDataApplyDetailsSerializer): "port": 9200, "password": "password", "partition_num": 2, + "no_security": 0, "nodes": { "zookeeper": [ { @@ -70,6 +71,9 @@ class KafkaApplyDetailSerializer(BigDataApplyDetailsSerializer): } """ + no_security = serializers.IntegerField( + help_text=_("无认证开关, 1表示无认证。0表示认证,默认0"), min_value=0, max_value=1, required=False, default=0 + ) replication_num = serializers.IntegerField( help_text=_("副本数量"), ) diff --git a/dbm-ui/backend/ticket/builders/mysql/base.py b/dbm-ui/backend/ticket/builders/mysql/base.py index 9b35585a42..6c12e71cf7 100644 --- a/dbm-ui/backend/ticket/builders/mysql/base.py +++ b/dbm-ui/backend/ticket/builders/mysql/base.py @@ -36,6 +36,10 @@ class BaseMySQLTicketFlowBuilder(MySQLTicketFlowBuilderPatchMixin, TicketFlowBui group = DBType.MySQL.value +class MySQLBasePauseParamBuilder(builders.PauseParamBuilder): + pass + + class MySQLBaseOperateDetailSerializer(SkipToRepresentationMixin, serializers.Serializer): """ mysql操作的基类,主要功能: @@ -84,10 +88,16 @@ def validate_cluster_can_access(self, attrs): ticket_type = self.context["ticket_type"] for cluster in clusters: + if cluster.cluster_type == ClusterType.TenDBSingle: + # 如果单节点异常,则直接报错 + if cluster.status_flag: + raise serializers.ValidationError(_("单节点实例状态异常,暂时无法执行该单据类型:{}").format(ticket_type)) + continue + for status_flag, whitelist in self.unavailable_whitelist__status_flag.items(): if cluster.status_flag & status_flag and ticket_type not in whitelist: raise serializers.ValidationError( - _("实例状态异常:{},暂时无法执行该单据类型:{}").format(status_flag.flag_text(), ticket_type) + _("高可用实例状态异常:{},暂时无法执行该单据类型:{}").format(status_flag.flag_text(), ticket_type) ) return attrs @@ -128,13 +138,10 @@ def validate_instance_related_clusters( if not CommonValidate.validate_instance_related_clusters(inst, cluster_ids, role): raise serializers.ValidationError(_("请保证所选实例{}的关联集群为{}").format(inst, cluster_ids)) - def validate_database_table_selector(self, attrs, role_key=None, is_only_db_operate_list: List[bool] = None): + def validate_database_table_selector(self, attrs, role_key=None): """校验库表选择器的数据是否合法""" is_valid, message = CommonValidate.validate_database_table_selector( - bk_biz_id=self.context["bk_biz_id"], - infos=attrs["infos"], - role_key=role_key, - is_only_db_operate_list=is_only_db_operate_list, + bk_biz_id=self.context["bk_biz_id"], infos=attrs["infos"], role_key=role_key ) if not is_valid: raise serializers.ValidationError(message) diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py b/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py index 0ef72ac222..3b1c11463e 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py @@ -42,7 +42,7 @@ class ChecksumDataInfoSerializer(serializers.Serializer): runtime_hour = serializers.IntegerField(help_text=_("超时时间")) timing = serializers.CharField(help_text=_("定时触发时间")) - infos = serializers.ListField(help_text=_("全备信息列表"), child=ChecksumDataInfoSerializer()) + infos = serializers.ListField(help_text=_("数据校验信息列表"), child=ChecksumDataInfoSerializer()) data_repair = serializers.DictField(help_text=_("数据修复信息")) is_sync_non_innodb = serializers.BooleanField(help_text=_("非innodb表是否修复"), required=False, default=False) diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_flashback.py b/dbm-ui/backend/ticket/builders/mysql/mysql_flashback.py index 16403156b2..66907c5bc1 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_flashback.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_flashback.py @@ -59,7 +59,6 @@ def validate(self, attrs): super(MySQLFlashbackDetailSerializer, self).validate_cluster_can_access(attrs) # 校验闪回的时间 self.validate_flash_time(attrs) - # TODO: 校验库表名是否规范 # 校验库表是否存在 RemoteServiceHandler(bk_biz_id=self.context["bk_biz_id"]).check_flashback_database(attrs["infos"]) diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py index fde3d2e4c0..153b0debe6 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py @@ -29,12 +29,14 @@ MysqlSingleApplyFlowParamBuilder, MysqlSingleApplyResourceParamBuilder, ) -from backend.ticket.constants import TicketType +from backend.ticket.constants import AffinityEnum, TicketType from backend.ticket.exceptions import TicketParamsVerifyException class MysqlHAApplyDetailSerializer(MysqlSingleApplyDetailSerializer): - disaster_tolerance_level = serializers.CharField(help_text=_("容灾级别")) + disaster_tolerance_level = serializers.ChoiceField( + help_text=_("容灾级别"), choices=AffinityEnum.get_choices(), required=False, default=AffinityEnum.NONE.value + ) start_proxy_port = serializers.IntegerField( help_text=_("Proxy起始端口"), required=False, diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py index 246cd658ac..8c8ffe14cf 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py @@ -45,8 +45,7 @@ def validate(self, attrs): super().validate(attrs) # 库表选择器校验 - db_operate_list = [info["truncate_data_type"] == TruncateDataTypeEnum.DROP_DATABASE for info in attrs["infos"]] - super().validate_database_table_selector(attrs, is_only_db_operate_list=db_operate_list) + super().validate_database_table_selector(attrs) return attrs diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py index 384ff69850..fe975ef36a 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py @@ -9,18 +9,14 @@ specific language governing permissions and limitations under the License. """ -from typing import List - from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers -from backend.db_meta.models import Cluster from backend.flow.consts import MySQLBackupFileTagEnum, MySQLBackupTypeEnum from backend.flow.engine.controller.mysql import MySQLController from backend.ticket import builders from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBaseOperateDetailSerializer -from backend.ticket.constants import FlowRetryType, FlowType, TicketType -from backend.ticket.models import Flow +from backend.ticket.constants import FlowRetryType, TicketType class MySQLHaFullBackupDetailSerializer(MySQLBaseOperateDetailSerializer): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py new file mode 100644 index 0000000000..1e5661981a --- /dev/null +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py @@ -0,0 +1,225 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import json +import logging + +from django.utils.translation import ugettext_lazy as _ +from rest_framework import serializers + +from backend.components import DBConfigApi +from backend.components.dbconfig import constants as dbconf_const +from backend.db_meta.enums import ClusterType +from backend.db_meta.models import App, DBModule, Spec +from backend.flow.engine.controller.mysql import MySQLController +from backend.ticket import builders +from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBaseOperateDetailSerializer +from backend.ticket.constants import FlowRetryType, TicketType + +logger = logging.getLogger("root") + + +class MySQLHaMetadataImportDetailSerializer(MySQLBaseOperateDetailSerializer): + # file = serializers.FileField(help_text=_("元数据json文件")) + json_content = serializers.JSONField(help_text=_("元数据json内容")) + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + db_module_id = serializers.IntegerField(help_text=_("模块ID")) + proxy_spec_id = serializers.IntegerField(help_text=_("代理层规格ID")) + storage_spec_id = serializers.IntegerField(help_text=_("存储层规格ID")) + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.__module_version = "" + self.__module_charset = "" + self.__proxy_spec = None + self.__storage_spec = None + + def validate(self, attrs): + # 这里需要先做些检查 + # 1. db module, proxy spec, storage spec 存在 + # 2. 集群版本和字符集满足 db module 的要求 + # 3. 集群机器配置符合 spec + + self.__validate_bk_biz_id_exists(attrs=attrs) + self.__validate_db_module_id_exists(attrs=attrs) + self.__validate_proxy_spec_id_exists(attrs=attrs) + self.__validate_storage_spec_id_exists(attrs=attrs) + self.__validate_file_content(attrs=attrs) + return attrs + + @staticmethod + def __validate_bk_biz_id_exists(attrs): + bk_biz_id = attrs["bk_biz_id"] + if not App.objects.filter(bk_biz_id=bk_biz_id).exists(): + raise serializers.ValidationError(_("bk_biz_id: {} 不存在".format(bk_biz_id))) + + def __validate_db_module_id_exists(self, attrs): + bk_biz_id = attrs["bk_biz_id"] + db_module_id = attrs["db_module_id"] + if not DBModule.objects.filter(db_module_id=db_module_id, bk_biz_id=bk_biz_id).exists(): + raise serializers.ValidationError(_("db_module_id: {} 不存在".format(db_module_id))) + + # 省得多次请求 api 浪费时间 + # 配置系统的特性: db module 没有配置时, 会返回一个默认的. version = 5.7, charset=utf8 + db_config = DBConfigApi.query_conf_item( + { + "bk_biz_id": str(bk_biz_id), + "level_name": dbconf_const.LevelName.MODULE, + "level_value": str(db_module_id), + "conf_file": dbconf_const.DEPLOY_FILE_NAME, + "conf_type": dbconf_const.ConfType.DEPLOY, + "namespace": ClusterType.TenDBHA, + "format": dbconf_const.FormatType.MAP, + } + )["content"] + logger.info("app: {}, db module: {}, db config: {}".format(bk_biz_id, db_module_id, db_config)) + self.__module_version = db_config.get("db_version") + self.__module_charset = db_config.get("charset") + + def __validate_proxy_spec_id_exists(self, attrs): + proxy_spec_id = attrs["proxy_spec_id"] + if not Spec.objects.filter(spec_id=proxy_spec_id).exists(): + raise serializers.ValidationError(_("proxy_spec_id: {} 不存在".format(proxy_spec_id))) + + self.__proxy_spec = Spec.objects.get(spec_id=proxy_spec_id) # .get_spec_info() + + def __validate_storage_spec_id_exists(self, attrs): + storage_spec_id = attrs["storage_spec_id"] + if not Spec.objects.filter(spec_id=storage_spec_id).exists(): + raise serializers.ValidationError(_("storage_spec_id: {} 不存在".format(storage_spec_id))) + + self.__storage_spec = Spec.objects.get(spec_id=storage_spec_id) + + def __validate_file_content(self, attrs): + # file_content = json.load(attrs["file"]).decode("utf-8") + for cluster_json in attrs["json_content"]: + self.__validate_cluster_json(cluster_json=cluster_json, attrs=attrs) + + def __validate_cluster_json(self, cluster_json, attrs): + self.__validate_cluster_version_charset(cluster_json=cluster_json, attrs=attrs) + self.__validate_proxy_spec_match(cluster_json=cluster_json) + self.__validate_storage_spec_match(cluster_json=cluster_json) + + def __validate_cluster_version_charset(self, cluster_json, attrs): + db_module_id = attrs["db_module_id"] + + cluster_version = cluster_json["version"] + cluster_charset = cluster_json["charset"] + + # db module 的 version = MySQL-5.7 + # 上报的版本是 5.7.20 + # 这两个字符串有点难搞啊 + trans_cluster_version = "MySQL-{}".format(".".join(cluster_version.split(".")[:2])) + logger.info("{} trans to {}".format(cluster_version, trans_cluster_version)) + + if cluster_charset != self.__module_charset or trans_cluster_version != self.__module_version: + immute_domain = cluster_json["immute_domain"] + raise serializers.ValidationError( + _( + "{} version: {} or charset: {} not match to db module: {}: {}, {}".format( + immute_domain, + cluster_version, + cluster_charset, + db_module_id, + self.__module_version, + self.__module_charset, + ) + ) + ) + + def __validate_proxy_spec_match(self, cluster_json): + proxies = cluster_json["proxies"] + for ip in list(set([ele["ip"] for ele in proxies])): + mj = list(filter(lambda e: e["IP"] == ip, cluster_json["machines"])) + if not mj: + raise serializers.ValidationError(_("{} not found in machine part".format(ip))) + + self.__validate_machine_spec_match(machine_json=mj[0], spec_obj=self.__proxy_spec) + + def __validate_storage_spec_match(self, cluster_json): + slaves = cluster_json["slaves"] + ips = list(set([ele["ip"] for ele in slaves])) + ips.append(cluster_json["master"]["ip"]) + for ip in ips: + mj = list(filter(lambda e: e["IP"] == ip, cluster_json["machines"])) + if not mj: + raise serializers.ValidationError(_("{} not found in machine part".format(ip))) + + self.__validate_machine_spec_match(machine_json=mj[0], spec_obj=self.__storage_spec) + + @staticmethod + def __validate_machine_spec_match(machine_json, spec_obj: Spec): + machine_cpu = machine_json["Cpu"] + machine_mem = machine_json["Mem"] # MB + machine_ip = machine_json["IP"] + + machine_mem /= 1024 # 规格是 GB, 所以转换下 + + machine_disks_json = json.loads(machine_json["Disks"]) + + if not (spec_obj.cpu["min"] <= machine_cpu <= spec_obj.cpu["max"]): + raise serializers.ValidationError( + _("{} cpu={} not match to {}".format(machine_ip, machine_cpu, spec_obj.cpu)) + ) + + # 内存 MB, GB转换时很难保证完全匹配, 所以规格区间需要扩展匹配 + spec_obj.mem["min"] = spec_obj.mem["min"] - 1 if spec_obj.mem["min"] > 1 else 1 + spec_obj.mem["max"] += 1 + logger.info("mem spec expand to {}".format(spec_obj.mem)) + + if not (spec_obj.mem["min"] <= machine_mem <= spec_obj.mem["max"]): + raise serializers.ValidationError( + _("{} mem={}GB not match to {}GB".format(machine_ip, machine_mem, spec_obj.mem)) + ) + + for spec_disk in spec_obj.storage_spec: + spec_mount_point = spec_disk["mount_point"] + spec_size = spec_disk["size"] # GB + spec_type = spec_disk["type"].lower() + + if spec_mount_point in machine_disks_json: + machine_disk_size = machine_disks_json[spec_mount_point]["size"] # GB + machine_disk_type = machine_disks_json[spec_mount_point]["disk_type"].lower() + + if machine_disk_size < spec_size: + raise serializers.ValidationError( + _( + "{} {} size={}GB not match to {}".format( + machine_ip, spec_mount_point, machine_disk_size, spec_disk + ) + ) + ) + + if spec_type != "all" and spec_type != machine_disk_type: + raise serializers.ValidationError( + _( + "{} {} type={} not match to {}".format( + machine_ip, spec_mount_point, machine_disk_type, spec_disk + ) + ) + ) + else: + raise serializers.ValidationError( + _("{} mount point {} not found".format(machine_ip, spec_mount_point)) + ) + + +class MySQLHaMetadataImportFlowParamBuilder(builders.FlowParamBuilder): + """MySQL HA 备份执行单据参数""" + + controller = MySQLController.mysql_ha_metadata_import_scene + + +@builders.BuilderFactory.register(TicketType.MYSQL_HA_METADATA_IMPORT) +class MySQLHaFullBackupFlowBuilder(BaseMySQLTicketFlowBuilder): + serializer = MySQLHaMetadataImportDetailSerializer + inner_flow_builder = MySQLHaMetadataImportFlowParamBuilder + inner_flow_name = _("MySQL高可用元数据导入") + retry_type = FlowRetryType.MANUAL_RETRY diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py b/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py index 1ec9a449e3..bd3ebe6882 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py @@ -13,7 +13,7 @@ from backend.flow.engine.controller.mysql import MySQLController from backend.ticket import builders -from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder +from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBasePauseParamBuilder from backend.ticket.builders.mysql.mysql_master_slave_switch import ( MysqlMasterSlaveSwitchDetailSerializer, MysqlMasterSlaveSwitchParamBuilder, @@ -39,6 +39,7 @@ class MysqlSingleDestroyFlowBuilder(BaseMySQLTicketFlowBuilder): inner_flow_builder = MysqlMasterFailOverParamBuilder inner_flow_name = _("主库故障切换执行") retry_type = FlowRetryType.MANUAL_RETRY + pause_node_builder = MySQLBasePauseParamBuilder @property def need_manual_confirm(self): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_master_slave_switch.py b/dbm-ui/backend/ticket/builders/mysql/mysql_master_slave_switch.py index 50f6855663..3df2ce7e05 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_master_slave_switch.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_master_slave_switch.py @@ -17,7 +17,11 @@ from backend.flow.engine.controller.mysql import MySQLController from backend.ticket import builders from backend.ticket.builders.common.base import HostInfoSerializer -from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBaseOperateDetailSerializer +from backend.ticket.builders.mysql.base import ( + BaseMySQLTicketFlowBuilder, + MySQLBaseOperateDetailSerializer, + MySQLBasePauseParamBuilder, +) from backend.ticket.constants import FlowRetryType, FlowType, TicketType from backend.ticket.models import Flow @@ -62,6 +66,7 @@ class MysqlMasterSlaveSwitchFlowBuilder(BaseMySQLTicketFlowBuilder): inner_flow_builder = MysqlMasterSlaveSwitchParamBuilder inner_flow_name = _("主从互换执行") retry_type = FlowRetryType.MANUAL_RETRY + pause_node_builder = MySQLBasePauseParamBuilder @property def need_manual_confirm(self): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_openarea.py b/dbm-ui/backend/ticket/builders/mysql/mysql_openarea.py new file mode 100644 index 0000000000..f3b2a4194e --- /dev/null +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_openarea.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from django.utils.translation import gettext_lazy as _ +from rest_framework import serializers + +from backend.db_meta.enums import ClusterType +from backend.db_meta.models import Cluster +from backend.db_services.mysql.sql_import.constants import BKREPO_SQLFILE_PATH, SQLCharset +from backend.flow.engine.controller.mysql import MySQLController +from backend.ticket import builders +from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBaseOperateDetailSerializer +from backend.ticket.constants import TicketType + + +class MysqlOpenAreaDetailSerializer(MySQLBaseOperateDetailSerializer): + class ConfigDataSerializer(serializers.Serializer): + class ConfigExecuteSerializer(serializers.Serializer): + source_db = serializers.CharField(help_text=_("源DB")) + target_db = serializers.CharField(help_text=_("目标DB")) + schema_tblist = serializers.ListField(help_text=_("表结构列表"), child=serializers.CharField()) + data_tblist = serializers.ListField(help_text=_("表数据列表"), child=serializers.CharField()) + + cluster_id = serializers.IntegerField(help_text=_("目标集群ID")) + execute_objects = serializers.ListSerializer(help_text=_("分区执行信息"), child=ConfigExecuteSerializer()) + + class PrivDataSerializer(serializers.Serializer): + class AccountRulesSerializer(serializers.Serializer): + dbname = serializers.CharField(help_text=_("db名")) + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + + user = serializers.CharField(help_text=_("用户")) + source_ips = serializers.ListField(help_text=_("IP列表"), child=serializers.CharField()) + target_instances = serializers.ListField(help_text=_("目标集群列表"), child=serializers.CharField()) + account_rules = serializers.ListSerializer(help_text=_("授权DB列表"), child=AccountRulesSerializer()) + cluster_type = serializers.ChoiceField(help_text=_("集群类型"), choices=ClusterType.get_choices()) + + cluster_id = serializers.IntegerField(help_text=_("源集群ID")) + path = serializers.CharField(help_text=_("SQL文件路径"), required=False, default=BKREPO_SQLFILE_PATH) + force = serializers.BooleanField(help_text=_("是否强制执行"), required=False, default=False) + config_data = serializers.ListSerializer(help_text=_("分区信息"), child=ConfigDataSerializer()) + rules_set = serializers.ListSerializer(help_text=_("授权信息"), child=PrivDataSerializer()) + + +class MysqlOpenAreaParamBuilder(builders.FlowParamBuilder): + controller = MySQLController.mysql_open_area_scene + + def format_ticket_data(self): + # 字符集先默认为default + self.ticket_data["charset"] = SQLCharset.DEFAULT.value + self.ticket_data["source_cluster"] = self.ticket_data.pop("cluster_id") + self.ticket_data["target_clusters"] = self.ticket_data.pop("config_data") + for info in self.ticket_data["target_clusters"]: + info["target_cluster"] = info.pop("cluster_id") + + +@builders.BuilderFactory.register(TicketType.MYSQL_OPEN_AREA) +class MysqlOpenAreaFlowBuilder(BaseMySQLTicketFlowBuilder): + serializer = MysqlOpenAreaDetailSerializer + inner_flow_builder = MysqlOpenAreaParamBuilder + inner_flow_name = _("分区执行") diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_proxy_switch.py b/dbm-ui/backend/ticket/builders/mysql/mysql_proxy_switch.py index 1cf660ac36..757b33691f 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_proxy_switch.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_proxy_switch.py @@ -22,7 +22,11 @@ HostInfoSerializer, InstanceInfoSerializer, ) -from backend.ticket.builders.mysql.base import BaseMySQLTicketFlowBuilder, MySQLBaseOperateDetailSerializer +from backend.ticket.builders.mysql.base import ( + BaseMySQLTicketFlowBuilder, + MySQLBaseOperateDetailSerializer, + MySQLBasePauseParamBuilder, +) from backend.ticket.constants import FlowRetryType, TicketType @@ -93,6 +97,7 @@ class MysqlProxySwitchFlowBuilder(BaseMySQLTicketFlowBuilder): inner_flow_name = _("替换PROXY执行") resource_batch_apply_builder = MysqlProxySwitchResourceParamBuilder retry_type = FlowRetryType.MANUAL_RETRY + pause_node_builder = MySQLBasePauseParamBuilder @property def need_manual_confirm(self): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py b/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py index 23ef8ecc85..89791b5f2e 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py @@ -82,6 +82,11 @@ def to_representation(self, instance): return representation def validate(self, attrs): + # 校验集群名是否重复 + for domain in attrs["domains"]: + CommonValidate.validate_duplicate_cluster_name( + self.context["bk_biz_id"], self.context["ticket_type"], domain["key"] + ) # 校验域名是否重复 # TODO 校验存量的域名是否存在重复 keys = [domain["key"] for domain in attrs["domains"]] diff --git a/dbm-ui/backend/ticket/builders/redis/base.py b/dbm-ui/backend/ticket/builders/redis/base.py index 2fc69160f1..10cb27f53c 100644 --- a/dbm-ui/backend/ticket/builders/redis/base.py +++ b/dbm-ui/backend/ticket/builders/redis/base.py @@ -46,7 +46,6 @@ def validate(self, attrs): # TODO: 暂时忽略单据互斥,后续可能改为执行互斥 try: cluster = Cluster.objects.get(id=attrs["cluster_id"]) - # 锁定检测 if Cluster.is_exclusive(cluster.id, self.context["ticket_type"]): raise serializers.ValidationError(_("集群【{}({})】锁定中,请等待").format(cluster.name, cluster.id)) diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py new file mode 100644 index 0000000000..dc544fb754 --- /dev/null +++ b/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.translation import ugettext_lazy as _ + +from backend.flow.engine.controller.name_service import NameServiceController +from backend.ticket import builders +from backend.ticket.builders.redis.base import BaseRedisTicketFlowBuilder, RedisSingleOpsBaseDetailSerializer +from backend.ticket.constants import TicketType + + +class RedisPluginDnsBindCLBDetailSerializer(RedisSingleOpsBaseDetailSerializer): + pass + + +class RedisPluginDnsBindCLBFlowParamBuilder(builders.FlowParamBuilder): + controller = NameServiceController.clb_create + + def format_ticket_data(self): + """ + { + "uid": 340, + "ticket_type": "REDIS_PLUGIN_DNS_BIND_CLB", + "created_by": "admin", + "cluster_id": 1111 + } + """ + super().format_ticket_data() + + +@builders.BuilderFactory.register(TicketType.REDIS_PLUGIN_DNS_BIND_CLB) +class RedisPluginDnsBindCLBFlowBuilder(BaseRedisTicketFlowBuilder): + serializer = RedisPluginDnsBindCLBDetailSerializer + inner_flow_builder = RedisPluginDnsBindCLBFlowParamBuilder + inner_flow_name = _("域名绑定CLB") + + @property + def need_itsm(self): + return False diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py new file mode 100644 index 0000000000..25848b9bd6 --- /dev/null +++ b/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.translation import ugettext_lazy as _ + +from backend.flow.engine.controller.name_service import NameServiceController +from backend.ticket import builders +from backend.ticket.builders.redis.base import BaseRedisTicketFlowBuilder, RedisSingleOpsBaseDetailSerializer +from backend.ticket.constants import TicketType + + +class RedisPluginDnsUnBindCLBDetailSerializer(RedisSingleOpsBaseDetailSerializer): + pass + + +class RedisPluginDnsUnBindCLBFlowParamBuilder(builders.FlowParamBuilder): + controller = NameServiceController.clb_create + + def format_ticket_data(self): + """ + { + "uid": 340, + "ticket_type": "REDIS_PLUGIN_DNS_UNBIND_CLB", + "created_by": "admin", + "cluster_id": 1111 + } + """ + super().format_ticket_data() + + +@builders.BuilderFactory.register(TicketType.REDIS_PLUGIN_DNS_UNBIND_CLB) +class RedisPluginDnsUnBindCLBFlowBuilder(BaseRedisTicketFlowBuilder): + serializer = RedisPluginDnsUnBindCLBDetailSerializer + inner_flow_builder = RedisPluginDnsUnBindCLBFlowParamBuilder + inner_flow_name = _("域名接绑CLB") + + @property + def need_itsm(self): + return False diff --git a/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py b/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py index 78d8747883..83f56d2bf7 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py @@ -67,8 +67,8 @@ def validate(self, attrs): super().validate(attrs) # 集群名校验 - bk_biz_id = self.context["bk_biz_id"] - CommonValidate.validate_duplicate_cluster_name(bk_biz_id, attrs["cluster_type"], attrs["cluster_name"]) + bk_biz_id, ticket_type = self.context["bk_biz_id"], self.context["ticket_type"] + CommonValidate.validate_duplicate_cluster_name(bk_biz_id, ticket_type, attrs["cluster_name"]) # 仅校验手工选择主机的情况 if attrs["ip_source"] != IpSource.MANUAL_INPUT: @@ -280,4 +280,4 @@ def need_manual_confirm(self): @property def need_itsm(self): - return False + return True diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py index b0764da083..a9b3b9988d 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py @@ -21,7 +21,7 @@ class RedisMasterSlaveSwitchDetailSerializer(serializers.Serializer): - """主从故障切换""" + """主从切换""" class InfoSerializer(ClusterValidateMixin, serializers.Serializer): class PairSerializer(serializers.Serializer): @@ -69,7 +69,7 @@ class RedisMasterSlaveSwitchParamBuilder(builders.FlowParamBuilder): class RedisMasterSlaveSwitchFlowBuilder(BaseRedisTicketFlowBuilder): serializer = RedisMasterSlaveSwitchDetailSerializer inner_flow_builder = RedisMasterSlaveSwitchParamBuilder - inner_flow_name = _("Redis 主从故障切换") + inner_flow_name = _("Redis 主从切换") @property def need_itsm(self): diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py index 1502d91c25..f244ea2728 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py @@ -40,7 +40,9 @@ class BackendGroupSerializer(serializers.Serializer): online_switch_type = serializers.ChoiceField( help_text=_("切换类型"), choices=SwitchConfirmType.get_choices(), default=SwitchConfirmType.NO_CONFIRM ) - resource_spec = ResourceSpecSerializer() + resource_spec = ResourceSpecSerializer(help_text=_("资源申请")) + capacity = serializers.IntegerField(help_text=_("当前容量需求")) + future_capacity = serializers.IntegerField(help_text=_("未来容量需求")) ip_source = serializers.ChoiceField(help_text=_("主机来源"), choices=IpSource.get_choices()) infos = serializers.ListField(help_text=_("批量操作参数列表"), child=InfoSerializer()) diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py index 602a0bbf50..2f82c72755 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py @@ -47,6 +47,8 @@ class SpecSerializer(serializers.Serializer): current_shard_num = serializers.IntegerField(help_text=_("当前分片数")) cluster_shard_num = serializers.IntegerField(help_text=_("目标分片数")) resource_spec = ResourceSpecSerializer(help_text=_("资源申请")) + capacity = serializers.IntegerField(help_text=_("当前容量需求")) + future_capacity = serializers.IntegerField(help_text=_("未来容量需求")) db_version = serializers.CharField(help_text=_("版本号")) online_switch_type = serializers.ChoiceField( help_text=_("切换类型"), choices=SwitchConfirmType.get_choices(), default=SwitchConfirmType.NO_CONFIRM diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py index b87a7cc74f..5c3de1e323 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py @@ -49,6 +49,8 @@ class SpecSerializer(serializers.Serializer): current_cluster_type = serializers.ChoiceField(choices=ClusterType.get_choices(), help_text=_("当前集群类型")) target_cluster_type = serializers.ChoiceField(choices=ClusterType.get_choices(), help_text=_("目标集群类型")) resource_spec = ResourceSpecSerializer(help_text=_("资源申请")) + capacity = serializers.IntegerField(help_text=_("当前容量需求")) + future_capacity = serializers.IntegerField(help_text=_("未来容量需求")) db_version = serializers.CharField(help_text=_("版本号")) online_switch_type = serializers.ChoiceField( help_text=_("切换类型"), choices=SwitchConfirmType.get_choices(), default=SwitchConfirmType.NO_CONFIRM diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/base.py b/dbm-ui/backend/ticket/builders/tendbcluster/base.py index 2f32171b7d..28979ce71f 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/base.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/base.py @@ -17,6 +17,7 @@ from backend.db_meta.enums import ClusterTenDBClusterStatusFlag, TenDBClusterSpiderRole from backend.db_meta.models import Cluster from backend.flow.consts import MAX_SPIDER_MASTER_COUNT, MIN_SPIDER_MASTER_COUNT, MIN_SPIDER_SLAVE_COUNT +from backend.ticket import builders from backend.ticket.builders import TicketFlowBuilder from backend.ticket.builders.common.base import MySQLTicketFlowBuilderPatchMixin, fetch_cluster_ids from backend.ticket.builders.mysql.base import ( @@ -31,6 +32,10 @@ class BaseTendbTicketFlowBuilder(MySQLTicketFlowBuilderPatchMixin, TicketFlowBui group = DBType.TenDBCluster.value +class TendbBasePauseParamBuilder(builders.PauseParamBuilder): + pass + + class TendbBaseOperateDetailSerializer(MySQLBaseOperateDetailSerializer): """ tendbcluster操作的基类,主要功能: @@ -108,6 +113,17 @@ def validate_min_spider_count(self, attrs): ): raise serializers.ValidationError(_("【{}】请保证缩容后的接入层spider master数量>0").format(cluster.name)) + def validate_checksum_database_selector(self, attrs): + """校验tendbcluster的checksum库表选择器""" + cluster_database_info = { + "infos": [ + {**backup_info, "cluster_id": info["cluster_id"]} + for info in attrs["infos"] + for backup_info in info["backup_infos"] + ] + } + super().validate_database_table_selector(attrs=cluster_database_info) + class TendbClustersTakeDownDetailsSerializer(MySQLClustersTakeDownDetailsSerializer): is_only_delete_slave_domain = serializers.BooleanField(help_text=_("是否只禁用只读接入层"), required=False, default=False) diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py index 4b1182dd63..4c5007f3a1 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py @@ -75,6 +75,10 @@ def validate(self, attrs): CommonValidate.validate_generate_domain("spider", attrs["cluster_name"], attrs["db_app_abbr"]) CommonValidate.validate_generate_domain("spider-slave", attrs["cluster_name"], attrs["db_app_abbr"]) # TODO: spider集群部署校验 + # 校验集群名是否重复 + CommonValidate.validate_duplicate_cluster_name( + self.context["bk_biz_id"], self.context["ticket_type"], attrs["cluster_name"] + ) return attrs diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_checksum.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_checksum.py index ca6d4b1e8e..44f1186051 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_checksum.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_checksum.py @@ -60,7 +60,7 @@ class BackupInfoSerializer(serializers.Serializer): is_sync_non_innodb = serializers.BooleanField(help_text=_("非innodb表是否修复"), required=False, default=False) def validate(self, attrs): - # super().validate(attrs) + super().validate_checksum_database_selector(attrs) return attrs diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_fixpoint_rollback.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_fixpoint_rollback.py index f30f379273..0762a01e3b 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_fixpoint_rollback.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_fixpoint_rollback.py @@ -16,8 +16,9 @@ from backend.components import DBConfigApi from backend.components.dbconfig import constants as dbconf_const -from backend.db_meta.enums import ClusterStatus, ClusterType, TenDBClusterSpiderRole -from backend.db_meta.models import AppCache, Cluster +from backend.db_meta.enums import ClusterType, TenDBClusterSpiderRole +from backend.db_meta.enums.comm import SystemTagEnum, TagType +from backend.db_meta.models import AppCache, Cluster, Tag from backend.db_services.dbbase.constants import IpSource from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders @@ -65,7 +66,7 @@ def pre_callback(self): rollback_flow = self.ticket.current_flow() ticket_data = rollback_flow.details["ticket_data"] - # # 为定点构造的flow填充临时集群信息 + # 为定点构造的flow填充临时集群信息 source_cluster_id = ticket_data.pop("cluster_id") # 对同一个集群同一天回档26^4才有可能重名, 暂时无需担心 target_cluster = Cluster.objects.get(name=ticket_data["apply_details"]["cluster_name"]) @@ -73,14 +74,13 @@ def pre_callback(self): rollback_flow.save(update_fields=["details"]) # 对临时集群记录变更 - ClusterOperateRecord.objects.create( - cluster_id=target_cluster.id, - ticket_id=self.ticket.id, - flow_id=rollback_flow.id, - creator=self.ticket.creator, + temporary_tag, _ = Tag.objects.get_or_create( + bk_biz_id=self.ticket.bk_biz_id, name=SystemTagEnum.TEMPORARY.value, type=TagType.SYSTEM.value + ) + target_cluster.tag_set.add(temporary_tag) + ClusterOperateRecord.objects.get_or_create( + cluster_id=target_cluster.id, ticket=self.ticket, flow=rollback_flow ) - target_cluster.status = ClusterStatus.TEMPORARY.value - target_cluster.save(update_fields=["status"]) class TendbApplyTemporaryFlowParamBuilder(builders.FlowParamBuilder): diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_flashback.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_flashback.py index b3038640b0..fb82b6c1e6 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_flashback.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_flashback.py @@ -11,10 +11,15 @@ from django.utils.translation import gettext_lazy as _ +from backend.db_services.mysql.remote_service.handlers import RemoteServiceHandler from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders from backend.ticket.builders.mysql.mysql_flashback import MySQLFlashbackDetailSerializer -from backend.ticket.builders.tendbcluster.base import BaseTendbTicketFlowBuilder, TendbBaseOperateDetailSerializer +from backend.ticket.builders.tendbcluster.base import ( + BaseTendbTicketFlowBuilder, + TendbBaseOperateDetailSerializer, + TendbBasePauseParamBuilder, +) from backend.ticket.constants import FlowRetryType, TicketType @@ -24,7 +29,9 @@ def validate(self, attrs): super(TendbBaseOperateDetailSerializer, self).validate_cluster_can_access(attrs) # 校验闪回时间 super().validate_flash_time(attrs) - # TODO: 校验flash的库表选择器 + # 校验flash的库表选择器 + RemoteServiceHandler(bk_biz_id=self.context["bk_biz_id"]).check_flashback_database(attrs["infos"]) + return attrs @@ -41,3 +48,8 @@ class TendbFlashbackFlowBuilder(BaseTendbTicketFlowBuilder): inner_flow_builder = TendbFlashbackFlowParamBuilder inner_flow_name = _("TenDB Cluster 闪回执行") retry_type = FlowRetryType.MANUAL_RETRY + pause_node_builder = TendbBasePauseParamBuilder + + @property + def need_manual_confirm(self): + return True diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_full_backup.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_full_backup.py index b479efe939..4ea3d22eb1 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_full_backup.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_full_backup.py @@ -22,7 +22,7 @@ class TendbFullBackUpDetailSerializer(TendbBaseOperateDetailSerializer): class FullBackUpItemSerializer(serializers.Serializer): class FullBackUpClusterItemSerializer(serializers.Serializer): - id = serializers.IntegerField(help_text=_("集群ID")) + cluster_id = serializers.IntegerField(help_text=_("集群ID")) backup_local = serializers.CharField(help_text=_("备份位置信息")) backup_type = serializers.ChoiceField(help_text=_("备份选项"), choices=MySQLBackupTypeEnum.get_choices()) @@ -52,7 +52,7 @@ def validate(self, attrs): for cluster in attrs["infos"]["clusters"]: if cluster["backup_local"] == TenDBBackUpLocation.SPIDER_MNT and "spider_mnt_address" not in cluster: - raise serializers.ValidationError(_("备份位置选择spider_mnt时,请提供临时节点的地址")) + raise serializers.ValidationError(_("备份位置选择spider_mnt时,请提供运维节点的地址")) return attrs diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_apply.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_apply.py index 4065843beb..160517d02d 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_apply.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_apply.py @@ -23,9 +23,9 @@ class TendbMNTApplyDetailSerializer(TendbBaseOperateDetailSerializer): class MNTApplySerializer(serializers.Serializer): cluster_id = serializers.IntegerField(help_text=_("集群ID")) bk_cloud_id = serializers.IntegerField(help_text=_("云区域ID")) - spider_ip_list = serializers.ListField(help_text=_("临时节点信息"), child=serializers.DictField()) + spider_ip_list = serializers.ListField(help_text=_("运维节点信息"), child=serializers.DictField()) - infos = serializers.ListField(help_text=_("添加spider临时节点信息"), child=MNTApplySerializer()) + infos = serializers.ListField(help_text=_("添加spider运维节点信息"), child=MNTApplySerializer()) def validate(self, attrs): super().validate(attrs) @@ -49,4 +49,4 @@ def format_ticket_data(self): class TendbMNTApplyFlowBuilder(BaseTendbTicketFlowBuilder): serializer = TendbMNTApplyDetailSerializer inner_flow_builder = TendbMNTApplyParamBuilder - inner_flow_name = _("TendbCluster 添加临时节点") + inner_flow_name = _("TendbCluster 添加运维节点") diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_destroy.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_destroy.py index 96e8ab33e0..49fff424ed 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_destroy.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_mnt_destroy.py @@ -22,9 +22,9 @@ class TendbMNTDestroyDetailSerializer(TendbBaseOperateDetailSerializer): class MNTDestroySerializer(serializers.Serializer): cluster_id = serializers.IntegerField(help_text=_("集群ID")) - spider_ip_list = serializers.ListField(help_text=_("临时节点信息"), child=serializers.DictField()) + spider_ip_list = serializers.ListField(help_text=_("运维节点信息"), child=serializers.DictField()) - infos = serializers.ListField(help_text=_("下架spider临时节点信息"), child=MNTDestroySerializer()) + infos = serializers.ListField(help_text=_("下架spider运维节点信息"), child=MNTDestroySerializer()) is_safe = serializers.BooleanField(help_text=_("是否安全模式执行"), required=False, default=True) def validate(self, attrs): @@ -40,4 +40,4 @@ class TendbMNTDestroyParamBuilder(builders.FlowParamBuilder): class TendbMNTDestroyFlowBuilder(BaseTendbTicketFlowBuilder): serializer = TendbMNTDestroyDetailSerializer inner_flow_builder = TendbMNTDestroyParamBuilder - inner_flow_name = _("TendbCluster 下架临时节点") + inner_flow_name = _("TendbCluster 下架运维节点") diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py index 547f19310f..ba8e9d7a1f 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py @@ -12,7 +12,8 @@ from django.utils.translation import ugettext as _ from rest_framework import serializers -from backend.db_meta.enums import ClusterStatus +from backend.db_meta.enums import ClusterPhase, ClusterStatus +from backend.db_meta.enums.comm import SystemTagEnum from backend.db_meta.models import Cluster from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders @@ -26,10 +27,15 @@ class TendbTemporaryDestroyDetailSerializer(TendbClustersTakeDownDetailsSerializer): def validate_cluster_ids(self, value): - cluster_types = set(Cluster.objects.filter(id__in=value).values_list("status", flat=True)) - if cluster_types != {ClusterStatus.TEMPORARY.value}: + clusters = Cluster.objects.filter(id__in=value, tag__name=SystemTagEnum.TEMPORARY.value) + if clusters.count() != len(value): raise serializers.ValidationError(_("此单据只用于临时集群的销毁,请不要用于其他正常集群")) - return value + + running_clusters = [cluster.id for cluster in clusters if cluster.phase == ClusterPhase.ONLINE] + if not running_clusters: + raise serializers.ValidationError(_("不存在状态为启用的临时集群,如果临时集群已禁用请在集群页面进行销毁")) + + return running_clusters class TendbTemporaryDisableFlowParamBuilder(builders.FlowParamBuilder): diff --git a/dbm-ui/backend/ticket/constants.py b/dbm-ui/backend/ticket/constants.py index a4fc3b7f2c..2c838a3538 100644 --- a/dbm-ui/backend/ticket/constants.py +++ b/dbm-ui/backend/ticket/constants.py @@ -161,6 +161,8 @@ def get_choice_value(cls, label: str) -> str: MYSQL_SINGLE_TRUNCATE_DATA = EnumField("MYSQL_SINGLE_TRUNCATE_DATA", _("MySQL 单节点清档")) MYSQL_SINGLE_RENAME_DATABASE = EnumField("MYSQL_SINGLE_RENAME_DATABASE", _("MySQL 单节点DB重命名")) MYSQL_HA_STANDARDIZE = EnumField("MYSQL_HA_STANDARDIZE", _("TendbHA 标准化")) + MYSQL_HA_METADATA_IMPORT = EnumField("MYSQL_HA_METADATA_IMPORT", _("TendbHA 元数据导入")) + MYSQL_OPEN_AREA = EnumField("MYSQL_OPEN_AREA", _("MySQL 开区")) # SPIDER(TenDB Cluster) TENDBCLUSTER_CHECKSUM = EnumField("TENDBCLUSTER_CHECKSUM", _("TenDB Cluster 数据校验修复")) @@ -201,6 +203,8 @@ def get_choice_value(cls, label: str) -> str: # REDIS REDIS_PLUGIN_CREATE_CLB = EnumField("REDIS_PLUGIN_CREATE_CLB", _("Redis 创建CLB")) REDIS_PLUGIN_DELETE_CLB = EnumField("REDIS_PLUGIN_DELETE_CLB", _("Redis 删除CLB")) + REDIS_PLUGIN_DNS_BIND_CLB = EnumField("REDIS_PLUGIN_DNS_BIND_CLB", _("Redis 域名绑定CLB")) + REDIS_PLUGIN_DNS_UNBIND_CLB = EnumField("REDIS_PLUGIN_DNS_UNBIND_CLB", _("Redis 域名解绑CLB")) REDIS_PLUGIN_CREATE_POLARIS = EnumField("REDIS_PLUGIN_CREATE_POLARIS", _("Redis 创建Polaris")) REDIS_PLUGIN_DELETE_POLARIS = EnumField("REDIS_PLUGIN_DELETE_POLARIS", _("Redis 删除Polaris")) REDIS_SINGLE_APPLY = EnumField("REDIS_SINGLE_APPLY", _("Redis 单节点部署")) @@ -217,7 +221,7 @@ def get_choice_value(cls, label: str) -> str: REDIS_CLUSTER_CUTOFF = EnumField("REDIS_CLUSTER_CUTOFF", _("Redis 整机替换")) REDIS_CLUSTER_AUTOFIX = EnumField("REDIS_CLUSTER_AUTOFIX", _("Redis 故障自愈")) REDIS_CLUSTER_INSTANCE_SHUTDOWN = EnumField("REDIS_CLUSTER_INSTANCE_SHUTDOWN", _("Redis 故障自愈-实例下架")) - REDIS_MASTER_SLAVE_SWITCH = EnumField("REDIS_MASTER_SLAVE_SWITCH", _("Redis 主从故障切换")) + REDIS_MASTER_SLAVE_SWITCH = EnumField("REDIS_MASTER_SLAVE_SWITCH", _("Redis 主从切换")) PROXY_SCALE_UP = EnumField("PROXY_SCALE_UP", _("Redis Proxy扩容")) PROXY_SCALE_DOWN = EnumField("PROXY_SCALE_DOWN", _("Redis Proxy缩容")) REDIS_ADD_DTS_SERVER = EnumField("REDIS_ADD_DTS_SERVER", _("Redis 新增DTS SERVER")) diff --git a/dbm-ui/backend/ticket/flow_manager/base.py b/dbm-ui/backend/ticket/flow_manager/base.py index fa95256df7..4268e64aa7 100644 --- a/dbm-ui/backend/ticket/flow_manager/base.py +++ b/dbm-ui/backend/ticket/flow_manager/base.py @@ -8,17 +8,18 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import logging +import operator from abc import ABC, abstractmethod +from functools import reduce from typing import Any, Optional, Union +from django.db.models import Q from django.utils.translation import gettext as _ from backend.ticket import constants from backend.ticket.constants import FLOW_FINISHED_STATUS, FLOW_NOT_EXECUTE_STATUS, FlowErrCode, TicketFlowStatus -from backend.ticket.models import Flow - -logger = logging.getLogger("root") +from backend.ticket.models import ClusterOperateRecord, Flow, InstanceOperateRecord +from backend.utils.basic import get_target_items_from_details class BaseTicketFlow(ABC): @@ -102,7 +103,6 @@ def summary(self) -> str: def run_error_status_handler(self, err: Exception): """run异常处理,更新失败状态和错误信息""" - logger.exception(f"fail to run flow: {err}") err_code = FlowErrCode.get_err_code(err, self.flow_obj.retry_type) self.flow_obj.err_msg = err self.flow_obj.err_code = err_code @@ -135,6 +135,47 @@ def flush_error_status_handler(self): self.ticket.status = constants.TicketStatus.RUNNING self.ticket.save(update_fields=["status", "update_at"]) + def create_operate_records(self, object_key, record_model): + """ + 写入操作记录的通用方法 + 每一轮flow在running时,需要更新当前集群的record.flow为当前flow,为新出现的集群增加record(如定点回档包含了新出现的集群) + """ + object_ids = set( + get_target_items_from_details(self.flow_obj.details, match_keys=[object_key, f"{object_key}s"]) + + get_target_items_from_details(self.ticket.details, match_keys=[object_key, f"{object_key}s"]) + ) + if not object_ids: + return + + record_filter = reduce( + operator.or_, [Q(**{object_key: obj_id, "ticket": self.ticket}) for obj_id in object_ids] + ) + + # 修改当前的flow引用,并批量更新 + to_update_records = record_model.objects.filter(record_filter) + for record in to_update_records: + record.flow = self.flow_obj + record_model.objects.bulk_update(to_update_records, fields=["flow"]) + + # 创建新加入的record,并批量创建 + object_ticket_tuples = list(to_update_records.values_list(object_key, "ticket")) + to_create_records = [ + record_model( + **{object_key: obj_id, "flow": self.flow_obj, "ticket": self.ticket, "creator": self.ticket.creator} + ) + for obj_id in object_ids + if (obj_id, self.ticket.id) not in object_ticket_tuples + ] + record_model.objects.bulk_create(to_create_records) + + def create_cluster_operate_records(self): + """写入集群操作记录""" + self.create_operate_records(object_key="cluster_id", record_model=ClusterOperateRecord) + + def create_instance_operate_records(self): + """写入示例的操作记录""" + self.create_operate_records(object_key="instance_id", record_model=InstanceOperateRecord) + def run(self): """执行流程并记录流程对象ID""" try: @@ -142,6 +183,9 @@ def run(self): except Exception as err: # pylint: disable=broad-except self.run_error_status_handler(err) return + else: + self.create_cluster_operate_records() + self.create_instance_operate_records() self.run_status_handler(flow_obj_id) diff --git a/dbm-ui/backend/ticket/flow_manager/inner.py b/dbm-ui/backend/ticket/flow_manager/inner.py index 48a59a82b7..a89088c851 100644 --- a/dbm-ui/backend/ticket/flow_manager/inner.py +++ b/dbm-ui/backend/ticket/flow_manager/inner.py @@ -14,7 +14,6 @@ from datetime import date, datetime from typing import Dict, Union -from django.forms import model_to_dict from django.utils.translation import gettext as _ from backend.db_meta.exceptions import ClusterExclusiveOperateException @@ -23,7 +22,7 @@ from backend.ticket import constants from backend.ticket.constants import BAMBOO_STATE__TICKET_STATE_MAP, FlowCallbackType from backend.ticket.flow_manager.base import BaseTicketFlow -from backend.ticket.models import ClusterOperateRecord, Flow, InstanceOperateRecord +from backend.ticket.models import Flow from backend.utils.basic import get_target_items_from_details from backend.utils.time import datetime2str @@ -96,43 +95,6 @@ def _status(self) -> str: def _url(self) -> str: return f"/database/{self.ticket.bk_biz_id}/mission-details/{self.root_id}/" - def create_cluster_operate_records(self): - """ - 写入集群操作记录 - """ - cluster_ids = get_target_items_from_details(self.flow_obj.details, match_keys=["cluster_id", "cluster_ids"]) - records = [ - ClusterOperateRecord( - cluster_id=cluster_id, flow=self.flow_obj, ticket=self.ticket, creator=self.ticket.creator - ) - for cluster_id in cluster_ids - ] - - # 如果当前记录已经被创建过了,则不重复创建(这里主要是防止重试inner节点造成重复的记录) - if records and ClusterOperateRecord.objects.filter(**model_to_dict(records[0])).exists(): - return - - ClusterOperateRecord.objects.bulk_create(records) - - def create_instance_operate_records(self): - """ - 写入实例的操作记录 - """ - # TODO 这个函数暂时只考虑StorageInstance,后续应该会将StorageInstance和ProxyInstance合并 - instance_ids = get_target_items_from_details(self.flow_obj.details, match_keys=["instance_id", "instance_ids"]) - records = [ - InstanceOperateRecord( - instance_id=instance_id, flow=self.flow_obj, ticket=self.ticket, creator=self.ticket.creator - ) - for instance_id in instance_ids - ] - - # 如果当前已经被创建过了,则不重复创建 - if records and InstanceOperateRecord.objects.filter(**model_to_dict(records[0])).exists(): - return - - InstanceOperateRecord.objects.bulk_create(records) - def check_exclusive_operations(self): """判断执行互斥""" # TODO: 目前来说,执行互斥对于同时提单或者同时重试的操作是防不住的。 @@ -144,7 +106,9 @@ def check_exclusive_operations(self): # 考虑:如果单纯是为了防住同时操作,是不是设计一个全局锁就好了? ticket_type = self.ticket.ticket_type cluster_ids = get_target_items_from_details(obj=self.ticket.details, match_keys=["cluster_id", "cluster_ids"]) - Cluster.handle_exclusive_operations(cluster_ids=cluster_ids, ticket_type=ticket_type) + Cluster.handle_exclusive_operations( + cluster_ids=cluster_ids, ticket_type=ticket_type, exclude_ticket_ids=[self.ticket.id] + ) def handle_exclusive_error(self): """处理执行互斥后重试的逻辑""" diff --git a/dbm-ui/backend/ticket/flow_manager/manager.py b/dbm-ui/backend/ticket/flow_manager/manager.py index ac2c734aeb..8005954c67 100644 --- a/dbm-ui/backend/ticket/flow_manager/manager.py +++ b/dbm-ui/backend/ticket/flow_manager/manager.py @@ -8,6 +8,8 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import logging + from backend import env from backend.ticket import constants from backend.ticket.constants import FLOW_FINISHED_STATUS, FlowType @@ -54,6 +56,8 @@ } ) +logger = logging.getLogger("root") + class TicketFlowManager(object): def __init__(self, ticket: Ticket): diff --git a/dbm-ui/backend/ticket/models/ticket.py b/dbm-ui/backend/ticket/models/ticket.py index 36640500d7..a176108e3f 100644 --- a/dbm-ui/backend/ticket/models/ticket.py +++ b/dbm-ui/backend/ticket/models/ticket.py @@ -201,16 +201,28 @@ def create_ticket( class ClusterOperateRecordManager(models.Manager): def filter_actives(self, cluster_id, *args, **kwargs): - """获得集群正在运行的单据""" - return self.filter(cluster_id=cluster_id, flow__status=TicketFlowStatus.RUNNING, *args, **kwargs) + """获得集群正在运行的单据记录""" + return self.filter(cluster_id=cluster_id, ticket__status=TicketFlowStatus.RUNNING, *args, **kwargs) + + def filter_inner_actives(self, cluster_id, *args, **kwargs): + """获取集群正在运行的inner flow的单据记录。此时认为集群会在互斥阶段""" + # 排除特定的单据,如自身单据重试排除自身 + exclude_ticket_ids = kwargs.pop("exclude_ticket_ids", []) + return self.filter( + cluster_id=cluster_id, + flow__flow_type=FlowType.INNER_FLOW, + flow__status=TicketFlowStatus.RUNNING, + *args, + **kwargs, + ).exclude(flow__ticket_id__in=exclude_ticket_ids) def get_cluster_operations(self, cluster_id, **kwargs): - """集群上的操作列表""" + """集群上的正在运行的操作列表""" return [r.summary for r in self.filter_actives(cluster_id, **kwargs)] def has_exclusive_operations(self, ticket_type, cluster_id, **kwargs): """判断当前单据类型与集群正在进行中的单据是否互斥""" - active_tickets = self.filter_actives(cluster_id, **kwargs) + active_tickets = self.filter_inner_actives(cluster_id, **kwargs) exclusive_infos = [] for active_ticket in active_tickets: try: diff --git a/dbm-ui/backend/urls.py b/dbm-ui/backend/urls.py index 43863817f0..cfadfb67e0 100644 --- a/dbm-ui/backend/urls.py +++ b/dbm-ui/backend/urls.py @@ -15,18 +15,19 @@ from drf_yasg.views import get_schema_view from rest_framework import permissions -from backend.homepage.views import HomeView, LoginSuccessView, LogOutView, VersionView +from backend.bk_web.swagger import BothHttpAndHttpsSchemaGenerator +from backend.homepage.views import HomeView, LoginSuccessView, LogOutView, VersionView, ping schema_view = get_schema_view( openapi.Info( title="BK-DBM API", default_version="v1", ), + generator_class=BothHttpAndHttpsSchemaGenerator, public=True, permission_classes=(permissions.IsAdminUser,), ) - api_patterns = [ path("ipchooser/", include("backend.db_services.ipchooser.urls")), path("infras/", include("backend.db_services.infras.urls")), @@ -40,6 +41,7 @@ path("partition/", include("backend.db_services.partition.urls")), path("packages/", include("backend.db_package.urls")), path("version/", include("backend.db_services.version.urls")), + path("metadata/", include("backend.db_services.meta_import.urls")), path("mysql/", include("backend.db_services.mysql.urls")), path("redis/", include("backend.db_services.redis.urls")), path("bigdata/", include("backend.db_services.bigdata.urls")), @@ -51,6 +53,7 @@ path("monitor/", include("backend.db_monitor.urls")), path("event/", include("backend.db_event.urls")), path("db_dirty/", include("backend.db_dirty.urls")), + path("dbbase/", include("backend.db_services.dbbase.urls")), ] urlpatterns = [ @@ -62,6 +65,7 @@ path("grafana/", include("backend.bk_dataview.grafana.urls")), # 版本日志 path("version_log/", include("backend.version_log.urls")), + path("db_report/", include("backend.db_report.urls")), ] # TODO 正式环境屏蔽swagger访问路径,目前开发测试只使用了 prod @@ -74,6 +78,7 @@ path("login_success.html", LoginSuccessView.as_view()), path("logout/", LogOutView.as_view()), path("version/", VersionView.as_view()), + path("ping/", ping, name="ping"), re_path("", HomeView.as_view()), ] urlpatterns += vue_patterns diff --git a/dbm-ui/bin/install_precommit.sh b/dbm-ui/bin/install_precommit.sh index ca0b727524..45fa7d41b4 100755 --- a/dbm-ui/bin/install_precommit.sh +++ b/dbm-ui/bin/install_precommit.sh @@ -1,4 +1,8 @@ #!/bin/sh +SCRIPT_DIR=`dirname $0` +cd $SCRIPT_DIR && cd .. || exit 1 + +rm -rf ../.git/hooks/pre-commit git config --unset-all core.hooksPath diff --git a/dbm-ui/config/ci.py b/dbm-ui/config/ci.py new file mode 100644 index 0000000000..079ffcfefa --- /dev/null +++ b/dbm-ui/config/ci.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from .default import * # pylint: disable=wildcard-import + +DEBUG = True + +# allow all hosts +CORS_ORIGIN_ALLOW_ALL = True + +# cookies will be allowed to be included in cross-site HTTP requests +CORS_ALLOW_CREDENTIALS = True + +MIDDLEWARE = ( + "corsheaders.middleware.CorsMiddleware", + "backend.bk_web.middleware.DisableCSRFCheckMiddleware", +) + MIDDLEWARE + +STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": os.environ.get("DB_NAME", "bk-dbm.sqlite3"), + } +} + +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "verbose": { + "format": "{levelname} {asctime} {module} {message}", + "style": "{", + }, + "simple": { + "format": "{levelname} {message}", + "style": "{", + }, + }, + "handlers": { + "console": { + "class": "logging.StreamHandler", + "formatter": "verbose", + }, + }, + "root": { + "handlers": ["console"], + "level": "INFO", + }, + "": { + "handlers": ["console"], + "level": "INFO", + }, + "django.request": { + "handlers": ["console"], + "level": "INFO", + }, + "django.server": { + "handlers": ["console"], + "level": "INFO", + }, +} diff --git a/dbm-ui/config/default.py b/dbm-ui/config/default.py index 1a46ba2022..53797f110d 100644 --- a/dbm-ui/config/default.py +++ b/dbm-ui/config/default.py @@ -66,6 +66,11 @@ # pipeline "pipeline.component_framework", "pipeline.eri", + # bk-iam + "backend.iam_app", + "iam.contrib.iam_migration", + # bk-audit + "bk_audit.contrib.bk_audit", # backend "backend.core.storages", "backend.core.encrypt", @@ -77,10 +82,9 @@ "backend.flow", "backend.flow.plugins", "backend.db_meta.apps.DBMeta", - "backend.iam_app", - "iam.contrib.iam_migration", "backend.db_services.mysql.permission.authorize", "backend.db_services.mysql.permission.clone", + "backend.db_services.mysql.open_area", "backend.db_services.ipchooser", "backend.dbm_init", "backend.db_proxy", @@ -91,6 +95,7 @@ "backend.db_dirty", "apigw_manager.apigw", "backend.db_periodic_task", + "backend.db_report" ) @@ -165,9 +170,24 @@ "CHARSET": "utf8", "COLLATION": "utf8_general_ci", }, + }, + "report_db": { + "ENGINE": "django.db.backends.mysql", + "NAME": os.environ.get("REPORT_DB_NAME", APP_CODE), + "USER": os.environ.get("REPORT_DB_USER", "root"), + "PASSWORD": os.environ.get("REPORT_DB_PASSWORD", ""), + "HOST": os.environ.get("REPORT_DB_HOST", "127.0.0.1"), + "PORT": os.environ.get("REPORT_DB_PORT", "3306"), + "OPTIONS": {"init_command": "SET default_storage_engine=INNODB", "charset": "utf8mb4"}, + "TEST": { + "CHARSET": "utf8", + "COLLATION": "utf8_general_ci", + }, } } +DATABASE_ROUTERS = ["backend.db_report.database_router.ReportRouter"] + # Cache - 缓存后端采用redis # https://docs.djangoproject.com/en/3.2/ref/settings/#cache CACHES = { @@ -203,11 +223,16 @@ BK_IAM_INNER_HOST = env.BK_IAM_INNER_HOST BK_IAM_SYSTEM_ID = env.BK_IAM_SYSTEM_ID BK_IAM_USE_APIGATEWAY = env.BK_IAM_USE_APIGATEWAY -BK_IAM_APIGATEWAY_URL = env.BK_IAM_APIGETEWAY +BK_IAM_APIGATEWAY_URL = env.BK_IAM_APIGATEWAY BK_IAM_MIGRATION_APP_NAME = "iam_app" BK_IAM_MIGRATION_JSON_PATH = "backend/iam_app/migration_json_files" BK_IAM_RESOURCE_API_HOST = env.BK_IAM_RESOURCE_API_HOST +# BK-AUDIT 审计中心配置,见 https://github.com/TencentBlueKing/bk-audit-python-sdk/tree/master +BK_AUDIT_SETTINGS = { + "formatter": "bk_audit.contrib.django.formatters.DjangoFormatter", +} + # APIGW配置 BK_APIGW_STATIC_VERSION = env.BK_APIGW_STATIC_VERSION BK_APIGW_MANAGER_MAINTAINERS = env.BK_APIGW_MANAGER_MAINTAINERS diff --git a/dbm-ui/frontend/.eslintrc.js b/dbm-ui/frontend/.eslintrc.js index 62ce58ae0a..2be7930ce5 100644 --- a/dbm-ui/frontend/.eslintrc.js +++ b/dbm-ui/frontend/.eslintrc.js @@ -36,6 +36,7 @@ module.exports = { __RESOURCE_UNIQUE_KEY__: false, ValueOf: false, ServiceReturnType: false, + SelectItem: false, }, rules: { '@typescript-eslint/no-explicit-any': 'off', @@ -123,6 +124,8 @@ module.exports = { registeredComponentsOnly: false, ignores: [], }], + 'vue/no-setup-props-reactivity-loss': 'off', + 'vue/no-setup-props-destructure': 'off', }, }, ], diff --git a/dbm-ui/frontend/.gitignore b/dbm-ui/frontend/.gitignore index 05e0b3dec8..d8ce74d33f 100644 --- a/dbm-ui/frontend/.gitignore +++ b/dbm-ui/frontend/.gitignore @@ -30,4 +30,4 @@ public/.DS_Store *.bak *.bak.* .codecc -.vscode \ No newline at end of file +.vscode diff --git a/dbm-ui/frontend/.stylelintignore b/dbm-ui/frontend/.stylelintignore index 44bfddd62e..60e7792abc 100644 --- a/dbm-ui/frontend/.stylelintignore +++ b/dbm-ui/frontend/.stylelintignore @@ -1,3 +1,4 @@ node_modules/ dist/ -public/ \ No newline at end of file +public/ +lib/ \ No newline at end of file diff --git a/dbm-ui/frontend/lib/bk-icon/demo.html b/dbm-ui/frontend/lib/bk-icon/demo.html index b602288d00..ccac825420 100644 --- a/dbm-ui/frontend/lib/bk-icon/demo.html +++ b/dbm-ui/frontend/lib/bk-icon/demo.html @@ -149,6 +149,14 @@

funnel

+
  • + +

    copy-2

    +
  • +
  • + +

    paste

    +
  • keyboard

    @@ -233,6 +241,10 @@

    script-template

  • +
  • + +

    qiyeweixin

    +
  • sql

    @@ -809,6 +821,46 @@

    jiankong

  • +
  • + +

    mimasuijihua

    +
  • +
  • + +

    jiqiren

    +
  • +
  • + +

    qiyeweixin-2

    +
  • +
  • + +

    weixin-2

    +
  • +
  • + +

    youjian

    +
  • +
  • + +

    duanxin

    +
  • +
  • + +

    yuyin

    +
  • +
  • + +

    warn-lightning

    +
  • +
  • + +

    unlink

    +
  • +
  • + +

    mobanshili

    +
  • 为什么使用

      @@ -874,6 +926,18 @@

      如何使用

      funnel

      +
    • + + + +

      copy-2

      +
    • +
    • + + + +

      paste

      +
    • @@ -1000,6 +1064,12 @@

      如何使用

      script-template

    • +
    • + + + +

      qiyeweixin

      +
    • @@ -1864,6 +1934,66 @@

      如何使用

      jiankong

    • +
    • + + + +

      mimasuijihua

      +
    • +
    • + + + +

      jiqiren

      +
    • +
    • + + + +

      qiyeweixin-2

      +
    • +
    • + + + +

      weixin-2

      +
    • +
    • + + + +

      youjian

      +
    • +
    • + + + +

      duanxin

      +
    • +
    • + + + +

      yuyin

      +
    • +
    • + + + +

      warn-lightning

      +
    • +
    • + + + +

      unlink

      +
    • +
    • + + + +

      mobanshili

      +

    为什么使用

      diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.eot b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.eot index c6c08e7a00..49b303d348 100644 Binary files a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.eot and b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.eot differ diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg index c14f2e2ed2..fddb8750a4 100644 --- a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg +++ b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg @@ -53,6 +53,12 @@ + + + + + + @@ -116,6 +122,9 @@ + + + @@ -548,6 +557,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.ttf b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.ttf index 06b3943915..b0d39d7f43 100644 Binary files a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.ttf and b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.ttf differ diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.woff b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.woff index 95e716222b..590a1fa810 100644 Binary files a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.woff and b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.woff differ diff --git a/dbm-ui/frontend/lib/bk-icon/iconcool.js b/dbm-ui/frontend/lib/bk-icon/iconcool.js index 1805d5a91c..a2b8caa617 100644 --- a/dbm-ui/frontend/lib/bk-icon/iconcool.js +++ b/dbm-ui/frontend/lib/bk-icon/iconcool.js @@ -1,5 +1,5 @@ !(function () { - const svgCode = ''; + const svgCode = ''; if (document.body) { document.body.insertAdjacentHTML('afterbegin', svgCode); } else { diff --git a/dbm-ui/frontend/lib/bk-icon/iconcool.json b/dbm-ui/frontend/lib/bk-icon/iconcool.json index 099b8a32fe..dbd457099d 100644 --- a/dbm-ui/frontend/lib/bk-icon/iconcool.json +++ b/dbm-ui/frontend/lib/bk-icon/iconcool.json @@ -1 +1 @@ -{"iconName":"bk-dbm","icons":[{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"}]} \ No newline at end of file +{"iconName":"bk-dbm","icons":[{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"copy-2","svgCode":"","codepoint":"\\e1e4"},{"name":"paste","svgCode":"","codepoint":"\\e1e5"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"qiyeweixin","svgCode":"","codepoint":"\\e1d9"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"},{"name":"mimasuijihua","svgCode":"","codepoint":"\\e1d8"},{"name":"jiqiren","svgCode":"","codepoint":"\\e1da"},{"name":"qiyeweixin-2","svgCode":"","codepoint":"\\e1db"},{"name":"weixin-2","svgCode":"","codepoint":"\\e1dc"},{"name":"youjian","svgCode":"","codepoint":"\\e1dd"},{"name":"duanxin","svgCode":"","codepoint":"\\e1de"},{"name":"yuyin","svgCode":"","codepoint":"\\e1df"},{"name":"warn-lightning","svgCode":"","codepoint":"\\e1e1"},{"name":"unlink","svgCode":"","codepoint":"\\e1e2"},{"name":"mobanshili","svgCode":"","codepoint":"\\e1e3"}]} \ No newline at end of file diff --git a/dbm-ui/frontend/lib/bk-icon/style.css b/dbm-ui/frontend/lib/bk-icon/style.css index 749110cdb6..46207a3d0b 100644 --- a/dbm-ui/frontend/lib/bk-icon/style.css +++ b/dbm-ui/frontend/lib/bk-icon/style.css @@ -47,6 +47,12 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype"); .db-icon-funnel:before { content: "\e1bd"; } +.db-icon-copy-2:before { + content: "\e1e4"; +} +.db-icon-paste:before { + content: "\e1e5"; +} .db-icon-keyboard:before { content: "\e1ae"; } @@ -110,6 +116,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype"); .db-icon-script-template:before { content: "\e138"; } +.db-icon-qiyeweixin:before { + content: "\e1d9"; +} .db-icon-sql:before { content: "\e1cb"; } @@ -542,3 +551,33 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype"); .db-icon-jiankong:before { content: "\e1d7"; } +.db-icon-mimasuijihua:before { + content: "\e1d8"; +} +.db-icon-jiqiren:before { + content: "\e1da"; +} +.db-icon-qiyeweixin-2:before { + content: "\e1db"; +} +.db-icon-weixin-2:before { + content: "\e1dc"; +} +.db-icon-youjian:before { + content: "\e1dd"; +} +.db-icon-duanxin:before { + content: "\e1de"; +} +.db-icon-yuyin:before { + content: "\e1df"; +} +.db-icon-warn-lightning:before { + content: "\e1e1"; +} +.db-icon-unlink:before { + content: "\e1e2"; +} +.db-icon-mobanshili:before { + content: "\e1e3"; +} diff --git a/dbm-ui/frontend/package.json b/dbm-ui/frontend/package.json index be43097994..ff381b9dbc 100644 --- a/dbm-ui/frontend/package.json +++ b/dbm-ui/frontend/package.json @@ -7,6 +7,8 @@ "dev-https": "vite --https", "build": "rimraf dist && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode production", "preview": "vite preview", + "build-only": "vite build", + "type-check": "vue-tsc --noEmit", "prepare": "cd ../.. && husky install dbm-ui/frontend/.husky", "lint:lint-staged": "lint-staged", "lint:script": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx --fix", @@ -15,10 +17,10 @@ "dependencies": { "@blueking/bk-weweb": "0.0.15", "@blueking/bkflow.js": "0.1.10", - "@blueking/ip-selector": "0.0.1-beta.116", + "@blueking/ip-selector": "0.0.1-beta.126", "@vueuse/core": "10.2.1", "axios": "1.2.1", - "bkui-vue": "0.0.2-beta.35", + "bkui-vue": "0.0.2-beta.68", "date-fns": "2.28.0", "dayjs": "1.11.9", "html-to-image": "1.11.3", @@ -57,7 +59,7 @@ "eslint": "8.44.0", "eslint-config-tencent": "1.0.4", "eslint-plugin-simple-import-sort": "10.0.0", - "eslint-plugin-vue": "9.15.1", + "eslint-plugin-vue": "9.17.0", "husky": "8.0.1", "less": "4.1.2", "lint-staged": "13.1.0", diff --git a/dbm-ui/frontend/src/App.vue b/dbm-ui/frontend/src/App.vue index 9387c27b4b..ae46c5c063 100644 --- a/dbm-ui/frontend/src/App.vue +++ b/dbm-ui/frontend/src/App.vue @@ -49,7 +49,7 @@ {{ $t('数据库管理') }} + + diff --git a/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue b/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue index 6f3d4e3558..4cc8f26522 100644 --- a/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue +++ b/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue @@ -48,23 +48,18 @@ import BusinessSelector from '@components/business-selector/BusinessSelector.vue'; - const props = defineProps({ - bizId: { - type: [Number, String], - required: true, - }, - appAbbr: { - type: String, - default: '', - }, - }); + interface Emits { + (e: 'changeBiz', value: BizItem): void + (e: 'changeAppAbbr', value: string): void + } - const emits = defineEmits([ - 'update:bizId', - 'changeBiz', - 'update:appAbbr', - 'changeAppAbbr', - ]); + const emits = defineEmits(); + const bizId = defineModel('bizId', { + required: true, + }); + const appAbbr = defineModel('appAbbr', { + default: '', + }); const route = useRoute(); const { t } = useI18n(); @@ -86,7 +81,7 @@ }); const appAbbrRef = ref(); - watch(() => props.bizId, (value) => { + watch(bizId, (value) => { if (typeof value === 'number' || value === null) { state.bizId = value; } else if (value === '') { @@ -96,7 +91,7 @@ immediate: true, }); - watch(() => props.appAbbr, (value) => { + watch(appAbbr, (value) => { state.appAbbr = value; }, { immediate: true, @@ -126,7 +121,7 @@ } function handleChangeBizId(value: number) { - emits('update:bizId', value); + bizId.value = value; const info = state.bizList.find(item => value === item.bk_biz_id); if (info) { state.appAbbr = info.english_name; @@ -134,11 +129,11 @@ info.english_name && appAbbrRef.value?.clearValidate(); } state.hasEnglishName = !!info?.english_name; - emits('changeBiz', info || {}); + emits('changeBiz', info || {} as BizItem); } function handleChangeAppAbbr(value: string) { - emits('update:appAbbr', value); + appAbbr.value = value; emits('changeAppAbbr', value); } diff --git a/dbm-ui/frontend/src/components/apply-items/ClusterAlias.vue b/dbm-ui/frontend/src/components/apply-items/ClusterAlias.vue index 8059aa911a..0d654e85f1 100644 --- a/dbm-ui/frontend/src/components/apply-items/ClusterAlias.vue +++ b/dbm-ui/frontend/src/components/apply-items/ClusterAlias.vue @@ -18,6 +18,7 @@ :rules="rules"> import { useI18n } from 'vue-i18n'; + import { verifyDuplicatedClusterName } from '@services/dbbase'; + interface Props { - modelValue: string + modelValue: string, + bizId: number|'', + clusterType: string } interface Emits { (e: 'update:modelValue', value: string): void } - defineProps(); + const props = defineProps(); const emits = defineEmits(); const { t } = useI18n(); @@ -46,6 +51,20 @@ message: t('只能包含中文_英文字母_数字_连字符'), trigger: 'blur', }, + { + validator: (val: string) => { + if (!props.bizId) { + return false; + } + return verifyDuplicatedClusterName({ + name: val, + bk_biz_id: props.bizId, + cluster_type: props.clusterType, + }).then(data => !data); + }, + message: t('集群名称重复'), + trigger: 'blur', + }, ]; const handleChange = (value: string) => { diff --git a/dbm-ui/frontend/src/components/apply-items/RegionItem.vue b/dbm-ui/frontend/src/components/apply-items/RegionItem.vue index c417d05d90..acd3f64c43 100644 --- a/dbm-ui/frontend/src/components/apply-items/RegionItem.vue +++ b/dbm-ui/frontend/src/components/apply-items/RegionItem.vue @@ -50,14 +50,14 @@ import { getInfrasCities } from '@services/ticket'; import type { CitiyItem } from '@services/types/ticket'; - const props = defineProps({ - modelValue: { - type: String, - default: '', - }, - }); + interface Emits { + (e: 'change', value: string): void + } - const emits = defineEmits(['update:modelValue', 'change']); + const emits = defineEmits(); + const modelValue = defineModel({ + default: '', + }); const { t } = useI18n(); @@ -70,11 +70,11 @@ const state = reactive({ isLoading: false, regions: [] as CitiyItem[], - cityCode: props.modelValue, + cityCode: modelValue.value, }); - watch(() => props.modelValue, () => { - state.cityCode = props.modelValue; + watch(modelValue, () => { + state.cityCode = modelValue.value; }); @@ -106,7 +106,7 @@ } function handleChange(value: string) { - emits('update:modelValue', value); + modelValue.value = value; emits('change', value); } diff --git a/dbm-ui/frontend/src/components/apply-items/SpecSelector.vue b/dbm-ui/frontend/src/components/apply-items/SpecSelector.vue index 482351feac..fe9ed87a41 100644 --- a/dbm-ui/frontend/src/components/apply-items/SpecSelector.vue +++ b/dbm-ui/frontend/src/components/apply-items/SpecSelector.vue @@ -77,6 +77,7 @@ diff --git a/dbm-ui/frontend/src/components/monitor-rule-check/NumberInput.vue b/dbm-ui/frontend/src/components/monitor-rule-check/NumberInput.vue new file mode 100644 index 0000000000..885bd19ed4 --- /dev/null +++ b/dbm-ui/frontend/src/components/monitor-rule-check/NumberInput.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/dbm-ui/frontend/src/components/monitor-rule-check/index.vue b/dbm-ui/frontend/src/components/monitor-rule-check/index.vue new file mode 100644 index 0000000000..a7298fcdbd --- /dev/null +++ b/dbm-ui/frontend/src/components/monitor-rule-check/index.vue @@ -0,0 +1,242 @@ + + + + + + diff --git a/dbm-ui/frontend/src/components/more-action-extend/Index.vue b/dbm-ui/frontend/src/components/more-action-extend/Index.vue index 4971f52492..66149d6625 100644 --- a/dbm-ui/frontend/src/components/more-action-extend/Index.vue +++ b/dbm-ui/frontend/src/components/more-action-extend/Index.vue @@ -5,6 +5,7 @@ :class="{ active: isPopoverShow }" + v-bind="attrs" @click.stop="handleClick"> @@ -26,6 +27,7 @@ onBeforeUnmount, onMounted, ref, + useAttrs, } from 'vue'; let activeTippyIns:Instance; @@ -36,6 +38,8 @@ let tippyIns:Instance | undefined; + const attrs = useAttrs(); + const isPopoverShow = ref(false); const handleClick = () => { @@ -86,9 +90,10 @@ diff --git a/dbm-ui/frontend/src/components/permission/Main.vue b/dbm-ui/frontend/src/components/permission/Main.vue index be2ace97b7..b480963e7c 100644 --- a/dbm-ui/frontend/src/components/permission/Main.vue +++ b/dbm-ui/frontend/src/components/permission/Main.vue @@ -26,7 +26,6 @@ + diff --git a/dbm-ui/frontend/src/components/tools-table-common/RenderText.vue b/dbm-ui/frontend/src/components/tools-table-common/RenderText.vue index 22490fd4b5..fb3644e907 100644 --- a/dbm-ui/frontend/src/components/tools-table-common/RenderText.vue +++ b/dbm-ui/frontend/src/components/tools-table-common/RenderText.vue @@ -14,6 +14,11 @@