Skip to content

PgBouncer Exporter dead alerts #1565

@Deezzir

Description

@Deezzir

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.
- 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions