From f8f23b0da322e0790ee6cfa38f2401fddfa6ce4d Mon Sep 17 00:00:00 2001 From: Mikhail Grigorev Date: Sun, 11 Feb 2024 22:06:26 +0500 Subject: [PATCH] - Change repo name - Update golang version - Fixed workflows - Fixed test - Fixed Dockerfile - Fixed reading config via symlink - Added systemd unit, docker-compose file and k8s deployment - Added README.ru.md --- .github/workflows/default.yml | 22 ++- .github/workflows/release.yml | 28 ++-- .goreleaser.yml | 33 ++++- Dockerfile | 16 ++- Makefile | 12 +- README.md | 86 +++++++---- README.ru.md | 102 +++++++++++++ cmd/pgscv.go | 4 +- deploy/deployment.yaml | 102 +++++++++++++ deploy/docker-compose.yaml | 18 +++ deploy/pgscv.default | 1 + deploy/pgscv.service | 25 ++++ deploy/pgscv.yaml | 71 ++++++++++ .../20210710.1-remove-query-normalization.md | 19 --- ...10.2-reject-using-pg_query-fingerprints.md | 30 ---- docker_entrypoint.sh | 13 ++ go.mod | 55 +++---- go.sum | 134 ++++++++++++++++++ internal/collector/collector.go | 6 +- internal/collector/collector_common.go | 8 +- internal/collector/collector_common_test.go | 8 +- internal/collector/config.go | 6 +- internal/collector/config_test.go | 2 +- internal/collector/filesystem_common.go | 2 +- internal/collector/linux_cpu.go | 4 +- internal/collector/linux_diskstats.go | 6 +- internal/collector/linux_diskstats_test.go | 4 +- internal/collector/linux_filesystem.go | 6 +- internal/collector/linux_filesystem_test.go | 4 +- internal/collector/linux_load_average.go | 4 +- internal/collector/linux_memory.go | 6 +- internal/collector/linux_memory_test.go | 8 +- internal/collector/linux_netdev.go | 6 +- internal/collector/linux_netdev_test.go | 4 +- internal/collector/linux_network.go | 4 +- internal/collector/linux_sysconfig.go | 4 +- internal/collector/linux_sysinfo.go | 4 +- internal/collector/pgbouncer_pools.go | 6 +- internal/collector/pgbouncer_pools_test.go | 2 +- internal/collector/pgbouncer_settings.go | 6 +- internal/collector/pgbouncer_settings_test.go | 4 +- internal/collector/pgbouncer_stats.go | 6 +- internal/collector/pgbouncer_stats_test.go | 2 +- internal/collector/pgscv_services.go | 2 +- internal/collector/postgres_activity.go | 6 +- internal/collector/postgres_activity_test.go | 2 +- internal/collector/postgres_archiver.go | 6 +- internal/collector/postgres_archiver_test.go | 2 +- internal/collector/postgres_bgwriter.go | 6 +- internal/collector/postgres_bgwriter_test.go | 2 +- internal/collector/postgres_common.go | 8 +- internal/collector/postgres_common_test.go | 4 +- internal/collector/postgres_conflicts.go | 6 +- internal/collector/postgres_conflicts_test.go | 2 +- internal/collector/postgres_custom.go | 2 +- internal/collector/postgres_custom_test.go | 2 +- internal/collector/postgres_database.go | 6 +- internal/collector/postgres_database_test.go | 2 +- internal/collector/postgres_functions.go | 6 +- internal/collector/postgres_functions_test.go | 2 +- internal/collector/postgres_indexes.go | 6 +- internal/collector/postgres_indexes_test.go | 2 +- internal/collector/postgres_locks.go | 6 +- internal/collector/postgres_locks_test.go | 2 +- internal/collector/postgres_logs.go | 6 +- internal/collector/postgres_logs_test.go | 4 +- internal/collector/postgres_replication.go | 6 +- .../collector/postgres_replication_slots.go | 6 +- .../postgres_replication_slots_test.go | 2 +- .../collector/postgres_replication_test.go | 2 +- internal/collector/postgres_schema.go | 6 +- internal/collector/postgres_schema_test.go | 4 +- internal/collector/postgres_settings.go | 6 +- internal/collector/postgres_settings_test.go | 2 +- internal/collector/postgres_statements.go | 6 +- .../collector/postgres_statements_test.go | 2 +- internal/collector/postgres_storage.go | 6 +- internal/collector/postgres_storage_test.go | 4 +- internal/collector/postgres_tables.go | 6 +- internal/collector/postgres_tables_test.go | 2 +- internal/collector/postgres_wal.go | 6 +- internal/collector/postgres_wal_test.go | 2 +- internal/collector/testing.go | 6 +- internal/filter/filter.go | 2 +- internal/http/http_server.go | 6 +- internal/http/http_server_test.go | 2 +- internal/model/model.go | 2 +- internal/pgscv/config.go | 69 +++++---- internal/pgscv/config_test.go | 36 +---- internal/pgscv/pgscv.go | 6 +- internal/pgscv/pgscv_test.go | 10 +- .../testdata/pgscv-services-example.yaml | 2 +- internal/service/config.go | 2 +- internal/service/service.go | 8 +- internal/service/service_test.go | 2 +- internal/service/testing.go | 4 +- internal/store/store.go | 4 +- internal/store/store_test.go | 2 +- internal/store/testing.go | 2 +- testing/docker-test-runner/Dockerfile | 37 +++-- .../prepare-test-environment.sh | 19 ++- 101 files changed, 901 insertions(+), 373 deletions(-) create mode 100644 README.ru.md create mode 100644 deploy/deployment.yaml create mode 100644 deploy/docker-compose.yaml create mode 100644 deploy/pgscv.default create mode 100644 deploy/pgscv.service create mode 100644 deploy/pgscv.yaml delete mode 100644 doc/adr/20210710.1-remove-query-normalization.md delete mode 100644 doc/adr/20210710.2-reject-using-pg_query-fingerprints.md create mode 100644 docker_entrypoint.sh diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 9af5c85..2ce418d 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -1,16 +1,32 @@ --- name: Default -on: push +on: + push: + branches: + - 'dev' + paths-ignore: + - ".github/**" + - "deploy/**" + - "testing/**" + - "README*" + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + inputs: + reason: + description: 'Launch reason' + required: true + default: 'Run tests' jobs: test: runs-on: ubuntu-latest - container: lesovsky/pgscv-test-runner:0.0.9 + container: cherts/pgscv-test-runner:1.0.0 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare test environment run: prepare-test-environment.sh - name: Run lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14ddba8..e2380fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,17 +2,19 @@ name: Release on: + workflow_dispatch: push: tags: - - '*' + - "v0.*" + - "v1.*" jobs: test: runs-on: ubuntu-latest - container: lesovsky/pgscv-test-runner:0.0.9 + container: cherts/pgscv-test-runner:1.0.0 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare test environment run: prepare-test-environment.sh - name: Run lint @@ -25,13 +27,13 @@ jobs: needs: test steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build image run: make docker-build - name: Log in to Docker Hub - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} - name: Push image to Docker Hub run: make docker-push @@ -39,16 +41,18 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v2 + - name: Run checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - name: Run setup Go + uses: actions/setup-go@v4 with: - go-version: 1.18 - - uses: goreleaser/goreleaser-action@v2 + go-version: 1.22 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 with: version: latest - args: release --rm-dist + args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 9b83a57..505dae7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,6 +7,7 @@ builds: main: ./cmd goarch: - amd64 + - arm64 goos: - linux env: @@ -17,15 +18,39 @@ builds: archives: - builds: [pgscv] + builds_info: + group: root + owner: root + wrap_in_directory: false + files: + - LICENSE + - src: "deploy/pgscv.yaml" + strip_parent: true + info: + owner: root + group: root + mode: 0640 + - src: "deploy/pgscv.service" + strip_parent: true + info: + owner: root + group: root + mode: 0644 + - src: "deploy/pgscv.default" + strip_parent: true + info: + owner: root + group: root + mode: 0644 changelog: sort: asc nfpms: - vendor: pgscv - homepage: https://github.com/lesovsky/pgscv - maintainer: Alexey Lesovsky - description: pgSCV is a multi-purpose monitoring agent and metrics exporter + homepage: https://github.com/cherts/pgscv + maintainer: Mikhail Grigorev + description: pgSCV - PostgreSQL ecosystem metrics collector. license: BSD-3 formats: [] - bindir: /usr/bin \ No newline at end of file + bindir: /usr/sbin diff --git a/Dockerfile b/Dockerfile index c8ac2f9..1079919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,17 @@ -# stage 1 -# __release_tag__ golang 1.18 was released 2022-03-15 -FROM golang:1.18 as build +# stage 1 +# __release_tag__ golang 1.22 was released 2024-02-06 +FROM golang:1.22 as build LABEL stage=intermediate WORKDIR /app COPY . . RUN make build # stage 2: scratch -# __release_tag__ alpine 3.13 was released 2021-02-18 -FROM alpine:3.13 as dist +# __release_tag__ alpine 3.19.1 was released 2024-01-26 +FROM alpine:3.19.1 as dist COPY --from=build /app/bin/pgscv /bin/pgscv -CMD ["pgscv"] \ No newline at end of file +#COPY docker_entrypoint.sh /bin/ +EXPOSE 9890 +ENTRYPOINT ["/bin/pgscv"] +#ENTRYPOINT ["/bin/docker_entrypoint.sh"] +CMD ["--log-level=info"] diff --git a/Makefile b/Makefile index 0d69b6d..829db5c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DOCKER_ACCOUNT = lesovsky +DOCKER_ACCOUNT = cherts APPNAME = pgscv TAG=$(shell git describe --tags --abbrev=0) @@ -9,7 +9,7 @@ LDFLAGS = -a -installsuffix cgo -ldflags "-X main.appName=${APPNAME} -X main.git .PHONY: help \ clean lint test race \ - build migrate docker-build docker-push deploy + build docker-build docker-push go-update .DEFAULT_GOAL := help @@ -21,10 +21,18 @@ clean: ## Clean rm -f ./bin/${APPNAME} ./bin/${APPNAME}.tar.gz ./bin/${APPNAME}.version ./bin/${APPNAME}.sha256 rmdir ./bin +go-update: # Update go mod + go mod tidy -compat=1.22 + go get -u ./cmd + go mod download + go get -u ./cmd + go mod download + dep: ## Get the dependencies go mod download lint: ## Lint the source files + go env -w GOFLAGS="-buildvcs=false" golangci-lint run --timeout 5m -E golint -e '(struct field|type|method|func) [a-zA-Z`]+ should be [a-zA-Z`]+' gosec -quiet ./... diff --git a/README.md b/README.md index a0e9b00..71b3ea9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ -# pgSCV - PostgreSQL ecosystem metrics collector. +# pgSCV - PostgreSQL ecosystem metrics collector + +[По-русски / In Russian](README.ru.md) ### pgSCV -- [collects](https://github.com/lesovsky/pgscv/wiki/Collectors) a lot of stats about PostgreSQL environment. +- [collects](https://github.com/cherts/pgscv/wiki/Collectors) a lot of stats about PostgreSQL environment. - exposes metrics through the HTTP `/metrics` endpoint in [Prometheus metrics exposition format](https://prometheus.io/docs/concepts/data_model/). **IMPORTANT NOTES** -pgSCV moved from 'weaponry' to 'lesovsky' GitHub account. From version 0.8.0 all features required for Weaponry will be removed: -- auto-discovery (all Postgres, Pgbouncer services have to be defined explicitly, by configuration file or environment variables) -- bootstrap, uninstall and auto-update -- push metrics to remote service -- Patroni support (because it has this feature built-in) +This project is a continuation of the development of the original pgSCV by [Lesovsky Alexey](https://github.com/lesovsky) ### Features - **Supported services:** support collecting metrics of PostgreSQL and Pgbouncer. @@ -22,45 +20,83 @@ pgSCV moved from 'weaponry' to 'lesovsky' GitHub account. From version 0.8.0 all block devices, network interfaces, filesystems, users, databases, etc. ### Requirements -- can run on Linux only; can connect to remote services running on other OS/PaaS. -- requisites for connecting to the services, such as login and password. -- database user should have privileges for executing stats functions and reading views. - For more details see [security considerations](https://github.com/lesovsky/pgscv/wiki/Security-considerations). +- Can run on Linux only; can connect to remote services running on other OS/PaaS. +- Requisites for connecting to the services, such as login and password. +- Database user should have privileges for executing stats functions and reading views. + For more details see [security considerations](https://github.com/cherts/pgscv/wiki/Security-considerations). ### Quick start -Download the archive from [releases](https://github.com/lesovsky/pgscv/releases). Unpack the archive. Start pgSCV under `postgres` user. +Download the archive from [releases](https://github.com/cherts/pgscv/releases). Unpack the archive. Create minimum config file. Start pgSCV systemd service under `postgres` user. + +```bash +curl -s -L https://github.com/cherts/pgscv/releases/download/v0.8.1/pgscv_0.8.1_linux_amd64.tar.gz -o - | tar xzf - -C /tmp && \ +mv /tmp/pgscv.yaml /etc && \ +mv /tmp/pgscv.service /etc/systemd/system && \ +mv /tmp/pgscv.default /etc/default/pgscv && \ +mv /tmp/pgscv /usr/sbin && \ +chown postgres:postgres /etc/pgscv.yaml && \ +systemctl daemon-reload && \ +systemctl enable pgscv --now +``` -```shell -wget https://github.com/lesovsky/pgscv/releases/download/v0.7.5/pgscv_0.7.5_linux_amd64.tar.gz -tar xvzf pgscv_0.7.5_linux_amd64.tar.gz -sudo -u postgres ./pgscv +or using Docker, use `DATABASE_DSN` for setting up a connection to PostgreSQL: +```bash +docker pull cherts/pgscv:latest +docker run -ti -d --name pgscv \ + -e PGSCV_LISTEN_ADDRESS=0.0.0.0:9890 \ + -e PGSCV_DISABLE_COLLECTORS="system" \ + -e DATABASE_DSN="postgresql://postgres:password@dbhost:5432/postgres" \ + -p 9890:9890 \ + --restart=always \ + cherts/pgscv:latest ``` -or using Docker, use `DATABASE_DSN` for setting up a connection to Postgres: +or using Docker, save `deploy/pgscv.yaml` config file to local directory /etc/pgscv: +```bash +docker pull cherts/pgscv:latest +docker run -ti -d --name pgscv \ + -v /etc/pgscv:/etc/app \ + -p 9890:9890 \ + --restart=always \ + cherts/pgscv:latest \ + --config-file=/etc/app/pgscv.yaml ``` -docker pull lesovsky/pgscv:latest -docker run -ti -e PGSCV_LISTEN_ADDRESS=0.0.0.0:9890 -e PGSCV_DISABLE_COLLECTORS="system" -e DATABASE_DSN="postgresql://postgres@dbhost/postgres" -p 9890:9890 lesovsky/pgscv:latest + +or using Docker-compose, edit file `docker-compose.yaml` for setting up a connection to PostgreSQL: +```bash +mkdir ~/pgscv +curl -s -L https://raw.githubusercontent.com/CHERTS/pgscv/master/deploy/docker-compose.yaml -o ~/pgscv/docker-compose.yaml && cd ~/pgscv +docker-compose up -d ``` When pgSCV has been started it is ready to accept HTTP requests at `http://127.0.0.1:9890/metrics`. +or using k8s +```bash +curl -s -L https://raw.githubusercontent.com/CHERTS/pgscv/master/deploy/deployment.yaml -o ~/deployment.yaml +kubectl apply -f ~/deployment.yaml +``` + ### Complete setup -Checkout complete setup [guide](https://github.com/lesovsky/pgscv/wiki/Setup-for-regular-users). +Checkout complete setup [guide](https://github.com/cherts/pgscv/wiki/Setup-for-regular-users). ### Documentation -For further documentation see [wiki](https://github.com/lesovsky/pgscv/wiki). +For further documentation see [wiki](https://github.com/cherts/pgscv/wiki). ### Support and feedback -If you need help using pgSCV feel free to open discussion or create an [issue](https://github.com/lesovsky/pgscv/issues) +If you need help using pgSCV feel free to open discussion via [email](sleuthhound@gmail.com) or Telegram [@cherts](https://t.me/cherts) or create an [issue](https://github.com/cherts/pgscv/issues) ### Development and contribution To help development you are encouraged to: -- provide [suggestion/feedback](https://github.com/lesovsky/pgscv/discussions) or [issue](https://github.com/lesovsky/pgscv/issues) +- provide feedback via [email](sleuthhound@gmail.com) or Telegram [@cherts](https://t.me/cherts) or create an [issue](https://github.com/cherts/pgscv/issues) - pull requests for new features - star the project -### Authors -- [Lesovsky Alexey](https://github.com/lesovsky) +### Current developer and maintaner +- [Mikhail Grigorev](https://github.com/cherts) + +### Authors of original version +- [Alexey Lesovsky](https://github.com/lesovsky) ### License BSD-3. See [LICENSE](./LICENSE) for more details. diff --git a/README.ru.md b/README.ru.md new file mode 100644 index 0000000..75be34d --- /dev/null +++ b/README.ru.md @@ -0,0 +1,102 @@ +# pgSCV - Сборщик метрик экосистемы PostgreSQL + +[In English / По-английски](README.md) + +### pgSCV +- [собирает](https://github.com/cherts/pgscv/wiki/Collectors) много статистики о среде PostgreSQL; +- предоставляет метрики по HTTP через эндпойнт `/metrics` в [формат Prometheus](https://prometheus.io/docs/concepts/data_model/); + +**IMPORTANT NOTES** +Данный проект является продолжением развития оригинального pgSCV авторства [Lesovsky Alexey](https://github.com/lesovsky) + +### Основные возможности +- **Поддерживаемые сервисы**: поддержка сбора показателей работы PostgreSQL и Pgbouncer; +- **Метрики ОС:** поддержка сбора показателей работы операционной системы; +- **TLS и аутентификация**: Эндпойнт `/metrics` может быть защищен с помощью базовой аутентификации и TLS; +- **Сбор показателей из нескольких сервисов**: pgSCV может собирать метрики из многих экземпляров баз данных, включая базы данных расположенные в облачных средах (Amazon AWS, Yandex.Cloud, VK.Cloud); +- **Настраиваемые пользовательские метрики**: pgSCV можно настроить на сбор кастомных пользовательских метрик; +- **Управление коллекторами**: При необходимости коллекторы можно отключить; +- **Коллекторные фильтры**: Коллекторы можно настроить так, чтобы они пропускали сбор метрик на основе значений меток, например блочные устройства, сетевые интерфейсы, файловые системы, пользователи, базы данных и т.д.; + +### Системные требования: +- Может работать только в ОС Linux; +- Может подключаться к удаленным сервисам, работающим на другой ОС/PaaS; +- Необходимы данные для подключения к сервисам/базам, такие как адрес, логин и пароль; +- Пользователь базы данных должен иметь права на выполнение статистических функций и чтение представлений. + Для получения более подробной информации смотрите [соображения безопасности](https://github.com/cherts/pgscv/wiki/Security-considerations). + +### Быстрый старт +Загрузите архив со страницы [releases](https://github.com/cherts/pgscv/releases). Распакуйте архив. Создайте минимальный файл конфигураации. Запустите pgSCV под пользователем postgres. + +```bash +curl -s -L https://github.com/cherts/pgscv/releases/download/v0.8.1/pgscv_0.8.1_linux_amd64.tar.gz -o - | tar xzf - -C /tmp && \ +mv /tmp/pgscv.yaml /etc && \ +mv /tmp/pgscv.service /etc/systemd/system && \ +mv /tmp/pgscv.default /etc/default/pgscv && \ +mv /tmp/pgscv /usr/sbin && \ +chown postgres:postgres /etc/pgscv.yaml && \ +systemctl daemon-reload && \ +systemctl enable pgscv --now +``` + +или используя Docker, используйте `DATABASE_DSN` для настройки соединения с PostgreSQL: +```bash +docker pull cherts/pgscv:latest +docker run -ti -d --name pgscv \ + -e PGSCV_LISTEN_ADDRESS=0.0.0.0:9890 \ + -e PGSCV_DISABLE_COLLECTORS="system" \ + -e DATABASE_DSN="postgresql://postgres:password@dbhost:5432/postgres" \ + -p 9890:9890 \ + --restart=always \ + cherts/pgscv:latest +``` + +или используя Docker, сохраните файл конфигурации `deploy/pgscv.yaml` на локальный сервер в каталог /etc/pgscv: +```bash +docker pull cherts/pgscv:latest +docker run -ti -d --name pgscv \ + -v /etc/pgscv:/etc/app \ + -p 9890:9890 \ + --restart=always \ + cherts/pgscv:latest \ + --config-file=/etc/app/pgscv.yaml +``` + +или используя Docker-compose, отредактируйте файл `docker-compose.yaml` для настройки соединения с PostgreSQL: +```bash +mkdir ~/pgscv +curl -s -L https://raw.githubusercontent.com/CHERTS/pgscv/master/deploy/docker-compose.yaml -o ~/pgscv/docker-compose.yaml && cd ~/pgscv +docker-compose up -d +``` + +После запуска pgSCV он готов принимать HTTP-запросы по адресу `http://127.0.0.1:9890/metrics` + +или используя k8s +```bash +curl -s -L https://raw.githubusercontent.com/CHERTS/pgscv/master/deploy/deployment.yaml -o ~/deployment.yaml +kubectl apply -f ~/deployment.yaml +``` + +### Полная настройка +Полная настройка описана в [руководстве](https://github.com/cherts/pgscv/wiki/Setup-for-regular-users). + +### Документация +Дополнительную документацию смотрите в [wiki](https://github.com/cherts/pgscv/wiki). + +### Поддержка и обратная связь +Если вам нужна помощь в использовании pgSCV Вы можете написать мне на [email](sleuthhound@gmail.com) или в Telegram [@cherts](https://t.me/cherts) или открыть [issues](https://github.com/cherts/pgscv/issues). + +### Развитие и вклад +Для содействия развитию проекта Вы можете: +- написать мне на [email](sleuthhound@gmail.com) или в Telegram [@cherts](https://t.me/cherts) или создать [issue](https://github.com/cherts/pgscv/issues) +- запросить новую функциональность; +- поставить звезду проекту на Github; + +### Текущий разработчик и сопровождающий +- [Mikhail Grigorev](https://github.com/cherts) + +### Автор оригинальной версии +- [Alexey Lesovsky](https://github.com/lesovsky) + +### Лицензия +BSD-3. Смотри файл [LICENSE](./LICENSE) для получения большей информации. diff --git a/cmd/pgscv.go b/cmd/pgscv.go index c5ab3ce..42f8db4 100644 --- a/cmd/pgscv.go +++ b/cmd/pgscv.go @@ -3,8 +3,8 @@ package main import ( "context" "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/pgscv" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/pgscv" "gopkg.in/alecthomas/kingpin.v2" "os" "os/signal" diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 0000000..8926116 --- /dev/null +++ b/deploy/deployment.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pgscv + namespace: default + labels: + link-app: pgscv +spec: + replicas: 1 + selector: + matchLabels: + link-app: pgscv + template: + metadata: + labels: + link-app: pgscv + spec: + #hostNetwork: true + dnsPolicy: ClusterFirst + containers: + - name: pgscv + image: cherts/pgscv:latest + imagePullPolicy: Always + args: + - --config-file=/app/conf/pgscv.yaml +# env: +# - name: PGSCV_DISABLE_COLLECTORS +# value: "system" +# - name: PGSCV_LISTEN_ADDRESS +# value: "0.0.0.0:9890" +# - name: DATABASE_DSN +# value: "postgresql://postgres:password@127.0.0.1:5432/postgres" + ports: + - name: http + containerPort: 9890 + protocol: TCP + # Set up resources + resources: + limits: + cpu: "1" + memory: 500Mi + ephemeral-storage: "100Mi" + #securityContext: + # privileged: true + volumeMounts: + - name: pgscv-config + mountPath: /app/conf/ + # Disable automatic injection of service information into environment variables + enableServiceLinks: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + nodeSelector: + kubernetes.io/os: linux + securityContext: { } + tolerations: + - operator: Exists + # Set priority + priorityClassName: system-cluster-critical + # Volume + volumes: + - name: pgscv-config + configMap: + name: pgscv-configmap + items: + - key: pgscv.yaml + path: pgscv.yaml + +--- +apiVersion: v1 +kind: Service +metadata: + name: pgscv + namespace: default + labels: + link-app: pgscv +spec: + ports: + - name: http + port: 9890 + targetPort: 9890 + protocol: TCP + selector: + link-app: pgscv + sessionAffinity: ClientIP + type: ClusterIP + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: pgscv-configmap + namespace: default +data: + pgscv.yaml: | + listen_address: 0.0.0.0:9890 + services: + "postgres:5432": + service_type: "postgres" + conninfo: "postgres://postgres:password@127.0.0.1:5432/postgres" + "pgbouncer:6432": + service_type: "pgbouncer" + conninfo: "postgres://pgbouncer:password@127.0.0.1:6432/pgbouncer" diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml new file mode 100644 index 0000000..a2c9039 --- /dev/null +++ b/deploy/docker-compose.yaml @@ -0,0 +1,18 @@ +services: + pgscv: + image: cherts/pgscv:latest + container_name: pgscv + restart: always + privileged: true + #cpus: 1 + #mem_limit: 1g + ports: + - 9890:9890 + environment: + PGSCV_DISABLE_COLLECTORS: "system" + PGSCV_LISTEN_ADDRESS: "0.0.0.0:9890" + DATABASE_DSN: "postgresql://postgres:password@dbhost:5432/postgres" +# command: +# - --config-file=/app/conf/pgscv.yaml +# volumes: +# - /etc/pgscv:/app/conf diff --git a/deploy/pgscv.default b/deploy/pgscv.default new file mode 100644 index 0000000..23cb5b6 --- /dev/null +++ b/deploy/pgscv.default @@ -0,0 +1 @@ +ARGS='--config-file=/etc/pgscv.yaml' diff --git a/deploy/pgscv.service b/deploy/pgscv.service new file mode 100644 index 0000000..43174ae --- /dev/null +++ b/deploy/pgscv.service @@ -0,0 +1,25 @@ +[Unit] +Description=pgSCV - PostgreSQL ecosystem metrics collector +Documentation=https://github.com/cherts/pgscv +Requires=network-online.target +After=network-online.target + +[Service] +Type=simple +User=postgres +Group=postgres +EnvironmentFile=-/etc/default/pgscv +# Start the agent process +ExecStart=/usr/sbin/pgscv $ARGS +# Kill all processes in the cgroup +KillMode=control-group +# Wait reasonable amount of time for agent up/down +TimeoutSec=5 +# Restart agent if it crashes +Restart=on-failure +RestartSec=10 +# if agent leaks during long period of time, let him to be the first person for eviction +OOMScoreAdjust=1000 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/pgscv.yaml b/deploy/pgscv.yaml new file mode 100644 index 0000000..31c07d5 --- /dev/null +++ b/deploy/pgscv.yaml @@ -0,0 +1,71 @@ +listen_address: 127.0.0.1:9890 +#authentication: +# username: monitoring +# password: supersecretpassword +# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key +# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem +#no_track_mode: false +services: + "postgres:5432": + service_type: "postgres" + conninfo: "postgres://postgres:password@127.0.0.1:5432/postgres" + "pgbouncer:6432": + service_type: "pgbouncer" + conninfo: "postgres://pgbouncer:password@127.0.0.1:6432/pgbouncer" +#disable_collectors: +# - system/loadaverage +# - system/cpu +# - system/diskstats +# - system/filesystems +# - system/netdev +# - system/network +# - system/memory +# - system/sysconfig +# - postgres/activity +# - postgres/archiver +# - postgres/bgwriter +# - postgres/conflicts +# - postgres/databases +# - postgres/indexes +# - postgres/functions +# - postgres/locks +# - postgres/logs +# - postgres/replication +# - postgres/replication_slots +# - postgres/statements +# - postgres/schemas +# - postgres/settings +# - postgres/storage +# - postgres/tables +# - postgres/wal +# - postgres/custom +# - pgbouncer/pools +# - pgbouncer/stats +# - pgbouncer/settings +# - system/pgscv +#databases: "^(a-z_)+_prod$" +#collectors: +# postgres/custom: +# filters: +# database: +# exclude: "^(uat|dev|stage)_.+$" +# subsystems: +# table: +# databases: "test[0-9]+|pgbench" +# query: "select schemaname,relname,seq_scan,n_tup_ins,n_tup_upd,n_tup_del from pg_stat_user_tables" +# metrics: +# - name: seq_scans +# usage: COUNTER +# value: seq_scan +# labels: +# - schemaname +# - relname +# description: "Total number of tuples by operation." +# - name: tuples_totals +# usage: COUNTER +# labeled_values: +# tuples: [ n_tup_ins, n_tup_upd, n_tup_del ] +# labels: +# - schemaname +# - relname +# description: "Total number of tuples by operation." diff --git a/doc/adr/20210710.1-remove-query-normalization.md b/doc/adr/20210710.1-remove-query-normalization.md deleted file mode 100644 index 1d939bf..0000000 --- a/doc/adr/20210710.1-remove-query-normalization.md +++ /dev/null @@ -1,19 +0,0 @@ -## Remove queries normalization - -Effective date: 2021-07-10 - -### Status -Queries normalization used by statements' collector has been removed. - -### Context -Using our own normalization rules add differences between Postgres native normalized queries and queries normalized by pgSCV. -Also, custom normalization adds extra ID (MD5 hash were used) for queries which is similar to native `queryid`. - -### Decision -Remove query normalization routine and remove extra ID generated during normalization. Use native `queryid` provided by Postgres for query differentiation. - -### Consequences -1. `NEGATIVE` This change statements metrics - `md5` label is replaced by `queryid` label. -2. `POSITIVE` Reduce complexity and ambiguity for people when comparing queries provided by pgSCV and Postgres. -3. `POSITIVE` Keep compatibility between queries in Postgres and pgSCV (and Weaponry). -4. `POSITIVE` Minor performance improvement because no need to calculate MD5 sums. \ No newline at end of file diff --git a/doc/adr/20210710.2-reject-using-pg_query-fingerprints.md b/doc/adr/20210710.2-reject-using-pg_query-fingerprints.md deleted file mode 100644 index c85d205..0000000 --- a/doc/adr/20210710.2-reject-using-pg_query-fingerprints.md +++ /dev/null @@ -1,30 +0,0 @@ -## Reject using queries fingerprints provided by [pg_query](https://github.com/pganalyze/pg_query_go) library - -Effective date: 2021-07-10 - -### Status -Do not use [pg_query](https://github.com/pganalyze/pg_query_go) fingerprints. - -### Context -`pg_query` provides unique fingerprints based on queries (better than native Postgres `queryid`). Using fingerprints, it is possible to distinguish queries extracted from many sources like pg_stat_statements, pg_stat_activity, Postgres server logs, etc. Using such fingerprints allow to identify queries independently are they normalized or not. For example, it possible to extract raw query from logs, get query from pg_stat_statements, calculate its fingerprints and match them. - -### Decision -Reject pg_query fingerprints. Since Postgres 14 there is [`compute_query_id`](https://www.postgresql.org/docs/14/runtime-config-statistics.html#GUC-COMPUTE-QUERY-ID) introduced. The `queryid` field of pg_stat_statements become available in pg_stat_activity and server logs (with properly configured `log_line_prefix`). Also go library is CGO based which might incur possible performance drawback when calculating too often and too many fingerprints (due to direct calling C functions), but no real performance tests have been made. - -### Consequences -1. `NEGATIVE` Use native, but less effective way of calculating `queryid`. -2. `POSITIVE` Keep compatibility with Postgres in way of using common `queryid` instead of less-known fingerprint. -3. `POSITIVE` Limited support of Postgres before version 14 (which don't have `compute_query_id`). - -### Extra -Small test has been made. -- build pgSCV with calculating fingerprints -- run every-second polling of `/metrics` endpoint -- compare memory usage between pgSCV running on the same host but without fingerprints -``` - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 261691 postgres 20 0 2943220 1,0g 15820 S 0,0 3,1 54:47.74 ./bin/pgscv - 7135 root 20 0 722796 26692 11268 S 0,0 0,1 92:52.66 /usr/local/pgscv/bin/pgscv --config-file=/etc/pgscv.yaml -``` - -- `./bin/pgscv` with fingerprints takes ~1GB RES vs. ~26MB RES of non-fingerprint version of pgSCV. \ No newline at end of file diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh new file mode 100644 index 0000000..50a2d97 --- /dev/null +++ b/docker_entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +ARG1=$1 + +case "${ARG1}" in +"bash" | "sh") + echo ${ARG1} + exec "$@" + ;; +*) + exec /bin/pgscv "$@" + ;; +esac diff --git a/go.mod b/go.mod index 04500a7..edecbd4 100644 --- a/go.mod +++ b/go.mod @@ -1,42 +1,45 @@ -module github.com/lesovsky/pgscv +module github.com/cherts/pgscv -go 1.18 +go 1.22 require ( - github.com/jackc/pgproto3/v2 v2.0.2 - github.com/jackc/pgx/v4 v4.8.0 - github.com/nxadm/tail v1.4.4 - github.com/prometheus/client_golang v1.11.1 - github.com/rs/zerolog v1.15.0 - github.com/stretchr/testify v1.5.1 - golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 // indirect - golang.org/x/net v0.0.0-20200625001655-4c5254603344 - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + github.com/jackc/pgproto3/v2 v2.3.2 + github.com/jackc/pgx/v4 v4.18.1 + github.com/nxadm/tail v1.4.11 + github.com/prometheus/client_golang v1.18.0 + github.com/rs/zerolog v1.32.0 + github.com/stretchr/testify v1.8.4 + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/net v0.21.0 + golang.org/x/sys v0.17.0 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect - github.com/golang/protobuf v1.4.3 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.6.3 // indirect + github.com/jackc/pgconn v1.14.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/pgtype v1.4.2 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect + github.com/jackc/pgtype v1.14.2 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect - golang.org/x/text v0.3.8 // indirect - golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect - google.golang.org/protobuf v1.26.0-rc.1 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 52ec2b2..176840e 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -7,22 +8,30 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= +github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= 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/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -30,8 +39,11 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -44,14 +56,19 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -64,12 +81,22 @@ github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.6.3 h1:4Ks3RKvSvKPolXZsnLQTDAsokDhgID14Cv4ehECmzlY= github.com/jackc/pgconn v1.6.3/go.mod h1:w2pne1C2tZgP+TvjqLpOigGzNqjBgQW9dUw/4Chex78= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgconn v1.14.1 h1:smbxIaZA08n6YuxEX1sDyjV/qkbtUtkH20qLkR9MUR4= +github.com/jackc/pgconn v1.14.1/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= @@ -78,9 +105,16 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1: github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.2 h1:q1Hsy66zh4vuNsajBUF2PNqfAMMfxU5mk594lPE9vjY= github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= +github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= @@ -89,6 +123,10 @@ github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkAL github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= github.com/jackc/pgtype v1.4.2 h1:t+6LWm5eWPLX1H5Se702JSBcirq6uWa4jiG4wV1rAWY= github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.14.2 h1:QBdZQTKpPdBlw2AdKwHEyqUcm/lrl2cwWAHjCMyln/o= +github.com/jackc/pgtype v1.14.2/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= @@ -97,10 +135,15 @@ github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6 github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= github.com/jackc/pgx/v4 v4.8.0 h1:xO3bPvwr0MJSoDfb4yeeWZIxSZ2VFBm5axPnaNEnGUQ= github.com/jackc/pgx/v4 v4.8.0/go.mod h1:AjqYcDmEyst6GF8jJi/RF73Gla9d7/HLZzJEZj2uwpM= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= +github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -114,6 +157,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= @@ -123,16 +167,26 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -141,6 +195,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -152,28 +208,41 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= +github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0 h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc h1:jUIKcSPO9MoMJBbEoyE/RJoE8vz7Mb8AjvifMMwSyvY= github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -181,32 +250,54 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -217,12 +308,18 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -233,21 +330,42 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -255,11 +373,18 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -269,12 +394,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -285,4 +414,9 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 459ea64..0f638d7 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "sync" ) diff --git a/internal/collector/collector_common.go b/internal/collector/collector_common.go index 9e81998..fc2c19e 100644 --- a/internal/collector/collector_common.go +++ b/internal/collector/collector_common.go @@ -3,10 +3,10 @@ package collector import ( "database/sql" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "regexp" "strconv" diff --git a/internal/collector/collector_common_test.go b/internal/collector/collector_common_test.go index e7cc78d..db032a7 100644 --- a/internal/collector/collector_common_test.go +++ b/internal/collector/collector_common_test.go @@ -3,9 +3,9 @@ package collector import ( "database/sql" "fmt" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" "regexp" @@ -278,7 +278,7 @@ func Test_updateFromSingleDatabase(t *testing.T) { for m := range ch { //fmt.Println(m.Desc().String()) counter++ - for _, s := range []string{"postgres_example1_value1", `const="example"`, `variableLabels: [label1]`} { + for _, s := range []string{"postgres_example1_value1", `const="example"`, `variableLabels: {label1}`} { assert.True(t, strings.Contains(m.Desc().String(), s)) } } diff --git a/internal/collector/config.go b/internal/collector/config.go index 9256fd6..7e14ab0 100644 --- a/internal/collector/config.go +++ b/internal/collector/config.go @@ -3,9 +3,9 @@ package collector import ( "context" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "net" "regexp" "strconv" diff --git a/internal/collector/config_test.go b/internal/collector/config_test.go index d837b07..f43df98 100644 --- a/internal/collector/config_test.go +++ b/internal/collector/config_test.go @@ -1,7 +1,7 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/filesystem_common.go b/internal/collector/filesystem_common.go index 43da5c2..756c1a8 100644 --- a/internal/collector/filesystem_common.go +++ b/internal/collector/filesystem_common.go @@ -3,7 +3,7 @@ package collector import ( "bufio" "fmt" - "github.com/lesovsky/pgscv/internal/log" + "github.com/cherts/pgscv/internal/log" "io" "os" "strings" diff --git a/internal/collector/linux_cpu.go b/internal/collector/linux_cpu.go index 267aeca..368747b 100644 --- a/internal/collector/linux_cpu.go +++ b/internal/collector/linux_cpu.go @@ -4,8 +4,8 @@ import ( "bufio" "bytes" "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_diskstats.go b/internal/collector/linux_diskstats.go index 7a06616..92ba52c 100644 --- a/internal/collector/linux_diskstats.go +++ b/internal/collector/linux_diskstats.go @@ -4,9 +4,9 @@ import ( "bufio" "bytes" "fmt" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_diskstats_test.go b/internal/collector/linux_diskstats_test.go index 4479f8d..dece7de 100644 --- a/internal/collector/linux_diskstats_test.go +++ b/internal/collector/linux_diskstats_test.go @@ -1,8 +1,8 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "os" "path/filepath" diff --git a/internal/collector/linux_filesystem.go b/internal/collector/linux_filesystem.go index 1ede1c8..e5ad0b9 100644 --- a/internal/collector/linux_filesystem.go +++ b/internal/collector/linux_filesystem.go @@ -3,9 +3,9 @@ package collector import ( "errors" "fmt" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_filesystem_test.go b/internal/collector/linux_filesystem_test.go index 1f067b1..4e3b782 100644 --- a/internal/collector/linux_filesystem_test.go +++ b/internal/collector/linux_filesystem_test.go @@ -1,8 +1,8 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "os" "path/filepath" diff --git a/internal/collector/linux_load_average.go b/internal/collector/linux_load_average.go index f4e64b0..27e0754 100644 --- a/internal/collector/linux_load_average.go +++ b/internal/collector/linux_load_average.go @@ -2,8 +2,8 @@ package collector import ( "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "os" "strconv" diff --git a/internal/collector/linux_memory.go b/internal/collector/linux_memory.go index b1c8ee2..45bf55d 100644 --- a/internal/collector/linux_memory.go +++ b/internal/collector/linux_memory.go @@ -3,9 +3,9 @@ package collector import ( "bufio" "fmt" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_memory_test.go b/internal/collector/linux_memory_test.go index db85cb1..ace8324 100644 --- a/internal/collector/linux_memory_test.go +++ b/internal/collector/linux_memory_test.go @@ -41,7 +41,7 @@ func TestMeminfoCollector_Update(t *testing.T) { "node_memory_WritebackTmp", "node_memory_NFS_Unstable", "node_memory_DirectMap2M", "node_memory_Hugetlb", "node_memory_CmaTotal", "node_memory_Mlocked", "node_memory_ShmemPmdMapped", "node_memory_SUnreclaim", "node_memory_KernelStack", "node_memory_VmallocChunk", "node_memory_Percpu", "node_memory_HardwareCorrupted", - "node_memory_CmaFree", "node_memory_CmaTotal", + "node_memory_CmaFree", "node_memory_CmaTotal", "node_memory_Zswap", "node_memory_Zswapped", "node_memory_SecPageTables", // vmstat "node_vmstat_nr_free_pages", "node_vmstat_nr_zone_inactive_anon", "node_vmstat_nr_zone_active_anon", "node_vmstat_nr_zone_inactive_file", "node_vmstat_nr_zone_active_file", "node_vmstat_nr_zone_unevictable", @@ -95,6 +95,12 @@ func TestMeminfoCollector_Update(t *testing.T) { "node_vmstat_thp_fault_fallback_charge", "node_vmstat_nr_swapcached", "node_vmstat_direct_map_level2_splits", "node_vmstat_direct_map_level3_splits", "node_vmstat_workingset_refault", "node_vmstat_workingset_activate", "node_vmstat_workingset_restore", "node_vmstat_pgdemote_kswapd", "node_vmstat_pgdemote_direct", + "node_vmstat_pgsteal_khugepaged", "node_vmstat_pgskip_device", "node_vmstat_pgdemote_khugepaged", + "node_vmstat_thp_scan_exceed_none_pte", "node_vmstat_nr_throttled_written", "node_vmstat_thp_scan_exceed_share_pte", + "node_vmstat_pgpromote_candidate", "node_vmstat_pgscan_khugepaged", "node_vmstat_zswpin", + "node_vmstat_thp_scan_exceed_swap_pte", "node_vmstat_allocstall_device", "node_vmstat_pgpromote_success", + "node_vmstat_pgalloc_device", "node_vmstat_nr_sec_page_table_pages", "node_vmstat_cow_ksm", + "node_vmstat_ksm_swpin_copy", "node_vmstat_zswpout", }, collector: NewMeminfoCollector, } diff --git a/internal/collector/linux_netdev.go b/internal/collector/linux_netdev.go index 41f50e6..2f4116e 100644 --- a/internal/collector/linux_netdev.go +++ b/internal/collector/linux_netdev.go @@ -3,9 +3,9 @@ package collector import ( "bufio" "fmt" - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_netdev_test.go b/internal/collector/linux_netdev_test.go index 928ad13..399819d 100644 --- a/internal/collector/linux_netdev_test.go +++ b/internal/collector/linux_netdev_test.go @@ -1,8 +1,8 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "os" "path/filepath" diff --git a/internal/collector/linux_network.go b/internal/collector/linux_network.go index 82120b2..5779699 100644 --- a/internal/collector/linux_network.go +++ b/internal/collector/linux_network.go @@ -2,8 +2,8 @@ package collector import ( "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "net" "strings" diff --git a/internal/collector/linux_sysconfig.go b/internal/collector/linux_sysconfig.go index a8a6a15..b26738c 100644 --- a/internal/collector/linux_sysconfig.go +++ b/internal/collector/linux_sysconfig.go @@ -4,8 +4,8 @@ import ( "bufio" "bytes" "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/linux_sysinfo.go b/internal/collector/linux_sysinfo.go index 5096ccd..4ba2e2a 100644 --- a/internal/collector/linux_sysinfo.go +++ b/internal/collector/linux_sysinfo.go @@ -3,8 +3,8 @@ package collector import ( "bufio" "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "io" "os" diff --git a/internal/collector/pgbouncer_pools.go b/internal/collector/pgbouncer_pools.go index d81bbc4..b4bfaf7 100644 --- a/internal/collector/pgbouncer_pools.go +++ b/internal/collector/pgbouncer_pools.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/pgbouncer_pools_test.go b/internal/collector/pgbouncer_pools_test.go index b68bd5b..bde44c8 100644 --- a/internal/collector/pgbouncer_pools_test.go +++ b/internal/collector/pgbouncer_pools_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/pgbouncer_settings.go b/internal/collector/pgbouncer_settings.go index 63274d0..45e8354 100644 --- a/internal/collector/pgbouncer_settings.go +++ b/internal/collector/pgbouncer_settings.go @@ -5,9 +5,9 @@ import ( "context" "fmt" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "os" "path/filepath" diff --git a/internal/collector/pgbouncer_settings_test.go b/internal/collector/pgbouncer_settings_test.go index 47d44d4..0125aa8 100644 --- a/internal/collector/pgbouncer_settings_test.go +++ b/internal/collector/pgbouncer_settings_test.go @@ -3,8 +3,8 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/pgbouncer_stats.go b/internal/collector/pgbouncer_stats.go index 35196f7..1796f6b 100644 --- a/internal/collector/pgbouncer_stats.go +++ b/internal/collector/pgbouncer_stats.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/pgbouncer_stats_test.go b/internal/collector/pgbouncer_stats_test.go index a9e48fd..623bfeb 100644 --- a/internal/collector/pgbouncer_stats_test.go +++ b/internal/collector/pgbouncer_stats_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/pgscv_services.go b/internal/collector/pgscv_services.go index b9a3374..c8d84ed 100644 --- a/internal/collector/pgscv_services.go +++ b/internal/collector/pgscv_services.go @@ -1,7 +1,7 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" ) diff --git a/internal/collector/postgres_activity.go b/internal/collector/postgres_activity.go index 6a37695..e30fd52 100644 --- a/internal/collector/postgres_activity.go +++ b/internal/collector/postgres_activity.go @@ -2,9 +2,9 @@ package collector import ( "context" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "regexp" "strconv" diff --git a/internal/collector/postgres_activity_test.go b/internal/collector/postgres_activity_test.go index ba487a6..5e2ef7e 100644 --- a/internal/collector/postgres_activity_test.go +++ b/internal/collector/postgres_activity_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_archiver.go b/internal/collector/postgres_archiver.go index fc4542a..22e6612 100644 --- a/internal/collector/postgres_archiver.go +++ b/internal/collector/postgres_archiver.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_archiver_test.go b/internal/collector/postgres_archiver_test.go index e180f85..2cb5eea 100644 --- a/internal/collector/postgres_archiver_test.go +++ b/internal/collector/postgres_archiver_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_bgwriter.go b/internal/collector/postgres_bgwriter.go index 23d63d7..335a04d 100644 --- a/internal/collector/postgres_bgwriter.go +++ b/internal/collector/postgres_bgwriter.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_bgwriter_test.go b/internal/collector/postgres_bgwriter_test.go index 3fbbdf3..88d35e0 100644 --- a/internal/collector/postgres_bgwriter_test.go +++ b/internal/collector/postgres_bgwriter_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_common.go b/internal/collector/postgres_common.go index 6903660..4687f8d 100644 --- a/internal/collector/postgres_common.go +++ b/internal/collector/postgres_common.go @@ -2,9 +2,9 @@ package collector import ( "context" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "strconv" "strings" ) @@ -18,6 +18,8 @@ const ( PostgresV12 = 120000 PostgresV13 = 130000 PostgresV14 = 140000 + PostgresV15 = 150000 + PostgresV16 = 160000 // Minimal required version is 9.5. PostgresVMinNum = PostgresV95 diff --git a/internal/collector/postgres_common_test.go b/internal/collector/postgres_common_test.go index 8b8ed29..5612ac4 100644 --- a/internal/collector/postgres_common_test.go +++ b/internal/collector/postgres_common_test.go @@ -3,8 +3,8 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_conflicts.go b/internal/collector/postgres_conflicts.go index 1683fd1..193c9e0 100644 --- a/internal/collector/postgres_conflicts.go +++ b/internal/collector/postgres_conflicts.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_conflicts_test.go b/internal/collector/postgres_conflicts_test.go index 7bc34c3..258eb16 100644 --- a/internal/collector/postgres_conflicts_test.go +++ b/internal/collector/postgres_conflicts_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_custom.go b/internal/collector/postgres_custom.go index c8dca16..92349d3 100644 --- a/internal/collector/postgres_custom.go +++ b/internal/collector/postgres_custom.go @@ -1,7 +1,7 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" ) diff --git a/internal/collector/postgres_custom_test.go b/internal/collector/postgres_custom_test.go index a1c89a0..ebe5716 100644 --- a/internal/collector/postgres_custom_test.go +++ b/internal/collector/postgres_custom_test.go @@ -1,7 +1,7 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "testing" ) diff --git a/internal/collector/postgres_database.go b/internal/collector/postgres_database.go index 21a4270..c9523fc 100644 --- a/internal/collector/postgres_database.go +++ b/internal/collector/postgres_database.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_database_test.go b/internal/collector/postgres_database_test.go index 0927fb2..00c9503 100644 --- a/internal/collector/postgres_database_test.go +++ b/internal/collector/postgres_database_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_functions.go b/internal/collector/postgres_functions.go index 343baff..1216c15 100644 --- a/internal/collector/postgres_functions.go +++ b/internal/collector/postgres_functions.go @@ -2,9 +2,9 @@ package collector import ( "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/postgres_functions_test.go b/internal/collector/postgres_functions_test.go index dcf3c31..9e232e9 100644 --- a/internal/collector/postgres_functions_test.go +++ b/internal/collector/postgres_functions_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_indexes.go b/internal/collector/postgres_indexes.go index 553ede1..2c44800 100644 --- a/internal/collector/postgres_indexes.go +++ b/internal/collector/postgres_indexes.go @@ -2,9 +2,9 @@ package collector import ( "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/postgres_indexes_test.go b/internal/collector/postgres_indexes_test.go index e9096c0..64965df 100644 --- a/internal/collector/postgres_indexes_test.go +++ b/internal/collector/postgres_indexes_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_locks.go b/internal/collector/postgres_locks.go index 1013a63..e5ff9dc 100644 --- a/internal/collector/postgres_locks.go +++ b/internal/collector/postgres_locks.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_locks_test.go b/internal/collector/postgres_locks_test.go index 39beace..97c587a 100644 --- a/internal/collector/postgres_locks_test.go +++ b/internal/collector/postgres_locks_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_logs.go b/internal/collector/postgres_logs.go index cb38ddc..06cabe7 100644 --- a/internal/collector/postgres_logs.go +++ b/internal/collector/postgres_logs.go @@ -2,9 +2,9 @@ package collector import ( "context" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/nxadm/tail" "github.com/prometheus/client_golang/prometheus" "io" diff --git a/internal/collector/postgres_logs_test.go b/internal/collector/postgres_logs_test.go index e416dca..3ae4ec4 100644 --- a/internal/collector/postgres_logs_test.go +++ b/internal/collector/postgres_logs_test.go @@ -4,8 +4,8 @@ import ( "bufio" "context" "fmt" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "os" "sync" diff --git a/internal/collector/postgres_replication.go b/internal/collector/postgres_replication.go index 7939f60..074a8f2 100644 --- a/internal/collector/postgres_replication.go +++ b/internal/collector/postgres_replication.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_replication_slots.go b/internal/collector/postgres_replication_slots.go index 8872c1b..57f8cbd 100644 --- a/internal/collector/postgres_replication_slots.go +++ b/internal/collector/postgres_replication_slots.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/postgres_replication_slots_test.go b/internal/collector/postgres_replication_slots_test.go index 10a3fad..3e31555 100644 --- a/internal/collector/postgres_replication_slots_test.go +++ b/internal/collector/postgres_replication_slots_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_replication_test.go b/internal/collector/postgres_replication_test.go index 1ccf4f4..ed53042 100644 --- a/internal/collector/postgres_replication_test.go +++ b/internal/collector/postgres_replication_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_schema.go b/internal/collector/postgres_schema.go index 2ecd8aa..8108fbc 100644 --- a/internal/collector/postgres_schema.go +++ b/internal/collector/postgres_schema.go @@ -2,9 +2,9 @@ package collector import ( "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "golang.org/x/net/context" "strings" diff --git a/internal/collector/postgres_schema_test.go b/internal/collector/postgres_schema_test.go index 53d537c..592778d 100644 --- a/internal/collector/postgres_schema_test.go +++ b/internal/collector/postgres_schema_test.go @@ -2,8 +2,8 @@ package collector import ( "context" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_settings.go b/internal/collector/postgres_settings.go index 9ddd2b3..cb0b863 100644 --- a/internal/collector/postgres_settings.go +++ b/internal/collector/postgres_settings.go @@ -2,9 +2,9 @@ package collector import ( "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "os" "regexp" diff --git a/internal/collector/postgres_settings_test.go b/internal/collector/postgres_settings_test.go index 40aac6b..64f928e 100644 --- a/internal/collector/postgres_settings_test.go +++ b/internal/collector/postgres_settings_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "os" "testing" diff --git a/internal/collector/postgres_statements.go b/internal/collector/postgres_statements.go index 372c10c..00ac5b9 100644 --- a/internal/collector/postgres_statements.go +++ b/internal/collector/postgres_statements.go @@ -3,9 +3,9 @@ package collector import ( "fmt" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/postgres_statements_test.go b/internal/collector/postgres_statements_test.go index dab165a..078821f 100644 --- a/internal/collector/postgres_statements_test.go +++ b/internal/collector/postgres_statements_test.go @@ -4,7 +4,7 @@ import ( "database/sql" "fmt" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_storage.go b/internal/collector/postgres_storage.go index d481752..38b6c10 100644 --- a/internal/collector/postgres_storage.go +++ b/internal/collector/postgres_storage.go @@ -3,9 +3,9 @@ package collector import ( "context" "fmt" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "os" "path/filepath" diff --git a/internal/collector/postgres_storage_test.go b/internal/collector/postgres_storage_test.go index 3c4700a..1ede643 100644 --- a/internal/collector/postgres_storage_test.go +++ b/internal/collector/postgres_storage_test.go @@ -3,8 +3,8 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "os" "testing" diff --git a/internal/collector/postgres_tables.go b/internal/collector/postgres_tables.go index 8f258bb..43deafe 100644 --- a/internal/collector/postgres_tables.go +++ b/internal/collector/postgres_tables.go @@ -2,9 +2,9 @@ package collector import ( "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" "strings" diff --git a/internal/collector/postgres_tables_test.go b/internal/collector/postgres_tables_test.go index 8a806cf..769a3f9 100644 --- a/internal/collector/postgres_tables_test.go +++ b/internal/collector/postgres_tables_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/postgres_wal.go b/internal/collector/postgres_wal.go index 6b05165..0db7458 100644 --- a/internal/collector/postgres_wal.go +++ b/internal/collector/postgres_wal.go @@ -1,9 +1,9 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "strconv" ) diff --git a/internal/collector/postgres_wal_test.go b/internal/collector/postgres_wal_test.go index c07ac4f..101d6d2 100644 --- a/internal/collector/postgres_wal_test.go +++ b/internal/collector/postgres_wal_test.go @@ -3,7 +3,7 @@ package collector import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/collector/testing.go b/internal/collector/testing.go index f9af2ad..7b87b61 100644 --- a/internal/collector/testing.go +++ b/internal/collector/testing.go @@ -1,8 +1,8 @@ package collector import ( - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" "regexp" @@ -44,7 +44,7 @@ func pipeline(t *testing.T, input pipelineInput) { assert.NoError(t, err) config.postgresServiceConfig = cfg case model.ServiceTypePgbouncer: - config.ConnString = "postgres://pgscv@127.0.0.1:6432/pgbouncer" + config.ConnString = "postgres://pgscv:pgscv@127.0.0.1:6432/pgbouncer" } go func() { diff --git a/internal/filter/filter.go b/internal/filter/filter.go index fa00220..0b3a070 100644 --- a/internal/filter/filter.go +++ b/internal/filter/filter.go @@ -1,7 +1,7 @@ package filter import ( - "github.com/lesovsky/pgscv/internal/log" + "github.com/cherts/pgscv/internal/log" "regexp" ) diff --git a/internal/http/http_server.go b/internal/http/http_server.go index d176de7..b8883a4 100644 --- a/internal/http/http_server.go +++ b/internal/http/http_server.go @@ -4,7 +4,7 @@ import ( "bufio" "bytes" "fmt" - "github.com/lesovsky/pgscv/internal/log" + "github.com/cherts/pgscv/internal/log" "github.com/prometheus/client_golang/prometheus/promhttp" "io" "net/http" @@ -94,9 +94,9 @@ func (s *Server) Serve() error { // handleRoot defines handler for '/' endpoint. func handleRoot() http.Handler { const htmlTemplate = ` -pgSCV / Weaponry metrics collector +pgSCV / PostgreSQL metrics collector -pgSCV / PostgreSQL metrics collector, for more info visit Github page. +pgSCV / PostgreSQL metrics collector, for more info visit Github page.

Metrics

diff --git a/internal/http/http_server_test.go b/internal/http/http_server_test.go index 9050160..1f4f0ef 100644 --- a/internal/http/http_server_test.go +++ b/internal/http/http_server_test.go @@ -108,7 +108,7 @@ func Test_handleRoot(t *testing.T) { body, err := io.ReadAll(res.Body) assert.NoError(t, err) - assert.Contains(t, string(body), `pgSCV / PostgreSQL metrics collector, for more info visit Github page.`) + assert.Contains(t, string(body), `pgSCV / PostgreSQL metrics collector, for more info visit Github page.`) res.Flush() } diff --git a/internal/model/model.go b/internal/model/model.go index 0cc1ef6..0795ec1 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -3,7 +3,7 @@ package model import ( "database/sql" "github.com/jackc/pgproto3/v2" - "github.com/lesovsky/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/filter" "regexp" ) diff --git a/internal/pgscv/config.go b/internal/pgscv/config.go index c0ab6ef..b9445eb 100644 --- a/internal/pgscv/config.go +++ b/internal/pgscv/config.go @@ -2,16 +2,18 @@ package pgscv import ( "fmt" - "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/http" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/service" - "gopkg.in/yaml.v2" + "io/fs" "os" "path/filepath" "regexp" "strings" + + "github.com/cherts/pgscv/internal/http" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/service" + "github.com/jackc/pgx/v4" + "gopkg.in/yaml.v2" ) const ( @@ -41,8 +43,12 @@ func NewConfig(configFilePath string) (*Config, error) { return newConfigFromEnv() } - log.Infoln("read configuration from ", configFilePath) - content, err := os.ReadFile(filepath.Clean(configFilePath)) + configRealPath, err := RealPath(configFilePath) + if err != nil { + return nil, err + } + log.Infoln("read configuration from ", configRealPath) + content, err := os.ReadFile(filepath.Clean(configRealPath)) if err != nil { return nil, err } @@ -57,6 +63,35 @@ func NewConfig(configFilePath string) (*Config, error) { return config, nil } +// Read real config file path +func RealPath(filePath string) (string, error) { + log.Infoln("reading file information ", filePath) + fileInfo, err := os.Lstat(filepath.Clean(filePath)) + if err != nil { + return filePath, err + } + if fileInfo.Mode()&fs.ModeSymlink != 0 { + log.Debugln("is symlink") + link, err := filepath.EvalSymlinks(filePath) + if err != nil { + return filePath, err + } + log.Debugln("resolved symlink to ", link) + return link, nil + } else if fileInfo.Mode().IsRegular() { + log.Debugln("is regular file") + return filePath, nil + } else if fileInfo.Mode()&fs.ModeNamedPipe != 0 { + log.Debugln("is named pipe") + return filePath, nil + } else if fileInfo.Mode().IsDir() { + log.Debugln("is directory") + return filePath, err + } else { + return filePath, err + } +} + // Validate checks configuration for stupid values and set defaults func (c *Config) Validate() error { if c.ListenAddress == "" { @@ -136,7 +171,7 @@ func (c *Config) Validate() error { // validateCollectorSettings validates collectors settings passed from main YAML configuration. func validateCollectorSettings(cs model.CollectorsSettings) error { - if cs == nil || len(cs) == 0 { + if len(cs) == 0 { return nil } @@ -271,22 +306,6 @@ func newConfigFromEnv() (*Config, error) { return config, nil } -// toggleAutoupdate control auto-update setting. -func toggleAutoupdate(value string) (string, error) { - // Empty value explicitly set to 'off'. - if value == "" { - return "off", nil - } - - // Valid values are 'devel', 'stable' and 'off'. All other are invalid. - switch value { - case "devel", "stable", "off": - return value, nil - default: - return "", fmt.Errorf("invalid value '%s' for 'autoupdate'", value) - } -} - // newDatabasesRegexp creates new regexp depending on passed string. func newDatabasesRegexp(s string) (*regexp.Regexp, error) { if s == "" { diff --git a/internal/pgscv/config_test.go b/internal/pgscv/config_test.go index 801b75c..24309c3 100644 --- a/internal/pgscv/config_test.go +++ b/internal/pgscv/config_test.go @@ -1,10 +1,10 @@ package pgscv import ( - "github.com/lesovsky/pgscv/internal/filter" - "github.com/lesovsky/pgscv/internal/http" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/service" + "github.com/cherts/pgscv/internal/filter" + "github.com/cherts/pgscv/internal/http" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/service" "github.com/stretchr/testify/assert" "os" "testing" @@ -47,7 +47,7 @@ func TestNewConfig(t *testing.T) { Defaults: map[string]string{}, ServicesConnsSettings: service.ConnsSettings{ "postgres:5432": {ServiceType: model.ServiceTypePostgresql, Conninfo: "host=127.0.0.1 port=5432 dbname=pgscv_fixtures user=pgscv"}, - "pgbouncer:6432": {ServiceType: model.ServiceTypePgbouncer, Conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv"}, + "pgbouncer:6432": {ServiceType: model.ServiceTypePgbouncer, Conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv password=pgscv"}, }, }, }, @@ -151,7 +151,7 @@ func TestConfig_Validate(t *testing.T) { valid: true, in: &Config{ListenAddress: "127.0.0.1:8080", ServicesConnsSettings: service.ConnsSettings{ "postgres:5432": {ServiceType: model.ServiceTypePostgresql, Conninfo: "host=127.0.0.1 dbname=pgscv_fixtures user=pgscv"}, - "pgbouncer:6432": {ServiceType: model.ServiceTypePgbouncer, Conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv"}, + "pgbouncer:6432": {ServiceType: model.ServiceTypePgbouncer, Conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv password=pgscv"}, }}, }, { @@ -451,30 +451,6 @@ func Test_newConfigFromEnv(t *testing.T) { } } -func Test_toggleAutoupdate(t *testing.T) { - testcases := []struct { - valid bool - in string - want string - }{ - {valid: true, in: "", want: "off"}, - {valid: true, in: "off", want: "off"}, - {valid: true, in: "devel", want: "devel"}, - {valid: true, in: "stable", want: "stable"}, - {valid: false, in: "invalid"}, - } - - for _, tc := range testcases { - got, err := toggleAutoupdate(tc.in) - if tc.valid { - assert.NoError(t, err) - assert.Equal(t, tc.want, got) - } else { - assert.Error(t, err) - } - } -} - func Test_newDatabasesRegexp(t *testing.T) { testcases := []struct { valid bool diff --git a/internal/pgscv/pgscv.go b/internal/pgscv/pgscv.go index cf60bdd..56dfa7f 100644 --- a/internal/pgscv/pgscv.go +++ b/internal/pgscv/pgscv.go @@ -3,9 +3,9 @@ package pgscv import ( "context" "errors" - "github.com/lesovsky/pgscv/internal/http" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/service" + "github.com/cherts/pgscv/internal/http" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/service" "sync" ) diff --git a/internal/pgscv/pgscv_test.go b/internal/pgscv/pgscv_test.go index 4828535..df0f9a2 100644 --- a/internal/pgscv/pgscv_test.go +++ b/internal/pgscv/pgscv_test.go @@ -2,10 +2,10 @@ package pgscv import ( "context" - "github.com/lesovsky/pgscv/internal/http" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/service" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/http" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/service" + "github.com/cherts/pgscv/internal/store" "github.com/stretchr/testify/assert" "io" "sync" @@ -56,7 +56,7 @@ func Test_runMetricsListener(t *testing.T) { assert.Equal(t, resp.StatusCode, http.StatusOK) body, err := io.ReadAll(resp.Body) assert.NoError(t, err) - assert.Contains(t, string(body), `pgSCV / PostgreSQL metrics collector, for more info visit Github page.`) + assert.Contains(t, string(body), `pgSCV / PostgreSQL metrics collector, for more info visit Github page.`) assert.NoError(t, resp.Body.Close()) // Make request to '/metrics' and assert response. diff --git a/internal/pgscv/testdata/pgscv-services-example.yaml b/internal/pgscv/testdata/pgscv-services-example.yaml index b0cd503..f03540f 100644 --- a/internal/pgscv/testdata/pgscv-services-example.yaml +++ b/internal/pgscv/testdata/pgscv-services-example.yaml @@ -5,4 +5,4 @@ services: conninfo: "host=127.0.0.1 port=5432 dbname=pgscv_fixtures user=pgscv" "pgbouncer:6432": service_type: "pgbouncer" - conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv" + conninfo: "host=127.0.0.1 port=6432 dbname=pgbouncer user=pgscv password=pgscv" diff --git a/internal/service/config.go b/internal/service/config.go index 8ae89ce..a8139bc 100644 --- a/internal/service/config.go +++ b/internal/service/config.go @@ -2,7 +2,7 @@ package service import ( "fmt" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "strings" ) diff --git a/internal/service/service.go b/internal/service/service.go index 06b28fb..6ab1bbb 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -2,10 +2,10 @@ package service import ( "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/collector" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" - "github.com/lesovsky/pgscv/internal/store" + "github.com/cherts/pgscv/internal/collector" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" + "github.com/cherts/pgscv/internal/store" "github.com/prometheus/client_golang/prometheus" "regexp" "sync" diff --git a/internal/service/service_test.go b/internal/service/service_test.go index 97b63ae..63e9033 100644 --- a/internal/service/service_test.go +++ b/internal/service/service_test.go @@ -1,7 +1,7 @@ package service import ( - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" "testing" diff --git a/internal/service/testing.go b/internal/service/testing.go index c23260e..3bca2a6 100644 --- a/internal/service/testing.go +++ b/internal/service/testing.go @@ -1,6 +1,6 @@ package service -import "github.com/lesovsky/pgscv/internal/model" +import "github.com/cherts/pgscv/internal/model" // TestSystemService returns system service for testing purposes func TestSystemService() Service { @@ -29,7 +29,7 @@ func TestPgbouncerService() Service { ServiceID: "pgbouncer:6432", ConnSettings: ConnSetting{ ServiceType: model.ServiceTypePgbouncer, - Conninfo: "host=127.0.0.1 port=6432 user=pgscv dbname=pgbouncer", + Conninfo: "host=127.0.0.1 port=6432 user=pgscv dbname=pgbouncer password=pgscv", }, } } diff --git a/internal/store/store.go b/internal/store/store.go index 358a21c..e587546 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -5,8 +5,8 @@ import ( "database/sql" "fmt" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/log" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/log" + "github.com/cherts/pgscv/internal/model" ) const ( diff --git a/internal/store/store_test.go b/internal/store/store_test.go index 21935d6..0a77067 100644 --- a/internal/store/store_test.go +++ b/internal/store/store_test.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/jackc/pgproto3/v2" "github.com/jackc/pgx/v4" - "github.com/lesovsky/pgscv/internal/model" + "github.com/cherts/pgscv/internal/model" "github.com/stretchr/testify/assert" "testing" ) diff --git a/internal/store/testing.go b/internal/store/testing.go index ba33b12..78361e1 100644 --- a/internal/store/testing.go +++ b/internal/store/testing.go @@ -6,7 +6,7 @@ import ( ) const TestPostgresConnStr = "host=127.0.0.1 port=5432 user=pgscv dbname=pgscv_fixtures sslmode=disable" -const TestPgbouncerConnStr = "host=127.0.0.1 port=6432 user=pgscv dbname=pgbouncer sslmode=disable" +const TestPgbouncerConnStr = "host=127.0.0.1 port=6432 user=pgscv dbname=pgbouncer sslmode=disable password=pgscv" func NewTest(t *testing.T) *DB { db, err := New(TestPostgresConnStr) diff --git a/testing/docker-test-runner/Dockerfile b/testing/docker-test-runner/Dockerfile index 581faed..c691430 100644 --- a/testing/docker-test-runner/Dockerfile +++ b/testing/docker-test-runner/Dockerfile @@ -1,27 +1,26 @@ -# lesovsky/pgscv-test-runner -# __release_tag__ postrges 14.2 was released 2022-02-10 -# __release_tag__ golang 1.18 was released 2022-03-15 -# __release_tag__ golangci-lint v1.45.2 was released 2022-03-24 -# __release_tag__ gosec v2.11.0 was released 2022-03-21 -FROM postgres:14.2 +# cherts/pgscv-test-runner +# __release_tag__ postrges 14.10 was released 2023-11-09 +# __release_tag__ golang 1.22 was released 2024-02-06 +# __release_tag__ golangci-lint v1.56.0 was released 2024-02-07 +# __release_tag__ gosec v2.18.2 was released 2023-10-23 +FROM postgres:14.10 -LABEL version="0.0.9" +LABEL version="1.0.0" # install dependencies RUN apt-get update && \ - apt-get install -y make gcc git curl pgbouncer && \ - curl -s -L https://golang.org/dl/go1.18.linux-amd64.tar.gz -o - | tar xzf - -C /usr/local && \ - cp /usr/local/go/bin/go /usr/local/bin/ && \ - curl -s -L https://github.com/golangci/golangci-lint/releases/download/v1.45.2/golangci-lint-1.45.2-linux-amd64.tar.gz -o - | \ - tar xzf - -C /usr/local golangci-lint-1.45.2-linux-amd64/golangci-lint && \ - cp /usr/local/golangci-lint-1.45.2-linux-amd64/golangci-lint /usr/local/bin/ && \ - curl -s -L https://github.com/securego/gosec/releases/download/v2.11.0/gosec_2.11.0_linux_amd64.tar.gz -o - | \ - tar xzf - -C /usr/local/bin gosec && \ - mkdir /usr/local/testing/ && \ + apt-get install -y vim make gcc git curl pgbouncer && \ + curl -s -L https://go.dev/dl/go1.22.0.linux-amd64.tar.gz -o - | tar xzf - -C /usr/local && \ + export PATH=$PATH:/usr/local/go/bin && \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOROOT)/bin v1.56.0 && \ + curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOROOT)/bin v2.18.2 && \ + mkdir /opt/testing/ && \ rm -rf /var/lib/apt/lists/* +ENV PATH="${PATH}:/usr/local/bin:/usr/local/go/bin" + # copy prepare test environment scripts -COPY prepare-test-environment.sh /usr/local/bin/ -COPY fixtures.sql /usr/local/testing/ +COPY prepare-test-environment.sh /usr/bin/ +COPY fixtures.sql /opt/testing/ -CMD ["echo", "I'm pgscv test runner 0.0.9"] +CMD ["echo", "I'm pgscv test runner 1.0.0"] diff --git a/testing/docker-test-runner/prepare-test-environment.sh b/testing/docker-test-runner/prepare-test-environment.sh index 2f67075..b10e745 100755 --- a/testing/docker-test-runner/prepare-test-environment.sh +++ b/testing/docker-test-runner/prepare-test-environment.sh @@ -1,12 +1,14 @@ -#!/bin/bash +#!/usr/bin/bash MAIN_DATADIR=/var/lib/postgresql/data/main STDB_DATADIR=/var/lib/postgresql/data/standby # init postgres +echo "InitDB..." su - postgres -c "/usr/lib/postgresql/14/bin/initdb -k -E UTF8 --locale=en_US.UTF-8 -D ${MAIN_DATADIR}" # add extra config parameters +echo "Creating main postgresql.auto.conf..." cat >> ${MAIN_DATADIR}/postgresql.auto.conf <> ${MAIN_DATADIR}/pg_hba.conf # run main postgres +echo "Run main PostgreSQL v14 via pg_ctl..." su - postgres -c "/usr/lib/postgresql/14/bin/pg_ctl -w -t 30 -l /var/run/postgresql/startup-main.log -D ${MAIN_DATADIR} start" su - postgres -c "psql -c \"SELECT pg_create_physical_replication_slot('standby_test_slot')\"" # run standby postgres +echo "Run pg_basebackup..." su - postgres -c "pg_basebackup -P -R -X stream -c fast -h 127.0.0.1 -p 5432 -U postgres -D ${STDB_DATADIR}" +echo "Creating standby postgresql.auto.conf..." cat >> ${STDB_DATADIR}/postgresql.auto.conf < /etc/pgbouncer/userlist.txt +echo '"pgscv" "pgscv"' > /etc/pgbouncer/userlist.txt # run pgbouncer +echo "Run pgbouncer..." su - postgres -c "/usr/sbin/pgbouncer -d /etc/pgbouncer/pgbouncer.ini" # check services availability +echo "Check services availability..." pg_isready -t 10 -h 127.0.0.1 -p 5432 -U pgscv -d postgres pg_isready -t 10 -h 127.0.0.1 -p 5433 -U pgscv -d postgres pg_isready -t 10 -h 127.0.0.1 -p 6432 -U pgscv -d pgbouncer