diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml index fbd0d26e49..625e33324a 100644 --- a/.github/workflows/admin.yml +++ b/.github/workflows/admin.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 @@ -95,7 +95,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 8edef91181..46bf271491 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -63,7 +63,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 3b56e28bbb..431a7f83cc 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -52,7 +52,7 @@ jobs: echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV echo "$HOME/gotip/bin" >> $GITHUB_PATH - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: lfs: true diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 9d44ae50e7..bcba69877d 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.branch }} diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 8fe9398359..851406bcef 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: API uses: readmeio/rdme@v8 diff --git a/.github/workflows/dockerhub-readme.yml b/.github/workflows/dockerhub-readme.yml index bb739540c3..b2f0e71574 100644 --- a/.github/workflows/dockerhub-readme.yml +++ b/.github/workflows/dockerhub-readme.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest environment: Production steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Update Docker Hub Readme for perconalab/pmm-server uses: peter-evans/dockerhub-description@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a44a430a6..5ecd013a33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/managed.yml b/.github/workflows/managed.yml index fcb0678b44..807377494b 100644 --- a/.github/workflows/managed.yml +++ b/.github/workflows/managed.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable Go build cache if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }} diff --git a/.github/workflows/qan-api2.yml b/.github/workflows/qan-api2.yml index c16b984bd2..328edd972b 100644 --- a/.github/workflows/qan-api2.yml +++ b/.github/workflows/qan-api2.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml index d04acadc5e..2acc444c22 100644 --- a/.github/workflows/sbom.yml +++ b/.github/workflows/sbom.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create SBOM for PMM uses: anchore/sbom-action@v0 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create SBOM for vmproxy uses: anchore/sbom-action@v0 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index a1ea10e660..bbe76d37df 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker Up run: docker compose up -d diff --git a/.github/workflows/vmproxy.yml b/.github/workflows/vmproxy.yml index 5bbbb6196d..ed81580f61 100644 --- a/.github/workflows/vmproxy.yml +++ b/.github/workflows/vmproxy.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/api/managementpb/checks.pb.go b/api/managementpb/checks.pb.go index ead9da805a..b86b939868 100644 --- a/api/managementpb/checks.pb.go +++ b/api/managementpb/checks.pb.go @@ -1654,7 +1654,7 @@ var file_managementpb_checks_proto_rawDesc = []byte{ 0x41, 0x4d, 0x49, 0x4c, 0x59, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x46, 0x41, 0x4d, 0x49, 0x4c, 0x59, 0x5f, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, - 0x44, 0x42, 0x10, 0x03, 0x32, 0xe8, 0x0f, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x44, 0x42, 0x10, 0x03, 0x32, 0xef, 0x0f, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x89, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, @@ -1686,111 +1686,111 @@ var file_managementpb_checks_proto_rawDesc = []byte{ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0xe7, 0x01, 0x0a, 0x10, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0xec, 0x01, 0x0a, 0x10, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, 0x92, 0x41, 0x4b, 0x12, 0x12, 0x54, 0x6f, 0x67, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x92, 0x41, 0x4d, 0x12, 0x12, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x1a, 0x35, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x55, 0x6e, 0x73, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, - 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x54, - 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, - 0x86, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2a, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, + 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x2f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, + 0x74, 0x88, 0x02, 0x01, 0x12, 0x88, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x91, 0x01, 0x92, 0x41, 0x53, 0x12, 0x1a, 0x47, 0x65, 0x74, 0x20, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x35, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, - 0x54, 0x6f, 0x6f, 0x6c, 0x27, 0x73, 0x20, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x88, 0x02, 0x01, 0x12, 0xc9, 0x02, 0x0a, 0x13, 0x53, 0x74, 0x61, + 0x12, 0x2a, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x92, 0x41, 0x55, 0x12, + 0x1a, 0x47, 0x65, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x20, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x35, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x27, 0x73, 0x20, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x88, 0x02, 0x01, 0x12, + 0xc9, 0x02, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x12, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xe0, 0x01, 0x92, 0x41, 0xae, 0x01, 0x12, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, - 0x94, 0x01, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x2e, - 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x69, 0x66, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x6e, 0x27, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, - 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x12, 0xdb, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe0, 0x01, 0x92, 0x41, 0xae, 0x01, 0x12, + 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x94, 0x01, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, + 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x77, 0x69, 0x6c, + 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x69, 0x66, 0x20, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x6e, + 0x27, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0xdb, 0x01, 0x0a, 0x12, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x92, 0x41, 0x46, 0x12, - 0x13, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x2f, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, - 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, - 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, - 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6c, 0x92, 0x41, 0x42, 0x12, 0x0d, 0x4c, 0x69, 0x73, - 0x74, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x1a, 0x31, 0x52, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x64, - 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x2f, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x88, 0x02, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x27, 0x2e, + 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x76, 0x92, 0x41, 0x46, 0x12, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, + 0x69, 0x73, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x2f, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, + 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, + 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, + 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6c, 0x92, + 0x41, 0x42, 0x12, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x73, 0x1a, 0x31, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, 0x64, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x88, 0x02, 0x0a, 0x14, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x9c, 0x01, 0x92, 0x41, 0x6a, 0x12, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x50, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, - 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x72, 0x20, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x62, 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, - 0x8e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x42, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, - 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, - 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9c, 0x01, 0x92, 0x41, 0x6a, 0x12, 0x16, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x50, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2f, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x62, 0x79, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, + 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, + 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/managementpb/checks.proto b/api/managementpb/checks.proto index 91bf8e0743..e2d9f82add 100644 --- a/api/managementpb/checks.proto +++ b/api/managementpb/checks.proto @@ -204,6 +204,7 @@ service SecurityChecks { } // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". rpc ToggleCheckAlert(ToggleCheckAlertRequest) returns (ToggleCheckAlertResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/management/SecurityChecks/ToggleCheckAlert" body: "*" @@ -211,6 +212,7 @@ service SecurityChecks { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Toggle Check Alert" description: "Silence/Unsilence alerts for a specific check result." + deprecated: true }; } // GetSecurityCheckResults returns Security Thread Tool's latest checks results. @@ -223,6 +225,7 @@ service SecurityChecks { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Get Security Check Results" description: "Returns Security Thread Tool's latest checks results." + deprecated: true }; } // StartSecurityChecks executes Security Thread Tool checks and returns when all checks are executed. diff --git a/api/managementpb/checks_grpc.pb.go b/api/managementpb/checks_grpc.pb.go index bfa8496cd4..0408efe0a2 100644 --- a/api/managementpb/checks_grpc.pb.go +++ b/api/managementpb/checks_grpc.pb.go @@ -38,6 +38,7 @@ type SecurityChecksClient interface { ListFailedServices(ctx context.Context, in *ListFailedServicesRequest, opts ...grpc.CallOption) (*ListFailedServicesResponse, error) // GetFailedChecks returns the checks result for a given service. GetFailedChecks(ctx context.Context, in *GetFailedChecksRequest, opts ...grpc.CallOption) (*GetFailedChecksResponse, error) + // Deprecated: Do not use. // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". ToggleCheckAlert(ctx context.Context, in *ToggleCheckAlertRequest, opts ...grpc.CallOption) (*ToggleCheckAlertResponse, error) // Deprecated: Do not use. @@ -79,6 +80,7 @@ func (c *securityChecksClient) GetFailedChecks(ctx context.Context, in *GetFaile return out, nil } +// Deprecated: Do not use. func (c *securityChecksClient) ToggleCheckAlert(ctx context.Context, in *ToggleCheckAlertRequest, opts ...grpc.CallOption) (*ToggleCheckAlertResponse, error) { out := new(ToggleCheckAlertResponse) err := c.cc.Invoke(ctx, SecurityChecks_ToggleCheckAlert_FullMethodName, in, out, opts...) @@ -142,6 +144,7 @@ type SecurityChecksServer interface { ListFailedServices(context.Context, *ListFailedServicesRequest) (*ListFailedServicesResponse, error) // GetFailedChecks returns the checks result for a given service. GetFailedChecks(context.Context, *GetFailedChecksRequest) (*GetFailedChecksResponse, error) + // Deprecated: Do not use. // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". ToggleCheckAlert(context.Context, *ToggleCheckAlertRequest) (*ToggleCheckAlertResponse, error) // Deprecated: Do not use. diff --git a/api/managementpb/json/managementpb.json b/api/managementpb/json/managementpb.json index 906290de9f..b5c9de7585 100644 --- a/api/managementpb/json/managementpb.json +++ b/api/managementpb/json/managementpb.json @@ -6365,6 +6365,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -6788,6 +6789,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index bd44fe8f09..8801f4cba5 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -29902,6 +29902,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -30325,6 +30326,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 48d466adff..f1e0ccb21b 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -20529,6 +20529,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -20952,6 +20953,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", diff --git a/build/packages/rpm/server/SPECS/victoriametrics.spec b/build/packages/rpm/server/SPECS/victoriametrics.spec index 8a7eada6dc..7b13cd2f3e 100644 --- a/build/packages/rpm/server/SPECS/victoriametrics.spec +++ b/build/packages/rpm/server/SPECS/victoriametrics.spec @@ -13,7 +13,7 @@ Name: percona-victoriametrics Version: 1.93.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: VictoriaMetrics monitoring solution and time series database License: Apache-2.0 URL: https://%{provider} @@ -50,7 +50,7 @@ install -D -p -m 0755 ./bin/vmalert-pure %{buildroot}%{_sbindir}/vmalert %changelog -* Tue Dec 15 2020 Nurlan Moldomurov - 1.93.1-1 +* Fri Sep 1 2023 Nurlan Moldomurov - 1.93.1-2 - upgrade victoriametrics to 1.93.1 release * Wed Mar 29 2023 Alexey Mukas - 1.89.1 diff --git a/cli-tests/package-lock.json b/cli-tests/package-lock.json index f182e3dba8..9267c6d8e2 100644 --- a/cli-tests/package-lock.json +++ b/cli-tests/package-lock.json @@ -20,13 +20,13 @@ "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^6.4.0", - "@typescript-eslint/parser": "^6.4.0", - "eslint": "8.47", + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", + "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.0", - "eslint-plugin-playwright": "^0.15.2" + "eslint-plugin-playwright": "^0.16.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -86,9 +86,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -245,9 +245,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", "dev": true }, "node_modules/@types/shelljs": { @@ -261,16 +261,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", - "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.6.0.tgz", + "integrity": "sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/type-utils": "6.4.0", - "@typescript-eslint/utils": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0", + "@typescript-eslint/scope-manager": "6.6.0", + "@typescript-eslint/type-utils": "6.6.0", + "@typescript-eslint/utils": "6.6.0", + "@typescript-eslint/visitor-keys": "6.6.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -296,15 +296,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", - "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz", + "integrity": "sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/typescript-estree": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0", + "@typescript-eslint/scope-manager": "6.6.0", + "@typescript-eslint/types": "6.6.0", + "@typescript-eslint/typescript-estree": "6.6.0", + "@typescript-eslint/visitor-keys": "6.6.0", "debug": "^4.3.4" }, "engines": { @@ -324,13 +324,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.0.tgz", - "integrity": "sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz", + "integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0" + "@typescript-eslint/types": "6.6.0", + "@typescript-eslint/visitor-keys": "6.6.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -341,13 +341,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", - "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.6.0.tgz", + "integrity": "sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.4.0", - "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/typescript-estree": "6.6.0", + "@typescript-eslint/utils": "6.6.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -368,9 +368,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", - "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz", + "integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -381,13 +381,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", - "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz", + "integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0", + "@typescript-eslint/types": "6.6.0", + "@typescript-eslint/visitor-keys": "6.6.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -408,17 +408,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", - "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.6.0.tgz", + "integrity": "sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/scope-manager": "6.6.0", + "@typescript-eslint/types": "6.6.0", + "@typescript-eslint/typescript-estree": "6.6.0", "semver": "^7.5.4" }, "engines": { @@ -433,12 +433,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.0.tgz", - "integrity": "sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz", + "integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/types": "6.6.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -936,15 +936,15 @@ } }, "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1141,9 +1141,9 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.15.2.tgz", - "integrity": "sha512-Q2jQ7ORjZscvwxR6MEgITZy23vxlnYlJlMR7aICFczWVMijTCZPGvvMoZaLWkAzx5J6fciulwbg+JJeRjMkTig==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.16.0.tgz", + "integrity": "sha512-DcHpF0SLbNeh9MT4pMzUGuUSnJ7q5MWbP8sSEFIMS6j7Ggnduq8ghNlfhURgty4c1YFny7Ge9xYTO1FSAoV2Vw==", "dev": true, "peerDependencies": { "eslint": ">=7", diff --git a/cli-tests/package.json b/cli-tests/package.json index c9e74264ce..a77f03f8a2 100644 --- a/cli-tests/package.json +++ b/cli-tests/package.json @@ -24,12 +24,12 @@ "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^6.4.0", - "@typescript-eslint/parser": "^6.4.0", - "eslint": "8.47", + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", + "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.0", - "eslint-plugin-playwright": "^0.15.2" + "eslint-plugin-playwright": "^0.16.0" } } diff --git a/go.mod b/go.mod index 21ac12e230..aa0ce786d5 100644 --- a/go.mod +++ b/go.mod @@ -23,11 +23,11 @@ require ( github.com/alecthomas/kong v0.8.0 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 - github.com/aws/aws-sdk-go v1.44.317 + github.com/aws/aws-sdk-go v1.45.2 github.com/blang/semver v3.5.1+incompatible github.com/brianvoe/gofakeit/v6 v6.23.0 - github.com/charmbracelet/bubbles v0.15.0 - github.com/charmbracelet/bubbletea v0.24.0 + github.com/charmbracelet/bubbles v0.16.1 + github.com/charmbracelet/bubbletea v0.24.1 github.com/charmbracelet/lipgloss v0.8.0 github.com/davecgh/go-spew v1.1.1 github.com/docker/docker v23.0.4+incompatible @@ -76,8 +76,8 @@ require ( go.starlark.net v0.0.0-20230717150657-8a3343210976 golang.org/x/crypto v0.12.0 golang.org/x/sync v0.3.0 - golang.org/x/sys v0.11.0 - golang.org/x/text v0.12.0 + golang.org/x/sys v0.12.0 + golang.org/x/text v0.13.0 golang.org/x/tools v0.12.0 google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d diff --git a/go.sum b/go.sum index 24fc2ef5b6..ae7441fedc 100644 --- a/go.sum +++ b/go.sum @@ -113,14 +113,12 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= 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/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.7/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.317 h1:+8XWrLmGMwPPXSRSLPzhgcGnzJ2mYkgkrcB9C/GnSOU= -github.com/aws/aws-sdk-go v1.44.317/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= +github.com/aws/aws-sdk-go v1.45.2 h1:hTong9YUklQKqzrGk3WnKABReb5R8GjbG4Y6dEQfjnk= +github.com/aws/aws-sdk-go v1.45.2/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -147,14 +145,12 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.1.1/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/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= -github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= -github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= -github.com/charmbracelet/bubbletea v0.24.0 h1:l8PHrft/GIeikDPCUhQe53AJrDD8xGSn0Agirh8xbe8= -github.com/charmbracelet/bubbletea v0.24.0/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= +github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= +github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= +github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc= +github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/charmbracelet/lipgloss v0.8.0 h1:IS00fk4XAHcf8uZKc3eHeMUTCxUH6NkaTrdyCQk84RU= github.com/charmbracelet/lipgloss v0.8.0/go.mod h1:p4eYUZZJ/0oXTuCQKFF8mqyKCz0ja6y+7DniDDw5KKU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -167,7 +163,6 @@ github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY 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/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -527,16 +522,12 @@ github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/ 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.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.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 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-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -586,11 +577,8 @@ github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTd github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= -github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= @@ -721,7 +709,6 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= @@ -973,17 +960,15 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/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-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/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-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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/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.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -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.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1002,8 +987,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -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/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= diff --git a/managed/cmd/pmm-managed-starlark/main.go b/managed/cmd/pmm-managed-starlark/main.go index bf55e01577..8247879f6d 100644 --- a/managed/cmd/pmm-managed-starlark/main.go +++ b/managed/cmd/pmm-managed-starlark/main.go @@ -129,13 +129,13 @@ func runChecks(l *logrus.Entry, data *checks.StarlarkScriptData) ([]check.Result if !ok { return nil, errors.Errorf("unexpected query result type: %T", dbQr) } - if dbRes[dbName], err = unmarshallQueryResult(s); err != nil { + if dbRes[dbName], err = unmarshalQueryResult(s); err != nil { return nil, err } } res[i] = dbRes case string: // used for all other databases - if res[i], err = unmarshallQueryResult(qr); err != nil { + if res[i], err = unmarshalQueryResult(qr); err != nil { return nil, err } default: @@ -158,7 +158,7 @@ func runChecks(l *logrus.Entry, data *checks.StarlarkScriptData) ([]check.Result return results, nil } -func unmarshallQueryResult(qr string) ([]map[string]any, error) { +func unmarshalQueryResult(qr string) ([]map[string]any, error) { b, err := base64.StdEncoding.DecodeString(qr) if err != nil { return nil, errors.Wrap(err, "failed to decode base64 encoded query result") diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index bc15c61f60..a27c774228 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -912,8 +912,7 @@ func main() { //nolint:cyclop,maintidx l.Fatalf("Could not create Clickhouse client: %s", err) } - checksService := checks.New(db, platformClient, actionsService, alertManager, v1.NewAPI(vmClient), clickhouseClient) - + checksService := checks.New(db, platformClient, actionsService, v1.NewAPI(vmClient), clickhouseClient) prom.MustRegister(checksService) // Integrated alerts services diff --git a/managed/services/checks/checks.go b/managed/services/checks/checks.go index 1d14bedb8b..f0c4c34360 100644 --- a/managed/services/checks/checks.go +++ b/managed/services/checks/checks.go @@ -33,7 +33,6 @@ import ( "time" "github.com/percona-platform/saas/pkg/check" - "github.com/percona-platform/saas/pkg/common" "github.com/pkg/errors" v1 "github.com/prometheus/client_golang/api/prometheus/v1" prom "github.com/prometheus/client_golang/prometheus" @@ -58,7 +57,6 @@ const ( // Environment variables that affect checks service; only for testing. envCheckFile = "PERCONA_TEST_CHECKS_FILE" - envResendInterval = "PERCONA_TEST_CHECKS_RESEND_INTERVAL" envDisableStartDelay = "PERCONA_TEST_CHECKS_DISABLE_START_DELAY" checkExecutionTimeout = 5 * time.Minute // limits execution time for every single check @@ -67,14 +65,9 @@ const ( scriptExecutionTimeout = 5 * time.Second // time limit for running pmm-managed-starlark resultCheckInterval = time.Second - // Sync with API tests. - resolveTimeoutFactor = 3 - defaultResendInterval = 2 * time.Second - prometheusNamespace = "pmm_managed" prometheusSubsystem = "advisor" - alertsPrefix = "/stt/" maxSupportedVersion = 2 ) @@ -91,17 +84,15 @@ var ( // Service is responsible for interactions with Percona Check service. type Service struct { - platformClient *platform.Client - agentsRegistry agentsRegistry - alertmanagerService alertmanagerService - db *reform.DB - alertsRegistry *registry - vmClient v1.API - clickhouseDB *sql.DB + platformClient *platform.Client + agentsRegistry agentsRegistry + db *reform.DB + alertsRegistry *registry + vmClient v1.API + clickhouseDB *sql.DB l *logrus.Entry startDelay time.Duration - resendInterval time.Duration platformPublicKeys []string localChecksFile string // For testing @@ -131,18 +122,11 @@ func New( db *reform.DB, platformClient *platform.Client, agentsRegistry agentsRegistry, - alertmanagerService alertmanagerService, vmClient v1.API, clickhouseDB *sql.DB, ) *Service { l := logrus.WithField("component", "checks") - resendInterval := defaultResendInterval - if d, err := time.ParseDuration(os.Getenv(envResendInterval)); err == nil && d > 0 { - l.Warnf("Interval changed to %s.", d) - resendInterval = d - } - var platformPublicKeys []string if k := envvars.GetPlatformPublicKeys(); k != nil { l.Warnf("Percona Platform public keys changed to %q.", k) @@ -150,17 +134,15 @@ func New( } s := &Service{ - db: db, - agentsRegistry: agentsRegistry, - alertmanagerService: alertmanagerService, - alertsRegistry: newRegistry(resolveTimeoutFactor * resendInterval), - vmClient: vmClient, - clickhouseDB: clickhouseDB, + db: db, + agentsRegistry: agentsRegistry, + alertsRegistry: newRegistry(), + vmClient: vmClient, + clickhouseDB: clickhouseDB, l: l, platformClient: platformClient, startDelay: defaultStartDelay, - resendInterval: resendInterval, platformPublicKeys: platformPublicKeys, localChecksFile: os.Getenv(envCheckFile), @@ -226,12 +208,6 @@ func (s *Service) Run(ctx context.Context) { var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - s.resendAlerts(ctx) - }() - wg.Add(1) go func() { defer wg.Done() @@ -241,23 +217,6 @@ func (s *Service) Run(ctx context.Context) { wg.Wait() } -// resendAlerts resends collected alerts until ctx is canceled. -func (s *Service) resendAlerts(ctx context.Context) { - t := time.NewTicker(s.resendInterval) - defer t.Stop() - - for { - s.alertmanagerService.SendAlerts(ctx, s.alertsRegistry.collect()) - - select { - case <-ctx.Done(): - return - case <-t.C: - // nothing, continue for loop - } - } -} - // runChecksLoop starts checks execution loop. func (s *Service) runChecksLoop(ctx context.Context) { // First checks run, start all checks from all groups. @@ -298,11 +257,11 @@ func (s *Service) GetSecurityCheckResults() ([]services.CheckResult, error) { return nil, services.ErrAdvisorsDisabled } - return s.alertsRegistry.getCheckResults(), nil + return s.alertsRegistry.getCheckResults(""), nil } // GetChecksResults returns the failed checks for a given service from AlertManager. -func (s *Service) GetChecksResults(ctx context.Context, serviceID string) ([]services.CheckResult, error) { +func (s *Service) GetChecksResults(_ context.Context, serviceID string) ([]services.CheckResult, error) { settings, err := models.GetSettings(s.db) if err != nil { return nil, err @@ -312,59 +271,7 @@ func (s *Service) GetChecksResults(ctx context.Context, serviceID string) ([]ser return nil, services.ErrAdvisorsDisabled } - filters := &services.FilterParams{ - IsCheck: true, - ServiceID: serviceID, - } - res, err := s.alertmanagerService.GetAlerts(ctx, filters) - if err != nil { - return nil, err - } - - checkResults := make([]services.CheckResult, 0, len(res)) - for _, alert := range res { - checkResults = append(checkResults, services.CheckResult{ - CheckName: alert.Labels[model.AlertNameLabel], - Silenced: len(alert.Status.SilencedBy) != 0, - AlertID: alert.Labels["alert_id"], - Interval: check.Interval(alert.Labels["interval_group"]), - Target: services.Target{ - AgentID: alert.Labels["agent_id"], - ServiceID: alert.Labels["service_id"], - ServiceName: alert.Labels["service_name"], - NodeName: alert.Labels["node_name"], - Labels: alert.Labels, - }, - Result: check.Result{ - Summary: alert.Annotations["summary"], - Description: alert.Annotations["description"], - ReadMoreURL: alert.Annotations["read_more_url"], - Severity: common.ParseSeverity(alert.Labels["severity"]), - Labels: alert.Labels, - }, - }) - } - return checkResults, nil -} - -// ToggleCheckAlert toggles the silence state of the check with the provided alertID. -func (s *Service) ToggleCheckAlert(ctx context.Context, alertID string, silence bool) error { - filters := &services.FilterParams{ - IsCheck: true, - AlertID: alertID, - } - res, err := s.alertmanagerService.GetAlerts(ctx, filters) - if err != nil { - return errors.Wrapf(err, "failed to get alerts with id: %s", alertID) - } - - if silence { - err = s.alertmanagerService.SilenceAlerts(ctx, res) - } else { - err = s.alertmanagerService.UnsilenceAlerts(ctx, res) - } - - return err + return s.alertsRegistry.getCheckResults(serviceID), nil } // runChecksGroup downloads and executes Advisors checks that should run in the interval specified by intervalGroup. @@ -411,11 +318,24 @@ func (s *Service) run(ctx context.Context, intervalGroup check.Interval, checkNa return errors.WithStack(err) } - if err := s.executeChecks(ctx, intervalGroup, checkNames); err != nil { + res, err := s.executeChecks(ctx, intervalGroup, checkNames) + if err != nil { return errors.WithStack(err) } - s.alertmanagerService.SendAlerts(ctx, s.alertsRegistry.collect()) + switch { + case len(checkNames) != 0: + // If we run some specific checks, delete previous results for them. + s.alertsRegistry.deleteByName(checkNames) + case intervalGroup != "": + // If we run whole interval group, delete previous results for that group. + s.alertsRegistry.deleteByInterval(intervalGroup) + default: + // If we run all checks, delete all previous results. + s.alertsRegistry.cleanup() + } + + s.alertsRegistry.set(res) return nil } @@ -706,46 +626,32 @@ func (s *Service) filterChecks(checks map[string]check.Check, group check.Interv // executeChecks runs checks for all reachable services. If intervalGroup specified only checks from that group will be // executed. If checkNames specified then only matched checks will be executed. -func (s *Service) executeChecks(ctx context.Context, intervalGroup check.Interval, checkNames []string) error { +func (s *Service) executeChecks(ctx context.Context, intervalGroup check.Interval, checkNames []string) ([]services.CheckResult, error) { disabledChecks, err := s.GetDisabledChecks() if err != nil { - return errors.WithStack(err) + return nil, errors.WithStack(err) } - var checkResults []services.CheckResult + var res []services.CheckResult checks, err := s.GetChecks() if err != nil { - return errors.WithStack(err) + return nil, errors.WithStack(err) } mySQLChecks, postgreSQLChecks, mongoDBChecks := groupChecksByDB(s.l, checks) mySQLChecks = s.filterChecks(mySQLChecks, intervalGroup, disabledChecks, checkNames) mySQLCheckResults := s.executeChecksForTargetType(ctx, models.MySQLServiceType, mySQLChecks) - checkResults = append(checkResults, mySQLCheckResults...) + res = append(res, mySQLCheckResults...) postgreSQLChecks = s.filterChecks(postgreSQLChecks, intervalGroup, disabledChecks, checkNames) postgreSQLCheckResults := s.executeChecksForTargetType(ctx, models.PostgreSQLServiceType, postgreSQLChecks) - checkResults = append(checkResults, postgreSQLCheckResults...) + res = append(res, postgreSQLCheckResults...) mongoDBChecks = s.filterChecks(mongoDBChecks, intervalGroup, disabledChecks, checkNames) mongoDBCheckResults := s.executeChecksForTargetType(ctx, models.MongoDBServiceType, mongoDBChecks) - checkResults = append(checkResults, mongoDBCheckResults...) - - switch { - case len(checkNames) != 0: - // If we run some specific checks, delete previous results for them. - s.alertsRegistry.deleteByName(checkNames) - case intervalGroup != "": - // If we run whole interval group, delete previous results for that group. - s.alertsRegistry.deleteByInterval(intervalGroup) - default: - // If we run all checks, delete all previous results. - s.alertsRegistry.cleanup() - } - - s.alertsRegistry.set(checkResults) + res = append(res, mongoDBCheckResults...) - return nil + return res, nil } func (s *Service) executeChecksForTargetType(ctx context.Context, serviceType models.ServiceType, checks map[string]check.Check) []services.CheckResult { @@ -767,8 +673,10 @@ func (s *Service) executeChecksForTargetType(ctx context.Context, serviceType mo s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "error").Inc() continue } - s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "ok").Inc() + res = append(res, results...) + + s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "ok").Inc() } } diff --git a/managed/services/checks/checks_test.go b/managed/services/checks/checks_test.go index 1eba59211c..2d89d9ddbe 100644 --- a/managed/services/checks/checks_test.go +++ b/managed/services/checks/checks_test.go @@ -28,15 +28,12 @@ import ( "github.com/percona-platform/saas/pkg/common" metrics "github.com/prometheus/client_golang/api" v1 "github.com/prometheus/client_golang/api/prometheus/v1" - "github.com/prometheus/common/model" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/postgresql" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" "github.com/percona/pmm/managed/utils/platform" @@ -72,7 +69,7 @@ func TestDownloadAdvisors(t *testing.T) { platformClient, err := platform.NewClient(db, devPlatformAddress) require.NoError(t, err) - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.platformPublicKeys = []string{devPlatformPublicKey} require.NoError(t, err) @@ -121,7 +118,7 @@ func TestDownloadAdvisors(t *testing.T) { } func TestLoadLocalChecks(t *testing.T) { - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) checks, err := s.loadLocalChecks(testChecksFile) require.NoError(t, err) @@ -167,7 +164,7 @@ func TestCollectAdvisors(t *testing.T) { require.NoError(t, err) t.Run("collect local checks", func(t *testing.T) { - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -198,7 +195,7 @@ func TestCollectAdvisors(t *testing.T) { }) t.Run("download checks", func(t *testing.T) { - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.platformPublicKeys = []string{devPlatformPublicKey} s.CollectAdvisors(context.Background()) @@ -231,7 +228,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -260,7 +257,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -292,7 +289,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -315,7 +312,7 @@ func TestEnableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -341,8 +338,6 @@ func TestEnableChecks(t *testing.T) { func TestChangeInterval(t *testing.T) { t.Run("normal", func(t *testing.T) { - var ams mockAlertmanagerService - ams.On("SendAlerts", mock.Anything, mock.Anything).Return() sqlDB := testdb.Open(t, models.SkipFixtures, nil) t.Cleanup(func() { require.NoError(t, sqlDB.Close()) @@ -350,7 +345,7 @@ func TestChangeInterval(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -395,7 +390,7 @@ func TestGetSecurityCheckResults(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) t.Run("STT enabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) results, err := s.GetSecurityCheckResults() assert.Empty(t, results) @@ -403,7 +398,7 @@ func TestGetSecurityCheckResults(t *testing.T) { }) t.Run("STT disabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -428,7 +423,7 @@ func TestStartChecks(t *testing.T) { setupClients(t) t.Run("unknown interval", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile err := s.runChecksGroup(context.Background(), check.Interval("unknown")) @@ -436,10 +431,7 @@ func TestStartChecks(t *testing.T) { }) t.Run("stt enabled", func(t *testing.T) { - var ams mockAlertmanagerService - ams.On("SendAlerts", mock.Anything, mock.Anything).Return() - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -451,7 +443,7 @@ func TestStartChecks(t *testing.T) { }) t.Run("stt disabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -541,7 +533,7 @@ func TestFilterChecks(t *testing.T) { partiallyValidAdvisor.Checks = partiallyValidAdvisor.Checks[0:1] // remove invalid check expected := append(valid, partiallyValidAdvisor) //nolint:gocritic - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) actual := s.filterSupportedChecks(checks) assert.ElementsMatch(t, expected, actual) } @@ -566,7 +558,7 @@ func TestMinPMMAgents(t *testing.T) { {name: "PostgreSQL Family", minVersion: pmmAgent2_6_0, check: check.Check{Version: 2, Queries: []check.Query{{Type: check.PostgreSQLShow}, {Type: check.PostgreSQLSelect}}}}, } - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) for _, test := range tests { test := test @@ -627,7 +619,7 @@ func TestFindTargets(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) t.Run("unknown service", func(t *testing.T) { t.Parallel() @@ -680,7 +672,7 @@ func TestFindTargets(t *testing.T) { func TestFilterChecksByInterval(t *testing.T) { t.Parallel() - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) rareCheck := check.Check{Name: "rareCheck", Interval: check.Rare} standardCheck := check.Check{Name: "standardCheck", Interval: check.Standard} @@ -713,11 +705,7 @@ func TestGetFailedChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) t.Run("no failed check for service", func(t *testing.T) { - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{}, nil) - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) results, err := s.GetChecksResults(context.Background(), "test_svc") assert.Empty(t, results) @@ -725,65 +713,112 @@ func TestGetFailedChecks(t *testing.T) { }) t.Run("non empty failed checks", func(t *testing.T) { - alertLabels := map[string]string{ - model.AlertNameLabel: "test_check", - "alert_id": "test_alert", - "service_name": "test_svc", - "service_id": "/service_id/test_svc1", - "interval_group": "frequent", - "severity": common.Severity(4).String(), - } - - testAlert := ammodels.GettableAlert{ - Annotations: map[string]string{ - "summary": "Check summary", - "description": "Check description", - "read_more_url": "https://www.example.com", + checkResults := []services.CheckResult{ + { + CheckName: "test_check", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc1", + ServiceID: "/service_id/test_svc1", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, }, - Alert: ammodels.Alert{ - Labels: alertLabels, + { + CheckName: "test_check2", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc2", + ServiceID: "/service_id/test_svc2", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, }, - Status: &ammodels.AlertStatus{}, } - results := []services.CheckResult{ + s := New(db, nil, nil, vmClient, clickhouseDB) + s.alertsRegistry.set(checkResults) + + response, err := s.GetChecksResults(context.Background(), "") + require.NoError(t, err) + assert.ElementsMatch(t, checkResults, response) + }) + + t.Run("non empty failed checks for specific service", func(t *testing.T) { + checkResults := []services.CheckResult{ { CheckName: "test_check", - AlertID: "test_alert", - Silenced: false, Interval: check.Frequent, Target: services.Target{ - ServiceName: "test_svc", + ServiceName: "test_svc1", ServiceID: "/service_id/test_svc1", - Labels: alertLabels, + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, }, Result: check.Result{ Summary: "Check summary", Description: "Check description", ReadMoreURL: "https://www.example.com", Severity: common.Error, - Labels: alertLabels, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, + }, + { + CheckName: "test_check2", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc2", + ServiceID: "/service_id/test_svc2", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, }, }, } - ams := mockAlertmanagerService{} - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{&testAlert}, nil) - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) + s.alertsRegistry.set(checkResults) - response, err := s.GetChecksResults(ctx, "test_svc") + response, err := s.GetChecksResults(context.Background(), "/service_id/test_svc1") require.NoError(t, err) - assert.Equal(t, results, response) + require.Len(t, response, 1) + assert.Equal(t, checkResults[0], response[0]) }) t.Run("STT disabled", func(t *testing.T) { - ams := mockAlertmanagerService{} - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return(nil, services.ErrAdvisorsDisabled) - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -792,66 +827,12 @@ func TestGetFailedChecks(t *testing.T) { err = models.SaveSettings(db, settings) require.NoError(t, err) - results, err := s.GetChecksResults(ctx, "test_svc") + results, err := s.GetChecksResults(context.Background(), "test_svc") assert.Nil(t, results) assert.ErrorIs(t, err, services.ErrAdvisorsDisabled) }) } -func TestToggleCheckAlert(t *testing.T) { - t.Parallel() - - t.Run("silence alert", func(t *testing.T) { - t.Parallel() - - testAlert := &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "test_alert_1", - }, - }, - Status: &ammodels.AlertStatus{}, - } - - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{testAlert}, nil) - ams.On("SilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}).Return(nil) - - s := New(nil, nil, nil, &ams, vmClient, clickhouseDB) - - active := len(testAlert.Status.SilencedBy) == 0 - err := s.ToggleCheckAlert(ctx, "test_alert_1", active) - require.NoError(t, err) - ams.AssertCalled(t, "SilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}) - }) - - t.Run("unsilence alert", func(t *testing.T) { - t.Parallel() - - testAlert := &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "test_alert_2", - }, - }, - Status: &ammodels.AlertStatus{SilencedBy: []string{"test_silence"}}, - } - - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{testAlert}, nil) - ams.On("UnsilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}).Return(nil) - - s := New(nil, nil, nil, &ams, vmClient, clickhouseDB) - - active := len(testAlert.Status.SilencedBy) == 0 - err := s.ToggleCheckAlert(ctx, "test_alert_1", active) - require.NoError(t, err) - ams.AssertCalled(t, "UnsilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}) - }) -} - func TestFillQueryPlaceholders(t *testing.T) { t.Parallel() diff --git a/managed/services/checks/deps.go b/managed/services/checks/deps.go index d4b3feeccb..267d69b5f5 100644 --- a/managed/services/checks/deps.go +++ b/managed/services/checks/deps.go @@ -18,13 +18,10 @@ package checks import ( "context" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services" ) //go:generate ../../../bin/mockery --name=agentsRegistry --case=snake --inpackage --testonly -//go:generate ../../../bin/mockery --name=alertmanagerService --case=snake --inpackage --testonly // agentsRegistry is a subset of methods of agents.Registry used by this package. // We use it instead of real type for testing and to avoid dependency cycle. @@ -39,12 +36,3 @@ type agentsRegistry interface { StartMongoDBQueryReplSetGetStatusAction(ctx context.Context, id, pmmAgentID, dsn string, files map[string]string, tdp *models.DelimiterPair) error StartMongoDBQueryGetDiagnosticDataAction(ctx context.Context, id, pmmAgentID, dsn string, files map[string]string, tdp *models.DelimiterPair) error } - -// alertmanagerService is a subset of methods of alertmanager.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type alertmanagerService interface { - SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts) - SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) -} diff --git a/managed/services/checks/mock_alertmanager_service_test.go b/managed/services/checks/mock_alertmanager_service_test.go deleted file mode 100644 index 4877388dc3..0000000000 --- a/managed/services/checks/mock_alertmanager_service_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package checks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - ammodels "github.com/percona/pmm/api/alertmanager/ammodels" - services "github.com/percona/pmm/managed/services" -) - -// mockAlertmanagerService is an autogenerated mock type for the alertmanagerService type -type mockAlertmanagerService struct { - mock.Mock -} - -// GetAlerts provides a mock function with given fields: ctx, params -func (_m *mockAlertmanagerService) GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params) - - var r0 []*ammodels.GettableAlert - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) ([]*ammodels.GettableAlert, error)); ok { - return rf(ctx, params) - } - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { - r1 = rf(ctx, params) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SendAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts) { - _m.Called(ctx, alerts) -} - -// SilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnsilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// newMockAlertmanagerService creates a new instance of mockAlertmanagerService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockAlertmanagerService(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockAlertmanagerService { - mock := &mockAlertmanagerService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/checks/registry.go b/managed/services/checks/registry.go index b357de660a..2be7d5c706 100644 --- a/managed/services/checks/registry.go +++ b/managed/services/checks/registry.go @@ -16,18 +16,11 @@ package checks import ( - "crypto/sha1" //nolint:gosec - "encoding/hex" - "fmt" "sync" - "time" - "github.com/go-openapi/strfmt" "github.com/percona-platform/saas/pkg/check" prom "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/model" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/services" ) @@ -36,20 +29,13 @@ type registry struct { rw sync.RWMutex // Results stored grouped by interval and by check name. It allows us to remove results for specific group. checkResults map[check.Interval]map[string][]services.CheckResult - - alertTTL time.Duration - nowF func() time.Time // for tests - - mInsights *prom.GaugeVec + mInsights *prom.GaugeVec } // newRegistry creates a new registry. -func newRegistry(alertTTL time.Duration) *registry { +func newRegistry() *registry { return ®istry{ checkResults: make(map[check.Interval]map[string][]services.CheckResult), - alertTTL: alertTTL, - nowF: time.Now, - mInsights: prom.NewGaugeVec(prom.GaugeOpts{ Namespace: prometheusNamespace, Subsystem: prometheusSubsystem, @@ -105,70 +91,25 @@ func (r *registry) cleanup() { r.checkResults = make(map[check.Interval]map[string][]services.CheckResult) } -// collect returns a slice of alerts created from the stored check results. -func (r *registry) collect() ammodels.PostableAlerts { +// getCheckResults returns checks results for the given service. If serviceID is empty it returns results for all services. +func (r *registry) getCheckResults(serviceID string) []services.CheckResult { r.rw.RLock() defer r.rw.RUnlock() - var alerts ammodels.PostableAlerts + var results []services.CheckResult for _, intervalGroup := range r.checkResults { for _, checkNameGroup := range intervalGroup { for _, checkResult := range checkNameGroup { - checkResult := checkResult - alerts = append(alerts, r.createAlert(&checkResult)) + if serviceID == "" || checkResult.Target.ServiceID == serviceID { + results = append(results, checkResult) + } } } } - return alerts -} - -func (r *registry) getCheckResults() []services.CheckResult { - r.rw.RLock() - defer r.rw.RUnlock() - - var results []services.CheckResult - for _, intervalGroup := range r.checkResults { - for _, checkNameGroup := range intervalGroup { - results = append(results, checkNameGroup...) - } - } return results } -func (r *registry) createAlert(checkResult *services.CheckResult) *ammodels.PostableAlert { - name, target, result, alertTTL := checkResult.CheckName, &checkResult.Target, &checkResult.Result, r.alertTTL - labels := make(map[string]string, len(target.Labels)+len(result.Labels)+4) - annotations := make(map[string]string, 2) - for k, v := range result.Labels { - labels[k] = v - } - for k, v := range target.Labels { - labels[k] = v - } - - labels[model.AlertNameLabel] = name - checkResult.AlertID = makeID(target, result) - labels["severity"] = result.Severity.String() - labels["stt_check"] = "1" - labels["alert_id"] = checkResult.AlertID - labels["interval_group"] = string(checkResult.Interval) - - annotations["summary"] = result.Summary - annotations["description"] = result.Description - annotations["read_more_url"] = result.ReadMoreURL - - endsAt := r.nowF().Add(alertTTL).UTC().Round(0) // strip a monotonic clock reading - return &ammodels.PostableAlert{ - Alert: ammodels.Alert{ - // GeneratorURL: "TODO", - Labels: labels, - }, - EndsAt: strfmt.DateTime(endsAt), - Annotations: annotations, - } -} - // Describe implements prom.Collector. func (r *registry) Describe(ch chan<- *prom.Desc) { r.mInsights.Describe(ch) @@ -177,21 +118,9 @@ func (r *registry) Describe(ch chan<- *prom.Desc) { // Collect implements prom.Collector. func (r *registry) Collect(ch chan<- prom.Metric) { r.mInsights.Reset() - res := r.getCheckResults() + res := r.getCheckResults("") for _, re := range res { r.mInsights.WithLabelValues(string(re.Target.ServiceType), re.AdvisorName, re.CheckName).Inc() } r.mInsights.Collect(ch) } - -// makeID creates an ID for STT check alert. -func makeID(target *services.Target, result *check.Result) string { - s := sha1.New() //nolint:gosec - fmt.Fprintf(s, "%s\n", target.AgentID) - fmt.Fprintf(s, "%s\n", target.ServiceID) - fmt.Fprintf(s, "%s\n", result.Summary) - fmt.Fprintf(s, "%s\n", result.Description) - fmt.Fprintf(s, "%s\n", result.ReadMoreURL) - fmt.Fprintf(s, "%v\n", result.Severity) - return alertsPrefix + hex.EncodeToString(s.Sum(nil)) -} diff --git a/managed/services/checks/registry_test.go b/managed/services/checks/registry_test.go index 0b4ca97e9b..ae5eb55f1d 100644 --- a/managed/services/checks/registry_test.go +++ b/managed/services/checks/registry_test.go @@ -17,25 +17,18 @@ package checks import ( "testing" - "time" - "github.com/go-openapi/strfmt" "github.com/percona-platform/saas/pkg/check" "github.com/percona-platform/saas/pkg/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/services" ) func TestRegistry(t *testing.T) { t.Run("create and collect Alerts", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -80,57 +73,15 @@ func TestRegistry(t *testing.T) { r.set(checkResults) - expectedAlerts := []*ammodels.PostableAlert{ - { - Annotations: map[string]string{ - "summary": "check summary", - "description": "check description", - "read_more_url": "https://www.example.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/e7b471407fe9734eac5b6adb178ee0ef08ef45f2", - "alertname": "name", - "baz": "qux", - "foo": "bar", - "severity": "warning", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - }, - { - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - }, - } + // Empty interval means standard + checkResults[1].Interval = check.Standard - collectedAlerts := r.collect() - assert.ElementsMatch(t, expectedAlerts, collectedAlerts) + collectedAlerts := r.getCheckResults("") + assert.ElementsMatch(t, checkResults, collectedAlerts) }) t.Run("delete check results by interval", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -177,40 +128,17 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByInterval(check.Standard) - expectedAlert := &ammodels.PostableAlert{ - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Frequent), - }, - }, - } - - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") require.Len(t, collectedAlerts, 1) - assert.Equal(t, expectedAlert, collectedAlerts[0]) + assert.Equal(t, checkResults[1], collectedAlerts[0]) }) t.Run("delete check result by name", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name1", + Interval: check.Standard, Target: services.Target{ AgentID: "/agent_id/123", ServiceID: "/service_id/123", @@ -230,6 +158,7 @@ func TestRegistry(t *testing.T) { }, { CheckName: "name2", + Interval: check.Standard, Target: services.Target{ AgentID: "/agent_id/321", ServiceID: "/service_id/321", @@ -252,37 +181,13 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByName([]string{"name1"}) - expectedAlert := &ammodels.PostableAlert{ - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - } - - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") require.Len(t, collectedAlerts, 1) - assert.Equal(t, expectedAlert, collectedAlerts[0]) + assert.Equal(t, checkResults[1], collectedAlerts[0]) }) t.Run("empty interval recognized as standard", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -328,7 +233,7 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByInterval(check.Standard) - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") assert.Empty(t, collectedAlerts) }) } diff --git a/managed/services/management/checks.go b/managed/services/management/checks.go index 705448cd0e..999e63b733 100644 --- a/managed/services/management/checks.go +++ b/managed/services/management/checks.go @@ -122,17 +122,23 @@ func (s *ChecksAPIService) GetFailedChecks(ctx context.Context, req *managementp failedChecks := make([]*managementpb.CheckResult, 0, len(results)) for _, result := range results { + labels := make(map[string]string, len(result.Target.Labels)+len(result.Result.Labels)) + for k, v := range result.Result.Labels { + labels[k] = v + } + for k, v := range result.Target.Labels { + labels[k] = v + } + failedChecks = append(failedChecks, &managementpb.CheckResult{ Summary: result.Result.Summary, CheckName: result.CheckName, Description: result.Result.Description, ReadMoreUrl: result.Result.ReadMoreURL, Severity: managementpb.Severity(result.Result.Severity), - Labels: result.Result.Labels, + Labels: labels, ServiceName: result.Target.ServiceName, ServiceId: result.Target.ServiceID, - AlertId: result.AlertID, - Silenced: result.Silenced, }) } @@ -167,12 +173,7 @@ func (s *ChecksAPIService) GetFailedChecks(ctx context.Context, req *managementp // ToggleCheckAlert toggles the silence state of the check with the provided alertID. func (s *ChecksAPIService) ToggleCheckAlert(ctx context.Context, req *managementpb.ToggleCheckAlertRequest) (*managementpb.ToggleCheckAlertResponse, error) { - err := s.checksService.ToggleCheckAlert(ctx, req.AlertId, req.Silence) - if err != nil { - return nil, errors.Wrapf(err, "failed to toggle silence status of alert with id: %s", req.AlertId) - } - - return &managementpb.ToggleCheckAlertResponse{}, nil + return nil, status.Error(codes.NotFound, "Advisor alerts silencing is not supported anymore.") } // GetSecurityCheckResults returns Security Thread Tool's latest checks results. diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index 1a873f89a4..b87ae574e3 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -71,7 +71,6 @@ type checksService interface { DisableChecks(checkNames []string) error EnableChecks(checkNames []string) error ChangeInterval(params map[string]check.Interval) error - ToggleCheckAlert(ctx context.Context, alertID string, newStatus bool) error } // grafanaClient is a subset of methods of grafana.Client used by this package. diff --git a/managed/services/management/mock_checks_service_test.go b/managed/services/management/mock_checks_service_test.go index 53131de5ab..d28cd5cb01 100644 --- a/managed/services/management/mock_checks_service_test.go +++ b/managed/services/management/mock_checks_service_test.go @@ -202,20 +202,6 @@ func (_m *mockChecksService) StartChecks(checkNames []string) error { return r0 } -// ToggleCheckAlert provides a mock function with given fields: ctx, alertID, newStatus -func (_m *mockChecksService) ToggleCheckAlert(ctx context.Context, alertID string, newStatus bool) error { - ret := _m.Called(ctx, alertID, newStatus) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool) error); ok { - r0 = rf(ctx, alertID, newStatus) - } else { - r0 = ret.Error(0) - } - - return r0 -} - // newMockChecksService creates a new instance of mockChecksService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockChecksService(t interface { diff --git a/managed/services/types.go b/managed/services/types.go index 2614d4fed2..04720ff2f5 100644 --- a/managed/services/types.go +++ b/managed/services/types.go @@ -66,8 +66,6 @@ func (t *Target) Copy() Target { type CheckResult struct { CheckName string AdvisorName string - Silenced bool - AlertID string Interval check.Interval Target Target Result check.Result diff --git a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml index a617876a55..e212ed109d 100644 --- a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml @@ -35,7 +35,7 @@ dest: /etc/grafana/grafana.ini section: database option: type - value: absent + state: absent - name: Remove database host ini_file: diff --git a/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml b/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml index d8f6b90937..7075c490d8 100644 --- a/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml @@ -1,4 +1,12 @@ --- +- name: Wait for grafana to update DB and be ready + ansible.builtin.uri: + url: "http://127.0.0.1:3000/api/health" + status_code: 200 + method: GET + retries: 120 + delay: 1 + - name: Create Grafana backup dir file: path: "/srv/backup/grafana"