Draft
Conversation
…le queries These queries used CROSS JOIN with pg_database or UNNEST to produce zero-filled result sets, causing memory pressure proportional to (lock_modes × databases) or (idle_connections × bucket_count). - pg_locks: replace VALUES CROSS JOIN pg_database with direct JOIN, only returning lock modes actually held - pg_stat_activity: remove VALUES CROSS JOIN pg_database, query pg_stat_activity directly with GROUP BY - pg_process_idle: replace UNNEST implicit cross-join with raw query and Go-side histogram bucketing; also fixes existing bug where QueryRowContext only processed a single (state, application_name) group
Replace per-database metrics (19 metrics × N databases) with a single aggregated row containing only metrics not available from other collectors: xact_commit, xact_rollback, temp_files, temp_bytes, deadlocks, blk_read_time, blk_write_time, active_time. Metrics that duplicate pg_stat_activity, pg_stat_user_tables, or pg_statio_user_tables (numbackends, blks_read, blks_hit, tup_*) are removed. The datid/datname labels are dropped. This is a breaking change for anyone querying these metrics by database name.
Benchmarks pg_locks, pg_stat_database, pg_stat_user_tables, pg_statio_user_tables, and pg_database at various scale points (100/500/1000/5000) to measure allocation growth as catalog objects increase.
Before running expensive queries, collectors now check the row count against a configurable limit. When exceeded, the collector skips metric emission and instead emits a pg_exporter_collector_rows_exceeded gauge with the actual count. Flags added: --collector.stat_user_tables.max_rows (default: 375) --collector.statio_user_tables.max_rows (default: 750) --collector.database.max_rows (default: 750) Set to 0 to disable the limit. Defaults derived from benchmark data targeting ~4MB per collector within a 32MiB memory budget.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.