github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/operator/metrics.mdx (about) 1 --- 2 layout: docs 3 page_title: 'Commands: operator metrics' 4 --- 5 6 # Command: operator metrics 7 8 The `operator metrics` command queries the [metrics API endpoint](/api-docs/metrics). 9 10 ## Usage 11 12 ```plaintext 13 nomad operator metrics [options] 14 ``` 15 16 ## General Options 17 18 @include 'general_options_no_namespace.mdx' 19 20 ## Metrics Specific Options 21 22 - `-pretty`: Pretty prints the JSON output 23 - `-format <format>`: Specify output format (`prometheus`) 24 - `-json`: Output the allocation in its JSON format. 25 - `-t`: Format and display allocation using a Go template. 26 27 ## Output 28 29 The output of `nomad operator metrics` is a JSON representation of the 30 [metrics API endpoint](/api-docs/metrics). 31 32 ```shell-session 33 $ nomad operator metrics -pretty 34 { 35 "Counters": [ 36 { 37 "Count": 11, 38 "Labels": {}, 39 "Max": 1.0, 40 "Mean": 1.0, 41 "Min": 1.0, 42 "Name": "nomad.nomad.rpc.query", 43 "Stddev": 0.0, 44 "Sum": 11.0 45 } 46 ], 47 "Gauges": [ 48 { 49 "Labels": { 50 "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f", 51 "datacenter": "dc1" 52 }, 53 "Name": "nomad.client.allocations.blocked", 54 "Value": 0.0 55 }, 56 { 57 "Labels": { 58 "datacenter": "dc1", 59 "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f" 60 }, 61 "Name": "nomad.client.allocations.migrating", 62 "Value": 0.0 63 } 64 ], 65 "Samples": [ 66 { 67 "Count": 20, 68 "Labels": {}, 69 "Max": 0.03544100001454353, 70 "Mean": 0.023678050097078084, 71 "Min": 0.00956599973142147, 72 "Name": "nomad.memberlist.gossip", 73 "Stddev": 0.005445327799243976, 74 "Sum": 0.4735610019415617 75 }, 76 { 77 "Count": 1, 78 "Labels": {}, 79 "Max": 0.0964059978723526, 80 "Mean": 0.0964059978723526, 81 "Min": 0.0964059978723526, 82 "Name": "nomad.nomad.client.update_status", 83 "Stddev": 0.0, 84 "Sum": 0.0964059978723526 85 } 86 ] 87 } 88 ```