Consul Operator Usage
Command: consul operator usage
The Usage operator
command provides cluster-level tools for Consul operators
to view usage information, such as service and service instance counts.
Usage: consul operator usage <subcommand> [options] # ...Subcommands: instances Display service instance usage information
instances
Corresponding HTTP API Endpoint: [GET] /v1/operator/usage
This command retrieves usage information about the number of services registered in a given datacenter. By default, the datacenter of the local agent is queried.
The table below shows this command's required ACLs. Configuration of blocking queries and agent caching are not supported from commands, but may be from the corresponding HTTP endpoint.
ACL Required |
---|
operator:read |
Usage: consul operator usage instances
The output looks like this:
$ consul operator usage instancesBillable Service Instances Total: 3dc1 Billable Service Instances: 3Billable ServicesServices Service instances2 3NodesDatacenter Count dc1 1 Total 1Connect ServicesType Service instancesconnect-native 0connect-proxy 0ingress-gateway 0mesh-gateway 1terminating-gateway 0
With the -all-datacenters
flag:
$ consul operator usage instances -all-datacentersBillable Service Instances Total: 4dc1 Billable Service Instances: 3dc2 Billable Service Instances: 1Billable ServicesDatacenter Services Service instancesdc1 2 3dc2 1 1Total 3 4NodesDatacenter Count dc1 1dc2 2 Total 3Connect ServicesDatacenter Type Service instancesdc1 connect-native 0dc1 connect-proxy 0dc1 ingress-gateway 0dc1 mesh-gateway 1dc1 terminating-gateway 0dc2 connect-native 0dc2 connect-proxy 0dc2 ingress-gateway 0dc2 mesh-gateway 1dc2 terminating-gateway 1Total 3
Command Options
-all-datacenters
- Display service counts from all known datacenters. Default isfalse
.-billable
- Display only billable service information. Default isfalse
.-connect
- Display only Consul service mesh component information. Default isfalse
.