feat: Database_observability: add health check collector for postgres component#5222
Merged
matthewnolf merged 2 commits intomainfrom Jan 12, 2026
Merged
feat: Database_observability: add health check collector for postgres component#5222matthewnolf merged 2 commits intomainfrom
matthewnolf merged 2 commits intomainfrom
Conversation
Contributor
|
💻 Deploy preview available (feat: database_observability: add health check collector for db-o11y postgres component): |
| r.err = fmt.Errorf("iterate pg_stat_statements: %w", err) | ||
| } | ||
|
|
||
| r.result = true |
Contributor
There was a problem hiding this comment.
What is the meaning of result here, given it's always set to true (while above we check for rows.Next())?
Contributor
Author
There was a problem hiding this comment.
You're right - we don't need this line
Contributor
|
💻 Deploy preview deleted (feat: Database_observability: add health check collector for postgres component). |
| // checkPgStatStatementsEnabled verifies that the pg_stat_statements extension is enabled. | ||
| func checkPgStatStatementsEnabled(ctx context.Context, db *sql.DB) healthCheckResult { | ||
| r := healthCheckResult{name: "PgStatStatementsEnabled"} | ||
| const q = `SELECT * FROM pg_extension WHERE extname = 'pg_stat_statements'` |
Contributor
There was a problem hiding this comment.
Just to note that our docs says to enable the extension on every database, but I appreciate it might worth starting simple and just running the check on the initial connection database.
cristiangreco
approved these changes
Jan 12, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Brief description of Pull Request
This change adds a new health_check collector to the
database_observability.postgrescomponent, responsible for exposing diagnostic status information. This information can be used to diagnose misconfiguration issues.This is a followup to this PR, which first introduced this for MySQL
Pull Request Details
Issue(s) fixed by this Pull Request
Notes to the Reviewer
PR Checklist