-
Notifications
You must be signed in to change notification settings - Fork 5
Pgwatch 3 helm chart #5
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
364e750
add new pgwatch-helm-chart for k8s/openshift
Schmaetz 9df2f8e
added option for using an existing database as metric store
Schmaetz 90a7ebc
change default values
Schmaetz 7c5595c
update Helm-Chart-Version
Schmaetz abd8207
added option for prometheus sink and allows to bring your own prom or…
Schmaetz ff998dd
replace cmd modifications by mounting launcher script
Schmaetz 2e12348
added retention setting for pg sink
Schmaetz 94cfec1
cleanup and change variable-name
Schmaetz 00734cf
added prom retention for new prometheus
Schmaetz ce14f56
change default values
Schmaetz 5ec3259
Update README.md
Schmaetz 820b224
Create README.md
Schmaetz d92fcfc
Update README.md
Schmaetz b472a04
Update values.yaml
Schmaetz e54264a
Update prometheus-config.yaml
Schmaetz 8da8309
Update grafana-deployment.yaml
Schmaetz cbcf502
Update README.md
Schmaetz cf52c36
Update values.yaml
Schmaetz d9ee500
Create alertmanager_deployment
Schmaetz 958ca28
Create charts-folder
Schmaetz 8ff62e9
Delete charts
Schmaetz a238476
Create index
Schmaetz f90c999
Update values.yaml
Schmaetz 188e41a
Update grafana-deployment.yaml
Schmaetz deffb81
added chart repo & updates version
Schmaetz a2cacdf
remove unneeded file
Schmaetz 0d5cd04
rename charts folder to docs for github-limitations
Schmaetz 4f06741
added sslmode to values
Schmaetz e3f9488
add custom datasource if using existing pg db
Schmaetz 3c1dd78
update datasource and basic values file
Schmaetz 2b0c21f
update helm repo
Schmaetz 38b4394
Updates for Readme
Schmaetz ef7c32f
Merge branch 'main' into pgwatch-3-helm-chart
Schmaetz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| helm/pgwatch/test_values.yaml |
This file contains hidden or 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,11 +1,161 @@ | ||
| # Documentation | ||
| [](https://pgwat.ch) | ||
| [](https://opensource.org/license/bsd-3-clause) | ||
| [](https://github.com/cybertec-postgresql/pgwatch/actions/workflows/build.yml) | ||
| [](https://coveralls.io/github/cybertec-postgresql/pgwatch?branch=master) | ||
|
|
||
|
|
||
| Key | Default value | Description | ||
| ---|---|--- | ||
| storage | influx | influx or postgres; Defines backend for storing data | ||
| postgres_storage.database | pgwatch2_metrics | in case if storage is set to postgres, defines database name | ||
| metrics_preset | | | ||
| metrics_preset.name | remotedba | name of the default metrics_preset | ||
| metrics_preset.description| Metrics used for monitoring of Remote-DBA Databases | Metrics preset description | ||
| metrics_preset.metrics | '{"kpi": 120, "wal": 60, "locks": 60, "db_size": 300, "archiver": 60, "backends": 60, "bgwriter": 60, "cpu_load": 60, "db_stats": 60, "settings": 7200, "wal_size": 300, "locks_mode": 60, "index_stats": 900, "replication": 120, "sproc_stats": 180, "table_stats": 300, "wal_receiver": 120, "change_events": 300, "table_io_stats": 600, "sequence_health": 3600, "replication_slots": 120}' | Metrics | ||
| # pgwatch v3-beta. Please test it as much as possible! | ||
|
|
||
| This is the next generation of [pgwatch2](https://github.com/cybertec-postgresql/pgwatch2/). | ||
|
|
||
| ## Quick Start | ||
|
|
||
| To fetch and run the latest **demo** Docker image, exposing | ||
| - Grafana on port 3000, | ||
| - the administrative web UI on port 8080, | ||
| - the internal configuration and metrics database on port 5432: | ||
|
|
||
| ```shell | ||
| docker run -d --name pw3 -p 5432:5432 -p 3000:3000 -p 8080:8080 -e PW_TESTDB=true cybertecpostgresql/pgwatch-demo | ||
| ``` | ||
|
|
||
| After some minutes you could open the ["Database Overview"](http://127.0.0.1:3000/dashboard/db/db-overview) dashboard and start looking at metrics. For defining your own dashboards you need to log in Grafana as admin (`admin`/`pgwatchadmin`). | ||
|
|
||
| If you don't want to add the test database for monitoring, remove the `PW_TESTDB` parameter when launching the container. | ||
|
|
||
|
|
||
|
|
||
| ## Development and production use | ||
|
|
||
| For production and long term installation `cybertecpostgresql/pgwatch` Docker image should be used. | ||
| For the fastest development and deployment experience the Docker compose files are provided: | ||
|
|
||
| ```shell | ||
| git clone https://github.com/cybertec-postgresql/pgwatch.git && cd pgwatch | ||
|
|
||
| docker compose -f ./docker/docker-compose.yml up --detach | ||
| ``` | ||
| <pre> | ||
| ✔ Network pgwatch_default Created | ||
| ✔ Container pgwatch-postgres-1 Healthy | ||
| ✔ Container pgwatch-pgwatch-1 Started | ||
| ✔ Container pgwatch-grafana-1 Started | ||
| </pre> | ||
|
|
||
| These commands will build and start services listed in the compose file: | ||
| - configuration and metric database; | ||
| - pgwatch monitoring agent with WebUI; | ||
| - Grafana with dashboards. | ||
|
|
||
| ## Monitor Database | ||
|
|
||
| After start, you could open the [monitoring dashboard](http://localhost:3000/) and start | ||
| looking at metrics. | ||
|
|
||
| To add a test database under monitoring, you can use [built-in WebUI](http://localhost:8080/). Or simply | ||
| execute from command line: | ||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml up add-test-db --force-recreate | ||
| ``` | ||
| <pre> | ||
| [+] Running 2/0 | ||
| ✔ Container pgwatch-postgres-1 Running 0.0s | ||
| ✔ Container pgwatch-add-test-db-1 Created 0.0s | ||
| Attaching to pgwatch-add-test-db-1 | ||
| pgwatch-add-test-db-1 | BEGIN | ||
| ... | ||
| pgwatch-add-test-db-1 | GRANT | ||
| pgwatch-add-test-db-1 | COMMENT | ||
| pgwatch-add-test-db-1 | INSERT 0 1 | ||
| pgwatch-add-test-db-1 exited with code 0 | ||
| </pre> | ||
|
|
||
| ## Produce Workload | ||
|
|
||
| To emulate workload for added test database execute: | ||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml up pgbench | ||
| ``` | ||
| <pre> | ||
| [+] Running 2/2 | ||
| ✔ Container pgwatch-postgres-1 Running 0.0s | ||
| ✔ Container pgwatch-pgbench-1 Created 0.1s | ||
| Attaching to pgwatch-pgbench-1 | ||
| pgwatch-pgbench-1 | dropping old tables... | ||
| pgwatch-pgbench-1 | NOTICE: table "pgbench_accounts" does not exist, skipping | ||
| pgwatch-pgbench-1 | NOTICE: table "pgbench_branches" does not exist, skipping | ||
| pgwatch-pgbench-1 | NOTICE: table "pgbench_history" does not exist, skipping | ||
| pgwatch-pgbench-1 | NOTICE: table "pgbench_tellers" does not exist, skipping | ||
| pgwatch-pgbench-1 | creating tables... | ||
| pgwatch-pgbench-1 | generating data (client-side)... | ||
| pgwatch-pgbench-1 | 100000 of 5000000 tuples (2%) done (elapsed 0.11 s, remaining 5.17 s) | ||
| pgwatch-pgbench-1 | 200000 of 5000000 tuples (4%) done (elapsed 0.25 s, remaining 6.06 s) | ||
| ... | ||
| pgwatch-pgbench-1 | 5000000 of 5000000 tuples (100%) done (elapsed 16.28 s, remaining 0.00 s) | ||
| pgwatch-pgbench-1 | vacuuming... | ||
| pgwatch-pgbench-1 | creating primary keys... | ||
| pgwatch-pgbench-1 | done in 42.29 s (drop tables 0.03 s, create tables 0.04 s, client-side generate 18.23 s, vacuum 1.29 s, primary keys 22.70 s). | ||
| pgwatch-pgbench-1 | pgbench (15.4) | ||
| pgwatch-pgbench-1 | starting vacuum... | ||
| pgwatch-pgbench-1 | end. | ||
| pgwatch-pgbench-1 | progress: 5.0 s, 642.2 tps, lat 15.407 ms stddev 11.794, 0 failed | ||
| pgwatch-pgbench-1 | progress: 10.0 s, 509.6 tps, lat 19.541 ms stddev 9.493, 0 failed | ||
| ... | ||
| pgwatch-pgbench-1 | progress: 185.0 s, 325.3 tps, lat 16.825 ms stddev 8.330, 0 failed | ||
| pgwatch-pgbench-1 | | ||
| pgwatch-pgbench-1 | | ||
| pgwatch-pgbench-1 | transaction type: builtin: TPC-B (sort of) | ||
| pgwatch-pgbench-1 | scaling factor: 50 | ||
| pgwatch-pgbench-1 | query mode: simple | ||
| pgwatch-pgbench-1 | number of clients: 10 | ||
| pgwatch-pgbench-1 | number of threads: 2 | ||
| pgwatch-pgbench-1 | maximum number of tries: 1 | ||
| pgwatch-pgbench-1 | number of transactions per client: 10000 | ||
| pgwatch-pgbench-1 | number of transactions actually processed: 100000/100000 | ||
| pgwatch-pgbench-1 | number of failed transactions: 0 (0.000%) | ||
| pgwatch-pgbench-1 | latency average = 18.152 ms | ||
| pgwatch-pgbench-1 | latency stddev = 13.732 ms | ||
| pgwatch-pgbench-1 | initial connection time = 25.085 ms | ||
| pgwatch-pgbench-1 | tps = 534.261013 (without initial connection time) | ||
| pgwatch-pgbench-1 | dropping old tables... | ||
| pgwatch-pgbench-1 | done in 0.45 s (drop tables 0.45 s). | ||
| pgwatch-pgbench-1 exited with code 0 | ||
| </pre> | ||
|
|
||
| ## Inspect database | ||
|
|
||
| > [!IMPORTANT] | ||
| pgAdmin uses port 80. If you want it to use another port, change it in `docker-compose.yml` file. | ||
|
|
||
| To look what is inside `pgwatch` database, you can spin up pgAdmin4: | ||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml up --detach pgadmin | ||
| ``` | ||
| Go to `localhost` in your favorite browser and login as `admin@local.com`, password `admin`. | ||
| Server `pgwatch` should be already added in `Servers` group. | ||
|
|
||
| ## Development | ||
|
|
||
| If you apply any changes to the source code and want to restart the agent, it's usually enough to run: | ||
|
|
||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml up pgwatch --build --force-recreate --detach | ||
| ``` | ||
|
|
||
| The command above will rebuild the `pgwatch` agent from sources and relaunch the container. | ||
|
|
||
| ## Logs | ||
|
|
||
| If you are running containers in detached mode, you still can follow the logs: | ||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml logs --follow | ||
| ``` | ||
|
|
||
| Or you may check the log of a particular service: | ||
| ```shell | ||
| docker compose -f ./docker/docker-compose.yml logs pgwatch --follow | ||
| ``` | ||
|
|
||
| # Contributing | ||
|
|
||
| Feedback, suggestions, problem reports, and pull requests are very much appreciated. | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: v1 | ||
| appVersion: "3.0" | ||
| description: A Helm chart for pgwatch monitoring tools | ||
| name: pgwatch | ||
| version: 3.0.1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rewrite readme? It still shows beta