Skip to content

Commit 3ae2e3b

Browse files
committed
Merge branch '16/edge' into prefixes
2 parents aae3023 + 9004942 commit 3ae2e3b

File tree

25 files changed

+8328
-3413
lines changed

25 files changed

+8328
-3413
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ jobs:
4848
env:
4949
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5050

51+
alert-test:
52+
name: Test Prometheus Alert Rules
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 5
55+
steps:
56+
- name: Checkout repo
57+
uses: actions/checkout@v5
58+
- name: Install prometheus snap
59+
run: sudo snap install prometheus
60+
- name: Check validity of prometheus alert rules
61+
run: promtool check rules src/prometheus_alert_rules/*
62+
- name: Run unit tests for prometheus alert rules
63+
run: promtool test rules tests/alerts/*.yaml
64+
5165
build:
5266
name: Build charm
5367
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v35.0.2

docs/.custom_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Nextcloud
8787
otf
8888
Parca
8989
Parca's
90+
patroni
9091
Patroni
9192
patronictl
9293
performant

docs/explanation/architecture.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ charmed-postgresql.patroni enabled active -
5050
charmed-postgresql.pgbackrest-exporter enabled active -
5151
charmed-postgresql.pgbackrest-service enabled active -
5252
charmed-postgresql.prometheus-postgres-exporter enabled active -
53+
charmed-postgresql.pgbackrest-exporter enabled active -
5354
```
5455

5556
<!-- TODO: The `ldap-sync` service is... -->
5657

5758
The `patroni` snap service is a main PostgreSQL instance which is normally up and running right after the charm deployment.
5859

59-
The `pgbackrest` snap service is a backup framework for PostgreSQL. It is disabled if [backups](/how-to/back-up-and-restore/create-a-backup) are not configured.
60+
The `pgbackrest` snap service is a backup framework for PostgreSQL. It is disabled if [Backup](/how-to/back-up-and-restore/create-a-backup) is not configured along with the `pgbackrest-exporter` service.
6061

6162
The `prometheus-postgres-exporter` service is activated after the relation with [COS Monitoring](/how-to/monitoring-cos/enable-monitoring) only.
6263

docs/explanation/security/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ The following information is configured to be logged:
100100

101101
Other events, like connections and disconnections, are logged depending on the value of the charm configuration options related to them. For more information, check the configuration options with the `logging` prefix in the [configuration reference](https://charmhub.io/postgresql/configurations#logging_log_connections).
102102

103+
Also, all operations performed by the charm as a result of user actions — such as enabling or disabling plugins, managing TLS, creating or restoring backups, and configuring replication between clusters (asynchronous or logical) — are executed through the underlying workload components (PostgreSQL, Patroni, or pgBackRest). Consequently, these operations are recorded in the respective workload log files, which are accessible in the directories below and also forwarded to COS:
104+
105+
* /var/snap/charmed-postgresql/common/var/log/patroni
106+
* /var/snap/charmed-postgresql/common/var/log/pgbackrest
107+
* /var/snap/charmed-postgresql/common/var/log/postgresql
108+
103109
No secrets are logged.
104110

105111
## Additional resources

docs/reference/alert-rules.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ This page contains a markdown version of the alert rules described in the `postg
4848
| PatroniPostgresqlDown | ![critical] | Patroni PostgreSQL instance is down.<br>Check for errors in the Loki logs. |
4949
| PatroniHasNoLeader | ![critical] | Patroni instance has no leader node.<br>A leader node (neither primary nor standby) cannot be found inside a cluster.<br>Check for errors in the Loki logs. |
5050

51+
## `PgbackrestExporter`
52+
53+
| Alert | Severity | Notes |
54+
| ----- | -------- | ----- |
55+
| `PgBackRestBackupError` | ![critical] | Backup failed for a stanza.<br>The last pgBackRest backup ended with error status > 0.<br>Check the pgBackRest logs for the stanza. |
56+
| `PgBackRestBackupTooOld` | ![warning] | No recent backup available.<br>The last pgBackRest backup is older than 7 days.<br>Consider checking your backup schedule, capacity, and logs. |
57+
| `PgBackRestStanzaError` | ![warning] | A stanza has reported errors.<br>Status > 0 indicates problems such as missing stanza path or no valid backups.<br>Check pgBackRest logs for details. |
58+
| `PgBackRestRepoError` | ![warning] | A repository has reported errors.<br>Status > 0 indicates the repo may be inaccessible, out of space, or otherwise unhealthy.<br>Check pgBackRest logs and storage system. |
59+
| `PgBackRestExporterError` | ![critical] | The pgBackRest exporter failed to fetch data.<br>Metric `pgbackrest_exporter_status == 0` indicates exporter-side issues.<br>This may be a misconfiguration or runtime error; check exporter logs. |
60+
5161
<!-- Badges -->
5262
[info]: https://img.shields.io/badge/info-blue
5363
[warning]: https://img.shields.io/badge/warning-yellow

docs/reference/troubleshooting/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Service Startup Current Notes
8686
charmed-postgresql.patroni enabled active -
8787
charmed-postgresql.pgbackrest-service enabled active -
8888
charmed-postgresql.prometheus-postgres-exporter enabled active -
89+
charmed-postgresql.pgbackrest-exporter enabled active -
8990
9091
ubuntu@juju-fd7874-0:~$ systemctl --failed
9192
...

0 commit comments

Comments
 (0)