Skip to main content

healthcheck

Checks that the API instance and all of its dependent services are online and reports their versions, useful for diagnosing connectivity issues or confirming what’s actually deployed.

Takes no arguments or options. It connects to Neo4j, MongoDB, Elasticsearch, Redis, and RabbitMQ and reports each service’s version, verifies the S3 storage and upload buckets are reachable, reports the Alpine, Caddy, FrankenPHP, and PHP versions of the running container, and finally makes an HTTP request to the API’s own index endpoint, expecting a 200 or 429 response. If any check fails, the command throws and exits with a non-zero status instead of printing a partial report.

Help

php bin/console healthcheck --help
Description:
  Check the health of the API and required databases.

Usage:
  healthcheck

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Example

php bin/console healthcheck
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.1.31, production mode

  Healthcheck

┌ Check if databases are online ────────────────────────────────────────────────
│ Neo4j version:         5.25.1 (community)
│ MongoDB version:       8.0.20
│ Elasticsearch version: 8.16.1
│ Redis version:         7.9.225
│ RabbitMQ version:      3.13.7
│ S3 buckets:            online
└ All databases are online.

┌ Check internal services ──────────────────────────────────────────────────────
│ Alpine version:        3.23.3
│ Caddy version:         2.11.2
│ FrankenPHP version:    1.12.1
│ PHP version:           8.5.4
└ Internal services are ok.

┌ Check API ────────────────────────────────────────────────────────────────────
│ Get index endpoint is online.
└ API is ok.

▶ Status is ok.