HealthController
class HealthController (View source)
Unauthenticated readiness probe reporting whether Poweradmin can reach its own dependencies. Disabled by default.
Deliberately does not extend BaseController: that constructor connects to the database unconditionally (AppInitializer), so a dead database would escape as a generic 500 instead of being reported here as a failed check.
The body carries no version, host, driver or error text. Anyone can call this, so a check either passed or it did not.
Constants
| private STATUS_OK |
|
| private STATUS_DOWN |
|
| private STATUS_SKIPPED |
|
| private STATUS_ERROR |
|
| private NO_STORE |
|
Methods
Resolved lazily so tests can substitute settings without a constructor argument the router would have to supply.
Built from configuration alone, so it still works while the database is down.
No description
No description
Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.
Reports 'skipped' when no PowerDNS API is configured, which is normal for database-backend installs and never fails the overall status.
Details
protected ConfigurationInterface
config()
Resolved lazily so tests can substitute settings without a constructor argument the router would have to supply.
protected LoggerInterface
logger()
Built from configuration alone, so it still works while the database is down.
Honours logging.type, which is 'null' by default: an operator who turned diagnostic logging off does not get a line per scrape.
void
run()
No description
JsonResponse
buildResponse()
No description
protected string
checkDatabase()
Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.
protected string
checkPowerdnsApi()
Reports 'skipped' when no PowerDNS API is configured, which is normal for database-backend installs and never fails the overall status.