Steps to reproduce
- Deploy the charm.
Expected behaviour
All PostgreSQL alerts evaluate correctly, and the PostgresqlRestarted alert has access to the postmaster start time metrics.
Actual behaviour
Several alerts are dead because the underlying metrics no longer exist natively in the exporter.
PostgresqlHighRateDeadlock (missing postgresql_errors_total)
PostgresqlSslCompressionActive (missing pg_stat_ssl_compression)
PostgresqlRestarted (fails because --collector.postmaster is not enabled in start-exporter.sh).
- Custom injecting SQL via
queries.yaml file to expose the necessary pg_txid_* and pg_bloat_* metrics is required:
PostgresqlLowXidConsumption
PostgresqlBloatIndexHigh
PostgresqlBloatTableHigh
PostgresqlInvalidIndex
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
Proposals for Discussion:
- Enable Postmaster Collector: Update
start-exporter.sh to include EXPORTER_OPTS="--collector.postmaster" so PostgresqlRestarted works.
- Dead Alerts: Remove
PostgresqlHighRateDeadlock and PostgresqlSslCompressionActive as they cannot be exported natively anymore.
- Custom Queries (
queries.yaml):
- Maybe inject the custom query only for
PostgresqlInvalidIndex as it is relatively lightweight.
- Question for maintainers: Does it make sense to include the heavier custom queries required for
PostgresqlLowXidConsumption, PostgresqlBloatIndexHigh(>80%), and PostgresqlBloatTableHigh(>80%)? Given that the exporter is scraped every ~20 seconds, running these heavy bloat/xid queries frequently could negatively impact database performance.
Reference: samber/awesome-prometheus-alerts#289 (comment)
Steps to reproduce
Expected behaviour
All PostgreSQL alerts evaluate correctly, and the
PostgresqlRestartedalert has access to the postmaster start time metrics.Actual behaviour
Several alerts are dead because the underlying metrics no longer exist natively in the exporter.
PostgresqlHighRateDeadlock(missingpostgresql_errors_total)PostgresqlSslCompressionActive(missingpg_stat_ssl_compression)PostgresqlRestarted(fails because--collector.postmasteris not enabled instart-exporter.sh).queries.yamlfile to expose the necessary pg_txid_* and pg_bloat_* metrics is required:PostgresqlLowXidConsumptionPostgresqlBloatIndexHighPostgresqlBloatTableHighPostgresqlInvalidIndexVersions
Juju CLI: N/A
Juju agent: N/A
Charm revision: N/A
LXD: N/A
Log output
Juju debug log: N/A
Additional context
Proposals for Discussion:
start-exporter.shto includeEXPORTER_OPTS="--collector.postmaster"soPostgresqlRestartedworks.PostgresqlHighRateDeadlockandPostgresqlSslCompressionActiveas they cannot be exported natively anymore.queries.yaml):PostgresqlInvalidIndexas it is relatively lightweight.PostgresqlLowXidConsumption,PostgresqlBloatIndexHigh(>80%), andPostgresqlBloatTableHigh(>80%)? Given that the exporter is scraped every ~20 seconds, running these heavy bloat/xid queries frequently could negatively impact database performance.Reference: samber/awesome-prometheus-alerts#289 (comment)