[Task] Add account expiry monitoring metrics for PostgreSQL#4040
Open
turanalmammadov wants to merge 1 commit intoapache:masterfrom
Open
[Task] Add account expiry monitoring metrics for PostgreSQL#4040turanalmammadov wants to merge 1 commit intoapache:masterfrom
turanalmammadov wants to merge 1 commit intoapache:masterfrom
Conversation
- Add account_expiry metric set to app-postgresql.yml querying pg_roles for roles with non-null rolvaliduntil (expiration timestamp) - Expose: rolname, rolvaliduntil, seconds_until_expiry, rolcanlogin - Update docs: home/docs/help/postgresql.md (English) - Update docs: home/i18n/zh-cn/.../postgresql.md (Chinese) Co-authored-by: Cursor <cursoragent@cursor.com>
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.
What does this PR do?
Adds account expiry monitoring metrics for PostgreSQL, consistent with the pattern already used for Oracle, MariaDB, SQL Server, and TiDB.
Changes
app-postgresql.yml: Added newaccount_expirymetric set that queriespg_rolesfor roles with a non-nullrolvaliduntilvalue. Exposes:rolname– role (user) namerolvaliduntil– account expiration timestampseconds_until_expiry– seconds remaining until expiry (negative means already expired)rolcanlogin– whether the role is permitted to log inhome/docs/help/postgresql.md: Addedaccount_expirymetric set table (English)home/i18n/zh-cn/.../postgresql.md: Addedaccount_expirymetric set table (Chinese)Why is this needed?
Monitoring password/account expiration helps DBAs proactively detect accounts about to expire and avoid unexpected authentication failures in production systems.
Testing
SQL query tested against PostgreSQL 14+:
Made with Cursor