Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 49b9bb4
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Nov 1 13:24:42 2023 +0300

    Bump github.com/aws/aws-sdk-go from 1.46.0 to 1.47.0 (#2588)

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.46.0 to 1.47.0.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.46.0...v1.47.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1acf7b2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Nov 1 11:57:57 2023 +0200

    Bump github.com/grafana/grafana-api-golang-client from 0.24.0 to 0.25.0 (#2587)

    Bumps [github.com/grafana/grafana-api-golang-client](https://github.com/grafana/grafana-api-golang-client) from 0.24.0 to 0.25.0.
    - [Release notes](https://github.com/grafana/grafana-api-golang-client/releases)
    - [Commits](grafana/grafana-api-golang-client@v0.24.0...v0.25.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/grafana/grafana-api-golang-client
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1cca6f9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 31 16:32:52 2023 +0300

    Bump github.com/docker/docker in /tools (#2583)

    Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.6+incompatible to 24.0.7+incompatible.
    - [Release notes](https://github.com/docker/docker/releases)
    - [Commits](moby/moby@v24.0.6...v24.0.7)

    ---
    updated-dependencies:
    - dependency-name: github.com/docker/docker
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 3f5dc68
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Tue Oct 31 15:12:58 2023 +0300

    PMM-12631 removed alertmanager configs from logs. (#2584)

    * PMM-12631 removed alertmanager configs from logs.

    * PMM-12631 removed alertmanager configs from tests and docs.

    * PMM-12631 Fix linter.

commit 353542d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 31 11:17:34 2023 +0000

    Bump github.com/ClickHouse/clickhouse-go/v2 from 2.13.0 to 2.15.0 (#2580)

    * Bump github.com/ClickHouse/clickhouse-go/v2 from 2.13.0 to 2.15.0

    Bumps [github.com/ClickHouse/clickhouse-go/v2](https://github.com/ClickHouse/clickhouse-go) from 2.13.0 to 2.15.0.
    - [Release notes](https://github.com/ClickHouse/clickhouse-go/releases)
    - [Changelog](https://github.com/ClickHouse/clickhouse-go/blob/main/CHANGELOG.md)
    - [Commits](ClickHouse/clickhouse-go@v2.13.0...v2.15.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/ClickHouse/clickhouse-go/v2
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    * Fix

    ---------

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Artem Gavrilov <artem.gavrilov@percona.com>

commit d08e47b
Author: Vadim Yalovets <vadim.yalovets@percona.com>
Date:   Tue Oct 31 10:09:02 2023 +0200

    PMM-12630 UI upgrade from 2.37.1 and lower does not work (#2582)

commit bc802b4
Author: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>
Date:   Mon Oct 30 11:32:51 2023 +0100

    PMM-12632 Fix agent client response. (#2581)

    * PMM-12632 Fix agent client response.

    * PMM-12632 Required changes.

commit 1d326ec
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 30 10:22:15 2023 +0100

    Bump github.com/google/uuid from 1.3.1 to 1.4.0 (#2579)

    Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.3.1 to 1.4.0.
    - [Release notes](https://github.com/google/uuid/releases)
    - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
    - [Commits](google/uuid@v1.3.1...v1.4.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/google/uuid
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d01ea55
Author: Vadim Yalovets <vadim.yalovets@percona.com>
Date:   Thu Oct 26 13:01:32 2023 +0300

    PMM-12626 Packages built using old go version (#2576)

    * PMM-12626 Packages built using old go version

    * PMM-12626 Packages built using old go version

commit 828153c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Oct 26 11:40:55 2023 +0200

    Bump google.golang.org/grpc from 1.58.0 to 1.58.3 in /tools (#2577)

    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.0 to 1.58.3.
    - [Release notes](https://github.com/grpc/grpc-go/releases)
    - [Commits](grpc/grpc-go@v1.58.0...v1.58.3)

    ---
    updated-dependencies:
    - dependency-name: google.golang.org/grpc
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit a3a52c1
Author: rishat-ishbulatov <111364991+rishat-ishbulatov@users.noreply.github.com>
Date:   Wed Oct 25 22:02:42 2023 +0300

    PMM-8655 Send unsent messages after connection problems (#1970)

    * PMM-8655 feat: config with cache

    * PMM-8655 feat: client domain models

    * PMM-8655 feat: buffer-ring with bigqueue

    * PMM-8655 feat: cache and dummy

    * PMM-8655 ref: client

    * PMM-8655 feat: cache connection response

    * PMM-8655 fix: sum, datarace for bigqueue

    * PMM-8655 ref: temp commented channel test on corrupted utf

    * Update config.go

    * Update go.sum

    * PMM-8655 Fix linters.

    * Update agent/client/cache/cache.go

    Co-authored-by: Alex Tymchuk <alexander.tymchuk@percona.com>

    * PMM-8655 Fix linters.

    * PMM-8655 remove unused field.

    * PMM-8655 Address review comments.

    * PMM-8655 get rid of goto operator.

    * PMM-8655 fix go.sum.

    * PMM-8655 fix go.sum.

    * PMM-8655 fix tests and linter.

    * revert label renaming

    * revert channel_test.go

    * PMM-8655 revert test.

    * PMM-8655 Fix linters.

    * PMM-8655 Fix linters.

    * PMM-8655 Fix linters.

    ---------

    Co-authored-by: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
    Co-authored-by: Nurlan Moldomurov <bupychuk1989@gmail.com>
    Co-authored-by: Alex Tymchuk <alexander.tymchuk@percona.com>
    Co-authored-by: Talha Bin Rizwan <talha.rizwan@percona.com>

commit 46626e6
Author: Alex Demidoff <alexander.demidoff@percona.com>
Date:   Wed Oct 25 20:14:41 2023 +0300

    PMM-12185 migrate telemetry GrafanaDS to using PostgreSQL (#2542)

    * PMM-12185 migrate telemetry GrafanaDS to using PostgreSQL

    * PMM-12185 configure GrafanaDB connection

    * PMM-12185 fix grafanaDB SQL stmnts

    * PMM-12185 don't init when ds is disabled

    * PMM-12185 cleanup the code

    * PMM-12185 update go modules

    * PMM-12185 Apply suggestions from code review

    Co-authored-by: Nurlan Moldomurov <nurlan.moldomurov@percona.com>

    * PMM-12185 remove the debug stmnt

    * PMM-12185 remove unused lint suppressions

    * PMM-12185 fix inconsistent log output

    * PMM-12185 trim trailing spaces

    * PMM-12185 rename VM config type for consistency sake

    ---------

    Co-authored-by: Nurlan Moldomurov <nurlan.moldomurov@percona.com>

commit 23571ee
Author: Francisco Miguel Biete Banon <fbiete@gmail.com>
Date:   Wed Oct 25 17:57:16 2023 +0100

    Missing settings to use keepalive in some locations (#2575)

    We have keepalives enabled in upstream blocks, but some of the locations are missing the proxy changes required to use it.
    [10 top nginx configuration mistakes](https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#no-keepalives)

commit 4346c6f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 25 09:49:34 2023 +0000

    Bump @typescript-eslint/parser from 6.8.0 to 6.9.0 in /cli-tests (#2570)

    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.8.0 to 6.9.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/parser)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/parser"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 71879ab
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 25 11:14:13 2023 +0300

    Bump github.com/brianvoe/gofakeit/v6 from 6.23.0 to 6.24.0 (#2565)

    Bumps [github.com/brianvoe/gofakeit/v6](https://github.com/brianvoe/gofakeit) from 6.23.0 to 6.24.0.
    - [Release notes](https://github.com/brianvoe/gofakeit/releases)
    - [Commits](brianvoe/gofakeit@v6.23.0...v6.24.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/brianvoe/gofakeit/v6
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>

commit 5730e16
Author: Alex Demidoff <alexander.demidoff@percona.com>
Date:   Tue Oct 24 21:11:40 2023 +0300

    PMM-12375 add database version to services (#2488)

    * PMM-12375 create serviceInfoBroker component

    * PMM-12375 serviceInfoBroker won't ping the db

    * PMM-12375 fix the test

    * PMM-12375 add tests for serviceInfoBroker

    * PMM-12375 fix the agent tests

    * PMM-12375 fix agent tests, server-side

    * PMM-12375 fix services tests

    * PMM-12375 do not update if version is empty

    * PMM-12375 remove the unused parameter

    * PMM-12375 remove the version from Stats

    * PMM-12375 add message type processing to channel

    * PMM-12375 update codeowners

    * PMM-12375 respect skipConnectionCheck, simpler schema

    * PMM-12375 fix linter warnings

    * PMM-12375 fix license headers

    * PMM-12375 respect skipConnectionCheck param

    * PMM-12375 minor fixes

    * PMM-12375 update the docs

    * PMM-12375 do not run serviceInfo for older clients

    * PMM-12375 add serviceInfoBroker to rds

    * PMM-12375 add serviceInfoBroker to azure

    * PMM-12375 add version to ListServices result

    * PMM-12375 a minor fix in teardown fn

    * PMM-12375 cleanup the inevntory_metrics_test

    * PMM-12375 follow up on review

    * PMM-12375 revert changes, move to other PRs

    * PMM-12375 revert changed related to linter

    * PMM-12375 make version nullable

    * PMM-12375 do not call FindService when skipping connection check

    * PMM-12375 fix pointer reference

    * PMM-12375 re-generate interfaces

    * PMM-12375 fix a dereference

    * PMM-12375 make ServiceInfoBroker work for older agents

    * PMM-12375 fix the linter error

    * PMM-12375 follow up on review

    * PMM-12375 a few corrections to managed's readme.md

    * PMM-12375 fix the mock file version

    * PMM-12375 bump up the compatibility version

    * PMM-12375 regen the mockfiles

    * PMM-12375 remove debug msg

    * Fix linter

    ---------

    Co-authored-by: Alex Tymchuk <alexander.tymchuk@percona.com>
    Co-authored-by: Alex Demidoff <alexander.tymchuk@gmail.com>
    Co-authored-by: Nurlan Moldomurov <nurlan.moldomurov@percona.com>

commit be137c9
Author: Artem Gavrilov <artem.gavrilov@percona.com>
Date:   Tue Oct 24 15:48:07 2023 +0200

    PMM-7 Update golang up to 1.21.3 (#2569)

    Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>

commit 330a37b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 24 13:40:01 2023 +0000

    Bump @typescript-eslint/eslint-plugin from 6.8.0 to 6.9.0 in /cli-tests (#2571)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.8.0 to 6.9.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/eslint-plugin)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>

commit 0f463f8
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 24 15:29:08 2023 +0200

    Bump eslint-plugin-import from 2.28.0 to 2.29.0 in /cli-tests (#2572)

    Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.28.0 to 2.29.0.
    - [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
    - [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
    - [Commits](import-js/eslint-plugin-import@v2.28.0...v2.29.0)

    ---
    updated-dependencies:
    - dependency-name: eslint-plugin-import
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 7fa52c3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 23 09:14:22 2023 +0000

    Bump eslint from 8.51.0 to 8.52.0 in /cli-tests (#2567)

    Bumps [eslint](https://github.com/eslint/eslint) from 8.51.0 to 8.52.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.51.0...v8.52.0)

    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit db41410
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 23 10:51:22 2023 +0200

    Bump eslint-plugin-playwright from 0.17.0 to 0.18.0 in /cli-tests (#2566)

    Bumps [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) from 0.17.0 to 0.18.0.
    - [Release notes](https://github.com/playwright-community/eslint-plugin-playwright/releases)
    - [Changelog](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/CHANGELOG.md)
    - [Commits](playwright-community/eslint-plugin-playwright@v0.17.0...v0.18.0)

    ---
    updated-dependencies:
    - dependency-name: eslint-plugin-playwright
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 3029ae9
Merge: c3cb1a7 12ce642
Author: Nurlan Moldomurov <bupychuk1989@gmail.com>
Date:   Sat Oct 21 22:23:55 2023 +0300

    Merge branch 'pmm-2.40.1'

commit c3cb1a7
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Oct 20 15:46:26 2023 +0300

    Bump github.com/aws/aws-sdk-go from 1.45.2 to 1.46.0 (#2562)

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.2 to 1.46.0.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.45.2...v1.46.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 12ce642
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Fri Oct 20 15:40:13 2023 +0300

    PMM-7 ignore errors on not really necessary step. (#2564)

commit aef2236
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 18 16:39:38 2023 +0300

    Bump github.com/prometheus/common from 0.44.0 to 0.45.0 (#2561)

    Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
    - [Release notes](https://github.com/prometheus/common/releases)
    - [Commits](prometheus/common@v0.44.0...v0.45.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/prometheus/common
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 85ca980
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Wed Oct 18 14:07:05 2023 +0300

    PMM-12587 Fix drop DB for EL7. (#2560)

commit 763b4cc
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 18 13:45:58 2023 +0300

    Bump google.golang.org/grpc from 1.58.0 to 1.59.0 (#2559)

    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.0 to 1.59.0.
    - [Release notes](https://github.com/grpc/grpc-go/releases)
    - [Commits](grpc/grpc-go@v1.58.0...v1.59.0)

    ---
    updated-dependencies:
    - dependency-name: google.golang.org/grpc
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 09071bf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 18 10:12:26 2023 +0000

    Bump github.com/vektra/mockery/v2 from 2.35.1 to 2.36.0 in /tools (#2552)

    * Bump github.com/vektra/mockery/v2 from 2.35.1 to 2.36.0 in /tools

    Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.35.1 to 2.36.0.
    - [Release notes](https://github.com/vektra/mockery/releases)
    - [Changelog](https://github.com/vektra/mockery/blob/master/docs/changelog.md)
    - [Commits](vektra/mockery@v2.35.1...v2.36.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/vektra/mockery/v2
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    * make gen

    * trigger

    ---------

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Jiří Čtvrtka <j.ctvrtka@gmail.com>
    Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>

commit 877cd07
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 10:03:44 2023 +0000

    Bump @typescript-eslint/parser from 6.7.0 to 6.8.0 in /cli-tests (#2555)

    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.7.0 to 6.8.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/parser)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/parser"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 8687f25
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 09:52:48 2023 +0000

    Bump @typescript-eslint/eslint-plugin from 6.7.0 to 6.8.0 in /cli-tests (#2554)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.0 to 6.8.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/eslint-plugin)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e721197
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 11:39:59 2023 +0200

    Bump eslint-plugin-playwright from 0.16.0 to 0.17.0 in /cli-tests (#2553)

    Bumps [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) from 0.16.0 to 0.17.0.
    - [Release notes](https://github.com/playwright-community/eslint-plugin-playwright/releases)
    - [Changelog](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/CHANGELOG.md)
    - [Commits](playwright-community/eslint-plugin-playwright@v0.16.0...v0.17.0)

    ---
    updated-dependencies:
    - dependency-name: eslint-plugin-playwright
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 9564347
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Tue Oct 17 12:36:37 2023 +0300

    PMM-12576 change admin ID to 1. (#2551)

    * PMM-12576 change admin ID to 1.

    * PMM-12576 Debug messages.

commit 578bab3
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Tue Oct 17 00:14:21 2023 +0300

    PMM-12592 PMM-12587 fix SQLite to PostgreSQL (#2549)

    * PMM-7 More debug data.

    * PMM-12584 fix hex values in PostgreSQL DB.

    * PMM-12588 Outdated grafana-db-migrator used (#2547)

    * PMM-12584 fix provisioning problem.

    * PMM-12584 fix drop database issue.

    * PMM-12584 fix drop database issue for EL7.

    * PMM-12584 fix drop database issue for EL7.

    * PMM-12584 fix drop database issue for EL7.

    * Update update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml

    Co-authored-by: Alex Demidoff <alexander.demidoff@percona.com>

    ---------

    Co-authored-by: Vadim Yalovets <vadim.yalovets@percona.com>
    Co-authored-by: Alex Demidoff <alexander.demidoff@percona.com>

commit 79357f3
Author: Artem Gavrilov <artem.gavrilov@percona.com>
Date:   Tue Sep 26 16:05:44 2023 +0200

    PMM-7 Fix datarace (#2501)

    * PMM-7 Fix datarace

    * PMM-7 Fix datarace

commit d58294a
Author: Alex Demidoff <alexander.demidoff@percona.com>
Date:   Mon Oct 16 15:46:45 2023 +0300

    PMM-7 fix API tests (#2550)

    * PMM-7 fix API tests

    Why:
    PMM API tests currently fail. Namely, `TestDownloadLogs` fails with the following diff:

    12:38:56          	            	Diff:
    12:38:56          	            	--- Expected
    12:38:56          	            	+++ Actual
    12:38:56          	            	@@ -1,2 +1,2 @@
    12:38:56          	            	-([]string) (len=38) {
    12:38:56          	            	+([]string) (len=39) {
    12:38:56          	            	  (string) (len=21) "alertmanager.base.yml",
    12:38:56          	            	@@ -5,2 +5,3 @@
    12:38:56          	            	  (string) (len=16) "alertmanager.yml",
    12:38:56          	            	+ (string) (len=25) "clickhouse-server.err.log",
    12:38:56          	            	  (string) (len=21) "clickhouse-server.log",
    12:38:56          	Test:       	TestDownloadLogs
    12:38:56  --- FAIL: TestDownloadLogs (0.56s)

    * PMM-7 disable the rotation config

commit 071946e
Author: Nurlan Moldomurov <bupychuk1989@gmail.com>
Date:   Wed Oct 11 00:38:08 2023 +0300

    PMM-12562 Show error 503 instead of 500.

commit cf67816
Author: Nurlan Moldomurov <nurlan.moldomurov@percona.com>
Date:   Sun Oct 15 23:14:36 2023 +0300

    PMM-12223 Update clickhouse. (#2489)

    * PMM-12223 Update clickhouse.

    * PMM-12223 update logs path

commit 58efa80
Author: Alex Demidoff <alexander.demidoff@percona.com>
Date:   Sat Oct 14 00:32:23 2023 +0300

    PMM-12463 Add telemetry envvar datasource (#2532)

    * PMM-12463 allow ireturn on DataSources

    * PMM-12463 fix some command hints

    * PMM-12463 add ENV_VAR dataSource

    * PMM-12463 add a provisionary envvar metrics extraction

    * PMM-12463 add a test for EnvVar datasource

    * PMM-12463 revert staticckeck linter

    * PMM-12463 fix linter warnings

    * PMM-12463 revert changes to main.go

    * PMM-12463 refactor the output format

    * PMM-12463 add a transform to strip values

    * PMM-12463 fix linter warnings

    * PMM-12463 refactor transform, add tests

    * PMM-12463 run format

    * PMM-12463 follow up on review comments

    * PMM-12185 remove the debug statement

    * PMM-12185 don't be too noisy when a ds is not initialized

commit 40e0fcf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Oct 12 09:52:50 2023 +0000

    Bump golang.org/x/net from 0.16.0 to 0.17.0 (#2541)

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.16.0 to 0.17.0.
    - [Commits](golang/net@v0.16.0...v0.17.0)

    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit df0c351
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Oct 12 11:33:00 2023 +0200

    Bump golang.org/x/net from 0.16.0 to 0.17.0 in /tools (#2540)

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.16.0 to 0.17.0.
    - [Commits](golang/net@v0.16.0...v0.17.0)

    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d974ff8
Author: Vishwas Sharma <135056281+vishwas-sharma2480@users.noreply.github.com>
Date:   Wed Oct 11 20:13:25 2023 +0530

    Enable errcheck linter rule (#2470)

    * Install the CodeSee workflow. Learn more at https://docs.codesee.io

    * removed the codesee-arch-diagram.yml~

    * enable errcheck linter on anew branch because old branch was not made from main branch

    * made change in file proxy.go located at vmproxy/proxy/proxy.go

    * made change in file admin/pkg/client/tarball/tarball.go located at admin/pkg/client/tarball/tarball.go

    * made change in file proxy_test.go located at vmproxy/proxy/proxy_test.go

    * made change in file proxy_test.go located at vmproxy/proxy/proxy_test.go

    * made change in file database.go located at managed/services/dbaas/kubernetes/client/database/database.go

    * made change in file percona_sso_model_helpers.go located at managed/models/percona_sso_model_helpers.go

    * made change in file api-tests/server/auth_test.go located at api-tests/server/auth_test.go

    * made change in file api-tests/server/auth_test.go located at api-tests/server/auth_test.go

    * made change in file admin/commands/summary.go located at admin/commands/summary.go

    * made change in file job_helpers_test.go located at managed/models/job_helpers_test.go

    * made change in file datasources.go located at managed/services/telemetry/datasources.go

    * made change in file datasources.go located at managed/services/telemetry/datasources.go

    * made change in file main.go located at qan-api2/main.go

    * made change in file main.go located at qan-api2/main.go

    * made change in file pgstatmonitor.go located at agent/agents/postgres/pgstatmonitor/pgstatmonitor.go

    * made change in file ports_registry_test.go located at agent/agents/supervisor/ports_registry_test.go

    * made change in file victoriametrics.go located at managed/services/victoriametrics/victoriametrics.go

    * made change in file readyz_test.go located at api-tests/server/readyz_test.go

    * made change in file version_test.go located at api-tests/server/version_test.go

    * made change in file client.go located at managed/utils/platform/client.go

    * made change in file auth_server_test.go located at managed/services/grafana/auth_server_test.go

    * made change in file auth_server_test.go located at managed/services/grafana/auth_server_test.go

    * made change in file alertmanager.go located at managed/services/alertmanager/alertmanager.go

    * made change in file inventory_metrics_test.go located at managed/services/inventory/inventory_metrics_test.go

    * made change in file client.go located at managed/services/grafana/client.go

    * made change in file connection_checker.go located at agent/connectionchecker/connection_checker.go

    * made change in file vmalert.go located at managed/services/vmalert/vmalert.go

    * made change in file vmalert.go located at managed/services/vmalert/vmalert.go

    * made change in file metrics.go located at qan-api2/models/metrics.go

    * changed database.go located at managed/services/dbaas/kubernetes/client/database/

    * changed database.go located at managed/services/dbaas/kubernetes/client/database/

    * removed commented errcheck linyter

    * changes after make format

    * made changes in managed/services/dbaas/kubernetes/client/client.go

    * made changes in anaged/services/management/dbaas/components_service.go

    * made changes in managed/services/management/dbaas/version_service_client.go

    * mae\ke format changes done

    ---------

    Co-authored-by: codesee-maps[bot] <86324825+codesee-maps[bot]@users.noreply.github.com>
    Co-authored-by: Artem Gavrilov <artem.gavrilov@percona.com>

commit 29fbba7
Author: Alex Tymchuk <alexander.tymchuk@percona.com>
Date:   Thu Sep 28 20:32:30 2023 +0300

    PMM-12547 Revert PMM-11670 Set the cluster label if empty (#2508)

    * Revert "PMM-11670 Set the cluster label if empty (#2459)"

    This reverts commit 3c58ed9.

    * PMM-12547 use a different IP

    * PMM-12547 fix the debug command in actions

commit 9d919df
Author: Talha Bin Rizwan <talha.rizwan@percona.com>
Date:   Wed Sep 27 21:51:02 2023 +0500

    PMM-7 Fix Clickhouse repository. (#2506)
  • Loading branch information
ademidoff committed Nov 2, 2023
1 parent 37715cf commit 18f8699
Show file tree
Hide file tree
Showing 195 changed files with 6,622 additions and 2,656 deletions.
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ linters-settings:
- github.com/charmbracelet/bubbletea.Model
- github.com/percona/pmm/admin/commands.Result
- github.com/percona/pmm/agent/runner/actions.Action
- github.com/percona/pmm/managed/services/telemetry.DataSource

lll:
line-length: 170
Expand Down Expand Up @@ -114,7 +115,7 @@ linters:
- revive
- paralleltest
- gocognit
- errcheck

# ENDTODO

run:
Expand Down
25 changes: 14 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ We'd be glad to welcome you to Percona community which tries to keep the open so

## Table of contents
1. [Project repos structure](#Project-repos-structure)
2. [API documentation](#API-documentation)
2. [API documentation](#API-Reference-Documentation)
3. [Prerequisites](#Prerequisites)
4. [Submitting a Bug](#Submitting-a-Bug)
4. [Submitting a bug](#Submitting-a-Bug)
5. [Setup your local development environment](#Setup-your-local-development-environment)
6. [Tests](#Tests)
7. [Feature Build](#Feature-Build)
Expand Down Expand Up @@ -200,19 +200,22 @@ There are number of approaches for the code review and ownership: Code Ownership

For more efficient review process we use a mixed approach:
* repos that have CODEOWNERS
* add **auto-review-team** additionally to CODEOWNERS assigned
* github will assign reviewers automatically
* repos that don't have CODEOWNERS
* add **auto-review-team**
* add reviewers as follows:
* add `pmm-review-fe` for UI/UX reviews
* add `pmm-review-exporters` for exporter reviews [see PMM Client](#PMM-Client)
* add `pmm-review-be` for backend reviews
* if you know exactly who should review your code
* add ppl to the review
* add them to the review


| Team | Description | Members |
| -------------------- | ----------------------------------------------------------------------- | ------- |
| pmm-review-fe | ppl for UI/UX reviews for [FrontEnd repos](#FrontEnd) | [FE team](https://github.com/orgs/percona/teams/pmm-review-fe/members) |
| pmm-review-exporters | reviewers for all exporters [see PMM Client](#PMM-Client) | [Exporters team](https://github.com/orgs/percona/teams/pmm-review-exporters/members) |
| pmm-review-be | Back-End engineers | [BE team](https://github.com/orgs/percona/teams/pmm-review-be/members) |
| PMM Admins | ppl that could use admins rights to force merge or change repo settings | [PMM Admin team](https://github.com/orgs/percona/teams/pmm-admins/members) |
| Team | Description | Members |
| -------------------- | -------------------------------------------------------------- | ------- |
| pmm-review-fe | UI reviewers of PRs to [FrontEnd repos](#FrontEnd) | [FE team](https://github.com/orgs/percona/teams/pmm-review-fe/members) |
| pmm-review-exporters | exporter reviewers of PRs to [PMM Client](#PMM-Client) | [Exporters team](https://github.com/orgs/percona/teams/pmm-review-exporters/members) |
| pmm-review-be | reviewers of backend (Go) PRs | [BE team](https://github.com/orgs/percona/teams/pmm-review-be/members) |
| PMM Admins | reviewers that could use admins rights to force merge or change repo settings | [PMM Admin team](https://github.com/orgs/percona/teams/pmm-admins/members) |


## After your Pull Request is merged
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

// AddCommand is used by Kong for CLI flags and commands.
type AddCommand struct {
External AddExternalCommand `cmd:"" help:"Add External source of data (like a custom exporter running on a port) to the monitoring"`
External AddExternalCommand `cmd:"" help:"Add External source of data (like a custom exporter running on a port) to monitoring"`
ExternalServerless AddExternalServerlessCommand `cmd:"" help:"Add External Service on Remote node to monitoring"`
HAProxy AddHAProxyCommand `cmd:"" name:"haproxy" help:"Add HAProxy to monitoring"`
MongoDB AddMongoDBCommand `cmd:"" name:"mongodb" help:"Add MongoDB to monitoring"`
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/add_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (cmd *AddMySQLCommand) RunCmd() (commands.Result, error) {

if cmd.CreateUser {
return nil, errors.New("Unrecognized option. To create a user, see " +
"'https://www.percona.com/doc/percona-monitoring-and-management/2.x/concepts/services-mysql.html#pmm-conf-mysql-user-account-creating'")
"'https://docs.percona.com/percona-monitoring-and-management/setting-up/client/mysql.html#create-a-database-account-for-pmm'")
}

var (
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/add_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestRun(t *testing.T) {
_, err := cmd.RunCmd()

if assert.Error(t, err) {
expected := "Unrecognized option. To create a user, see 'https://www.percona.com/doc/percona-monitoring-and-management/2.x/concepts/services-mysql.html#pmm-conf-mysql-user-account-creating'"
expected := "Unrecognized option. To create a user, see 'https://docs.percona.com/percona-monitoring-and-management/setting-up/client/mysql.html#create-a-database-account-for-pmm'"
assert.Equal(t, expected, err.Error())
}
})
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/pmm/server/docker/mock_functions_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions admin/commands/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func addFile(zipW *zip.Writer, name string, fileName string) {
logrus.Debugf("%s", err)
r = io.NopCloser(bytes.NewReader([]byte(err.Error() + "\n")))
}
defer r.Close() //nolint:gosec
defer r.Close() //nolint:gosec,errcheck

modTime := time.Now()
if fi, _ := os.Stat(fileName); fi != nil {
Expand Down Expand Up @@ -219,7 +219,7 @@ func addVMAgentTargets(ctx context.Context, zipW *zip.Writer, agentsInfo []*agen
addData(zipW, "client/vmagent-targets.html", now, bytes.NewReader([]byte(err.Error())))
return
}
defer res.Body.Close() //nolint:gosec
defer res.Body.Close() //nolint:gosec,errcheck
html, err = io.ReadAll(res.Body)
if err != nil {
logrus.Debugf("%s", err)
Expand All @@ -241,7 +241,7 @@ func getURL(ctx context.Context, url string) ([]byte, error) {
if err != nil {
return nil, errors.WithStack(err)
}
defer resp.Body.Close() //nolint:gosec
defer resp.Body.Close() //nolint:gosec,errcheck

if resp.StatusCode != http.StatusOK {
return nil, errors.Errorf("status code: %d", resp.StatusCode)
Expand Down
2 changes: 1 addition & 1 deletion admin/pkg/client/tarball/tarball.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (b *Base) checksumTarball(ctx context.Context, link string, path string) er
return err
}

defer res.Body.Close() //nolint:gosec
defer res.Body.Close() //nolint:gosec,errcheck
if res.StatusCode != http.StatusOK {
return fmt.Errorf("%w: cannot download tarball's sha256sum (http %d)", ErrHTTPStatusNotOk, res.StatusCode)
}
Expand Down
2 changes: 1 addition & 1 deletion admin/pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ var ErrVolumeExists = fmt.Errorf("VolumeExists")
func (b *Base) CreateVolume(ctx context.Context, volumeName string, labels map[string]string) (*volume.Volume, error) {
// We need to first manually check if the volume exists because
// cli.VolumeCreate() does not complain if it already exists.
v, err := b.Cli.VolumeList(ctx, filters.NewArgs(filters.Arg("name", volumeName)))
v, err := b.Cli.VolumeList(ctx, volume.ListOptions{Filters: filters.NewArgs(filters.Arg("name", volumeName))})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion agent/agentlocal/mock_client_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/agentlocal/mock_supervisor_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions agent/agents/mysql/perfschema/perfschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/percona/pmm/agent/queryparser"
"github.com/percona/pmm/agent/tlshelpers"
"github.com/percona/pmm/agent/utils/truncate"
"github.com/percona/pmm/agent/utils/version"
"github.com/percona/pmm/api/agentpb"
"github.com/percona/pmm/api/inventorypb"
"github.com/percona/pmm/utils/sqlmetrics"
Expand All @@ -59,18 +58,6 @@ type versionsCache struct {
items map[string]*mySQLVersion
}

func (m *PerfSchema) mySQLVersion() *mySQLVersion {
m.versionsCache.rw.RLock()
defer m.versionsCache.rw.RUnlock()

res := m.versionsCache.items[m.agentID]
if res == nil {
return &mySQLVersion{}
}

return res
}

const (
retainHistory = 5 * time.Minute
refreshHistory = 5 * time.Second
Expand All @@ -93,7 +80,6 @@ type PerfSchema struct {
changes chan agents.Change
historyCache *historyCache
summaryCache *summaryCache
versionsCache *versionsCache
}

// Params represent Agent parameters.
Expand Down Expand Up @@ -207,7 +193,6 @@ func newPerfSchema(params *newPerfSchemaParams) (*PerfSchema, error) {
changes: make(chan agents.Change, 10),
historyCache: historyCache,
summaryCache: summaryCache,
versionsCache: &versionsCache{items: make(map[string]*mySQLVersion)},
}, nil
}

Expand Down Expand Up @@ -237,17 +222,6 @@ func (m *PerfSchema) Run(ctx context.Context) {
m.changes <- agents.Change{Status: inventorypb.AgentStatus_WAITING}
}

// cache MySQL version
ver, ven, err := version.GetMySQLVersion(ctx, m.q)
if err != nil {
m.l.Error(err)
}

m.versionsCache.items[m.agentID] = &mySQLVersion{
version: ver.Float(),
vendor: ven.String(),
}

go m.runHistoryCacheRefresher(ctx)

// query events_statements_summary_by_digest every minute at 00 seconds
Expand Down
2 changes: 1 addition & 1 deletion agent/agents/postgres/pgstatmonitor/pgstatmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func getPGSM20Settings(q *reform.Querier) (settings, error) {
if err != nil {
return nil, err
}
defer rows.Close()
defer rows.Close() //nolint:errcheck

result := make(settings)
for rows.Next() {
Expand Down
6 changes: 3 additions & 3 deletions agent/agents/supervisor/ports_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestRegistry(t *testing.T) {
r := newPortsRegistry(65000, 65002, []uint16{65000})
l1, err := net.Listen("tcp", "127.0.0.1:65001")
require.NoError(t, err)
defer l1.Close() //nolint:gosec
defer l1.Close() //nolint:gosec,errcheck

p, err := r.Reserve()
assert.NoError(t, err)
Expand All @@ -46,8 +46,8 @@ func TestRegistry(t *testing.T) {
err = r.Release(65002)
assert.Equal(t, errPortBusy, err)

l1.Close()
l2.Close()
l1.Close() //nolint:errcheck
l2.Close() //nolint:errcheck

p, err = r.Reserve()
assert.NoError(t, err)
Expand Down
108 changes: 108 additions & 0 deletions agent/client/cache/cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Copyright 2023 Percona LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package cache incapsulates agent message storing logic.
package cache

import (
"path"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/percona/pmm/agent/config"
"github.com/percona/pmm/agent/models"
"github.com/percona/pmm/agent/utils/buffer-ring/bigqueue"
"github.com/percona/pmm/api/agentpb"
)

// Cache represent cache implementation based on bigqueue.
type Cache struct {
l *logrus.Entry
// prioritized represent cache for high priority agent messages e.g. job, action results
prioritized *bigqueue.Ring
// unprioritized represent cache for low priority agent messages e.g. qan metrics
unprioritized *bigqueue.Ring
}

// New recreates cache.
func New(cfg config.Cache) (*Cache, error) {
if cfg.Disable {
return nil, errors.New("disable in cache config is set to true")
}
if cfg.Dir == "" {
return nil, errors.New("cache directory is not set up")
}
l := logrus.WithField("component", "cache")
prioritized, err := bigqueue.New(path.Join(cfg.Dir, "prioritized"), cfg.PrioritizedSize, l.WithField("type", "prioritized"))
if err != nil {
return nil, err
}
unprioritized, err := bigqueue.New(path.Join(cfg.Dir, "unprioritized"), cfg.UnprioritizedSize, l.WithField("type", "unprioritized"))
if err != nil {
return nil, err
}
return &Cache{
l: l,
prioritized: prioritized,
unprioritized: unprioritized,
}, nil
}

// Send stores agent response to cache on nil channel.
func (c *Cache) Send(resp *models.AgentResponse) error {
var cache *bigqueue.Ring
switch resp.Payload.(type) {
case *agentpb.StartActionResponse,
*agentpb.StopActionResponse,
*agentpb.PBMSwitchPITRResponse,
*agentpb.StartJobResponse,
*agentpb.JobStatusResponse,
*agentpb.GetVersionsResponse,
*agentpb.JobProgress,
*agentpb.StopJobResponse,
*agentpb.CheckConnectionResponse,
*agentpb.JobResult,
*agentpb.ServiceInfoResponse:
cache = c.prioritized
default:
cache = c.unprioritized
}
return cache.Send(resp)
}

// SendAndWaitResponse stores AgentMessages with AgentMessageRequestPayload on nil channel.
func (c *Cache) SendAndWaitResponse(payload agentpb.AgentRequestPayload) (agentpb.ServerResponsePayload, error) { //nolint:ireturn
switch payload.(type) {
case *agentpb.ActionResultRequest:
return c.prioritized.SendAndWaitResponse(payload)
case *agentpb.QANCollectRequest,
*agentpb.StateChangedRequest:
return c.unprioritized.SendAndWaitResponse(payload)
default:
}
return &agentpb.StateChangedResponse{}, nil
}

// Close closes cache databases.
func (c *Cache) Close() {
c.prioritized.Close()
c.unprioritized.Close()
}

// SetSender sets sender and sends stored agent messages with sender.
func (c *Cache) SetSender(s models.Sender) {
c.prioritized.SetSender(s)
c.unprioritized.SetSender(s)
}
Loading

0 comments on commit 18f8699

Please sign in to comment.