forked from lesovsky/pgscv
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
- Loading branch information
Showing
101 changed files
with
901 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
#COPY docker_entrypoint.sh /bin/ | ||
EXPOSE 9890 | ||
ENTRYPOINT ["/bin/pgscv"] | ||
#ENTRYPOINT ["/bin/docker_entrypoint.sh"] | ||
CMD ["--log-level=info"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]([email protected]) 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]([email protected]) 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. |
Oops, something went wrong.