feat: database_observability: add health_check collector to validate configuration#5115
feat: database_observability: add health_check collector to validate configuration#5115matthewnolf merged 5 commits intomainfrom
Conversation
|
💻 Deploy preview deleted (feat: database_observability: add health_check collector to validate configuration). |
| // checkMySQLVersion validates that the database the MySQL version >= 8.0. | ||
| func checkMySQLVersion(ctx context.Context, db *sql.DB) healthCheckResult { | ||
| r := healthCheckResult{name: "MySQLVersionSupported"} | ||
| const q = `SELECT VERSION()` |
There was a problem hiding this comment.
Could we re-use the value from component.go (which already runs this query)?
| // checkSetupConsumerCPUTimeEnabled validates events_statements_cpu consumer is enabled. | ||
| func checkSetupConsumerCPUTimeEnabled(ctx context.Context, db *sql.DB) healthCheckResult { | ||
| r := healthCheckResult{name: "SetupConsumerCPUTimeEnabled"} | ||
| const q = `SELECT enabled FROM performance_schema.setup_consumers WHERE NAME = 'events_statements_cpu'` |
There was a problem hiding this comment.
Is it worth having a single check for setup_consumers maybe?
There was a problem hiding this comment.
Or maybe we could just use database_observability_setup_consumers_enabled?
|
|
||
| // checkDBConnectionValid validates the database connection with a short timeout. | ||
| func checkDBConnectionValid(ctx context.Context, db *sql.DB) healthCheckResult { | ||
| r := healthCheckResult{name: "DBConnectionValid"} |
There was a problem hiding this comment.
Wondering if mysql_up can do the job here?
| SELECT | ||
| @@performance_schema_max_sql_text_length, | ||
| @@performance_schema_max_digest_length, | ||
| @@max_digest_length` |
There was a problem hiding this comment.
Could we use perhaps these?
mysql_global_variables_performance_schema_max_digest_length
mysql_global_variables_performance_schema_max_sql_text_length
mysql_global_variables_max_digest_length
|
@cristiangreco I like the approach of using data already available instead of repeating it here. I have removed the healthChecks where the data was available in other metrics |
31825cb to
6bc33e2
Compare
PR Description
Adds a new collector within the
database_observability.mysqlcomponent for reporting diagnostic data of the target database. This data enables us to visualise configuration issues.Many of the healthChecks have been removed since we can access the required data from other collectors/signals. Remaining are just a few which we can not otherwise query.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist
BEGIN_COMMIT_OVERRIDE
feat(database_observability): Add health_check collector to validate configuration (#5115)
END_COMMIT_OVERRIDE