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.
cratis chronicle diagnoseOptions
Section titled “Options”| Flag | Description |
|---|---|
--watch | Continuously 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. |
Health Checks
Section titled “Health Checks”The command runs the following checks in sequence:
| Check | What it verifies |
|---|---|
| Connection | The CLI can reach the Chronicle management API. |
| Server version | The 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 stores | At least one event store exists and is accessible. |
| Observers | All observers are active and not stopped or faulted. |
| Failed partitions | No observer partitions are in a failed state. |
| Recommendations | No server-generated recommendations are pending. |
| Event sequence tail | The event log tail is readable and returns a valid sequence number. |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | All health checks passed. |
| Non-zero | One or more checks failed. |
Examples
Section titled “Examples”Run a one-time health check:
cratis chronicle diagnoseRun against a specific server:
cratis chronicle diagnose --server chronicle://prod.example.com:35000Get machine-readable output for CI:
cratis chronicle diagnose -o jsonecho "Exit code: $?"Watch mode — refresh every five seconds:
cratis chronicle diagnose --watchWatch mode with a custom interval:
cratis chronicle diagnose --watch --interval 10Use in a CI pipeline and fail the build if the server is unhealthy:
cratis chronicle diagnose -o json --yesif [ $? -ne 0 ]; then echo "Chronicle health check failed" exit 1fi