Skip to content

Feat/enable pg pool connection #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update README.md and start.sh to include pool min/max config
TAYTS committed Sep 10, 2022
commit eac906b659713e6a0d20df3d04194c9214437972
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ Additional information regarding the adapter and getting started is provided bel

PostgreSQL Prometheus Adapter supports:

* PostgreSQL 14
* PostgreSQL 13
* PostgreSQL 12
* PostgreSQL 11
- PostgreSQL 14
- PostgreSQL 13
- PostgreSQL 12
- PostgreSQL 11

## Building

@@ -54,7 +54,7 @@ export DATABASE_URL=...
```shell
Default: None
Description: Database connection parameters
Ex: “user=<> password=<> host=<> port=<> database=<>
Ex: “user=<> password=<> host=<> port=<> database=<> pool_min_conns=[] pool_max_conns=[]
```

#### Adapter parameters
@@ -80,6 +80,7 @@ Flags:
--pg-threads=1 Writer DB threads to run 1-10
--parser-threads=5 parser threads to run per DB writer 1-10
```

:point_right: Note: pg_commit_secs and pg_commit_rows controls when data rows will be flushed to database. First one to reach threshold will trigger the flush.

### Container
@@ -93,7 +94,7 @@ podman run --rm \
-e DATABASE_URL="user=testuser password=test123 host=192.168.12.36 port=5432 database=testdb" \
--detach \
crunchydata/postgresql-prometheus-adapterl:latest
```
```

#### Stop container

@@ -117,6 +118,7 @@ pg_commit_rows=20000 Write data to database every N Rows
pg_threads=1 Writer DB threads to run 1-10
parser_threads=5 parser threads to run per DB writer 1-10
```

:point_right: Note: pg_commit_secs and pg_commit_rows controls when data rows will be flushed to database. First one to reach threshold will trigger the flush.

## Prometheus Configuration
@@ -125,18 +127,18 @@ Add the following to your prometheus.yml:

```yaml
remote_write:
- url: "http://<ip address>:9201/write"
- url: "http://<ip address>:9201/write"
remote_read:
- url: "http://<ip address>:9201/read"
```
- url: "http://<ip address>:9201/read"
```
## Maintainers
The PostgreSQL Prometheus Adapter is maintained by the team at [Crunchy Data](https://www.crunchydata.com/).
## Contributing to the Project
Want to contribute to the PostgreSQL Prometheus Adapter? Great! Please use GitHub to submit an issue for the PostgreSQL Prometheus Adapter project. If you would like to work the issue, please add that information in the issue so that we can confirm we are not already working no need to duplicate efforts.
Want to contribute to the PostgreSQL Prometheus Adapter? Great! Please use GitHub to submit an issue for the PostgreSQL Prometheus Adapter project. If you would like to work the issue, please add that information in the issue so that we can confirm we are not already working no need to duplicate efforts.
## License
3 changes: 1 addition & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

if [[ "${DATABASE_URL}" == "" ]]; then
echo 'Missing DATABASE_URL'
echo 'example -e DATABASE_URL="user=<db user> password=<db user password> host=<db host> port=<db port> database=<db name>"'
echo 'example -e DATABASE_URL="user=<db user> password=<db user password> host=<db host> port=<db port> database=<db name> pool_min_conns=[minimum pool connection] pool_max_conns=[maximum pool connection]"'
exit 1
fi

@@ -46,4 +46,3 @@ echo /postgresql-prometheus-adapter \
--pg-commit-rows=${pg_commit_rows} \
--pg-threads=${pg_threads} \
--parser-threads=${parser_threads}