Skip to content

Diagnose

The diagnose command runs a comprehensive health check against the connected Chronicle server. It tests connectivity, retrieves the server version, inspects event stores, checks observer states, counts failed partitions, lists active recommendations, and reads the event sequence tail. The results give you a quick picture of whether the system is healthy or requires attention.

The command exits with a non-zero status code if any health check fails, making it suitable for use in CI pipelines and monitoring scripts.

Terminal window
cratis chronicle diagnose
FlagDescription
--watchContinuously refresh the output at the specified interval. Press Ctrl+C to stop. Requires table output format.
--interval <SECONDS>Refresh interval in seconds when using --watch. Defaults to 5.

The command runs the following checks in sequence:

CheckWhat it verifies
ConnectionThe CLI can reach the Chronicle management API.
Server versionThe server responds with a valid version identifier. The CLI also checks the NuGet feed for a newer Chronicle server release. When a newer version is available, a warning is shown next to the version in all output modes (table, plain, JSON, and watch).
Event storesAt least one event store exists and is accessible.
ObserversAll observers are active and not stopped or faulted.
Failed partitionsNo observer partitions are in a failed state.
RecommendationsNo server-generated recommendations are pending.
Event sequence tailThe event log tail is readable and returns a valid sequence number.
CodeMeaning
0All health checks passed.
Non-zeroOne or more checks failed.

Run a one-time health check:

Terminal window
cratis chronicle diagnose

Run against a specific server:

Terminal window
cratis chronicle diagnose --server chronicle://prod.example.com:35000

Get machine-readable output for CI:

Terminal window
cratis chronicle diagnose -o json
echo "Exit code: $?"

Watch mode — refresh every five seconds:

Terminal window
cratis chronicle diagnose --watch

Watch mode with a custom interval:

Terminal window
cratis chronicle diagnose --watch --interval 10

Use in a CI pipeline and fail the build if the server is unhealthy:

Terminal window
cratis chronicle diagnose -o json --yes
if [ $? -ne 0 ]; then
echo "Chronicle health check failed"
exit 1
fi