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

config()

Resolved lazily so tests can substitute settings without a constructor argument the router would have to supply.

LoggerInterface
logger()

Built from configuration alone, so it still works while the database is down.

void
run()

No description

JsonResponse
buildResponse()

No description

string
checkDatabase()

Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.

string
checkPowerdnsApi()

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.

Return Value

ConfigurationInterface

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.

Return Value

LoggerInterface

void run()

No description

Return Value

void

JsonResponse buildResponse()

No description

Return Value

JsonResponse

protected string checkDatabase()

Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.

Return Value

string

protected string checkPowerdnsApi()

Reports 'skipped' when no PowerDNS API is configured, which is normal for database-backend installs and never fails the overall status.

Return Value

string