Add `prefect server status`
First check
- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to find a similar request and didn't find it.
- [X] I searched the Prefect documentation for this feature.
Prefect Version
2.x
Describe the current behavior
To perform a healthcheck, manual API requests must be made.
Describe the proposed behavior
We should provide a CLI command to perform healthchecks against the configured server: prefect server status
This command should return a 0 or 1 status code depending on the availability of the server. It can also display information about the server if it is available.
This command should include a --wait flag that will attempt to connect until the service responds with a healthy value.
This command should include a --timeout <seconds> option that will fail the healthcheck after a total number of seconds.
Example Use
This is especially useful in combination with --detach as proposed in #6989
prefect orion start --detach
prefect orion status --wait --timeout 60
Possible output
$ prefect orion status
Connecting to <address>...
Server available.
...
Also useful when run in a Docker container
Additional context
This would replace the script at https://github.com/PrefectHQ/prefect/blob/main/scripts/wait-for-server.py
I'd propose a prefect orion status command instead, which would print information about the running instance, but also allow people to suppress output (in case they only care about the status code, such as for readinessProbe checks).
This is how Vault handles their readiness probes: https://github.com/hashicorp/vault-helm/blob/7e21a09ebd9fb7890c5dfe90c4716b50d1662637/templates/server-statefulset.yaml#L160-L161
👍 sounds better to me!
Hi @masonmenges, looks like this was assigned to you awhile ago. Shall I unassign?
@serinamarie That should be fine, if time permits I might take a look at this again but I haven't looked at this in a while.