A developer is deploying a new service called 'inventory' with a Connect sidecar proxy. They want to verify that the sidecar is running and registered correctly. Which command should they use to check the status of the Connect-enabled service?
The 'consul health service' command displays the health checks associated with a service, including the sidecar proxy if it is registered as a service. For a Connect-enabled service, the sidecar proxy is registered as a separate service named 'inventory-sidecar-proxy'. Running 'consul health service inventory' shows the health of the main service, and you can also check the sidecar proxy's health. This command is the standard way to verify service and proxy status.
Why this answer
To check the status of a Connect-enabled service, you should use 'consul health service' because it returns the health checks for the service and its sidecar proxy. The sidecar proxy is registered as a separate service, so you can also query it directly. Commands like 'consul catalog nodes' only show node placement, not health or proxy status.
Exam trap
The trap here is assuming there is a dedicated 'consul connect status' command or that 'consul services status' exists, when in fact health checks are queried via 'consul health service'.