[monitoring-template] feat(sqlserver): add database account expiry metrics (#3737)#4141
Merged
Merged
Conversation
tomsun28
approved these changes
May 24, 2026
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.
[monitoring-template] feat(sqlserver): add database account expiry metrics
Adds an
account_expirymetric group to the SQL Server monitoring template, matching the existing MySQL implementation.Query
What is Included
app-sqlserver.yml— newaccount_expirymetric group (priority 100,multiRow)SqlServerJdbcTemplateIntegrationTest— 34 tests across SQL Server 2017, 2019, 2022, and 2025pom.xml—mssql-jdbctest dependencyDesign Decisions
CASE WHENreturningY/Ninstead of rawCAST AS VARCHAR— matches MySQLmysql.user.password_expiredformat and avoids implicit VARCHAR lengthsPermissions Required
Equivalent to the MySQL implementation which requires
SELECT ON mysql.*.Compatibility
All three catalog objects (
sys.sql_logins,LOGINPROPERTY("DaysUntilExpiration"),LOGINPROPERTY("IsExpired")) are documented in Microsoft Learn for SQL Server 2025 with no deprecation warnings.Known Limitation
HertzBeat hardcodes a 1,000-row limit for
multiRowqueries. Servers with >1,000 SQL logins will see truncated results. This is a platform limitation, not specific to this template.References
🤖 This patch was developed with assistance from DeepSeek-v4-pro.