flower
/

review · segments

Create three PHP health-check classes for Laravel app

claude 29 events 4 segments dap-ops-health

segment 1 of 4

Read harness contracts and database config

Done

The assistant read the HealthCheck interface, HealthResult DTO, HealthStatus enum, HealthGroup constants, AbstractCheck base class, Tcp support class, and config/database.php to understand the exact signatures and connection names.

outcome

All contract files and database config have been read and understood.

next steps

key decisions

  • Use named arguments when calling HealthResult::up() and ::down() to avoid argument order confusion.

open questions

2 weeks ago 2 weeks ago

segment 2 of 4

Create MysqlCheck.php health check

Done

Created the MysqlCheck class extending AbstractCheck with key 'mysql', name 'App Database (MySQL)', group HealthGroup::DATABASES, default cadence 60. The run() method times a select 1 on the 'mysql' connection, returning HealthResult::up with latency and meta on success, or HealthResult::down with exception message on failure.

outcome

File app/Health/Checks/MysqlCheck.php created and passes php -l syntax check.

next steps

key decisions

  • Use named arguments for HealthResult::up() and ::down() to avoid argument order issues.
  • Include 'connection' and 'database' in meta on success; include 'connection' on failure.

open questions

2 weeks ago 2 weeks ago

segment 3 of 4

Create FosMysqlCheck.php health check

Done

Created the FosMysqlCheck class extending AbstractCheck with key 'fos', name 'FOS Database (MySQL)', group HealthGroup::DATABASES, default cadence 60. The run() method times a select 1 on the 'fos' connection, returning HealthResult::up with latency and meta on success, or HealthResult::down with exception message on failure.

outcome

File app/Health/Checks/FosMysqlCheck.php created and passes php -l syntax check.

next steps

key decisions

  • Include 'connection', 'host', and 'database' in meta on both success and failure paths for diagnostic value.

open questions

  • The brief only specified meta for the success path on FosMysqlCheck; the assistant added host/database meta on the down path too. Confirm if this is acceptable.

2 weeks ago 2 weeks ago

segment 4 of 4

Create LabworksCheck.php health check

Done

Created the LabworksCheck class extending AbstractCheck with key 'labworks', name 'Labworks (SQL Server)', group HealthGroup::DATABASES, cadence overridden to 120. The run() method first checks if host is configured, then uses Tcp::probe() for a fast TCP pre-check before attempting a select 1 on the 'labworks' connection. Returns appropriate HealthResult::up or ::down with latency and meta.

outcome

File app/Health/Checks/LabworksCheck.php created and passes php -l syntax check.

next steps

key decisions

  • Override cadence to 120 seconds because Labworks is a LAN box reachable only over VPN and the check includes a TCP pre-probe.
  • Use Tcp::probe() as a fast pre-flight to avoid hanging on a slow SQL Server login when the network is down.
  • Default port to 1433 if not configured, as that is the standard SQL Server port.

open questions

2 weeks ago 2 weeks ago