canonical / canonical/postgresql-operator

PgBouncer Exporter dead alerts

Open
#1,565 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
20
Forks
36
Avg merge
4d 15h
Merged PRs (30d)
30

Description

## Steps to reproduce
1. Deploy the charm with the PgBouncer charm.

## Expected behaviour
All PgBouncer alerts should evaluate successfully against the new exporter metric structures. Furthermore, PgBouncer-specific alerts should logically reside in the PgBouncer charm repository, not the PostgreSQL charm.

## Actual behaviour
Several legacy alerts are dead due to missing or deprecated metrics:
* `PgbouncerErrors`
* `PgbouncerMaxConnections`

Additionally, these alerts are currently bundled in the `postgresql` charm rather than the standalone `pgbouncer-operator` charm.

## Versions

Juju CLI: N/A
Juju agent: N/A
Charm revision: N/A
LXD: N/A

## Log output
Juju debug log: N/A

## Additional context
**Proposal:**
1. Move all PgBouncer alerts from `canonical/postgresql-operator` to `canonical/pgbouncer-operator`.
2. Replace the dead alerts with the proposed alerts.

```yaml
- alert: PgBouncerDown
expr: pgbouncer_up == 0
for: 1m
labels:
severity: critical
annotations:
summary: "PgBouncer is down (instance {{ $labels.instance }})"

- alert: PgBouncerClientQueueing
expr: sum by (database, user) (pgbouncer_pools_client_waiting_connections) > 0
for: 30s
labels:
severity: warning
annotations:
summary: "Clients are queueing for connections"

- alert: PgBouncerDatabaseFull
expr: pgbouncer_databases_current_connections / pgbouncer_databases_max_connections > 0.9
for: 2m
labels:
severity: warning
annotations:
summary: "PgBouncer pool nearly full"

- alert: PgBouncerHighWaitTime
expr: pgbouncer_pools_client_maxwait_seconds > 5
for: 1m
labels:
severity: warning
annotations:
summary: "Oldest client waiting too long"

- alert: PgBouncerIdleServerHigh
expr: pgbouncer_pools_server_idle_connections > (pgbouncer_databases_pool_size * 0.8)
for: 5m
labels:
severity: info
annotations:
summary: "High number of idle server connections"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.